diff --git a/plugins/sentry/src/components/Router.tsx b/plugins/sentry/src/components/Router.tsx index 7c0468fda2..47d532b4e3 100644 --- a/plugins/sentry/src/components/Router.tsx +++ b/plugins/sentry/src/components/Router.tsx @@ -19,31 +19,28 @@ import { Routes, Route } from 'react-router'; import { WarningPanel } from '@backstage/core'; import { SentryPluginWidget } from './SentryPluginWidget/SentryPluginWidget'; -const SENTRY_ANNOTATION = 'sentry.io/project-id'; +const SENTRY_ANNOTATION = 'sentry.io/project-slug'; -const isPluginApplicableToEntity = (entity: Entity) => - Boolean(entity.metadata.annotations?.[SENTRY_ANNOTATION]) && - entity.metadata.annotations?.[SENTRY_ANNOTATION] !== ''; +export const Router = ({ entity }: { entity: Entity }) => { + const projectId = entity.metadata.annotations?.[SENTRY_ANNOTATION]; -export const Router = ({ entity }: { entity: Entity }) => - !isPluginApplicableToEntity(entity) ? ( - - `entity.metadata.annotations[' - {SENTRY_ANNOTATION}']` key is missing on the entity.{' '} - - ) : ( + if (!projectId) { + return ( + +
{SENTRY_ANNOTATION}
annotation is missing on the entity. +
+ ); + } + + return ( + } /> ) ); +};