Merge branch 'master' of github.com:spotify/backstage into shmidt-i/universal-file-github-actions
* 'master' of github.com:spotify/backstage: (536 commits) fix(catalog-backend): make addProcessor work (#3132) use cost insights changeset prefix fix(deps): yarn.lock changes missed (#3128) Disable yarn update check removed transformErrors function feat: make entity not found page responsive (#3125) Add changeset Loosen up the type some more Updated types and moved defaulting logic Move working directory config to backend Add missing config to create-app Add testing for working directory config Add workdir config support to scaffolder fix unbumped packages and bump changelog v0.1.1-alpha.26 chore(docs): more docs around proxy setup techdocs-backend: remove duplicate log tagging catalog-backend: remove data parsing processing step scaffolder-backend: fix review nit docs: fix copy and paste error ...
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
export type Step = {
|
||||
name: string;
|
||||
status: string;
|
||||
conclusion: string;
|
||||
conclusion?: string;
|
||||
number: number; // starts from 1
|
||||
started_at: string;
|
||||
completed_at: string;
|
||||
|
||||
@@ -81,10 +81,9 @@ const WidgetContent = ({
|
||||
export const LatestWorkflowRunCard = ({
|
||||
entity,
|
||||
branch = 'master',
|
||||
}: {
|
||||
entity: Entity;
|
||||
branch: string;
|
||||
}) => {
|
||||
// Display the card full height suitable for
|
||||
variant,
|
||||
}: Props) => {
|
||||
const errorApi = useApi(errorApiRef);
|
||||
const [owner, repo] = (
|
||||
entity?.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] ?? '/'
|
||||
@@ -102,7 +101,7 @@ export const LatestWorkflowRunCard = ({
|
||||
}, [error, errorApi]);
|
||||
|
||||
return (
|
||||
<InfoCard title={`Last ${branch} build`}>
|
||||
<InfoCard title={`Last ${branch} build`} variant={variant}>
|
||||
<WidgetContent
|
||||
error={error}
|
||||
loading={loading}
|
||||
@@ -113,14 +112,18 @@ export const LatestWorkflowRunCard = ({
|
||||
);
|
||||
};
|
||||
|
||||
type Props = {
|
||||
entity: Entity;
|
||||
branch: string;
|
||||
variant?: string;
|
||||
};
|
||||
|
||||
export const LatestWorkflowsForBranchCard = ({
|
||||
entity,
|
||||
branch = 'master',
|
||||
}: {
|
||||
entity: Entity;
|
||||
branch: string;
|
||||
}) => (
|
||||
<InfoCard title={`Last ${branch} build`}>
|
||||
variant,
|
||||
}: Props) => (
|
||||
<InfoCard title={`Last ${branch} build`} variant={variant}>
|
||||
<WorkflowRunsTable branch={branch} entity={entity} />
|
||||
</InfoCard>
|
||||
);
|
||||
|
||||
@@ -18,9 +18,9 @@ import { errorApiRef, useApi } from '@backstage/core-api';
|
||||
import { GITHUB_ACTIONS_ANNOTATION } from '../../../universal';
|
||||
import { useWorkflowRuns } from '../useWorkflowRuns';
|
||||
import React, { useEffect } from 'react';
|
||||
import { EmptyState, Table } from '@backstage/core';
|
||||
import { EmptyState, InfoCard, Table } from '@backstage/core';
|
||||
import { WorkflowRunStatus } from '../WorkflowRunStatus';
|
||||
import { Button, Card, Link, TableContainer } from '@material-ui/core';
|
||||
import { Button, Link } from '@material-ui/core';
|
||||
import { generatePath, Link as RouterLink } from 'react-router-dom';
|
||||
|
||||
const firstLine = (message: string): string => message.split('\n')[0];
|
||||
@@ -30,6 +30,7 @@ export type Props = {
|
||||
branch?: string;
|
||||
dense?: boolean;
|
||||
limit?: number;
|
||||
variant?: string;
|
||||
};
|
||||
|
||||
export const RecentWorkflowRunsCard = ({
|
||||
@@ -37,6 +38,7 @@ export const RecentWorkflowRunsCard = ({
|
||||
branch,
|
||||
dense = false,
|
||||
limit = 5,
|
||||
variant,
|
||||
}: Props) => {
|
||||
const errorApi = useApi(errorApiRef);
|
||||
const [owner, repo] = (
|
||||
@@ -70,15 +72,19 @@ export const RecentWorkflowRunsCard = ({
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<TableContainer component={Card}>
|
||||
<InfoCard
|
||||
title="Recent Workflow Runs"
|
||||
subheader={branch ? `Branch: ${branch}` : 'All Branches'}
|
||||
noPadding
|
||||
variant={variant}
|
||||
>
|
||||
<Table
|
||||
title="Recent Workflow Runs"
|
||||
subtitle={branch ? `Branch: ${branch}` : 'All Branches'}
|
||||
isLoading={loading}
|
||||
options={{
|
||||
search: false,
|
||||
paging: false,
|
||||
padding: dense ? 'dense' : 'default',
|
||||
toolbar: false,
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
@@ -98,6 +104,6 @@ export const RecentWorkflowRunsCard = ({
|
||||
]}
|
||||
data={runs}
|
||||
/>
|
||||
</TableContainer>
|
||||
</InfoCard>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -77,8 +77,9 @@ const JobsList = ({ jobs, entity }: { jobs?: Jobs; entity: Entity }) => {
|
||||
<Box>
|
||||
{jobs &&
|
||||
jobs.total_count > 0 &&
|
||||
jobs.jobs.map((job: Job) => (
|
||||
jobs.jobs.map(job => (
|
||||
<JobListItem
|
||||
key={job.id}
|
||||
job={job}
|
||||
className={
|
||||
job.status !== 'success' ? classes.failed : classes.success
|
||||
@@ -108,7 +109,7 @@ const StepView = ({ step }: { step: Step }) => {
|
||||
<TableCell>
|
||||
<WorkflowRunStatus
|
||||
status={step.status.toUpperCase()}
|
||||
conclusion={step.conclusion.toUpperCase()}
|
||||
conclusion={step.conclusion?.toUpperCase()}
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
@@ -142,8 +143,8 @@ const JobListItem = ({
|
||||
<AccordionDetails className={classes.accordionDetails}>
|
||||
<TableContainer>
|
||||
<Table>
|
||||
{job.steps.map((step: Step) => (
|
||||
<StepView step={step} />
|
||||
{job.steps.map(step => (
|
||||
<StepView key={step.number} step={step} />
|
||||
))}
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
@@ -15,5 +15,3 @@
|
||||
*/
|
||||
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
require('jest-fetch-mock').enableMocks();
|
||||
|
||||
Reference in New Issue
Block a user