diff --git a/.changeset/fluffy-cooks-smoke.md b/.changeset/fluffy-cooks-smoke.md new file mode 100644 index 0000000000..e4f14e6f43 --- /dev/null +++ b/.changeset/fluffy-cooks-smoke.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +On TechDocs page header, change the breadcrumbs link to be static and point to TechDocs homepage. diff --git a/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx b/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx index 8128366392..082caeeb09 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx @@ -18,6 +18,7 @@ import { TechDocsPageHeader } from './TechDocsPageHeader'; import { act } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; +import { rootRouteRef } from '../../plugin'; describe('', () => { it('should render a techdocs page header', async () => { @@ -54,6 +55,7 @@ describe('', () => { { mountedRoutes: { '/catalog/:namespace/:kind/:name/*': entityRouteRef, + '/docs': rootRouteRef, }, }, ); @@ -85,6 +87,7 @@ describe('', () => { { mountedRoutes: { '/catalog/:namespace/:kind/:name/*': entityRouteRef, + '/docs': rootRouteRef, }, }, ); @@ -118,6 +121,7 @@ describe('', () => { { mountedRoutes: { '/catalog/:namespace/:kind/:name/*': entityRouteRef, + '/docs': rootRouteRef, }, }, ); diff --git a/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx b/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx index bfab2f8515..1d4321001d 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx @@ -21,6 +21,7 @@ import { EntityName, parseEntityName } from '@backstage/catalog-model'; import { Header, HeaderLabel, Link, useRouteRef } from '@backstage/core'; import { TechDocsMetadata } from '../../types'; import { EntityRefLink, entityRouteRef } from '@backstage/plugin-catalog-react'; +import { rootRouteRef } from '../../plugin'; type TechDocsPageHeaderProps = { entityId: EntityName; @@ -59,6 +60,8 @@ export const TechDocsPageHeader = ({ ownerEntity = parseEntityName(owner, { defaultKind: 'group' }); } + const docsRootLink = useRouteRef(rootRouteRef)(); + const labels = ( <> {labels}