Skip to content

Commit

Permalink
fix pipeline runs types
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Nov 25, 2024
1 parent 838f2f4 commit c9c59de
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/components/page-step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ export function PageStep({ appName, jobName, stepName }: PageStepProps) {
<div className="grid grid--gap-medium grid--overview-columns">
<div className="grid grid--gap-medium">
<Typography>
Pipeline Step <strong>
{step.status.toLowerCase()}
Pipeline Step{' '}
<strong>
{step.status?.toLowerCase() ?? 'pending'}
</strong>{' '}
</Typography>
<Typography>
Expand Down Expand Up @@ -119,7 +120,7 @@ export function PageStep({ appName, jobName, stepName }: PageStepProps) {
</section>

{stepName === 'run-pipelines' &&
(pipelineRuns?.length > 0 ? (
(pipelineRuns && pipelineRuns.length > 0 ? (
<section>
<Typography
variant="h4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function PipelineTaskStepsTableRow({
)}
</Table.Cell>
<Table.Cell variant="icon">
<PipelineRunStatusBadge status={status} />
<PipelineRunStatusBadge status={status ?? 'PipelineRunPending'} />
</Table.Cell>
</Table.Row>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function PipelineTaskTableRow({
)}
</Table.Cell>
<Table.Cell variant="icon">
<PipelineRunStatusBadge status={task.status} />
<PipelineRunStatusBadge status={task.status ?? 'PipelineRunPending'} />
</Table.Cell>
</Table.Row>
);
Expand Down
5 changes: 4 additions & 1 deletion src/components/pipeline-run/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export function PipelineRun({ pipelineRun }: Props) {
<div className="grid grid--gap-medium grid--overview-columns">
<div className="grid grid--gap-medium">
<Typography>
Pipeline run <strong>{pipelineRun.status.toLowerCase()}</strong>
Pipeline run{' '}
<strong>
{pipelineRun.status?.toLowerCase() ?? 'pending'}
</strong>
</Typography>
<Typography>
{getPipelineRunExecutionState(pipelineRun.status)} pipeline{' '}
Expand Down
4 changes: 3 additions & 1 deletion src/components/pipeline-runs/pipeline-run-table-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export function PipelineRunTableRow({ appName, jobName, pipelineRun }: Props) {
)}
</Table.Cell>
<Table.Cell variant="icon">
<PipelineRunStatusBadge status={pipelineRun.status} />
<PipelineRunStatusBadge
status={pipelineRun.status ?? 'PipelineRunPending'}
/>
</Table.Cell>
</Table.Row>
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/replica-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export const ReplicaList: FunctionComponent<{
/>
</Table.Cell>
<Table.Cell>
<ReplicaStatusBadge status={replica.replicaStatus?.status} />
<ReplicaStatusBadge
status={replica.replicaStatus?.status ?? 'Pending'}
/>
</Table.Cell>
<Table.Cell>
<RelativeToNow time={replica.created} />
Expand Down
4 changes: 3 additions & 1 deletion src/components/replica/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ const Overview = ({
)}
<ReplicaImage replica={replica} />
{status || (
<ReplicaStatusBadge status={replica.replicaStatus?.status} />
<ReplicaStatusBadge
status={replica.replicaStatus?.status ?? 'Pending'}
/>
)}
</div>
<div className="grid grid--gap-medium">
Expand Down
2 changes: 1 addition & 1 deletion src/utils/pipeline/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function getPipelineStepDescription(stepName: string): string | null {
}
}

export function getPipelineStepTitle(stepName: string): string | null {
export function getPipelineStepTitle(stepName?: string): string | null {
switch (stepName) {
case PipelineStep.CloneConfig:
return 'Cloning Radix config';
Expand Down

0 comments on commit c9c59de

Please sign in to comment.