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 -4
View File
@@ -20,7 +20,7 @@ import { rootRouteRef, buildRouteRef } from '../plugin';
import { WorkflowRunDetails } from './WorkflowRunDetails';
import { WorkflowRunsTable } from './WorkflowRunsTable';
import { CLOUDBUILD_ANNOTATION } from './useProjectName';
import { WarningPanel } from '@backstage/core';
import { MissingAnnotationEmptyState } from '@backstage/core';
export const isPluginApplicableToEntity = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[CLOUDBUILD_ANNOTATION]);
@@ -28,9 +28,7 @@ export const isPluginApplicableToEntity = (entity: Entity) =>
export const Router = ({ entity }: { entity: Entity }) =>
// TODO(shmidt-i): move warning to a separate standardized component
!isPluginApplicableToEntity(entity) ? (
<WarningPanel title="Cloudbuild plugin:">
<pre>{CLOUDBUILD_ANNOTATION}</pre> annotation is missing on the entity.
</WarningPanel>
<MissingAnnotationEmptyState annotation={CLOUDBUILD_ANNOTATION} />
) : (
<Routes>
<Route