hyrax
hyrax copied to clipboard
By default, sort Works, Collections tables in Dashboard by inverse of Last modified date
Descriptive summary
When viewing works or collections in the dashboard, the most recently updated ones should be at the top.
Rationale
As a content manager, I want to be able to quickly see the most recent resources I've added and updated in order to verify that their ingest was successful, and to edit them further.
Actual behavior
They appear to sort with the most recently updated at the bottom.
Steps to reproduce the behavior
Log in to your hyrax test app and navigate to dashboard > collections > new collection Create several collections. Observe their sort order. Edit one to see what happens when it's been updated.
After looking into this, we learned the following things:
- We should sort by changing the params passed into the Solr query (search_service.rb) rather than sorting the results of that query. The results are paginated, so sorting each page wouldn't be accurate.
- "Your Collections" are rendered inside the _default_groups.html.erb file.
- To sort by most recently modified collection, we should compare by a document's
_source["system_modified_dtsi"]attribute, which is a String containing the date and time that the collection was last modified.