fix(github-actions): fix crash when viewing ongoing workflows

This commit is contained in:
Fredrik Adelöw
2020-10-20 14:44:09 +02:00
parent 17e04965b0
commit 0cd1fd178a
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -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;
@@ -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>