Skip to content

Commit 9b0f0c8

Browse files
Merge pull request #531 from zenml-io/UAT
2 parents abb8227 + 3ea6a2f commit 9b0f0c8

File tree

8 files changed

+446
-313
lines changed

8 files changed

+446
-313
lines changed

appserverSchema.d.ts

Lines changed: 392 additions & 196 deletions
Large diffs are not rendered by default.

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

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,25 @@ import { workspaceSelectors } from '../../../../redux/selectors';
77
import { Link } from 'react-router-dom';
88
import { routePaths } from '../../../../routes/routePaths';
99
import { Run } from '../../../../api/types';
10+
import { Box } from '../../boxes';
11+
import { icons } from '../../icons';
12+
import { iconColors, iconSizes } from '../../../../constants';
1013

1114
interface CodeCardProps {
1215
run: Run;
1316
}
1417

18+
const innerBoxStyleDisable = {
19+
// height: '30px',
20+
border: '2px solid #f0ebfc',
21+
borderRadius: '5px',
22+
display: 'inline-flex',
23+
paddingLeft: '8px',
24+
paddingRight: '8px',
25+
justifyContent: 'center',
26+
alignItems: 'center',
27+
};
28+
1529
const CodeCard = ({ run }: CodeCardProps) => {
1630
const selectedWorkspace = useSelector(workspaceSelectors.selectedWorkspace);
1731
return (
@@ -20,17 +34,43 @@ const CodeCard = ({ run }: CodeCardProps) => {
2034
<Paragraph className={styles.card__key}>Code Repository</Paragraph>
2135
<Paragraph className={styles.card__value}>
2236
{/* @ts-ignore */}
23-
{run.deployment?.code_reference?.code_repository?.id ? (
24-
<Link
25-
to={routePaths.repositories.overview(
26-
selectedWorkspace,
27-
// @ts-ignore
28-
run.deployment?.code_reference?.code_repository?.id,
37+
{run.body?.code_reference?.body?.code_repository?.id ? (
38+
<>
39+
{run.body?.code_reference?.permission_denied ||
40+
run.body?.code_reference?.body?.code_repository
41+
.permission_denied ? (
42+
<div>
43+
<Box style={innerBoxStyleDisable}>
44+
<icons.lock2
45+
style={{ paddingRight: '5px' }}
46+
color={iconColors.grey}
47+
size={iconSizes.sml}
48+
/>
49+
<Paragraph
50+
size="small"
51+
style={{
52+
color: '#666c78',
53+
}}
54+
>
55+
{run.body?.code_reference?.body?.code_repository?.name &&
56+
`${run.body?.code_reference?.body.code_repository?.name}`}
57+
{/* `${run?.body?.pipeline?.name} ( v${run?.pipeline?.version} )`} */}
58+
</Paragraph>
59+
</Box>
60+
</div>
61+
) : (
62+
<Link
63+
to={routePaths.repositories.overview(
64+
selectedWorkspace,
65+
// @ts-ignore
66+
run.body?.code_reference?.body?.code_repository?.id,
67+
)}
68+
>
69+
{/* @ts-ignore */}
70+
{run.body?.code_reference?.body?.code_repository?.name}
71+
</Link>
2972
)}
30-
>
31-
{/* @ts-ignore */}
32-
{run.deployment?.code_reference?.code_repository?.id}
33-
</Link>
73+
</>
3474
) : (
3575
'n/a'
3676
)}

src/ui/hooks/usePollingService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const usePollingService = ({
1818
sortBy,
1919
isExpended,
2020
dispatchFun,
21+
type,
2122
paginatedValue,
2223
}: {
2324
pipelineId?: TId;
@@ -26,7 +27,7 @@ export const usePollingService = ({
2627
isExpended?: any;
2728
sortBy: string;
2829
dispatchFun: Function;
29-
30+
type?: string;
3031
paginatedValue: any;
3132
filter: {
3233
column: filterValue;
@@ -40,7 +41,6 @@ export const usePollingService = ({
4041

4142
const isValidFilter = filter?.map((f) => f.value).join('');
4243
const [pending, setPending] = useState(false);
43-
console.log(stackComponentId, 'dispatchFun');
4444
useEffect(() => {
4545
if (!isValidFilter && !isExpended && !pending) {
4646
const intervalId = setInterval(() => {
@@ -52,6 +52,7 @@ export const usePollingService = ({
5252
stackId: stackId,
5353
component_id: stackComponentId,
5454
sort_by: sortBy,
55+
type,
5556
logical_operator: 'and',
5657
workspace: selectedWorkspace,
5758
page: paginatedValue.page,

src/ui/layouts/pipelines/RunDetail/useService.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,6 @@ export const useService = (): ServiceInterface => {
5151
// eslint-disable-next-line react-hooks/exhaustive-deps
5252
}, [isMounted, setIsMounted]);
5353

54-
useEffect(() => {
55-
if (run.body?.status === 'running') {
56-
const intervalId = setInterval(() => {
57-
dispatch(
58-
runsActions.runForId({
59-
pipelineId: pipelineId,
60-
runId: id,
61-
onSuccess: (res) => {
62-
if (res.status !== 'running') {
63-
dispatch(
64-
runsActions.graphForRun({
65-
runId: id,
66-
}),
67-
);
68-
}
69-
},
70-
}),
71-
);
72-
}, 12000);
73-
74-
return () => {
75-
clearInterval(intervalId);
76-
};
77-
}
78-
// This is important
79-
}, [pipelineId, id, run, dispatch]);
80-
8154
const fetchMetaData = async () => {
8255
const response = await axios.get(
8356
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${id}&key=orchestrator_url`,

src/ui/layouts/repositories/RunDetail/useService.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,6 @@ export const useService = (): ServiceInterface => {
5151
// eslint-disable-next-line react-hooks/exhaustive-deps
5252
}, [isMounted, setIsMounted]);
5353

54-
useEffect(() => {
55-
if (run.body?.status === 'running') {
56-
const intervalId = setInterval(() => {
57-
dispatch(
58-
runsActions.runForId({
59-
repositoryID: repositoryID,
60-
runId: id,
61-
onSuccess: (res) => {
62-
if (res.status !== 'running') {
63-
dispatch(
64-
runsActions.graphForRun({
65-
runId: id,
66-
}),
67-
);
68-
}
69-
},
70-
}),
71-
);
72-
}, 12000);
73-
74-
return () => {
75-
clearInterval(intervalId);
76-
};
77-
}
78-
// This is important
79-
}, [repositoryID, id, run, dispatch]);
80-
8154
const fetchMetaData = async () => {
8255
const response = await axios.get(
8356
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${id}&key=orchestrator_url`,

src/ui/layouts/runs/RunDetail/useService.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,6 @@ export const useService = (): ServiceInterface => {
6161
}
6262
// eslint-disable-next-line react-hooks/exhaustive-deps
6363
}, [isMounted, setIsMounted]);
64-
useEffect(() => {
65-
if (run.body?.status === 'running') {
66-
const intervalId = setInterval(() => {
67-
dispatch(
68-
runsActions.runForId({
69-
runId: runId,
70-
onSuccess: (res) => {
71-
if (res.status !== 'running') {
72-
dispatch(
73-
runsActions.graphForRun({
74-
runId: runId,
75-
}),
76-
);
77-
}
78-
},
79-
}),
80-
);
81-
}, 5000);
82-
83-
return () => {
84-
clearInterval(intervalId);
85-
};
86-
}
87-
// This is important
88-
}, [runId, run, dispatch]);
8964

9065
const fetchMetaData = async () => {
9166
const response = await axios.get(

src/ui/layouts/stackComponents/Stacks/List/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const List: React.FC<Props> = ({
6969
usePollingService({
7070
filter,
7171
sortBy: activeSortingDirection?.toLowerCase() + ':' + activeSorting,
72+
type: componentId,
7273
dispatchFun: stackComponentsActions.getMy,
7374
paginatedValue: stackComponentsPaginated,
7475
});

src/ui/layouts/stacks/RunDetail/useService.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,6 @@ export const useService = (): ServiceInterface => {
5151
// eslint-disable-next-line react-hooks/exhaustive-deps
5252
}, [isMounted, setIsMounted]);
5353

54-
useEffect(() => {
55-
if (run.body?.status === 'running') {
56-
const intervalId = setInterval(() => {
57-
dispatch(
58-
runsActions.runForId({
59-
stackId: stackId,
60-
runId: id,
61-
onSuccess: (res) => {
62-
if (res.status !== 'running') {
63-
dispatch(
64-
runsActions.graphForRun({
65-
runId: id,
66-
}),
67-
);
68-
}
69-
},
70-
}),
71-
);
72-
}, 5000);
73-
74-
return () => {
75-
clearInterval(intervalId);
76-
};
77-
}
78-
// This is important
79-
}, [stackId, id, run, dispatch]);
8054
const fetchMetaData = async () => {
8155
const response = await axios.get(
8256
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${id}&key=orchestrator_url`,

0 commit comments

Comments
 (0)