Open IuliiaHerets opened 1 week ago
Triggered auto assignment to @MariaHCD (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
Triggered auto assignment to @strepanier03 (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.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Edited by proposal-police: This proposal was edited at 2024-11-12 10:11:34 UTC.
Search - Category field is still present after deleting all the categories
Offending PR: https://github.com/Expensify/App/pull/52102
We will show the category menu if the policy category id exist in nonPersonalPolicyCategoryIds
https://github.com/Expensify/App/blob/e3632a9877542727230814ffc9fdd78bd087ecbd/src/pages/Search/AdvancedSearchFilters.tsx#L279-L284
When we create new workspace and enable the categories feature, the category menu item will show because the policy category id is exist inside nonPersonalPolicyCategoryIds
https://github.com/Expensify/App/blob/e3632a9877542727230814ffc9fdd78bd087ecbd/src/pages/Search/AdvancedSearchFilters.tsx#L282
But when we delete all the categories, the policy category id still exists in this allPolicyCategories
with empty object value and when when we check if the policy category is exist inside nonPersonalPolicyCategoryIds it will return true which cause this issue
https://github.com/Expensify/App/blob/e3632a9877542727230814ffc9fdd78bd087ecbd/src/pages/Search/AdvancedSearchFilters.tsx#L282
Inside allPolicyCategories
we should filter out if the value is empty object
const filteredPoliciyCategories = useMemo(() => Object.values(allPolicyCategories ?? {}).filter((policyCategory) => !isEmptyObject(policyCategory)), [allPolicyCategories])
OR
const nonPersonalPolicyCategoryCount = Object.keys(allPolicyCategories).filter(
(policyCategoryId) => nonPersonalPolicyCategoryIds.includes(policyCategoryId) && !isEmptyObject(allPolicyCategories[policyCategoryId]),
).length;
const shouldDisplayCategoryFilter = nonPersonalPolicyCategoryCount !== 0 || !!singlePolicyCategories;
Since this is a bug from https://github.com/Expensify/App/pull/52102 and we're still in the regression period, the original PR author will be handling the fix for this.
cc: @Kicu @fedirjh @luacmartins
will write a comment here a bit later
Please assign me, I will provide a fix for this. That being said I don't think this is necessarily a deploy blocker, maybe @luacmartins you can verify
Yea, this is not a blocker. Assigning it to you @Kicu
@Kicu asked me to take a look at it, I think that solution that @NJ-2020 proposed is good(also tested it) and we should let him open a PR with it 😄 WDYT @luacmartins
That works for me
FYI keep in mind that @sumo-slonik is also working on other filters misbehaving here: https://github.com/Expensify/App/pull/52462
PR ready
FYI keep in mind that @sumo-slonik is also working on other filters misbehaving here: #52462
all related bugs for : CategoryFilter TagFilter CardFilter have been solved by this PR which was linked by Mateusz
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.60-0 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://github.com/Expensify/App/pull/52102 Email or phone of affected tester (no customers): applausetester+290324@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Both Category and Tag fields will not be present because there are no categories and tags.
Actual Result:
Category field is still present after deleting all the categories, while Tag field is not present which is expected.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/b502db54-f355-431c-be27-f9f7ef16a0df
View all open jobs on GitHub