Skip to content

Commit cfba5cb

Browse files
authored
feat: Sort source dropdown alphabetically (#1359)
Fixes HDX-2820
1 parent c42a070 commit cfba5cb

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.changeset/little-hounds-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": minor
3+
---
4+
5+
feat: Sort source dropdown alphabetically

packages/app/src/components/SourceSelect.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ function SourceSelectControlledComponent({
6161

6262
const values = useMemo(
6363
() => [
64-
...(data
65-
?.filter(
66-
source =>
67-
!allowedSourceKinds || allowedSourceKinds.includes(source.kind),
68-
)
69-
.map(d => ({
70-
value: d.id,
71-
label: d.name,
72-
})) ?? []),
64+
...(
65+
data
66+
?.filter(
67+
source =>
68+
!allowedSourceKinds || allowedSourceKinds.includes(source.kind),
69+
)
70+
.map(d => ({
71+
value: d.id,
72+
label: d.name,
73+
})) ?? []
74+
).sort((a, b) => a.label.localeCompare(b.label)),
7375
...(onCreate && !hasLocalDefaultSources
7476
? [
7577
{

0 commit comments

Comments
 (0)