-
Notifications
You must be signed in to change notification settings - Fork 121
Bookings: Show bookings tab when site is eligible #16153
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
077d33f
Show bookings tab when site is eligible
itsmeichigo 9e81f47
Remove unnecessary caching
itsmeichigo 6f6c479
Add unit tests
itsmeichigo f460ecd
Create bookingsEligibilityChecker upon observing
itsmeichigo 2115397
Ignore periphery
itsmeichigo 349779f
Merge branch 'WOOMOB-1363-hide-POS-tab-for-CIAB-sites' into woomob-12…
itsmeichigo ecfc2b3
Disable optional tabs when site ID change
itsmeichigo 76c5b0d
Update site ID for POSTabCoordinator upon switching stores
itsmeichigo 35c4988
Ignore unused method to be updated later
itsmeichigo 7198db0
Merge branch 'trunk' into woomob-1231-ios-bookings-tab
itsmeichigo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,7 @@ final class NotificationsBadgeController { | |
| /// | ||
| private func hideDotOn(with input: NotificationsBadgeInput) { | ||
| let tag = dotTag(for: input.tab) | ||
| if let subviews = input.tabBar.orderedTabBarActionableViews[input.tabIndex].subviews.first?.subviews { | ||
| if let subviews = input.tabBar.orderedTabBarActionableViews[safe: input.tabIndex]?.subviews.first?.subviews { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While testing I encountered a crash due to index out of bound here, so I added this for safety. |
||
| for subview in subviews where subview.tag == tag { | ||
| subview.fadeOut() { _ in | ||
| subview.removeFromSuperview() | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm hoping the siteID can remain constant in
POSTabCoordinator. How about reinitializing thePOSTabCoordinatorhere instead of updating the siteID? Would it cause any issues?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.
@jaclync POSTabCoordinator requires the eligibility checker, which now requires a full site model to check if the site is CIAB. Upon changes of site ID, we don't yet have the full site model so it's not possible to reinitialize the coordinator.
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.
It would be great if the coordinator can be separated from the eligibility checker, but with the current design I don't have a better solution. Please feel free to suggest a solution if you have one in mind, thanks!
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'd consider separating the tab visibility logic in
POSEntryPointEligibilityCheckerProtocolto a new protocol that stays in the app, so thatPOSEntryPointEligibilityCheckerProtocoljust hascheckEligibilityandrefreshEligibilitythat should not depend on the fullSite(the CIAB check is performed on the tab visibility).We're also in the middle of moving POS code into a separate module, and I'm refactoring the dependencies of
PointOfSaleEntryPointViewpassed inPOSTabCoordinator. Please go ahead with merging this PR and I'll look into the refactoring as part of the POS module refactoring work.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.
Thank you!