mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
feat: Sort dashboard filter values (#1270)
Closes HDX-2581 Dashboard filter options are now sorted alphabetically.
This commit is contained in:
parent
348a4044e8
commit
2dc0079b08
2 changed files with 14 additions and 6 deletions
5
.changeset/happy-buses-occur.md
Normal file
5
.changeset/happy-buses-occur.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/app": patch
|
||||
---
|
||||
|
||||
feat: Sort dashboard filter options
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue