Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DH/Editor] : Sort by changeDate by default #1022

Merged
merged 6 commits into from
Oct 29, 2024
Merged

Conversation

cmoinier
Copy link
Collaborator

@cmoinier cmoinier commented Oct 18, 2024

Description

This PR ensures that both editor and datahub search/landing pages sort their results by changeDate and not by relevancy.
It also makes sure to revert back to a sorting by relevancy when a full text search is done.

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

Copy link
Contributor

github-actions bot commented Oct 18, 2024

Affected libs: common-domain, api-metadata-converter, api-repository, feature-catalog, feature-record, feature-router, feature-search, feature-map, feature-dataviz, feature-editor, feature-auth, ui-search, common-fixtures, ui-elements, feature-notifications, ui-catalog, util-shared, ui-widgets, ui-inputs, ui-layout, ui-map, ui-dataviz,
Affected apps: metadata-converter, metadata-editor, datahub, demo, webcomponents, search, map-viewer, datafeeder, data-platform,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Oct 18, 2024

📷 Screenshots are here!

@coveralls
Copy link

coveralls commented Oct 18, 2024

Coverage Status

coverage: 83.363% (-0.5%) from 83.88%
when pulling ab1960b on sort-by-last-date
into 09f416f on main.

@cmoinier cmoinier marked this pull request as draft October 21, 2024 10:52
@cmoinier cmoinier marked this pull request as ready for review October 21, 2024 12:57
@cmoinier cmoinier force-pushed the sort-by-last-date branch 5 times, most recently from 6ccc90e to 4dad7d3 Compare October 21, 2024 14:10
Copy link
Collaborator

@jahow jahow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think there might be a better way to do this. This PR will immediately put a _sort parameter in the URL if none is present. The previous behavior (when using the router) was to fall back to relevancy because of this code:
https://github.com/geonetwork/geonetwork-ui/blob/main/libs/feature/router/src/lib/default/state/router.effects.ts#L64

I think we can change that to CHANGE_DATE, so we can have the datahub or editor load without a _sort parameter showing up.

Also the sort-by component should offer CHANGE_DATE alongside CREATE_DATE I guess:
https://github.com/geonetwork/geonetwork-ui/blob/main/libs/feature/search/src/lib/sort-by/sort-by.component.ts

(the create date criteria can be kept under the name "Newest" and change date can be "Last modification")

Copy link
Collaborator

@jahow jahow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! two minor comments to address and it's good to merge :)

@cmoinier cmoinier merged commit 0c459c1 into main Oct 29, 2024
11 checks passed
@cmoinier cmoinier deleted the sort-by-last-date branch October 29, 2024 16:48
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.

3 participants