diff --git a/.changeset/tiny-lobsters-exercise.md b/.changeset/tiny-lobsters-exercise.md index f50ff9a236..78cc753bab 100644 --- a/.changeset/tiny-lobsters-exercise.md +++ b/.changeset/tiny-lobsters-exercise.md @@ -1,7 +1,21 @@ --- -'@backstage/plugin-techdocs': patch +'@backstage/plugin-techdocs': minor --- +**BREAKING:** +Table column utilities `createNameColumn`, `createOwnerColumn`, `createTypeColumn` as well as actions utilities `createCopyDocsUrlAction` and `createStarEntityAction` are no longer directly exported. Instead accessible through DocsTable and EntityListDocsTable. + +Use as following: + +```tsx +DocsTable.columns.createNameColumn(); +DocsTable.columns.createOwnerColumn(); +DocsTable.columns.createTypeColumn(); + +DocsTable.actions.createCopyDocsUrlAction(); +DocsTable.actions.createStarEntityAction(); +``` + - Renamed `DocsResultListItem` to `TechDocsSearchResultListItem`, leaving the old name in place as a deprecations. - Renamed `TechDocsPage` to `TechDocsReaderPage`, leaving the old name in place as a deprecations. diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index 31f8ee9a6d..917c1d5d85 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -47,7 +47,32 @@ export const DocsResultListItem: ( ) => JSX.Element; // @public -export const DocsTable: (props: DocsTableProps) => JSX.Element | null; +export const DocsTable: { + (props: DocsTableProps): JSX.Element | null; + columns: { + createNameColumn(): TableColumn; + createOwnerColumn(): TableColumn; + createTypeColumn(): TableColumn; + }; + actions: { + createCopyDocsUrlAction(copyToClipboard: Function): (row: DocsTableRow) => { + icon: () => JSX.Element; + tooltip: string; + onClick: () => any; + }; + createStarEntityAction( + isStarredEntity: Function, + toggleStarredEntity: Function, + ): ({ entity }: DocsTableRow) => { + cellStyle: { + paddingLeft: string; + }; + icon: () => JSX.Element; + tooltip: string; + onClick: () => any; + }; + }; +}; // @public export type DocsTableProps = { @@ -199,7 +224,10 @@ export type TechDocsCustomHomeProps = { // @public export type TechDocsEntityMetadata = Entity & { - locationMetadata?: LocationSpec; + locationMetadata?: { + type: string; + target: string; + }; }; // @public diff --git a/plugins/techdocs/src/home/components/Tables/DocsTable.tsx b/plugins/techdocs/src/home/components/Tables/DocsTable.tsx index 323cdab96a..b875ba4e98 100644 --- a/plugins/techdocs/src/home/components/Tables/DocsTable.tsx +++ b/plugins/techdocs/src/home/components/Tables/DocsTable.tsx @@ -131,3 +131,6 @@ export const DocsTable = (props: DocsTableProps) => { ); }; + +DocsTable.columns = columnFactories; +DocsTable.actions = actionFactories;