Skip to content

Commit

Permalink
Nits and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
vchiapaikeo committed Dec 1, 2023
1 parent 58e0a4e commit 03c80bd
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions airflow/www/static/js/dag/nav/FilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,6 @@ const FilterBar = () => {
},
});

const runTypeOptionsDeserialized = transformCsvToMultiSelectOptions(
filters.runTypeOptions
);
const runTypeDeserialized = transformCsvToMultiSelectOptions(filters.runType);
const runStateOptionsDeserialized = transformCsvToMultiSelectOptions(
filters.runStateOptions
);
const runStateDeserialized = transformCsvToMultiSelectOptions(
filters.runState
);

return (
<Flex
backgroundColor="blackAlpha.200"
Expand Down Expand Up @@ -120,7 +109,7 @@ const FilterBar = () => {
<Box px={2} style={multiSelectBoxStyle}>
<MultiSelect
{...multiSelectStyles}
value={runTypeDeserialized}
value={transformCsvToMultiSelectOptions(filters.runType)}
onChange={(typeOptions) => {
if (
Array.isArray(typeOptions) &&
Expand All @@ -131,15 +120,15 @@ const FilterBar = () => {
);
}
}}
options={runTypeOptionsDeserialized}
options={transformCsvToMultiSelectOptions(filters.runTypeOptions)}
placeholder="All Run Types"
/>
</Box>
<Box />
<Box px={2} style={multiSelectBoxStyle}>
<MultiSelect
{...multiSelectStyles}
value={runStateDeserialized}
value={transformCsvToMultiSelectOptions(filters.runState)}
onChange={(stateOptions) => {
if (
Array.isArray(stateOptions) &&
Expand All @@ -150,7 +139,7 @@ const FilterBar = () => {
);
}
}}
options={runStateOptionsDeserialized}
options={transformCsvToMultiSelectOptions(filters.runStateOptions)}
placeholder="All Run States"
/>
</Box>
Expand Down

0 comments on commit 03c80bd

Please sign in to comment.