Merge remote-tracking branch 'upstream/master'

This commit is contained in:
NetPenguins
2020-09-12 09:10:07 -04:00
331 changed files with 9921 additions and 3831 deletions
@@ -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] !== '';
@@ -30,8 +30,8 @@ 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['
{GITHUB_ACTIONS_ANNOTATION}']` key is missing on the entity.{' '}
<pre>{GITHUB_ACTIONS_ANNOTATION}</pre> annotation is missing on the
entity.
</WarningPanel>
) : (
<Routes>
@@ -13,39 +13,38 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { useWorkflowRunsDetails } from './useWorkflowRunsDetails';
import { useWorkflowRunJobs } from './useWorkflowRunJobs';
import { useProjectName } from '../useProjectName';
import { WorkflowRunLogs } from '../WorkflowRunLogs';
import {
makeStyles,
Box,
TableRow,
TableCell,
ListItemText,
Accordion,
AccordionSummary,
Typography,
AccordionDetails,
TableContainer,
Table,
Paper,
TableBody,
LinearProgress,
CircularProgress,
Theme,
Breadcrumbs,
Link as MaterialLink,
} from '@material-ui/core';
import { Jobs, Job, Step } from '../../api';
import moment from 'moment';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import ExternalLinkIcon from '@material-ui/icons/Launch';
import { Entity } from '@backstage/catalog-model';
import { Link } from '@backstage/core';
import {
Accordion,
AccordionDetails,
AccordionSummary,
Box,
Breadcrumbs,
CircularProgress,
LinearProgress,
Link as MaterialLink,
ListItemText,
makeStyles,
Paper,
Table,
TableBody,
TableCell,
TableContainer,
TableRow,
Theme,
Typography,
} from '@material-ui/core';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import ExternalLinkIcon from '@material-ui/icons/Launch';
import moment from 'moment';
import React from 'react';
import { Job, Jobs, Step } from '../../api';
import { useProjectName } from '../useProjectName';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
import { useWorkflowRunJobs } from './useWorkflowRunJobs';
import { useWorkflowRunsDetails } from './useWorkflowRunsDetails';
import { WorkflowRunLogs } from '../WorkflowRunLogs';
const useStyles = makeStyles<Theme>(theme => ({
root: {
@@ -116,10 +115,7 @@ const StepView = ({ step }: { step: Step }) => {
const JobListItem = ({ job, className, entity }: { job: Job; className: string; entity: Entity }) => {
const classes = useStyles();
return (
<Accordion
TransitionProps={{ unmountOnExit: true }}
className={className}
>
<Accordion TransitionProps={{ unmountOnExit: true }} className={className}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls={`panel-${name}-content`}
+1 -1
View File
@@ -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';
+7 -1
View File
@@ -14,7 +14,12 @@
* limitations under the License.
*/
import { createPlugin, createRouteRef } from '@backstage/core';
import {
createPlugin,
createRouteRef,
createApiFactory,
} from '@backstage/core';
import { githubActionsApiRef, GithubActionsClient } from './api';
// TODO(freben): This is just a demo route for now
export const rootRouteRef = createRouteRef({
@@ -29,4 +34,5 @@ export const buildRouteRef = createRouteRef({
export const plugin = createPlugin({
id: 'github-actions',
apis: [createApiFactory(githubActionsApiRef, new GithubActionsClient())],
});