-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: add sorting logic for resources #709
feat: add sorting logic for resources #709
Conversation
✅ Deploy Preview for idrc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@jhung, do you have some time on this project to add some design for the sort UI? |
@chosww here's a mockup of the filter. The behaviour is the same as what is there currently with the following adjustments:
|
@chosww I took a look at the preview - it looks fine to me. However, can you put "Newest Published" before "Oldest Published"? |
That's great! I updated the order as you requested. @greatislander I think this work is ready for your review now. |
src/admin/config.yml
Outdated
@@ -465,6 +465,8 @@ collections: | |||
create: true | |||
i18n: false | |||
fields: | |||
- {label: Layout, name: layout, widget: hidden, default: layouts/single--resource.njk} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required?
export function renderSortUI() { | ||
let sortUIHtml = | ||
`<div class='resources-sort'> | ||
<p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a <label>
— the select has no accessible name.
Additionally to the two issues I identified above, there's a broader problem with the filtering/sorting which is that the change on input is not communicated to screen readers. We should discuss this, @chosww. |
npm run test
without errorsnpm run build
without errorsDescription
Resolves #518:
Add sort and pin features to the resources page.
Steps to test
Additional information
Currently we only have title and publishedYear attributes to sort the resources by, it would probably makes sense to add more attributes for sorting category.
Related issues
Resolves #518