diff --git a/.changeset/stupid-drinks-trade.md b/.changeset/stupid-drinks-trade.md new file mode 100644 index 0000000000..a9eeacec8a --- /dev/null +++ b/.changeset/stupid-drinks-trade.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Add kind column by default to TechDocsTable diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index 3207a16f87..f355fd00d2 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -79,6 +79,7 @@ export const DocsTable: { columns: { createNameColumn(): TableColumn; createOwnerColumn(): TableColumn; + createKindColumn(): TableColumn; createTypeColumn(): TableColumn; }; actions: { @@ -142,6 +143,7 @@ export const EntityListDocsTable: { columns: { createNameColumn(): TableColumn; createOwnerColumn(): TableColumn; + createKindColumn(): TableColumn; createTypeColumn(): TableColumn; }; actions: { diff --git a/plugins/techdocs/src/home/components/Tables/DocsTable.tsx b/plugins/techdocs/src/home/components/Tables/DocsTable.tsx index 5e5b41ee3e..03ba442578 100644 --- a/plugins/techdocs/src/home/components/Tables/DocsTable.tsx +++ b/plugins/techdocs/src/home/components/Tables/DocsTable.tsx @@ -17,16 +17,16 @@ import React from 'react'; import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; -import { useRouteRef, useApi, configApiRef } from '@backstage/core-plugin-api'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; import { - humanizeEntityRef, getEntityRelations, + humanizeEntityRef, } from '@backstage/plugin-catalog-react'; import { rootDocsRouteRef } from '../../../routes'; import { - LinkButton, EmptyState, + LinkButton, Table, TableColumn, TableOptions, @@ -87,6 +87,7 @@ export const DocsTable = (props: DocsTableProps) => { const defaultColumns: TableColumn[] = [ columnFactories.createNameColumn(), columnFactories.createOwnerColumn(), + columnFactories.createKindColumn(), columnFactories.createTypeColumn(), ]; diff --git a/plugins/techdocs/src/home/components/Tables/columns.tsx b/plugins/techdocs/src/home/components/Tables/columns.tsx index 774cfc5e8a..bc85bb7a63 100644 --- a/plugins/techdocs/src/home/components/Tables/columns.tsx +++ b/plugins/techdocs/src/home/components/Tables/columns.tsx @@ -57,6 +57,12 @@ export const columnFactories = { ), }; }, + createKindColumn(): TableColumn { + return { + title: 'Kind', + field: 'entity.kind', + }; + }, createTypeColumn(): TableColumn { return { title: 'Type',