feat: disable categories/tags/distance rates when feature is disabled#43637
Conversation
Signed-off-by: dominictb <tb-dominic@outlook.com>
Signed-off-by: dominictb <tb-dominic@outlook.com>
Signed-off-by: dominictb <tb-dominic@outlook.com>
|
@getusha what is your ETA for testing this? thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-06-20.at.11.33.20.at.night.movAndroid: mWeb ChromeScreen.Recording.2024-06-18.at.1.24.04.in.the.afternoon.moviOS: NativeScreen.Recording.2024-06-20.at.11.16.59.at.night.moviOS: mWeb SafariScreen.Recording.2024-06-18.at.12.59.36.in.the.afternoon.movMacOS: Chrome / SafariScreen.Recording.2024-06-18.at.12.53.38.in.the.afternoon.movMacOS: DesktopScreen.Recording.2024-06-21.at.2.14.58.in.the.afternoon.mov |
|
@dominictb could we update the QA steps to something like this? does the following make sense?
|
|
@getusha done! |
| // find the rate to be enabled after disabling the distance rate feature | ||
| // first check the default rate | ||
| let rateEntryToBeEnabled = rateEntries.find((rate) => rate[1]?.name === 'Default Rate'); | ||
| // if the default rate is not enabled/doesn't exist, we'll switch to the first enabled rate |
There was a problem hiding this comment.
@dominictb noticed one case,
- Create 3 distance rates
- Disable the first one and leave the others enabled
- Go offline
- Disable and enable the feature
- You'll notice the 2nd rate will remain enabled while the first one is disabled
- Go online
- The change will be reverted and only the first one will be re-enabled
I think we need to make sure that we re-enable the first distance rate, even if it was previously disabled.
Screen.Recording.2024-06-18.at.1.35.24.in.the.afternoon.mov
There was a problem hiding this comment.
@getusha lemme check and update. Give me some time, thanks!
There was a problem hiding this comment.
web-8MB.mp4
Fixed
getusha
left a comment
There was a problem hiding this comment.
lgtm & tests well. thanks
|
|
||
| const rateEntries = Object.entries(customUnit?.rates ?? {}); | ||
| // find the rate to be enabled after disabling the distance rate feature |
There was a problem hiding this comment.
NAB
| const rateEntries = Object.entries(customUnit?.rates ?? {}); | |
| // find the rate to be enabled after disabling the distance rate feature | |
| const rateEntries = Object.entries(customUnit?.rates ?? {}); | |
| // find the rate to be enabled after disabling the distance rate feature |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.2-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.3-7 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
|
|
||
| function enablePolicyCategories(policyID: string, enabled: boolean) { | ||
| const onyxUpdatesToDisableCategories: OnyxUpdate[] = []; | ||
| if (!enabled) { |
There was a problem hiding this comment.
Edge case: From #71645 we need to handle optimistic to updates policy categories to enabled when re-enabling the category feature.
Details
feat: disable categories/tags/distance rates when feature is disabled
Fixed Issues
$ #39463
PROPOSAL: #39463 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
compressed_android.webm.mp4
Android: mWeb Chrome
compressed_aweb.webm.mp4
iOS: Native
compressed_ios.mp4.mp4
iOS: mWeb Safari
compressed_iosweb.mp4.mp4
MacOS: Chrome / Safari
compressed_web.mov.mp4
MacOS: Desktop
compressed_web.mov.mp4