@@ -3,14 +3,13 @@ import React, { useEffect, useState } from 'react';
33import FooterWrapper from 'src/components/FooterWrapper' ;
44import { Teaspoons } from 'src/libs/ajax/teaspoons/Teaspoons' ;
55import { PipelineRunResponse } from 'src/libs/ajax/teaspoons/teaspoons-models' ;
6- import colors from 'src/libs/colors' ;
76import * as Nav from 'src/libs/nav' ;
7+ import { notify } from 'src/libs/notifications' ;
88import { useCancellation } from 'src/libs/react-utils' ;
99import { 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
1514export 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 >
0 commit comments