diff --git a/.changeset/silly-geese-design.md b/.changeset/silly-geese-design.md new file mode 100644 index 0000000000..d4f8de2510 --- /dev/null +++ b/.changeset/silly-geese-design.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-api-docs': patch +'@backstage/plugin-catalog': minor +--- + +Add hidden title column to catalog and API table to enable filtering by title. diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx index 9fc6b2c3c2..b0acd3567c 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx @@ -40,6 +40,7 @@ import React from 'react'; import { registerComponentRouteRef } from '../../routes'; const defaultColumns: TableColumn[] = [ + CatalogTable.columns.createTitleColumn({ hidden: true }), CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), CatalogTable.columns.createSystemColumn(), CatalogTable.columns.createOwnerColumn(), diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 0d2d611412..c5ee52df5c 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -136,6 +136,13 @@ export const CatalogTable: { createSpecLifecycleColumn(): TableColumn; createMetadataDescriptionColumn(): TableColumn; createTagsColumn(): TableColumn; + createTitleColumn( + options?: + | { + hidden?: boolean | undefined; + } + | undefined, + ): TableColumn; }>; }; diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 94ae7c47f4..96937c52c2 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -68,6 +68,7 @@ export const CatalogTable = (props: CatalogTableProps) => { const defaultColumns: TableColumn[] = useMemo(() => { return [ + columnFactories.createTitleColumn({ hidden: true }), columnFactories.createNameColumn({ defaultKind: filters.kind?.value }), ...createEntitySpecificColumns(), columnFactories.createMetadataDescriptionColumn(), diff --git a/plugins/catalog/src/components/CatalogTable/columns.tsx b/plugins/catalog/src/components/CatalogTable/columns.tsx index 0fb91d4f3f..d8b52e276e 100644 --- a/plugins/catalog/src/components/CatalogTable/columns.tsx +++ b/plugins/catalog/src/components/CatalogTable/columns.tsx @@ -131,4 +131,14 @@ export const columnFactories = Object.freeze({ ), }; }, + createTitleColumn(options?: { + hidden?: boolean; + }): TableColumn { + return { + title: 'Title', + field: 'entity.metadata.title', + hidden: options?.hidden, + searchable: true, + }; + }, });