chore: revert some of the universal file stuff for now

This commit is contained in:
blam
2020-12-16 10:36:57 +01:00
parent a04b28ac4b
commit c754b6aa47
10 changed files with 18 additions and 76 deletions
@@ -32,10 +32,7 @@ import {
useApi,
} from '@backstage/core';
import ExternalLinkIcon from '@material-ui/icons/Launch';
// TODO(blam): Replace with the universal import from github-actions after a release
// As it will break the E2E without it
const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';
import { GITHUB_ACTIONS_ANNOTATION } from '../useProjectName';
const useStyles = makeStyles<Theme>({
externalLinkIcon: {
@@ -15,6 +15,7 @@
*/
import { Entity } from '@backstage/catalog-model';
import { errorApiRef, useApi } from '@backstage/core-api';
import { GITHUB_ACTIONS_ANNOTATION } from '../useProjectName';
import { useWorkflowRuns } from '../useWorkflowRuns';
import React, { useEffect } from 'react';
import { EmptyState, InfoCard, Table } from '@backstage/core';
@@ -22,10 +23,6 @@ import { WorkflowRunStatus } from '../WorkflowRunStatus';
import { Button, Link } from '@material-ui/core';
import { generatePath, Link as RouterLink } from 'react-router-dom';
// TODO(blam): Replace with the universal import from github-actions after a release
// As it will break the E2E without it
const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';
const firstLine = (message: string): string => message.split('\n')[0];
export type Props = {
@@ -19,12 +19,9 @@ import { Routes, Route } from 'react-router';
import { rootRouteRef, buildRouteRef } from '../plugin';
import { WorkflowRunDetails } from './WorkflowRunDetails';
import { WorkflowRunsTable } from './WorkflowRunsTable';
import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName';
import { MissingAnnotationEmptyState } from '@backstage/core';
// TODO(blam): Replace with the universal import from github-actions after a release
// As it will break the E2E without it
const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';
export const isPluginApplicableToEntity = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]);
@@ -16,7 +16,8 @@
import { useAsync } from 'react-use';
import { Entity } from '@backstage/catalog-model';
import { GITHUB_ACTIONS_ANNOTATION } from '../../universal';
export const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';
export const useProjectName = (entity: Entity) => {
const { value, loading, error } = useAsync(async () => {
+1
View File
@@ -18,3 +18,4 @@ export { plugin } from './plugin';
export * from './api';
export { Router, isPluginApplicableToEntity } from './components/Router';
export * from './components/Cards';
export { GITHUB_ACTIONS_ANNOTATION } from './components/useProjectName';