-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement FiltersPresenter#reset_url
#3493
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.
Looks good to me 👍 Just a couple of minor comments.
Other thing is that given this is owned by #govuk-patterns-and-pages it doesn't feel like I should have the review without some team involvement. So imagine we want to check in with them.
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 simplification 👍
This returns the URL used for the "Clear all" link on both the filter summary and filter panel in the new "all content" finder UI. - Add real implementation for `FiltersPresenter#reset_url`, merging the query parameters keys from every applied facet and then removing them from the current URL - Add `UrlBuilder#url_except_keys` to remove all given keys from the current finder URL's query parameters - Refactor duplication into a `#applied_filters` private method
This returns the URL used for the "Clear all" link on both the filter
summary and filter panel in the new "all content" finder UI.
FiltersPresenter#reset_url
, merging thequery parameters keys from every applied facet and then removing them
from the current URL
UrlBuilder#url_except_keys
to remove all given keys from thecurrent finder URL's query parameters
#applied_filters
private methodNote this code could be simpler if we just removed all query params except the keyword, but then we would also lose any other query parameters that are unrelated to the filtering/sorting.
Review app testing