You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-11-20] [$250] Search filters - Category list shows default categories when no workspace is created #50564
Version Number: 9.0.47-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):applausetester+pso@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Go to staging.new.expensify.com
Log in with a new account (no workspace)
Go to Search
Click Filters
Click Categories
Expected Result:
Category list should be empty because no workspace is created
Actual Result:
Category list shows default categories when no workspace is created
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidenceBug6630371_1728540215030.20241010_140142.mp4
@garrettmknight FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
But i think for cards we should update the if condition from above code to:
if(isEmptyObject(cardList)){returnundefined;}
And Inside the SearchFiltersCategoryPage we can use the new hook we just created getAllCategories if the current policy categories is empty which also will filter out the personal policy
And we should update from this:
changed the title [-]Search filters - Category list shows default categories when no workspace is created[/-][+][$250] Search filters - Category list shows default categories when no workspace is created[/+]on Oct 10, 2024
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production
2b. Reported on staging (deploy blocker)
2c. Reported on both staging and production
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A This is a new feature rather than a bug fix.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Open Search
Open Advanced filters RHP
Verify that there is no tag filter displayed if user has no tags
Verify that there is no category filter displayed if user has no categories
Verify that there is no tax filter displayed if user has no taxes
Activity
melvin-bot commentedon Oct 10, 2024
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.lanitochka17 commentedon Oct 10, 2024
@garrettmknight FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
lanitochka17 commentedon Oct 10, 2024
We think that this bug might be related to #wave-control
NJ-2020 commentedon Oct 10, 2024
Edited by proposal-police: This proposal was edited at 2024-10-16 06:05:34 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search filters - Category list shows default categories when no workspace is created
What is the root cause of that problem?
Right here we don't filter out the personal policy for
allPolicyIDCategoriesApp/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCategoryPage.tsx
Lines 22 to 32 in 8f5ba1e
And inside AdvancedSearchFilters.tsx we don't hide the categories, tags, and taxes if the list is empty
What changes do you think we should make in order to solve the problem?
We can create 2 new hooks inside PolicyUtils to get the lists of tags and categories, for taxes we already have right here:
App/src/pages/Search/AdvancedSearchFilters.tsx
Line 262 in ce23fb5
and we will hide the categories, tags and taxes inside AdvancedSearchFilters page if the list is empty
Then inside AdvancedSearchFilters
For
cardswe already hide right here if the lists are emptyApp/src/pages/Search/AdvancedSearchFilters.tsx
Line 261 in ce23fb5
App/src/pages/Search/AdvancedSearchFilters.tsx
Lines 317 to 321 in ce23fb5
But i think for
cardswe should update the if condition from above code to:And Inside the SearchFiltersCategoryPage we can use the new hook we just created
getAllCategoriesif the current policy categories is empty which also will filter out the personal policyAnd we should update from this:
App/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCategoryPage.tsx
Lines 31 to 41 in ce23fb5
to
Here's the test branch
Result
What alternative solutions did you explore? (Optional)
truph01 commentedon Oct 10, 2024
Edited by proposal-police: This proposal was edited at 2024-10-11 23:28:14 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Category list shows default categories when no workspace is created
What is the root cause of that problem?
App/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersCategoryPage.tsx
Line 28 in 8f5ba1e
we don't filter out the personal policy, which also has categories.
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
then for the key category, tag, or card, check if its options length is greater than 0, if not, return undefined in:
App/src/pages/Search/AdvancedSearchFilters.tsx
Line 268 in 8f5ba1e
[-]Search filters - Category list shows default categories when no workspace is created[/-][+][$250] Search filters - Category list shows default categories when no workspace is created[/+]melvin-bot commentedon Oct 10, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021844424503641996992
melvin-bot commentedon Oct 10, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)52 remaining items
melvin-bot commentedon Nov 20, 2024
Payment Summary
Upwork Job
BugZero Checklist (@garrettmknight)
garrettmknight commentedon Nov 21, 2024
@fedirjh please complete the checklist when you get a chance.
fedirjh commentedon Nov 22, 2024
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A This is a new feature rather than a bug fix.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Nov 25, 2024
@garrettmknight, @Kicu, @luacmartins, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
garrettmknight commentedon Nov 25, 2024
@fedirjh thanks - submit the payment request when you're ready!
JmillsExpensify commentedon Dec 10, 2024
Payment summary: @fedirjh owed $250 via NewDot
garrettmknight commentedon Dec 10, 2024
$250 approved for @fedirjh