fix(entityTypeFilter): generate unique available types

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2022-05-13 13:39:48 -04:00
parent 490d663a55
commit b880c0e092
2 changed files with 12 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
Fix `EntityTypeFilter` so generating available types is case insensitive
@@ -96,7 +96,13 @@ export function useEntityTypeFilter(): {
}
// Sort by facet count descending, so the most common types appear on top
const newTypes = sortBy(facets, f => -f.count).map(f => f.value);
const newTypes = [
...new Set(
sortBy(facets, f => -f.count).map(f =>
f.value.toLocaleLowerCase('en-US'),
),
),
];
setAvailableTypes(newTypes);
// Update type filter to only valid values when the list of available types has changed