scientist-softserv / west-virginia-university

West Virginia University
0 stars 0 forks source link

Alphabetize facets #107

Closed laritakr closed 11 months ago

laritakr commented 11 months ago

Ref https://github.com/scientist-softserv/west-virginia-university/issues/106

Render facet list in alphabetical order.

Screenshots ## Before ![Screenshot 2023-10-18 at 6 26 41 PM](https://github.com/wvulibraries/hydra_acda_portal_public/assets/17851674/805e0b86-92e4-4ed7-b817-917a41a798ad) ## After ![Screenshot 2023-10-19 at 10 43 04 AM](https://github.com/scientist-softserv/west-virginia-university/assets/17851674/b02c1034-da15-491e-9a58-e6be879a6fe5)

Testing

jeremyf commented 11 months ago

@laritakr I'm wondering, did you explore arranging facets in the catalog controller?

https://github.com/scientist-softserv/west-virginia-university/blob/fbb244d55195e58a0cfb863a84229f3e3c8515cc/hydra/app/controllers/catalog_controller.rb#L50-L66

My understanding is the order in which they are defined is the default sort order. Which would then remove the need for a decorator.

laritakr commented 11 months ago

@laritakr I'm wondering, did you explore arranging facets in the catalog controller?

I thought about doing it that way, but I thought adding the explicit sort made it more obvious and less subject to someone changing it inadvertently. I can do it the other way and just comment it, if you think that's better.