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

fix: sort columns using non case sensitive sort #469

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

flaminic
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for dhis2-maintenance-app-beta ready!

Name Link
🔨 Latest commit 1ee1e2a
🔍 Latest deploy log https://app.netlify.com/sites/dhis2-maintenance-app-beta/deploys/67612d3a29d6ed0008aa6a18
😎 Deploy Preview https://deploy-preview-469.maintenance-app-beta.netlify.dhis2.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@flaminic flaminic force-pushed the DHIS2-18512/sort-case-insensitive branch from 4afac53 to 572c4e4 Compare December 16, 2024 15:04
@@ -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
Copy link
Member

@Birkbjo Birkbjo Dec 16, 2024

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]}`

Copy link
Contributor Author

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={
Copy link
Member

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

@flaminic flaminic requested a review from Birkbjo December 17, 2024 07:50
@flaminic flaminic merged commit e05fd78 into master Dec 17, 2024
11 checks passed
@flaminic flaminic deleted the DHIS2-18512/sort-case-insensitive branch December 17, 2024 08:00
dhis2-bot added a commit that referenced this pull request Dec 18, 2024
## [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))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 0.19.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants