-
Notifications
You must be signed in to change notification settings - Fork 117
[Woo POS] Update conditions for showing POS entry point #12783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Generated by 🚫 Danger |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
import class WooFoundation.CurrencySettings | ||
import enum WooFoundation.CountryCode | ||
import protocol Experiments.FeatureFlagService | ||
import struct Yosemite.SiteSetting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if there are any performance effects when importing specific structs, enums, classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's performance gain from this, but this makes it clear what the exact dependencies are if we ever want to move it to a framework.
Looks good! 💯 Just noting that I didn't see the POS row rendering the first time despite all conditions being true, then I navigated back and forth and rendered correctly. I think is just some different flavour from the existing issue with rows being rendered before the app state is fully sync. For a different PR: I think we could start to add tests for the eligibility checker since is something that most likely won't change soon. |
Thanks for reviewing & testing it as well @iamgabrielma!
I noticed this too, and I'm looking into this today as a subtask of #12779. I think there are two different issues:
Yup I agree! There were mentions about uncertainty of the eligibility checks earlier p1716196427643069/1716183208.646519-slack-C070SJRA8DP, so I added a separate subtask to #12780 to update the checks if needed with unit tests. But now from p91TBi-beb-p2#comment-12134 it seems like we're fine with the current checks, so I'll work on adding some tests for it today. |
Part of: #12780
Why
As the conditions had been implemented in Android woocommerce/woocommerce-android#11513 and mentioned in the weekly update decisions section p91TBi-bfp-p2#decisions, I'm following the same checks in iOS:
How
To consolidate the checks,
POSEligibilityChecker
was created to check if a store is eligible for POSUIDevice.current.userInterfaceIdiom == .pad
as in the beta feature switchServiceLocator.currencySettings
currency settings singletonServiceLocator.selectedSiteSettings.siteSettings
site settings singletonCardPresentPaymentsOnboardingUseCase.state
displayPointOfSaleToggle
- we can consider renaming it after the decision of whether to keep the feature switch or red dot notification is made p91TBi-beb-p2#comment-12129Then,
POSEligibilityChecker().isEligible()
is called when:HubMenuViewModel
- the feature switch could have been enabled before this PR, and the eligibility check should be in place to prevent the entry point from being shownIn
HubMenuViewModel
, the POS entry point was also updated from a row in the General section to a new section without a title below the store switch to minimize the chance of merge conflicts with #12779.Testing instructions
There are a few scenarios that @jaclync will test again after approval:
Continue with an iPad with the POS feature switch enabled for the following cases:
Screenshots
Simulator.Screen.Recording.-.iPad.Air.5th.generation.-.2024-05-20.at.17.15.55.mp4
RELEASE-NOTES.txt
if necessary.