Skip to content

Commit

Permalink
fix(topology): filter options should show unique value only
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Sep 12, 2024
1 parent fb87a10 commit e128ab4
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions src/app/Topology/Toolbar/TopologyFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,19 @@ export const TopologyFilter: React.FC<TopologyFilterProps> = ({ isDisabled }) =>
return !criteria || !criteria.includes(val);
}
return true;
})
.map<TopologyFilterSelectOption>((val) => ({
value: val,
render: () =>
isLabelOrAnnotation(cat) ? (
<Label color="grey" textMaxWidth={LABEL_TEXT_MAXWIDTH}>
{val}
</Label>
) : (
val
),
})),
}),
),
),
).map<TopologyFilterSelectOption>((val) => ({
value: val,
render: () =>
isLabelOrAnnotation(cat) ? (
<Label color="grey" textMaxWidth={LABEL_TEXT_MAXWIDTH}>
{val}
</Label>
) : (
val
),
})),
}))
.filter((group) => group.options && group.options.length); // Do show show empty groups

Expand Down Expand Up @@ -267,20 +266,19 @@ export const TopologyFilter: React.FC<TopologyFilterProps> = ({ isDisabled }) =>
.filter((val) => {
const criteria: string[] = targetFilters.filters[cat];
return !criteria || !criteria.includes(val);
})
.map<TopologyFilterSelectOption>((val) => ({
value: val,
render: () =>
isLabelOrAnnotation(cat) ? (
<Label color="grey" textMaxWidth={LABEL_TEXT_MAXWIDTH}>
{val}
</Label>
) : (
val
),
})),
}),
),
),
).map<TopologyFilterSelectOption>((val) => ({
value: val,
render: () =>
isLabelOrAnnotation(cat) ? (
<Label color="grey" textMaxWidth={LABEL_TEXT_MAXWIDTH}>
{val}
</Label>
) : (
val
),
})),
},
];

Expand Down

0 comments on commit e128ab4

Please sign in to comment.