Fix filter based on reportField.disabledOptions#38958
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Desktop |
| } | ||
|
|
||
| const filteredRecentlyUsedOptions = recentlyUsedOptions.filter((option) => option !== selectedValue); | ||
| const filteredRecentlyUsedOptions = recentlyUsedOptions.filter((option) => option !== selectedValue && fieldOptions.includes(option)); |
There was a problem hiding this comment.
We shouldn't show options that are not available in "Recent"
|
Update: @GandalfGwaihir found that we still had a bug where we could offer a disabled option in the "Recents" list. Added a fix for that too. |
|
@amyevans this should be ready for review again, thanks |
|
Cool, I'll test locally as well |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Fix filter based on reportField.disabledOptions (cherry picked from commit b6d2c59)
|
QA passed:
Testing accounts: aldo+db38958@expensifail.com, aldo+db38958_m@expensifail.com |
|
🚀 Cherry-picked to staging by https://github.com/yuwenmemon in version: 1.4.56-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|



The filter was wrong and it was checking if the elements in
reportField.valueswere not insidereportField.disabledOptions, and instead we should just used the index to see if the same position insidereportField.disabledOptionswastrueor not.Sample
reportField.disabledOptions:[false, false, true]Details
Fixed Issues
$ #38898
PROPOSAL: #38898 (comment)
Tests
Offline tests
N/A
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop