🧹 Remove date from advanced search #127
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.
There is a known issue with the date facet in advanced search and the common approach is to remove it. This commit will remove the date from the advanced search form and also increase the character limit for the form fields. It was set to 4 but that was only enough for the year and didn't work for a date search like DD/MM/YYYY. Lastly, I moved the gem call for
blacklight_range_limit
out of the development group so it can be used in a deployed environment. Other than those changes, the search seems to be working as expectedRef:
Expected Behavior Before Changes
Filtered advanced searches generally work as intended as the results show up in the catalog search view just like a regular search. However, the actual
Search
button does not work. It does work if you hitenter
orreturn
on your keyboard though. This is because it conflicts with the Blacklight Range Limit gem in that the Date facet also has a form element so it becomes a nested form tag which does some funky rendering.Expected Behavior After Changes
Filtered advanced searches should still work but the Date facet is omitted so it doesn't cause conflicts. Date searches on the regular search is not just limited to 4 characters anymore.
Screenshots / Video
Before:
Screen.Recording.2023-10-21.at.09.19.14.mp4
After:
Screen.Recording.2023-10-21.at.09.16.56.mp4