scientist-softserv / west-virginia-university

West Virginia University
0 stars 0 forks source link

🧹 Remove date from advanced search #127

Closed kirkkwang closed 1 year ago

kirkkwang commented 1 year ago

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 expected

Ref:

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 hit enter or return 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:

https://github.com/scientist-softserv/west-virginia-university/assets/19597776/488cac37-b0c1-4e36-b2d2-facf2c812f8b

After:

https://github.com/scientist-softserv/west-virginia-university/assets/19597776/9ec99696-c7c6-4459-bf97-0d9ff8237288