Skip to content

Commit 2dc0079

Browse files
authored
feat: Sort dashboard filter values (#1270)
Closes HDX-2581 Dashboard filter options are now sorted alphabetically.
1 parent 348a404 commit 2dc0079

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.changeset/happy-buses-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
feat: Sort dashboard filter options

packages/app/src/DashboardFilters.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,19 @@ const DashboardFilterSelect = ({
5454
},
5555
);
5656

57+
const selectValues = keys?.[0]?.value
58+
.map(value => String(value))
59+
.sort()
60+
.map(value => ({
61+
value,
62+
label: value,
63+
}));
64+
5765
return (
5866
<Select
5967
placeholder={filter.name}
6068
value={value ?? null} // null clears the select, undefined makes the select uncontrolled
61-
data={
62-
keys?.[0]?.value.map(value => ({
63-
value: String(value),
64-
label: String(value),
65-
})) || []
66-
}
69+
data={selectValues || []}
6770
searchable
6871
clearable
6972
allowDeselect

0 commit comments

Comments
 (0)