-
Notifications
You must be signed in to change notification settings - Fork 0
Add 'clear all filters' button to filter panel #161
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
Conversation
Pull Request Test Coverage Report for Build 8632614985Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
c22440a
to
e85f1a2
Compare
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.
Approved but with a suggestion for some additional tests we may find useful to have in place. If you agree, we can add them. If you don't, you can merge as-is.
assert_not filter_applied?(query[:contentTypeFilter], 'dataset') | ||
end | ||
|
||
test 'applied_filters returns all currently applied filters' do |
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.
Thoughts on a controller test confirming the button does not show up (or at least isn't visible) unless the expected conditions are met? I would be okay with not including it, but I also think it may be helpful to confirm at that level.
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.
Yeah, that makes sense and should be easily testable.
Why these changes are being introduced: There is not currently an affordance to remove all currently applied filters. Relevant ticket(s): * [GDT-223](https://mitlibraries.atlassian.net/browse/GDT-223) How this addresses that need: This adds the requested button, which uses a new `remove_all_filters` helper method that generates a new query in a similar fashion to the `add_filter` and `remove_filter` helpers. Side effects of this change: * The `applied_filters` method now takes a `query` argument rather than accessing the `@enhanced_query` within the method. This felt like good practice and more consistent with how we structured our other filter helper methods (including the newly added one). * Two cassettes have been added to accommodate new tests.
850c78b
to
54946d7
Compare
Why these changes are being introduced:
There is not currently an affordance to remove all currently applied filters.
Relevant ticket(s):
How this addresses that need:
This adds the requested button, which uses a new
remove_all_filters
helper method that generates a new query in a similar fashion to theadd_filter
andremove_filter
helpers.Side effects of this change:
The
applied_filters
method now takes aquery
argument rather than accessing the@enhanced_query
within the method. This felt like good practice and more consistent with how we structured our other filter helper methods (including the newly added one).Developer
Accessibility
New ENV
Approval beyond code review
Additional context needed to review
While the diff makes it look like there are a lot of SCSS changes, most of it is an extra indentation. All of the rules from line 108-127 of
_panels.scss
are now on a.list-filter-summary
selector. This basically bumps the flex container down one level in the DOM, so the new button can inherit the.filter-summary
rules without inheritingdisplay: flex
.In terms of confirming functionality, the button should appear in the search summary panel if two or more filters are applied. When clicked, it should remove all filters and reset the page number to 1; all other query terms should remain unaffected.
Code Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing