Merge pull request #7328 from awanlin/topic/add-is-docs-available
Add is TechDocs available
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs': patch
|
||||
---
|
||||
|
||||
Added a check for the TechDocs annotation on the entity
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -44,4 +44,4 @@ export {
|
||||
TechDocsReaderPage,
|
||||
} from './plugin';
|
||||
export * from './reader';
|
||||
export { EmbeddedDocsRouter, Router } from './Router';
|
||||
export { EmbeddedDocsRouter, Router, isTechDocsAvailable } from './Router';
|
||||
|
||||
Reference in New Issue
Block a user