Merge pull request #7328 from awanlin/topic/add-is-docs-available

Add is TechDocs available
This commit is contained in:
Patrik Oldsberg
2021-09-27 13:53:41 +02:00
committed by GitHub
4 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': patch
---
Added a check for the TechDocs annotation on the entity
+5
View File
@@ -167,6 +167,11 @@ export const EntityTechdocsContent: (_props: {
entity?: Entity | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "isTechDocsAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const isTechDocsAvailable: (entity: Entity) => boolean;
// Warning: (ae-missing-release-tag) "PanelType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
+3
View File
@@ -25,6 +25,9 @@ import { MissingAnnotationEmptyState } from '@backstage/core-components';
const TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';
export const isTechDocsAvailable = (entity: Entity) =>
Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]);
export const Router = () => {
return (
<Routes>
+1 -1
View File
@@ -44,4 +44,4 @@ export {
TechDocsReaderPage,
} from './plugin';
export * from './reader';
export { EmbeddedDocsRouter, Router } from './Router';
export { EmbeddedDocsRouter, Router, isTechDocsAvailable } from './Router';