docs: plugin integration into catalog

This commit is contained in:
Ivan Shmidt
2020-08-31 23:18:06 +02:00
parent e57798cd88
commit 713060d1f3
8 changed files with 154 additions and 27 deletions
@@ -16,17 +16,18 @@
import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { Routes, Route } from 'react-router';
import { rootRouteRef, buildRouteRef } from './plugin';
import { WorkflowRunDetails } from './components/WorkflowRunDetails';
import { WorkflowRunsTable } from './components/WorkflowRunsTable';
import { GITHUB_ACTIONS_ANNOTATION } from './components/useProjectName';
import { rootRouteRef, buildRouteRef } from '../plugin';
import { WorkflowRunDetails } from './WorkflowRunDetails';
import { WorkflowRunsTable } from './WorkflowRunsTable';
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] !== '';
export const GitHubActionsPage = ({ entity }: { entity: Entity }) =>
export const Router = ({ entity }: { entity: Entity }) =>
// TODO(shmidt-i): move warning to a separate standardized component
!isPluginApplicableToEntity(entity) ? (
<WarningPanel title=" GitHubActions plugin:">
`entity.metadata.annotations['
+1 -2
View File
@@ -16,6 +16,5 @@
export { plugin } from './plugin';
export * from './api';
export { Widget } from './components/Widget';
export { GitHubActionsPage } from './Router';
export { Router } from './components/Router';
export { GITHUB_ACTIONS_ANNOTATION } from './components/useProjectName';