Skip to content

Commit

Permalink
Sort groups and countries alphabetically instead of implicitly by size (
Browse files Browse the repository at this point in the history
  • Loading branch information
linusha authored Sep 2, 2024
2 parents 90203e0 + 3a62d2e commit 41f7096
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/CountriesFilterSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default function CountriesFilterSelect({
onChange,
}: CountriesFilterSelectProps) {
const options = Object.fromEntries(
countries.map((country) => [country.code, country.label]),
countries
.map((country) => [country.code, country.label])
.sort((a, b) => a[1].localeCompare(b[1])),
);

return (
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/GroupsFilterSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default function GroupsFilterSelect({
onChange,
}: GroupsFilterSelectProps) {
const options = Object.fromEntries(
groups.map((group) => [group.code, group.short_label || group.label]),
groups
.map((group) => [group.code, group.short_label || group.label])
.sort((a, b) => a[1].localeCompare(b[1])),
);

return (
Expand Down

0 comments on commit 41f7096

Please sign in to comment.