-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Stop displaying some advanced filters when they have no data #52102
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 = |
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.
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) |
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
@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. |
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 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 [cardList = {}] = useOnyx(ONYXKEYS.CARD_LIST); | ||
const taxRates = getAllTaxRates(); | ||
const personalDetails = usePersonalDetails(); | ||
|
||
const [policies = {}] = useOnyx(ONYXKEYS.COLLECTION.POLICY); | ||
const [allPolicyCategories = {}] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES); |
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.
Explanation of Change
This PR adds logic to hide
Category
,Tag
andTax rate
search 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-filters-web.mov
MacOS: Desktop