Skip to content

Commit

Permalink
Merge pull request #2692 from headlamp-k8s/sort-namespaces
Browse files Browse the repository at this point in the history
frontend: k8s: Sort namespaces in UI
  • Loading branch information
joaquimrocha authored Dec 17, 2024
2 parents b9675b7 + 01324b5 commit 81fb494
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/components/common/NamespacesAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ function NamespacesFromClusterAutocomplete(
) {
const [namespacesList] = Namespace.useList();
const namespaceNames = useMemo(
() => namespacesList?.map(namespace => namespace.metadata.name) ?? [],
() =>
namespacesList
?.map(namespace => namespace.metadata.name)
.slice()
.sort((a, b) => a.localeCompare(b)) ?? [],
[namespacesList]
);

Expand Down

0 comments on commit 81fb494

Please sign in to comment.