Hack to fix collections year limiter #931
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #899
There is a bigger issue here at play. We shouldn't always be redirecting to
/search
from pages that have search results (collections/users/items) when they change the year range limit. They should remain under the same page they previously were.Example:
If on a collections page (http://localhost:3000/communities/24a186e9-1356-4569-be37-bc3adce8b55c/collections/d677ccdb-606e-4841-bfba-46919e9beb7e) and you change the year limit and hit limit button, it should remain on this page, and only add some query params to the url. Instead we are redirecting this to the search page so it can handle it (http://localhost:3000/search).
How to fix this? Well this requires a bit more work. We have a "ItemSearch" Concern that has been neglected. Ideally, everything should be using this concern. However currently, "SearchController" is doing it's own thing. We should refactor the "SearchController" and move all it's custom "search" stuff into the "ItemSearch" concern so all search pages get it (items/collections/users) and then instead of redirecting to the search page like this, we can just handle this in its originating controller and this would fix this issue.
For a quick fix, I am just adding a facet for the member paths (community/collection pair), so we can limit the search page to only that collection.
What it looks like now, after you limit year range on a collection page, you will enter the "search" page with the year range and faceted by the collection you were previously on: