[CP Staging] Filter page improvements#65411
Conversation
|
@alitoshmatov Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@alitoshmatov Sorry for bump. Please don't review it yet. It will be linked to a different issue so the review will be based on that. |
|
Note for later: Before we merge this PR, I'd like to test an adhoc build. |
|
Sure, Ready for review now. |
|
@alitoshmatov can you please review this asap? I would love to get this shipped to staging before the current checklist; otherwise, QA might raise this as a bug. |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
@shubham1206agra I already started reviewing this PR from this thread cc @mountiny |
|
@DylanDylann Sorry, but I also started reviewing this PR. And I was assigned by CME here. |
| @@ -70,7 +70,7 @@ function SearchFiltersWorkspacePage() { | |||
| }, [selectedOptions]); | |||
There was a problem hiding this comment.
@parasharrajat Can you fix this function by using below?
const applyChanges = useCallback(() => {
const policyIds = selectedOptions.map((option) => (option ? option.toString() : undefined)).filter(Boolean) as string[];
updateWorkspaceFilter(policyIds.length > 0 ? policyIds : null);
}, [selectedOptions]);There was a problem hiding this comment.
Actually, fix the buildQueryStringFromFilterFormValues function.
There was a problem hiding this comment.
See the diff
diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts
index 52fb60daeaa..18239a27095 100644
--- a/src/libs/SearchQueryUtils.ts
+++ b/src/libs/SearchQueryUtils.ts
@@ -395,7 +395,7 @@ function buildSearchQueryString(queryJSON?: SearchQueryJSON) {
*/
function buildQueryStringFromFilterFormValues(filterValues: Partial<SearchAdvancedFiltersForm>) {
// We separate type and status filters from other filters to maintain hashes consistency for saved searches
- const {type, status, policyID, groupBy, ...otherFilters} = filterValues;
+ const {type, status, groupBy, ...otherFilters} = filterValues;
const filtersString: string[] = [];
// When switching types/setting the type, ensure we aren't polluting our query with filters that are
@@ -436,11 +436,6 @@ function buildQueryStringFromFilterFormValues(filterValues: Partial<SearchAdvanc
filtersString.push(`${CONST.SEARCH.SYNTAX_ROOT_KEYS.STATUS}:${filterValueArray.map(sanitizeSearchValue).join(',')}`);
}
- if (policyID) {
- const sanitizedPolicyIDs = Array.isArray(policyID) ? policyID.map((id) => sanitizeSearchValue(id)).join(',') : sanitizeSearchValue(policyID);
- filtersString.push(`${CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID}:${sanitizedPolicyIDs}`);
- }
-
const mappedFilters = Object.entries(otherFilters)
.map(([filterKey, filterValue]) => {
if (There was a problem hiding this comment.
Which issue are we solving here?
There was a problem hiding this comment.
I see. I think we need this logic for sanitizing but, the fix here might be to check the length as the value is an array. Pushing that change now.
There was a problem hiding this comment.
There is similar logic below which handles sanitizing
There was a problem hiding this comment.
@parasharrajat See
App/src/libs/SearchQueryUtils.ts
Line 490 in 99e31a5
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-07-05.at.12.53.55.PM.movAndroid: mWeb ChromeScreen.Recording.2025-07-05.at.12.20.09.PM.moviOS: HybridAppScreen.Recording.2025-07-05.at.12.50.17.PM.moviOS: mWeb SafariScreen.Recording.2025-07-05.at.11.57.33.AM.movMacOS: Chrome / SafariScreen.Recording.2025-07-05.at.11.30.41.AM.movMacOS: DesktopScreen.Recording.2025-07-05.at.12.26.53.PM.mov |
…space (cherry picked from commit c5f6b11) (cherry-picked to staging by mountiny)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.1.76-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.76-5 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.1.77-1 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.77-2 🚀
|
Explanation of Change
Fixed Issues
$ #65418
$ #65453
PROPOSAL:
Tests
Prerequisites
Tax Exempt, Tax Rate 1Go to Reports page.
Open filters and go to the workspace filter page.
Select both workspaces.
Save the filter.
Go back to the workspace filter page and press the reset button.
Savebutton filter is not updated.Now, keep both workspaces selected and go to the tax rate filter page.
Now, select any tax rate values and save this filter.
Go back to the tax rate filter page.
Verify that there are no duplicate names in the list.
Verify that no errors appear in the JS console
Offline tests
Same as tests.
QA Steps
Same as tests.
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
03.07.2025_18.03.50_REC.mp4
Android: mWeb Chrome
03.07.2025_18.08.33_REC.mp4
iOS: Native
03.07.2025_17.58.10_REC.mp4
iOS: mWeb Safari
03.07.2025_17.59.36_REC.mp4
MacOS: Chrome / Safari
03.07.2025_14.20.52_REC.mp4
MacOS: Desktop
03.07.2025_18.07.45_REC.mp4