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
+1 -2
View File
@@ -63,7 +63,6 @@
"msw": "^0.21.2"
},
"files": [
"dist",
"universal.js"
"dist"
]
}
@@ -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';
-22
View File
@@ -1,22 +0,0 @@
// @ts-check
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Annotation to define on the entity to enable the plugin
* @type {string}
*/
module.exports.GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';