Skip to content

Commit 3f0476d

Browse files
Merge pull request #542 from zenml-io/UAT
Uat
2 parents 700944d + 409df07 commit 3f0476d

File tree

4 files changed

+74
-31
lines changed

4 files changed

+74
-31
lines changed

src/api/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export type Run = components['schemas']['PipelineRunResponse'];
2626
// //Repository
2727
export type Repository = components['schemas']['CodeRepositoryResponse'];
2828

29+
// PipelineBuild
30+
export type PipelineBuild = components['schemas']['PipelineBuildResponse'];
31+
2932
// ServerInfo
3033

3134
export type ServerInfo = components['schemas']['ServerModel'];

src/ui/components/lineage/sidebarTabsSwitchers/stepTabSwitcher.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,11 @@ const StepnodeTabHeader: React.FC<any> = ({ node, fetching }) => {
412412
</div>
413413
)}
414414
{node.metadata?.run_metadata !== null &&
415-
Object.entries(node.metadata.run_metadata).map(
415+
Object.values(node.metadata.run_metadata).map(
416416
(e: any, index: number) => (
417417
<tr key={index}>
418-
<td className="td_key">{e[1]?.key}</td>
419-
<td className="td_value">{e[1]?.value}</td>
418+
<td className="td_key">{e?.body?.key}</td>
419+
<td className="td_value">{e?.body?.value}</td>
420420
</tr>
421421
),
422422
)}

src/ui/components/runDetailCards/Cards/OrchestratorCard.tsx

Lines changed: 67 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,95 @@
1-
import React from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import DetailCard from '../DetailCard';
33
import styles from '../index.module.scss';
44
import { Paragraph } from '../../typographies';
5-
import { Run } from '../../../../api/types';
5+
import { PipelineBuild, Run } from '../../../../api/types';
6+
import axios from 'axios';
7+
import { useSelector } from 'react-redux';
8+
import { sessionSelectors } from '../../../../redux/selectors';
69

710
interface OrchestratorCardProps {
811
run: Run;
912
}
1013

1114
const OrchestratorCard = ({ run }: OrchestratorCardProps) => {
15+
const authToken = useSelector(sessionSelectors.authenticationToken);
16+
const [pipelineBuild, setPipelineBuild] = useState<PipelineBuild | null>(
17+
null,
18+
);
19+
async function fetchPipelineBuild(id: string) {
20+
try {
21+
const response = await axios.get(
22+
`${process.env.REACT_APP_BASE_API_URL}/pipeline_builds/${id}`,
23+
{
24+
headers: {
25+
Authorization: `bearer ${authToken}`,
26+
},
27+
},
28+
);
29+
setPipelineBuild(response.data);
30+
} catch (e) {
31+
console.log(e);
32+
}
33+
}
34+
35+
useEffect(() => {
36+
if (run.body?.build?.id) {
37+
fetchPipelineBuild(run.body?.build.id);
38+
}
39+
// eslint-disable-next-line react-hooks/exhaustive-deps
40+
}, []);
41+
1242
return (
1343
<DetailCard isInitiallyOpen={true} heading="Orchestrator">
1444
<div>
1545
<Paragraph className={styles.card__key}>Orchestrator Run ID</Paragraph>
1646
<Paragraph className={styles.card__value}>
17-
{/* @ts-ignore */}
1847
{run.metadata?.orchestrator_run_id}
1948
</Paragraph>
2049
</div>
2150
<div>
2251
<Paragraph className={styles.card__key}>URL</Paragraph>
2352
<Paragraph className={styles.card__value}>
24-
{/* @ts-ignore */}
25-
{run.metadata?.orchestrator_url?.value ? (
53+
{(run.metadata?.run_metadata?.orchestrator_url as {
54+
[key: string]: any;
55+
})?.body?.value ? (
2656
<a
2757
rel="noopener noreferrer"
28-
// @ts-ignore
29-
href={run.metadata?.orchestrator_url?.value}
58+
href={
59+
(run.metadata?.run_metadata?.orchestrator_url as {
60+
[key: string]: any;
61+
})?.body?.value
62+
}
3063
target="_blank"
3164
>
32-
{/* @ts-ignore */}
33-
{run.metadata?.orchestrator_url?.value}
65+
{
66+
(run.metadata?.run_metadata?.orchestrator_url as {
67+
[key: string]: any;
68+
})?.body?.value
69+
}
3470
</a>
3571
) : (
3672
'n/a'
3773
)}
3874
</Paragraph>
3975
</div>
40-
{/* @ts-ignore */}
41-
{run.build?.images?.orchestrator && (
76+
77+
{pipelineBuild?.metadata?.images?.orchestrator && (
4278
<>
4379
<div>
4480
<Paragraph className={styles.card__key}>Image</Paragraph>
4581
<Paragraph className={styles.card__value}>
46-
{/* @ts-ignore */}
47-
{run.build?.images?.orchestrator?.image}
82+
{
83+
(pipelineBuild.metadata?.images?.orchestrator as {
84+
[key: string]: any;
85+
})?.image
86+
}
4887
</Paragraph>
4988
</div>
50-
{/* @ts-ignore */}
51-
{run.build?.images?.orchestrator?.dockerfile ? (
89+
90+
{(pipelineBuild.metadata?.images?.orchestrator as {
91+
[key: string]: any;
92+
})?.dockerfile ? (
5293
<div>
5394
<details>
5495
<summary className={styles.card__summary}>
@@ -60,13 +101,13 @@ const OrchestratorCard = ({ run }: OrchestratorCardProps) => {
60101
</Paragraph>
61102
</summary>
62103
<div className={styles.card__detailsContainer}>
63-
{/* @ts-ignore */}
64104
<Paragraph
65105
style={{ whiteSpace: 'pre-wrap' }}
66106
className={styles.card__value}
67107
>
68-
{/* @ts-ignore */}
69-
{run.build?.images?.orchestrator?.dockerfile || 'n/a'}
108+
{(pipelineBuild.metadata?.images?.orchestrator as {
109+
[key: string]: any;
110+
})?.dockerfile || 'n/a'}
70111
</Paragraph>
71112
</div>
72113
</details>
@@ -82,8 +123,9 @@ const OrchestratorCard = ({ run }: OrchestratorCardProps) => {
82123
</Paragraph>
83124
</div>
84125
)}
85-
{/* @ts-ignore */}
86-
{run.build?.images?.orchestrator?.requirements ? (
126+
{(pipelineBuild.metadata?.images?.orchestrator as {
127+
[key: string]: any;
128+
})?.requirements ? (
87129
<div>
88130
<details>
89131
<summary className={styles.card__summary}>
@@ -95,13 +137,13 @@ const OrchestratorCard = ({ run }: OrchestratorCardProps) => {
95137
</Paragraph>
96138
</summary>
97139
<div className={styles.card__detailsContainer}>
98-
{/* @ts-ignore */}
99140
<Paragraph
100141
style={{ whiteSpace: 'pre-wrap' }}
101142
className={styles.card__value}
102143
>
103-
{/* @ts-ignore */}
104-
{run.build?.images?.orchestrator?.requirements || 'n/a'}
144+
{(pipelineBuild.metadata?.images?.orchestrator as {
145+
[key: string]: any;
146+
})?.requirements || 'n/a'}
105147
</Paragraph>
106148
</div>
107149
</details>
@@ -120,15 +162,13 @@ const OrchestratorCard = ({ run }: OrchestratorCardProps) => {
120162
<div>
121163
<Paragraph className={styles.card__key}>ZenML Version</Paragraph>
122164
<Paragraph className={styles.card__value}>
123-
{/* @ts-ignore */}
124-
{run.build?.zenml_version || 'n/a'}
165+
{pipelineBuild.metadata?.zenml_version || 'n/a'}
125166
</Paragraph>
126167
</div>
127168
<div>
128169
<Paragraph className={styles.card__key}>Python Version</Paragraph>
129170
<Paragraph className={styles.card__value}>
130-
{/* @ts-ignore */}
131-
{run.build?.python_version || 'n/a'}
171+
{pipelineBuild.metadata?.python_version || 'n/a'}
132172
</Paragraph>
133173
</div>
134174
</>

src/ui/layouts/settings/Organization/UserBox/UserBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const UserBox = ({ data, permission, setShowPasswordUpdate, setUser }: any) => {
4444
justifyContent="center"
4545
marginTop="lg"
4646
>
47-
<Box>
47+
<Box style={{ width: '100%' }}>
4848
<Box className={styles.imageContainer}>
4949
<FlexBox
5050
justifyContent="center"

0 commit comments

Comments
 (0)