From bf1b430b9604359f94ac271592957bf02c5383ab Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Fri, 4 Sep 2020 15:59:03 +0200 Subject: [PATCH] feat(github-actions): exported predicate --- plugins/github-actions/src/components/Router.tsx | 2 +- plugins/github-actions/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/github-actions/src/components/Router.tsx b/plugins/github-actions/src/components/Router.tsx index d0745f67d4..83c18ed483 100644 --- a/plugins/github-actions/src/components/Router.tsx +++ b/plugins/github-actions/src/components/Router.tsx @@ -22,7 +22,7 @@ import { WorkflowRunsTable } from './WorkflowRunsTable'; import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName'; import { WarningPanel } from '@backstage/core'; -const isPluginApplicableToEntity = (entity: Entity) => +export const isPluginApplicableToEntity = (entity: Entity) => Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]) && entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] !== ''; diff --git a/plugins/github-actions/src/index.ts b/plugins/github-actions/src/index.ts index 17c1fa2dd7..24fe6fc90d 100644 --- a/plugins/github-actions/src/index.ts +++ b/plugins/github-actions/src/index.ts @@ -16,6 +16,6 @@ export { plugin } from './plugin'; export * from './api'; -export { Router } from './components/Router'; +export { Router, isPluginApplicableToEntity } from './components/Router'; export * from './components/Cards'; export { GITHUB_ACTIONS_ANNOTATION } from './components/useProjectName';