Change hardcoded docs link to use route reference

- Specify Changelog

Signed-off-by: tudi2d <phugenroth@googlemail.com>
This commit is contained in:
tudi2d
2021-03-12 14:54:02 +01:00
parent 83bfc98a39
commit 634577d887
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/plugin-techdocs': patch
---
Change breadcrumbs link to be static
On TechDocs page header, change the breadcrumbs link to be static and point to TechDocs homepage.
@@ -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 = (
<>
<HeaderLabel
@@ -113,7 +116,7 @@ export const TechDocsPageHeader = ({
siteDescription && siteDescription !== 'None' ? siteDescription : ''
}
type="Docs"
typeLink="/docs"
typeLink={docsRootLink}
>
{labels}
</Header>