Use MissingAnnotationEmptyState for plugins (#2824)

This commit is contained in:
Stefan Ålund
2020-10-09 15:11:15 +02:00
committed by GitHub
parent 28793b502c
commit 8d666e43bd
8 changed files with 17 additions and 45 deletions
+2 -11
View File
@@ -17,8 +17,7 @@
import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { Route, Routes } from 'react-router-dom';
import { WarningPanel } from '@backstage/core';
import { MissingAnnotationEmptyState } from '@backstage/core';
import {
rootRouteRef,
rootDocsRouteRef,
@@ -43,15 +42,7 @@ export const EmbeddedDocsRouter = ({ entity }: { entity: Entity }) => {
const projectId = entity.metadata.annotations?.[TECHDOCS_ANNOTATION];
if (!projectId) {
return (
<WarningPanel title="Techdocs plugin:">
<pre>{TECHDOCS_ANNOTATION}</pre> annotation is missing on the entity.
<br />
<a href="https://backstage.io/docs/features/techdocs/creating-and-publishing">
Getting Started
</a>
</WarningPanel>
);
return <MissingAnnotationEmptyState annotation={TECHDOCS_ANNOTATION} />;
}
return (