diff --git a/.changeset/giant-eagles-talk.md b/.changeset/giant-eagles-talk.md new file mode 100644 index 0000000000..759719c2d9 --- /dev/null +++ b/.changeset/giant-eagles-talk.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-catalog': minor +'@backstage/plugin-catalog-react': minor +--- + +Added `createMetadataTitleColumn` to allow table column for `metadata.title` entity field diff --git a/plugins/catalog-react/src/components/EntityTable/columns.tsx b/plugins/catalog-react/src/components/EntityTable/columns.tsx index 6956d6a900..701a8a167c 100644 --- a/plugins/catalog-react/src/components/EntityTable/columns.tsx +++ b/plugins/catalog-react/src/components/EntityTable/columns.tsx @@ -150,6 +150,23 @@ export function createMetadataDescriptionColumn< }; } +export function createMetadataTitleColumn< + T extends Entity, +>(): TableColumn { + return { + title: 'Title', + field: 'metadata.title', + render: entity => ( + + ), + width: 'auto', + }; +} + export function createSpecLifecycleColumn(): TableColumn { return { title: 'Lifecycle', diff --git a/plugins/catalog/src/components/CatalogTable/columns.tsx b/plugins/catalog/src/components/CatalogTable/columns.tsx index 60493d1847..389e11f3c4 100644 --- a/plugins/catalog/src/components/CatalogTable/columns.tsx +++ b/plugins/catalog/src/components/CatalogTable/columns.tsx @@ -94,6 +94,20 @@ export function createMetadataDescriptionColumn(): TableColumn { }; } +export function createMetadataTitleColumn(): TableColumn { + return { + title: 'Title', + field: 'entity.metadata.title', + render: ({ entity }) => ( + + ), + width: 'auto', + }; +} + export function createTagsColumn(): TableColumn { return { title: 'Tags',