feat: Sort dashboard filter values (#1270)

Closes HDX-2581

Dashboard filter options are now sorted alphabetically.
This commit is contained in:
Drew Davis 2025-10-15 15:13:31 -04:00 committed by GitHub
parent 348a4044e8
commit 2dc0079b08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---
feat: Sort dashboard filter options

View file

@ -54,16 +54,19 @@ const DashboardFilterSelect = ({
},
);
const selectValues = keys?.[0]?.value
.map(value => String(value))
.sort()
.map(value => ({
value,
label: value,
}));
return (
<Select
placeholder={filter.name}
value={value ?? null} // null clears the select, undefined makes the select uncontrolled
data={
keys?.[0]?.value.map(value => ({
value: String(value),
label: String(value),
})) || []
}
data={selectValues || []}
searchable
clearable
allowDeselect