Skip to content

Commit

Permalink
Merge pull request #1422 from dhis2/DHIS2-10843/ignore-case-when-sort…
Browse files Browse the repository at this point in the history
…ing-authorities

fix: ignore case when sorting grouped authorities by name
  • Loading branch information
flaminic authored Jul 15, 2024
2 parents 6ac6565 + 6f50370 commit 0f65e44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/RoleForm/groupAuthorities/groupAuthorities.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ const groupForAuthority = (auth) => {
const sortGroupedAuthorities = (groupedAuthorities) => {
const sortedGroupedAuthorities = {}
for (const [group, items] of Object.entries(groupedAuthorities)) {
sortedGroupedAuthorities[group] = sortBy(items, 'name')
sortedGroupedAuthorities[group] = sortBy(items, (item) =>
item.name?.toLowerCase()
)
}
return sortedGroupedAuthorities
}
Expand Down

0 comments on commit 0f65e44

Please sign in to comment.