-
Notifications
You must be signed in to change notification settings - Fork 6
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
Sort catalog items alphabetically in the E&A modal and the data catalog #1039
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
isDatasetData(d) && | ||
d.layers.sort((a, b) => a[sortField]?.localeCompare(b[sortField]) || 0) | ||
})) as DatasetData[]; | ||
} |
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.
I think
veda-ui/app/scripts/components/common/catalog/prepare-datasets.ts
Lines 75 to 81 in 03d0488
sortField && | |
/* eslint-disable-next-line fp/no-mutating-methods */ | |
filtered.sort((a, b) => { | |
if (!a[sortField]) return Infinity; | |
return a[sortField]?.localeCompare(b[sortField]); | |
}); |
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.
The problem is that this will only work for the Data Catalog, where we show the datasets. But in the E&A Modal we show the layers within those datasets, so we have to go one level down (to the layers prop) to sort them. Showing the layers in the new E&A Modal makes it more obvious that they are unsorted as opposed to the old modal when we showed them horizontally and it was not as obvious.
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.
lgtm 🚀 thanks for getting on this quick!
## 🎉 Features * 🦗 ## 🚀 Improvements - Base setup for using react-uswds in the veda-ui #1029 - Consolidate utils/veda-data(-no-faux-module) methods into new dir and remove faux module dependencies for Library build #1030 - Upgrade to Parcel 2.12 and make library build work #1045 - Update E&A Date Picker to react-calendar with USWDS tokens #1048 ## 🐛 Fixes - Sort catalog items alphabetically in the E&A modal and the data catalog #1039
Related Ticket: #1038
Description of Changes
Add fix that sorts catalog content alphabetically by default for the Data Catalog view and the E&A modal. This behavior was there for the Data Catalog before the last release, but not for the old E&A modal (due to it using horizontal cards).
Notes & Questions About Changes
{Add additonal notes and outstanding questions here related to changes in this pull request}
Validation / Testing