Merge pull request #2556 from spotify/freben/booool
chore: trust the Boolean :)
This commit is contained in:
@@ -24,8 +24,7 @@ import { Entity } from '@backstage/catalog-model';
|
||||
import { WarningPanel } from '@backstage/core';
|
||||
|
||||
export const isPluginApplicableToEntity = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[CIRCLECI_ANNOTATION]) &&
|
||||
entity.metadata.annotations?.[CIRCLECI_ANNOTATION] !== '';
|
||||
Boolean(entity.metadata.annotations?.[CIRCLECI_ANNOTATION]);
|
||||
|
||||
export const Router = ({ entity }: { entity: Entity }) =>
|
||||
!isPluginApplicableToEntity(entity) ? (
|
||||
|
||||
@@ -23,13 +23,12 @@ import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName';
|
||||
import { WarningPanel } from '@backstage/core';
|
||||
|
||||
export const isPluginApplicableToEntity = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]) &&
|
||||
entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] !== '';
|
||||
Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]);
|
||||
|
||||
export const Router = ({ entity }: { entity: Entity }) =>
|
||||
// TODO(shmidt-i): move warning to a separate standardized component
|
||||
!isPluginApplicableToEntity(entity) ? (
|
||||
<WarningPanel title=" GitHubActions plugin:">
|
||||
<WarningPanel title="GitHubActions plugin:">
|
||||
<pre>{GITHUB_ACTIONS_ANNOTATION}</pre> annotation is missing on the
|
||||
entity.
|
||||
</WarningPanel>
|
||||
|
||||
@@ -23,8 +23,7 @@ import { WarningPanel } from '@backstage/core';
|
||||
import { CITable } from './BuildsPage/lib/CITable';
|
||||
|
||||
export const isPluginApplicableToEntity = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[JENKINS_ANNOTATION]) &&
|
||||
entity.metadata.annotations?.[JENKINS_ANNOTATION] !== '';
|
||||
Boolean(entity.metadata.annotations?.[JENKINS_ANNOTATION]);
|
||||
|
||||
export const Router = ({ entity }: { entity: Entity }) => {
|
||||
return !isPluginApplicableToEntity(entity) ? (
|
||||
|
||||
@@ -23,7 +23,7 @@ import { ROLLBAR_ANNOTATION } from '../constants';
|
||||
import { EntityPageRollbar } from './EntityPageRollbar/EntityPageRollbar';
|
||||
|
||||
export const isPluginApplicableToEntity = (entity: Entity) =>
|
||||
entity.metadata.annotations?.[ROLLBAR_ANNOTATION] !== '';
|
||||
Boolean(entity.metadata.annotations?.[ROLLBAR_ANNOTATION]);
|
||||
|
||||
type Props = {
|
||||
entity: Entity;
|
||||
|
||||
Reference in New Issue
Block a user