-
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
[Search v2.5] - Category field is still present after deleting all the categories #52362
Comments
Triggered auto assignment to @MariaHCD ( |
Triggered auto assignment to @strepanier03 ( |
💬 A slack conversation has been started in #expensify-open-source |
👋 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. ProposalPlease re-state the problem that we are trying to solve in this issue.Search - Category field is still present after deleting all the categories What is the root cause of that problem?Offending PR: #52102 App/src/pages/Search/AdvancedSearchFilters.tsx Lines 279 to 284 in e3632a9
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
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
What changes do you think we should make in order to solve the problem?Inside 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; What alternative solutions did you explore? (Optional) |
Since this is a bug from #52102 and we're still in the regression period, the original PR author will be handling the fix for this. |
will write a comment here a bit later |
Please assign me, I will provide a fix for this. |
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 😄 |
That works for me |
FYI keep in mind that @sumo-slonik is also working on other filters misbehaving here: #52462 |
PR ready |
all related bugs for : |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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: #52102
Email or phone of affected tester (no customers): [email protected]
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
Bug6661800_1731356979898.20241112_042538.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: