Added support for filtering based on system column in catalog table
Signed-off-by: Lavanya Sainik <lavanya.sainik@ericsson.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': minor
|
||||
---
|
||||
|
||||
Added support of filtering based on system columns in catalog table
|
||||
@@ -62,6 +62,21 @@ export const columnFactories = Object.freeze({
|
||||
return {
|
||||
title: 'System',
|
||||
field: 'resolved.partOfSystemRelationTitle',
|
||||
customFilterAndSearch: (query, row) => {
|
||||
let systems: JsonArray = [];
|
||||
if (
|
||||
row.entity?.spec?.system &&
|
||||
Array.isArray(row.entity?.spec?.system)
|
||||
) {
|
||||
systems = row.entity?.spec?.system;
|
||||
} else if (row.entity?.spec?.system) {
|
||||
systems = [row.entity?.spec?.system];
|
||||
}
|
||||
return systems
|
||||
.join(', ')
|
||||
.toLocaleUpperCase('en-US')
|
||||
.includes(query.toLocaleUpperCase('en-US'));
|
||||
},
|
||||
render: ({ resolved }) => (
|
||||
<EntityRefLinks
|
||||
entityRefs={resolved.partOfSystemRelations}
|
||||
|
||||
Reference in New Issue
Block a user