Skip to content

Commit 69b6db4

Browse files
Merge branch 'dev' into QA-Fixes
2 parents c416921 + bd51da9 commit 69b6db4

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

src/ui/components/dag/index.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import React from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import { useService } from './useService';
33
import { LayoutFlow } from '../lineage';
44
import { FullWidthSpinner } from '../spinners';
5+
import { useSelector } from '../../hooks';
6+
import { sessionSelectors } from '../../../redux/selectors';
7+
import axios from 'axios';
58

69
const styles = {
710
container: { width: '100%', height: '100%' },
@@ -12,16 +15,38 @@ export const DAG: React.FC<{ runId: TId; fetching?: boolean }> = ({
1215
runId,
1316
fetching,
1417
}) => {
18+
const [metadata, setMetaData] = useState([] as any);
19+
20+
const authToken = useSelector(sessionSelectors.authenticationToken);
21+
1522
const { graph } = useService({ runId });
1623

24+
useEffect(() => {
25+
fetchMetaData();
26+
// eslint-disable-next-line react-hooks/exhaustive-deps
27+
}, [runId]);
28+
29+
const fetchMetaData = async () => {
30+
const response = await axios.get(
31+
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${runId}&key=orchestrator_url`,
32+
{
33+
headers: {
34+
Authorization: `bearer ${authToken}`,
35+
},
36+
},
37+
);
38+
39+
setMetaData(response?.data?.items); //Setting the response into state
40+
};
41+
1742
if (fetching) {
1843
return <FullWidthSpinner color="black" size="md" />;
1944
}
20-
45+
// console.log(metadata, 'metadatametadata');
2146
return (
2247
<div style={styles.container}>
2348
<div style={styles.dag}>
24-
<LayoutFlow runId={runId} graph={graph} />
49+
<LayoutFlow graph={graph} runId={runId} metadata={metadata} />
2550
</div>
2651
</div>
2752
);
Lines changed: 5 additions & 0 deletions
Loading

src/ui/components/icons/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { ReactComponent as Cached } from './assets/Cached.svg';
4444
import { ReactComponent as RightArrow } from './assets/RightArrow.svg';
4545
import { ReactComponent as Edit } from './assets/Edit.svg';
4646
import { ReactComponent as Search } from './assets/Search.svg';
47-
47+
import { ReactComponent as Logs } from './assets/Logs.svg';
4848
//icons for stackComponents
4949
// import { ReactComponent as PuzzlePiece } from './assets/PuzzlePiece.svg';
5050
import { ReactComponent as Folders } from './assets/Folders.svg';
@@ -172,7 +172,7 @@ const icons = {
172172
edit: createIcon({ Component: Edit }),
173173
search: createIcon({ Component: Search }),
174174
run: createIcon({ Component: Run, useStroke: true }),
175-
175+
logs: createIcon({ Component: Logs, useStroke: true }),
176176
//icons for stackComponents
177177
artifact_store: createIcon({ Component: Folders, useStroke: true }),
178178
alerter: createIcon({ Component: ChatDots, useStroke: true }),

src/ui/components/lineage/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const getLayoutedElements = (
110110

111111
const nodeTypes = { step: StepNode, artifact: ArtifactNode };
112112

113-
export const LayoutFlow: React.FC<any> = (graph: any, runId: any) => {
113+
export const LayoutFlow: React.FC<any> = (graph: any) => {
114114
const dispatch = useDispatch();
115115
const {
116116
initialNodes: layoutedNodes,
@@ -153,9 +153,19 @@ export const LayoutFlow: React.FC<any> = (graph: any, runId: any) => {
153153
>
154154
Refresh
155155
</button>
156-
156+
<button onClick={() => setLegend(!legend)}>Legend</button>
157+
<button
158+
onClick={() => {
159+
window.open(
160+
graph?.metadata[0]?.value
161+
? graph?.metadata[0]?.value
162+
: 'https://zenml.io/home',
163+
);
164+
}}
165+
>
166+
Orchestrator Logs
167+
</button>
157168
<div style={{ position: 'relative' }}>
158-
<button onClick={() => setLegend(!legend)}>Legend</button>
159169
<div className="legend" style={{ display: legend ? '' : 'none' }}>
160170
<span>
161171
<Analysis /> <span>Data Analysis Artifact</span>

0 commit comments

Comments
 (0)