-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Filter bookmark #1010
base: master
Are you sure you want to change the base?
Filter bookmark #1010
Conversation
232d966
to
a8b2bc9
Compare
172ea11
to
c765dec
Compare
Still to do before merging:
|
); | ||
|
||
useEffect(() => { | ||
handleQuerySearchParams({ |
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.
Does this need to be inside a conditional like in the Verify and Grower contexts?
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.
I think it's the others that are incorrect.
I suspect the if (searchParams)
check is an artefact of a previous way of doing this.
We probably shouldn't check it as we're not using it within this useEffect
. I'll do some more testing.
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.
Nice solution!
When testing out the back button with the Capture Filter the filter fields aren't being updated to match the url filters Test filter data:
Before back button: After back button (the capture reference id and capture uuid fields should be filled): URL filter string: |
Description
Introduces filter persistence and linkability for the following tools:
When a user applies a filter in one of these tools, the URL search parameters are updated with the filter values and pagination parameters. This provides several benefits:
Issue(s) addressed
Note that filters for Capture Matching, Earnings, Payments and Stakeholders are not yet supported.
These can be addressed under separate issues using the same pattern and utility functions.
What kind of change(s) does this PR introduce?
Please check if the PR fulfils these requirements
Issue
What is the current behavior?
Filters do not persist.
What is the new behavior?
Filters stay in the URL.
Breaking change
Does this PR introduce a breaking change?
No.
Other useful information