-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LWS-244: Filter sort #1103
LWS-244: Filter sort #1103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM!
Some things I would like see in a later PR:
- Suitable default sort order for each facet group (should maybe be a backend config?)
Things to discuss later:
- Some/top/all? facet groups should be expanded by default?
- Some facet groups might work better as top N + alphabetically, e.g. Language: Swedish, English, German, Afrikaans, Akkandian, Albanian...
I actually had this implemented ('special' sorting for groups was a var in the constants file) but it was then removed in discussion with Ebou since users can achieve the same thing if they want to. Don't know if that is a correct conclusion. Let's merge this for testing and see what can be improved. |
Description
Tickets involved
LWS-244
Solves
Allowing the user to sort individual filter groups as well as some general changes to facet/filter section.
Summary of changes
Each filter group (with the exception of
other
) now gets a sort select element on expansion. The sorting is done in the client, and is persisted after navigation/reload by setting a cookie using thejs-cookie
package. By using cookies (and not localStorage) the setting is available during SSR, which is probably also needed with future user settings until we save them in a db.The cookie is retrieved in the hooks
handle
function and passed to the frontend in the serverload
functions. Quite the roundtrip, but i've not come up with a more elegant way to do it...Other changes
details
/summary
elements for the filter panel (in line with rest of the app) to allow expanding the sections without js enabled.discriminator
text which i've made darker.