casa
casa copied to clipboard
5847 surface common filters with helper
Note: This is an alternative approach to #5871 Instead of persisting client state with sessionStorage, I scrapped the idea of using client state for the collapse logic. Instead, I am using the original method of having the menu shown or hidden based on the existence of the filter params. However, I have removed the "surfaced" params from this check, so that when you filter only by an option such as "Hide draft", it will not open the filter options menu.
What github issue is this PR for, if any?
Resolves #5847
What changed, and why?
- Moved the
Sorted by
andHide drafts
filter options outside of the collapsable area of the form element, so that they display regardless of filter menu collapse status. - Fixed the positioning of the form select pseudo icons by refactoring the HTML syntax around the select elements
- Changed the filter-card-body collapse class logic to, fix a bug where the "Expand / show" button did not respond to the first click after filtering. This change accounts for how Bootstrap implements its version of collapse.
- Added helper
expand_filters?
to prevent filter menu from expanding when filtering only by "surfaced" filter options.
How is this tested? (please write tests!) ππͺ
I added tests for the new expanded_filters?
helper method.
Screenshots please :)
Feelings gif (optional)
Instead of a gif, I asked ChatGPT to write a haiku about Bootstrap. γγΌγγΉγγ©γγ εΆη΄γζγγ¦ θͺη±γζ±γ