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

Task/WC-166 Sort publication requests by descending date #1014

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

jarosenb
Copy link
Collaborator

Overview

  • Updates the DescriptionList component to permit sorting by adding a _order key. The key is filtered out before rendering the list, so it won't show up in the UI.
  • Sorts publication requests in descending date order before passing them to DescriptionList.

Related

Changes

Testing

  1. Go to a project with >1 publication requests and check that the requests are sorted in order of descending date.

UI

Notes

@jarosenb jarosenb requested a review from shayanaijaz November 21, 2024 21:02
Copy link
Contributor

@shayanaijaz shayanaijaz left a comment

Choose a reason for hiding this comment

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

This works well, although I wonder if a simpler solution would be to do the sort in the backend when retrieving the publication requests. Somewhere over here. Let me know what you think

@jarosenb
Copy link
Collaborator Author

jarosenb commented Dec 4, 2024

This works well, although I wonder if a simpler solution would be to do the sort in the backend when retrieving the publication requests. Somewhere over here. Let me know what you think

A simple solution is impossible here unfortunately- the DescriptionList in core-components takes an object as a prop and iterates over its keys, so there's no way to guarantee the ordering except by adding a new key/value to the description data.

@shayanaijaz shayanaijaz merged commit 761c23d into task/digital-rocks Dec 10, 2024
0 of 4 checks passed
@shayanaijaz shayanaijaz deleted the task/WC-166--sort-pub-requests branch December 10, 2024 18:59
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.

2 participants