Skip to content

Conversation

@mikejritter
Copy link
Contributor

What does this do?

  • Create a new SortBy component
  • Create sort update handlers
  • Renders the SortBy component in the SearchResultSummary
  • Add sort.js configuration to CollectionObjects

Why are we doing this? (with JIRA link)
Jira: https://collectionspace.atlassian.net/browse/DRYD-1993

With the addition of the new search result views for objects, we wanted additional functionality in order to sort on more fields. This adds that by creating a new configuration, sort.js, which is used to specify the fields which a record uses for sorting. I chose this rather than trying to add the sort options in the existing configuration files as the new views are fairly different from the previous columns.js.

How should this be tested? Do these changes have associated tests?
For testing the sort behavior, tests were added to searchHelpers.spec.js which can be reviewed/tested with npm run test.

For testing the views:

  • Run the devserver, e.g. npm run devserver --back-end=https://core.dev.collectionspace.org
  • Run a search for CollectionObjects
  • In the Search Result page
    • Verify the SortBy component shows up in the SearchResultSummary header
    • Update the sort by using the dropdown input
    • Update the sort direction using the button next to the dropdown input
    • In the table view, update the sort and verify that the SortBy component updates
  • Run a search against another object
    • Verify that the SortBy component shows up
    • Update the sort by using the dropdown input
    • Update the sort direction using the dropdown input
    • Update the sort in the table and verify that the SortBy component updates

Dependencies for merging? Releasing to production?
This hasn't done any setting of preferred sortBy/sortDir in redux. If needed we can add that here.

In areas where columns.js was used, the code has been updated in order to prefer sort.js first then fallback if it isn't found. This might cause some issues with existing profiles as their configured fields for sorting on CollectionObjects.

I also noticed that the table columns change width when changing direction. That's something I had been meaning to do, and will get a ticket of its own.

Has the application documentation been updated for these changes?
N/A

Did someone actually run this code to verify it works?
@mikejritter has been testing against core.dev

@mikejritter mikejritter requested a review from spirosdi January 15, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant