geonetwork-ui
geonetwork-ui copied to clipboard
[datahub] sort datasets by title
At the moment you can only sort the search results (i.e. datasets) by Relevancy
, Last updates
or Popularity
. Quite a common sort option is the title (i.e. sorting the results in alphabetical order). Would it be possible to have that added in?
The sort options could absolutely be made configurable. They are currently hardcoded here: https://github.com/geonetwork/geonetwork-ui/blob/main/libs/feature/search/src/lib/sort-by/sort-by.component.ts
On the other hand, please note that sorting records by name might be a bit counter-intuitive as there are no real pagination for the search results, but instead a "show more" option. So reaching the last records this way might be combersome.
I see what you mean, but presumably, a user wouldn't just want to reach the last record without any filtering or search term so it would mean that the list of records is already reduced I think.
I had a play with https://github.com/geonetwork/geonetwork-ui/blob/main/libs/feature/search/src/lib/sort-by/sort-by.component.ts sometime ago, but the best I could make it do was to sort alphabetically but in reverse (so from Z to A)- which as you can tell is close, but not quite the result I was after :joy:
Strange! but yes definitely an interesting feature. Please ask here or open a discussion on Github if you need pointers or opinions before implementing something.