-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: sort columns using non case sensitive sort #469
Conversation
✅ Deploy Preview for dhis2-maintenance-app-beta ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
4afac53
to
572c4e4
Compare
@@ -78,5 +78,5 @@ export const useSectionListSortOrder = () => { | |||
export const useSortOrderQueryParams = () => { | |||
const [sortOrder] = useSectionListSortOrder() | |||
|
|||
return sortOrder ? formatSortOrderToString(sortOrder) : undefined | |||
return sortOrder ? `${sortOrder[0]}:i${sortOrder[1]}` : undefined |
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.
Do we always want to enforce case insensitive sorts?
I guess the reason why you didn't update formatSortOrderToString
is because that would affect the URL, and not just the value used for the API. Which makes sense, but I still think we should try to reuse formatSortOrderToString
?
Eg. we could do something like
const formatSortOrderToString = (value: ParsedSortOrder, caseSensitive: boolean = false): string =>
`${value[0]}:${caseSensitive ? '': 'i'}${value[1]}`
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 so.
yes i though the url makes more sense with the asc and desc, which is also what the table uses, Sure, I can move it in there, probably having a variable called caseSensitive helps the understanding of what the i does so happy w that
@@ -57,7 +61,11 @@ export const HeaderColumnsSortable = ({ | |||
{headerColumns.map((headerColumn) => ( | |||
<DataTableColumnHeader | |||
sortDirection={getDataTableSortDirection(headerColumn)} | |||
onSortIconClick={handleSortOrderChange} | |||
onSortIconClick={ |
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.
Nice, I guess this fixes that prop-type error
## [0.19.5](v0.19.4...v0.19.5) (2024-12-18) ### Bug Fixes * adjust form container styles ([6d60814](6d60814)) * adjust form footer styles ([1be5c38](1be5c38)) * adjust global background color ([6eab28e](6eab28e)) * adjust help and description texts ([ec05922](ec05922)) * adjust org unit row height, expand button ([7e5b7a7](7e5b7a7)) * adjust sidebar filter empty state ([dc1f21f](dc1f21f)) * adjust table icon button color ([fcfc1b5](fcfc1b5)) * data element group transfers sizing ([d153156](d153156)) * only sort if persisted unless it is display name ([#472](#472)) [skip release] ([4e4b5b8](4e4b5b8)) * ou-tree field styling ([f0e6d18](f0e6d18)) * prevent sidebar focus styles on mouse click ([c43aa2a](c43aa2a)) * reduce page-title bottom margin ([e4b3f0c](e4b3f0c)) * reduce sidebar filter padding ([f96633b](f96633b)) * remove global lineheight declaration ([6e92f6c](6e92f6c)) * sidebar filter placeholder label ([3259147](3259147)) * sidebar filter placeholder style ([70664f3](70664f3)) * sidebar, sidenav style adjustments ([501b53c](501b53c)) * sort columns using non case sensitive sort ([#469](#469)) [skip release] ([e05fd78](e05fd78)) * use destructive style for delete menu items ([209542b](209542b)) ### Features * do not allow creation of org units at level 1 unless it's the first ([#470](#470)) [skip release] ([21e73b8](21e73b8))
🎉 This PR is included in version 0.19.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.