diff --git a/.changeset/chilly-sheep-scream.md b/.changeset/chilly-sheep-scream.md new file mode 100644 index 0000000000..eb568ffd8f --- /dev/null +++ b/.changeset/chilly-sheep-scream.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': minor +--- + +Added support of filtering based on system columns in catalog table diff --git a/plugins/catalog/src/components/CatalogTable/columns.tsx b/plugins/catalog/src/components/CatalogTable/columns.tsx index d5362badda..87de8bfc91 100644 --- a/plugins/catalog/src/components/CatalogTable/columns.tsx +++ b/plugins/catalog/src/components/CatalogTable/columns.tsx @@ -62,6 +62,18 @@ export const columnFactories = Object.freeze({ return { title: 'System', field: 'resolved.partOfSystemRelationTitle', + customFilterAndSearch: (query, row) => { + if (!row.resolved.partOfSystemRelations) { + return false; + } + + const systemNames = row.resolved.partOfSystemRelations.map( + ref => ref.name, + ); // Extract system names from entityRefs + + const searchText = systemNames.join(', ').toLocaleUpperCase('en-US'); + return searchText.includes(query.toLocaleUpperCase('en-US')); + }, render: ({ resolved }) => (