refactor: simplify optional chaining

This commit is contained in:
Ivan Shmidt
2020-08-31 23:44:33 +02:00
parent e8259d1515
commit 8539b14a7e
@@ -23,8 +23,8 @@ import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName';
import { WarningPanel } from '@backstage/core';
const isPluginApplicableToEntity = (entity: Entity) =>
Boolean(entity?.metadata?.annotations?.[GITHUB_ACTIONS_ANNOTATION]) &&
entity?.metadata?.annotations?.[GITHUB_ACTIONS_ANNOTATION] !== '';
Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]) &&
entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] !== '';
export const Router = ({ entity }: { entity: Entity }) =>
// TODO(shmidt-i): move warning to a separate standardized component