diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index 6d5ab61ec1..9c41c6dde2 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -162,15 +162,15 @@ having to set anything up. ```tsx - {({ techdocsMetadataValue, entityMetadataValue, entityId, onReady }) => ( + {({ techdocsMetadataValue, entityMetadataValue, entityRef, onReady }) => ( <> - + )} @@ -183,11 +183,11 @@ interested in replacing the Header: ```tsx - {({ entityId, onReady }) => ( + {({ entityRef, onReady }) => ( <>
- + )} @@ -198,11 +198,11 @@ Or maybe you want to disable the in-context search ```tsx - {({ entityId, onReady }) => ( + {({ entityRef, onReady }) => ( <>
- + )} diff --git a/packages/app/src/components/techdocs/TechDocsPage.tsx b/packages/app/src/components/techdocs/TechDocsPage.tsx index ce97d4a38e..be11e30e61 100644 --- a/packages/app/src/components/techdocs/TechDocsPage.tsx +++ b/packages/app/src/components/techdocs/TechDocsPage.tsx @@ -25,15 +25,15 @@ import React from 'react'; const DefaultTechDocsPage = () => { return ( - {({ techdocsMetadataValue, entityMetadataValue, entityId, onReady }) => ( + {({ techdocsMetadataValue, entityMetadataValue, entityRef, onReady }) => ( <> - + )} diff --git a/plugins/techdocs/dev/index.tsx b/plugins/techdocs/dev/index.tsx index 659a4e2caf..8dc0e5d30b 100644 --- a/plugins/techdocs/dev/index.tsx +++ b/plugins/techdocs/dev/index.tsx @@ -110,7 +110,7 @@ function createPage({ render() { return ( { { ', () => { it('should render Reader content', async () => { useParams.mockReturnValue({ - entityId: 'Component::backstage', + entityRef: 'Component::backstage', }); const scmIntegrationsApi: ScmIntegrationsApi = @@ -68,7 +68,7 @@ describe('', () => { wrapInTestApp( void; withSearch?: boolean; }; @@ -71,8 +71,8 @@ const useStyles = makeStyles(theme => ({ }, })); -export const Reader = ({ entityId, onReady, withSearch = true }: Props) => { - const { kind, namespace, name } = entityId; +export const Reader = ({ entityRef, onReady, withSearch = true }: Props) => { + const { kind, namespace, name } = entityRef; const theme = useTheme(); const classes = useStyles(); @@ -448,7 +448,7 @@ export const Reader = ({ entityId, onReady, withSearch = true }: Props) => { {withSearch && shadowDomRef?.current?.shadowRoot?.innerHTML && ( - + )}
diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx index 272edb0373..6a5af982fd 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx @@ -54,7 +54,7 @@ global.scroll = jest.fn(); describe('', () => { it('should render techdocs page', async () => { useParams.mockReturnValue({ - entityId: 'Component::backstage', + entityRef: 'Component::backstage', }); const scmIntegrationsApi: ScmIntegrationsApi = @@ -111,7 +111,7 @@ describe('', () => { it('should render techdocs page with custom header', async () => { useParams.mockReturnValue({ - entityId: 'Component::backstage', + entityRef: 'Component::backstage', }); const scmIntegrationsApi: ScmIntegrationsApi = diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index e73e03fbcc..a8db3e1d15 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -29,11 +29,11 @@ import { Page } from '@backstage/core-components'; export type TechDocsPageRenderFunction = ({ techdocsMetadataValue, entityMetadataValue, - entityId, + entityRef, }: { techdocsMetadataValue?: TechDocsMetadata | undefined; entityMetadataValue?: TechDocsEntityMetadata | undefined; - entityId: EntityName; + entityRef: EntityName; onReady: () => void; }) => JSX.Element; @@ -78,7 +78,7 @@ export const TechDocsPage = ({ children }: TechDocsPageProps) => { ? children({ techdocsMetadataValue, entityMetadataValue, - entityId: { kind, namespace, name }, + entityRef: { kind, namespace, name }, onReady, }) : children} diff --git a/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx b/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx index dede1af115..4fa43bfed5 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx @@ -25,7 +25,7 @@ describe('', () => { await act(async () => { const rendered = await renderInTestApp( ', () => { await act(async () => { const rendered = await renderInTestApp( ', () => { await act(async () => { const rendered = await renderInTestApp( { - const { name } = entityId; + const { name } = entityRef; const { site_name: siteName, site_description: siteDescription } = techDocsMetadata || {}; @@ -59,7 +59,7 @@ export const TechDocsPageHeader = ({ value={ }