Skip to content

Commit

Permalink
(fix) fix request location labels
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Sep 4, 2022
1 parent 9da6679 commit 2bf135f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/SensitiveData/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Stack, Box, Text } from "@chakra-ui/react"
import { Select } from "chakra-react-select"
import { GetSensitiveDataAggParams } from "@common/types"
import { DataSection, RiskScore } from "@common/enums"
import { DATA_SECTION_TO_LABEL_MAP } from "@common/maps"

interface SensitiveDataFilterProps {
hosts?: string[]
Expand Down Expand Up @@ -84,23 +85,23 @@ const SensitiveDataFilters: React.FC<SensitiveDataFilterProps> = React.memo(
value={
locations
? locations.map(location => ({
label: location,
label: DATA_SECTION_TO_LABEL_MAP[location],
value: location,
}))
: undefined
}
isMulti={true}
size="sm"
options={Object.values(DataSection).map(e => ({
label: e,
label: DATA_SECTION_TO_LABEL_MAP[e],
value: e,
}))}
placeholder="Filter by location..."
instanceId="sensitive-data-tbl-env-location"
onChange={e =>
setParams(params => ({
...params,
locations: e.map(location => location.label as DataSection),
locations: e.map(location => location.value as DataSection),
}))
}
/>
Expand Down

0 comments on commit 2bf135f

Please sign in to comment.