Skip to content

Commit 94e69d3

Browse files
committed
much more style
1 parent f33bda4 commit 94e69d3

File tree

1 file changed

+23
-62
lines changed
  • src/pages/scientificServices/pipelines/tabs/history/details/components

1 file changed

+23
-62
lines changed

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

Lines changed: 23 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ interface JobBasicsProps {
1313

1414
const InfoItem = ({ label, value }: { label: string; value: React.ReactNode }) => (
1515
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem' }}>
16-
<div style={{ color: colors.dark(0.6), fontWeight: 500 }}>{label}</div>
17-
<div style={{ fontWeight: 600, color: colors.dark() }}>{value}</div>
16+
<div style={{ color: colors.dark(), fontWeight: 600 }}>{label}</div>
17+
<div style={{ fontWeight: 500, color: colors.dark(0.7) }}>{value}</div>
1818
</div>
1919
);
2020

@@ -54,28 +54,6 @@ export const JobBasics = ({ pipelineRunResult }: JobBasicsProps) => {
5454
}
5555
};
5656

57-
const calculateDuration = () => {
58-
if (!pipelineRunResult.jobReport.completed) {
59-
return 'In progress';
60-
}
61-
62-
const submitted = new Date(pipelineRunResult.jobReport.submitted);
63-
const completed = new Date(pipelineRunResult.jobReport.completed);
64-
const durationMs = completed.getTime() - submitted.getTime();
65-
66-
const hours = Math.floor(durationMs / (1000 * 60 * 60));
67-
const minutes = Math.floor((durationMs % (1000 * 60 * 60)) / (1000 * 60));
68-
const seconds = Math.floor((durationMs % (1000 * 60)) / 1000);
69-
70-
if (hours > 0) {
71-
return `${hours}h ${minutes}m`;
72-
}
73-
if (minutes > 0) {
74-
return `${minutes}m ${seconds}s`;
75-
}
76-
return `${seconds}s`;
77-
};
78-
7957
return isLoadingPipelineDetails ? (
8058
<Spinner />
8159
) : (
@@ -95,7 +73,27 @@ export const JobBasics = ({ pipelineRunResult }: JobBasicsProps) => {
9573
<div style={{ marginBottom: '1rem' }}>
9674
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
9775
<div style={{ flex: 1 }}>
98-
<h2>{pipelineDetails && <AoUStylizedString text={pipelineDetails.displayName} />}</h2>
76+
<h2>
77+
{pipelineDetails && (
78+
<div style={{ display: 'flex', alignItems: 'center' }}>
79+
<AoUStylizedString text={pipelineDetails.displayName} />
80+
<span
81+
style={{
82+
backgroundColor: 'white',
83+
// color: colors.dark(0.8),
84+
padding: '0.25rem 0.75rem',
85+
borderRadius: '20px',
86+
fontSize: 12,
87+
marginLeft: '0.5rem',
88+
fontWeight: 500,
89+
border: '1px solid #d7d9dc',
90+
}}
91+
>
92+
Version {pipelineRunResult.pipelineRunReport.pipelineVersion}
93+
</span>
94+
</div>
95+
)}
96+
</h2>
9997
{pipelineDetails && pipelineDetails.description && (
10098
<div style={{ margin: '1rem 0rem', color: colors.dark(0.8) }}>{pipelineDetails.description}</div>
10199
)}
@@ -132,25 +130,6 @@ export const JobBasics = ({ pipelineRunResult }: JobBasicsProps) => {
132130
// justifyContent: 'space-between',
133131
}}
134132
>
135-
{/* Pipeline Name */}
136-
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem', minWidth: '200px' }}>
137-
<div style={{ color: colors.dark(0.6), fontWeight: 500 }}>Pipeline</div>
138-
<div
139-
style={{
140-
width: 'fit-content',
141-
fontWeight: 600,
142-
backgroundColor: pipelineNameToColor(pipelineRunResult.pipelineRunReport.pipelineName),
143-
padding: '0.33rem',
144-
borderRadius: '4px',
145-
}}
146-
>
147-
{pipelineRunResult.pipelineRunReport.pipelineName}{' '}
148-
{pipelineRunResult.pipelineRunReport.pipelineVersion
149-
? `v${pipelineRunResult.pipelineRunReport.pipelineVersion}`
150-
: ''}
151-
</div>
152-
</div>
153-
154133
{/* Job ID */}
155134
<InfoItem
156135
label='Job ID'
@@ -164,24 +143,6 @@ export const JobBasics = ({ pipelineRunResult }: JobBasicsProps) => {
164143

165144
{/* Description */}
166145
<InfoItem label='Description' value={pipelineRunResult.jobReport.description || 'No description'} />
167-
168-
{/* /!* Status *!/ */}
169-
{/* <div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem' }}> */}
170-
{/* <div style={{ color: colors.dark(0.6), fontWeight: 500 }}>Status</div> */}
171-
{/* <div */}
172-
{/* style={{ */}
173-
{/* display: 'flex', */}
174-
{/* alignItems: 'center', */}
175-
{/* gap: '0.5rem', */}
176-
{/* textTransform: 'capitalize', */}
177-
{/* fontWeight: 600, */}
178-
{/* color: getStatusColor(pipelineRunResult.jobReport.status), */}
179-
{/* }} */}
180-
{/* > */}
181-
{/* {getStatusIcon(pipelineRunResult.jobReport.status)} */}
182-
{/* {pipelineRunResult.jobReport.status.toLowerCase()} */}
183-
{/* </div> */}
184-
{/* </div> */}
185146
</div>
186147
</div>
187148
);

0 commit comments

Comments
 (0)