Skip to content

Commit e6edbc0

Browse files
committed
cleanup post-refinement
1 parent fb883d3 commit e6edbc0

File tree

8 files changed

+234
-322
lines changed

8 files changed

+234
-322
lines changed

src/libs/ajax/teaspoons/teaspoons-models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export interface PipelineRunReport {
124124
pipelineVersion: number;
125125
toolVersion: string;
126126
outputs?: Record<string, string>;
127+
inputs?: Record<string, string>;
127128
outputExpirationDate?: string;
128129
}
129130

src/pages/scientificServices/pipelines/tabs/history/JobHistory.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,14 @@ const getColumns = (paginatedRuns: PipelineRun[], sort: SortProperties, onSort:
268268
},
269269
size: { basis: 40 },
270270
},
271-
// {
272-
// field: 'resultURL',
273-
// headerRenderer: () => <HeaderCell>Actions</HeaderCell>,
274-
// cellRenderer: ({ rowIndex }) => {
275-
// return <ActionCell pipelineRun={paginatedRuns[rowIndex]} />;
276-
// },
277-
// size: { basis: 40 },
278-
// },
271+
{
272+
field: 'resultURL',
273+
headerRenderer: () => <HeaderCell>Actions</HeaderCell>,
274+
cellRenderer: ({ rowIndex }) => {
275+
return <ActionCell pipelineRun={paginatedRuns[rowIndex]} />;
276+
},
277+
size: { basis: 40 },
278+
},
279279
];
280280
};
281281

@@ -319,7 +319,7 @@ const JobIdCell = ({ pipelineRun }: CellProps): ReactNode => {
319319
style={{
320320
width: 'fit-content',
321321
fontWeight: 600,
322-
backgroundColor: pipelineNameToColor(pipelineRun.pipelineName),
322+
backgroundColor: pipelineNameToColor(pipelineRun),
323323
padding: '0.33rem',
324324
borderRadius: '4px',
325325
fontSize: '10px',
@@ -562,8 +562,8 @@ const getRunStatusIcon = (pipelineRun: PipelineRun): ReactNode => {
562562
}
563563
};
564564

565-
export const pipelineNameToColor = (pipelineName: string): string => {
566-
switch (pipelineName) {
565+
export const pipelineNameToColor = (pipelineRun: PipelineRun): string => {
566+
switch (pipelineRun.pipelineName) {
567567
case 'array_imputation':
568568
return '#4D72AA4D';
569569
default:

src/pages/scientificServices/pipelines/tabs/history/details/JobDetails.tsx

Lines changed: 29 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import React, { useEffect, useState } from 'react';
33
import FooterWrapper from 'src/components/FooterWrapper';
44
import { Teaspoons } from 'src/libs/ajax/teaspoons/Teaspoons';
55
import { PipelineRunResponse } from 'src/libs/ajax/teaspoons/teaspoons-models';
6-
import colors from 'src/libs/colors';
76
import * as Nav from 'src/libs/nav';
7+
import { notify } from 'src/libs/notifications';
88
import { useCancellation } from 'src/libs/react-utils';
99
import { pipelinesTopBar } from 'src/pages/scientificServices/pipelines/common/scientific-services-common';
10-
import { JobBasics } from 'src/pages/scientificServices/pipelines/tabs/history/details/components/JobBasics';
11-
import { JobInputsOutputs } from 'src/pages/scientificServices/pipelines/tabs/history/details/components/JobInputsOutputs';
12-
import { JobMetrics } from 'src/pages/scientificServices/pipelines/tabs/history/details/components/JobMetrics';
13-
import { JobTimeline } from 'src/pages/scientificServices/pipelines/tabs/history/details/components/JobTimeline';
10+
import { JobDetailsHeader } from 'src/pages/scientificServices/pipelines/tabs/history/details/sections/JobDetailsHeader';
11+
import { JobInputsOutputs } from 'src/pages/scientificServices/pipelines/tabs/history/details/sections/JobInputsOutputs';
12+
import { JobTimeline } from 'src/pages/scientificServices/pipelines/tabs/history/details/sections/JobTimeline';
1413

1514
export interface JobDetailsProps {
1615
jobId: string;
@@ -29,31 +28,32 @@ export const JobDetails = ({ jobId }: JobDetailsProps) => {
2928
try {
3029
const response = await Teaspoons(signal).getPipelineRunResult(jobId);
3130

32-
// Add mock outputs to the response for testing
33-
const mockResponse: PipelineRunResponse = {
34-
...response,
35-
pipelineRunReport: {
36-
...response.pipelineRunReport,
37-
inputs: {
38-
'Output Basename': 'test',
39-
'Minimum Imputation Quality': '0.3',
40-
'Multi-Sample VCF': 'NA12878_50_duplicate_renamed.clean.vcf.gz',
41-
},
42-
outputs: {
43-
'Imputed Multi-Sample VCF': 'gs://fc-secure-bucket/imputation-results/chr1-22.dose.vcf.gz',
44-
'Imputed Multi-Sample VCF Index': 'gs://fc-secure-bucket/imputation-results/chr1-22.info',
45-
'Contigs Metrics TSV': 'gs://fc-secure-bucket/imputation-results/qc-report.html',
46-
'Imputation Chunks QC TSV': 'gs://fc-secure-bucket/imputation-results/summary-statistics.tsv',
47-
},
48-
outputExpirationDate: '2025-12-28T10:20:01Z',
49-
},
50-
};
31+
// // Add mock outputs to the response for testing
32+
// const mockResponse: PipelineRunResponse = {
33+
// ...response,
34+
// pipelineRunReport: {
35+
// ...response.pipelineRunReport,
36+
// inputs: {
37+
// 'Output Basename': 'test',
38+
// 'Minimum Imputation Quality': '0.3',
39+
// 'Multi-Sample VCF': 'NA12878_50_duplicate_renamed.clean.vcf.gz',
40+
// },
41+
// outputs: {
42+
// 'Imputed Multi-Sample VCF': 'gs://fc-secure-bucket/imputation-results/chr1-22.dose.vcf.gz',
43+
// 'Imputed Multi-Sample VCF Index': 'gs://fc-secure-bucket/imputation-results/chr1-22.info',
44+
// 'Contigs Metrics TSV': 'gs://fc-secure-bucket/imputation-results/qc-report.html',
45+
// 'Imputation Chunks QC TSV': 'gs://fc-secure-bucket/imputation-results/summary-statistics.tsv',
46+
// },
47+
// outputExpirationDate: '2025-12-28T10:20:01Z',
48+
// },
49+
// };
5150

52-
setPipelineRunResult(mockResponse);
51+
setPipelineRunResult(response);
5352
} catch (err) {
54-
setError('Failed to load job details. Please try again later.');
55-
// eslint-disable-next-line no-console
56-
console.error('Error fetching job details:', err);
53+
setError('Failed to load job details.');
54+
notify('error', 'Error', {
55+
detail: `Failed to load job details: ${err instanceof Error ? err.message : String(err)}`,
56+
});
5757
} finally {
5858
setIsLoading(false);
5959
}
@@ -88,38 +88,19 @@ export const JobDetails = ({ jobId }: JobDetailsProps) => {
8888
</div>
8989
)}
9090

91-
{error && (
92-
<div
93-
style={{
94-
padding: '1rem',
95-
backgroundColor: colors.danger(0.1),
96-
border: `1px solid ${colors.danger()}`,
97-
borderRadius: '4px',
98-
color: colors.danger(),
99-
}}
100-
>
101-
{error}
102-
</div>
103-
)}
104-
10591
{!isLoading && !error && pipelineRunResult && (
10692
<div>
10793
{/* Job Summary Widget */}
108-
<JobBasics pipelineRunResult={pipelineRunResult} />
94+
<JobDetailsHeader pipelineRunResult={pipelineRunResult} />
10995

11096
{/* Timeline and Inputs/Outputs Section */}
11197
<div style={{ display: 'flex', gap: '1.5rem', marginBottom: '1.5rem' }}>
112-
{/* Timeline - 1/3 width */}
11398
<div style={{ flex: '0 0 calc(33.333% - 1rem)' }}>
11499
<JobTimeline pipelineRunResult={pipelineRunResult} />
115100
</div>
116101

117-
{/* Inputs & Outputs - 2/3 width */}
118102
<div style={{ flex: '0 0 calc(66.667% - 0.5rem)' }}>
119103
<JobInputsOutputs pipelineRunResult={pipelineRunResult} />
120-
{pipelineRunResult.jobReport.status === 'SUCCEEDED' && (
121-
<JobMetrics pipelineRunResult={pipelineRunResult} />
122-
)}
123104
</div>
124105
</div>
125106
</div>

src/pages/scientificServices/pipelines/tabs/history/details/components/JobInputsOutputs.tsx

Lines changed: 0 additions & 170 deletions
This file was deleted.

0 commit comments

Comments
 (0)