-
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.3] [Saved Searches] Fix duplicate saved searches #49243
Conversation
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 but do we have this consistency issue with other filters too? cc @Kicu
Yes with the expense type, just like in the video test of the related issue. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-09-18.at.12.47.03.PM.movAndroid: mWeb ChromeScreen.Recording.2024-09-18.at.12.43.43.PM.movScreen.Recording.2024-09-18.at.12.45.28.PM.moviOS: NativeScreen.Recording.2024-09-18.at.12.41.07.PM.moviOS: mWeb SafariScreen.Recording.2024-09-18.at.12.33.36.PM.movMacOS: Chrome / SafariScreen.Recording.2024-09-18.at.12.22.19.PM.movMacOS: DesktopScreen.Recording.2024-09-18.at.12.24.41.PM.mov |
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.
IMO it will be safer if we slightly rewrite the buildQueryStringFromFilterValues
function to achieved a desirable effect
BUG The filter name resets when you save again. Screen.Recording.2024-09-16.at.1.03.12.PM.mov |
@allroundexperts I've fixed this @Kicu I've handled your comments Feel free to re-review, cc @luacmartins |
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.
Found a typo, this code looks much cleaner 👍
@allroundexperts can you please re-review? |
@lakchote Are we supposed to create a new search whenever a merchant is edited? I would just edit the existing one. Screen.Recording.2024-09-18.at.11.40.14.AM.mov |
Yes. |
Correct, we should create new searches if any of the values are changed |
✋ 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.38-0 🚀
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.38-4 🚀
|
Details
When we open the search page there are no filters applied.
Then, when we open the advanced search filters, the filters
type: expense status: all
are automatically applied.If we set a new filter, such as Merchant, the query string for the search will become
type: expense status: all merchant:test
.Once we save the search, and make it the one currently selected, if we edit its filters however the type and status filters will be appended at the end of the array. As such the query string will become
merchant: test type: expense status: all
.Since the query strings are different, if we save the search again, we'll have different hashes and as such duplicate saved searches.
This PR aims to make sure these filters are always applied at the beginning of the query string.
Fixed Issues
$ #49205
Tests
Offline tests
NA
QA Steps
Same as in tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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./** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop