Add check for TechDocs annotation on entity
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
This commit is contained in:
@@ -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