Stop displaying some advanced filters when they have no data#52102
Conversation
e342e0b to
92c9783
Compare
|
@luacmartins I need some advice here. However the original issue mentions something else: that if you do not have any policy selected, then you still get categories. freshly created account |
|
@Kicu I think we can exclude those by comparing the policy type. Those default categories should belong to a policy with type = |
luacmartins
left a comment
There was a problem hiding this comment.
Looks good. We just need to address the personal policy categories now.
92c9783 to
5292f56
Compare
|
Thanks for your explanation @luacmartins the PR is updated according to your suggestion and is ready for review Category filter no longer shown even though there are categories for policy (personal) |
|
@fedirjh all yours. Please prioritize this review! |
Reviewer Checklist
Screenshots/Videos |
@Kicu When I disable the categories in the policy . I still still see the filter in Search, is that expected ? CleanShot.2024-11-08.at.10.15.57.mp4 |
This happens for tags and taxes as well. |
|
Hi! I'am Adam from SWM and I have worked recently on Search v2. @Kicu is currently OOO but I can answer some questions. I believe the observed behavior is as expected. Search retrieves data for display from Onyx, thus we have no way of knowing whether expenses tagged with disabled tags exist. This is why I think we should allow users to search using these tags (or categories or tax rates). Alternatively, we can adjust the logic to receive information from the BE about the existence of such expenses. |
fedirjh
left a comment
There was a problem hiding this comment.
I believe the observed behavior is as expected. Search retrieves data for display from Onyx, thus we have no way of knowing whether expenses tagged with disabled tags exist. This is why I think we should allow users to search using these tags (or categories or tax rates).
That make sense. @luacmartins What do you think about that?
|
Yea, I agree. |
|
✋ 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/luacmartins in version: 9.0.60-0 🚀
|
|
will take a look at both |
|
@mjasikowski yup already asked a colleague to work on this |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.60-3 🚀
|
| const personalDetails = usePersonalDetails(); | ||
|
|
||
| const [policies = {}] = useOnyx(ONYXKEYS.COLLECTION.POLICY); | ||
| const [allPolicyCategories = {}] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES); |











Explanation of Change
This PR adds logic to hide
Category,TagandTax ratesearch filters if there is no data corresponding to specific filter.Also added very small code tweaks and renames.
Fixed Issues
$ #50564
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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
rec-filters-web.mov
MacOS: Desktop