-
Notifications
You must be signed in to change notification settings - Fork 130
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
[Woo POS] Hide POS mode for ineligible users #12641
[Woo POS] Hide POS mode for ineligible users #12641
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #12641 +/- ##
=========================================
Coverage 40.63% 40.64%
- Complexity 5674 5675 +1
=========================================
Files 1230 1229 -1
Lines 69166 69162 -4
Branches 9579 9578 -1
=========================================
+ Hits 28105 28110 +5
+ Misses 38476 38468 -8
+ Partials 2585 2584 -1 ☔ View full report in Codecov by Sentry. |
} else { | ||
initialState[MoreMenuItemButton.Type.WooPos] = MoreMenuItemButton.State.Hidden | ||
} | ||
flows += doCheckAvailability(MoreMenuItemButton.Type.WooPos) { isWooPosEnabled() } |
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.
That plus thing was here only because of the local FF, now we can simplify this:
private fun checkFeaturesAvailability(): Flow<Map<MoreMenuItemButton.Type, MoreMenuItemButton.State>> {
val initialState = MoreMenuItemButton.Type.entries.associateWith { MoreMenuItemButton.State.Loading }
.toMutableMap()
return listOf(
doCheckAvailability(MoreMenuItemButton.Type.Blaze) { isBlazeEnabled() },
doCheckAvailability(MoreMenuItemButton.Type.GoogleForWoo) { isGoogleForWooEnabled() },
doCheckAvailability(MoreMenuItemButton.Type.Inbox) { moreMenuRepository.isInboxEnabled() },
doCheckAvailability(MoreMenuItemButton.Type.Settings) { moreMenuRepository.isUpgradesEnabled() },
doCheckAvailability(MoreMenuItemButton.Type.WooPos) { isWooPosEnabled() },
).merge()
.map { update ->
initialState[update.first] = update.second
initialState
}
.onStart { emit(initialState) }
}
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.
LGTM!
Closes: #12189
Description
This PR:
woo_pos
remote feature flagwoo_pos
local feature flagSteps to reproduce
Testing information
The tests that have been performed
Device: Samsung Galaxy Tab S9, Android 14
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: