hyrax icon indicating copy to clipboard operation
hyrax copied to clipboard

By default, sort Works, Collections tables in Dashboard by inverse of Last modified date

Open hackartisan opened this issue 3 years ago • 1 comments

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.

hackartisan avatar Mar 03 '22 17:03 hackartisan

After looking into this, we learned the following things:

  1. 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.
  2. "Your Collections" are rendered inside the _default_groups.html.erb file.
  3. 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.

thanyabegum avatar Mar 16 '22 19:03 thanyabegum