-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search summary panel and full filter support
Why these changes are being introduced: It would be helpful if users could see what filters they've applied to a search directly below the search bar, which would also provide another path to remove filters. Relevant ticket(s): https://mitlibraries.atlassian.net/browse/GDT-142 How this addresses that need: This provides the requested panel. We had been calling this a "filter removal" panel, but I ended up naming the partial `search_summary` to avoid any confusion with the filter sidebar. However, the currently displayed data has the `filter-removal` class, because it's likely we will want to show advanced search terms here, too (possibly just for screen readers). While working on this, it occurred to me that the existing TIMDEX UI filter implementation is incomplete. It pulls in the aggregation names and uses those as the internal filter names. This works fine for the existing `contentType` and `source` filters, but it will cause a name collision for filters that also exist as regular search inputs (e.g. `contributors` vs. `contributorsFilter`). Since we will be adding more aggregations and filters soon, it makes sense to fix this problem now. Side effects of these changes: * The "You searched for" list has been removed, as this feature replaces it. As mentioned above, we will likely want to provide that information in some manner in the search summary, but that will require some discussion with Darcy, who is out-of-office at the moment. * Filter keys are now cast as symbols throughout the application. Previously, they would be strings in some places and symbols in others. I found that confusing, but if this change is even more confusing, I'm happy to revert it. * A few tests have been skipped due to the removal of the "You searched for list". I chose not to delete them in case we reintroduce that feature in the near future. * Most of the cassettes have been regenerated, due to changes to the `TimdexSearch` model.
- Loading branch information
Showing
42 changed files
with
631 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<% return unless applied_filters.any? %> | ||
|
||
<div class="filter-summary"> | ||
<h2 class="hd-filter-summary hd-5">You searched for: </h2> | ||
<ul class="list-filter-summary list-inline"> | ||
<% applied_filters.each do |filter| %> | ||
<li> | ||
<a href="<%= results_path(remove_filter(@enhanced_query, filter.keys[0], filter.values[0])) %>"> | ||
<%= "#{nice_labels[filter.keys[0]] || filter.keys[0]}: #{filter.values[0]}" %> | ||
<span class="sr">Remove applied filter?</span> | ||
</a> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.