Skip to content

Commit 9b281e7

Browse files
Merge pull request #188 from zenml-io/QA-Fixes
Qa fixes
2 parents 9582df7 + 9e3d0a0 commit 9b281e7

File tree

7 files changed

+94
-35
lines changed

7 files changed

+94
-35
lines changed

src/api/stackComponents/getStackComponentListApi.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const getMyStackComponentsApi = ({
1111
size,
1212
type,
1313
filtersParam,
14+
id,
1415
workspace,
1516
}: {
1617
workspace: string;
@@ -19,12 +20,13 @@ const getMyStackComponentsApi = ({
1920
logical_operator: string;
2021
type: string;
2122
filtersParam?: object;
23+
id?: any;
2224
page: number;
2325
size: number;
2426
}): Promise<TStack> =>
2527
fetchApiWithAuthRequest({
2628
url: apiUrl(endpoints.StackComponents.my(type, workspace)),
27-
params: { sort_by, logical_operator, page, size, ...filtersParam },
29+
params: { sort_by, logical_operator, page, size, ...filtersParam, id },
2830
method: httpMethods.get,
2931
authenticationToken,
3032
});

src/redux/actions/stackComponents/getStackComponentListAction.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const getStackComponentListAction = ({
99
page,
1010
size,
1111
filtersParam,
12+
id,
1213
onSuccess,
1314
onFailure,
1415
}: {
@@ -19,6 +20,7 @@ export const getStackComponentListAction = ({
1920
page: number;
2021
size: number;
2122
filtersParam?: object;
23+
id?: any;
2224
onSuccess?: (res: any) => void;
2325
onFailure?: (res: any) => void;
2426
}): TRequestAction => ({
@@ -36,6 +38,7 @@ export const getStackComponentListAction = ({
3638
page,
3739
size,
3840
filtersParam,
41+
id,
3942
},
4043
onSuccess,
4144
onFailure,

src/ui/layouts/stackComponents/Stacks/useService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const callActionForStackComponentsForPagination = () => {
7474
size: number,
7575
filters?: any[],
7676
sortby?: string,
77+
id?: any,
7778
) {
7879
const logicalOperator = localStorage.getItem('logical_operator');
7980

@@ -90,6 +91,7 @@ export const callActionForStackComponentsForPagination = () => {
9091
page: page,
9192
size: size,
9293
filtersParam,
94+
id: id,
9395
onSuccess: () => setFetching(false),
9496
onFailure: () => setFetching(false),
9597
}),

src/ui/layouts/stacks/CreateStack/ListForAll/GetList/index.tsx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const GetList: React.FC<Props> = ({
126126
<CustomStackBox
127127
image={item?.logoUrl}
128128
stackName={item.name}
129-
stackDesc={item?.flavor.name}
129+
stackDesc={item?.flavor}
130130
value={checkboxValue?.length > 0 ? true : false}
131131
onCheck={(e: any) => {
132132
e.stopPropagation();
@@ -149,7 +149,32 @@ export const GetList: React.FC<Props> = ({
149149
{showPopup && (
150150
<SidePopup
151151
isCreate={false}
152-
onSeeExisting={() => {}}
152+
onSeeExisting={() => {
153+
// debugger;
154+
dispatch(
155+
stackComponentsActions.getMy({
156+
workspace: selectedWorkspace
157+
? selectedWorkspace
158+
: locationPath.split('/')[2],
159+
type: selectedStackBox.type,
160+
161+
page: 1,
162+
size: 1,
163+
id: selectedStackBox.id,
164+
onSuccess: () => {
165+
setFetching(false);
166+
history.push(
167+
routePaths.stackComponents.configuration(
168+
selectedStackBox.type,
169+
selectedStackBox.id,
170+
selectedWorkspace,
171+
),
172+
);
173+
},
174+
onFailure: () => setFetching(false),
175+
}),
176+
);
177+
}}
153178
onClose={() => setShowPopup(false)}
154179
>
155180
<Box marginTop="md" paddingBottom={'xxxl'}>

src/ui/layouts/stacks/CreateStack/ListForAll/SidePopup/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const SidePopup: React.FC<{
4343
{children}
4444
</Box>
4545

46-
<Box
46+
<Box
4747
paddingVertical="lg"
4848
paddingHorizontal="md"
4949
className={styles.actionSection}
@@ -63,7 +63,6 @@ export const SidePopup: React.FC<{
6363
)}
6464
</FlexBox.Row>
6565
</Box>
66-
6766
</OutsideClickHandler>
6867
</Box>
6968
</FlexBox>

src/ui/layouts/stacks/CreateStack/ListForAll/index.tsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ import { useDispatch, useSelector } from 'react-redux';
1313
import { GetList } from './GetList';
1414
import { GetFlavorsListForLogo } from '../../../stackComponents/Stacks/List/GetFlavorsListForLogo';
1515
import { SidePopup } from './SidePopup';
16-
import { showToasterAction } from '../../../../../redux/actions';
16+
import {
17+
showToasterAction,
18+
stackComponentsActions,
19+
} from '../../../../../redux/actions';
1720
import axios from 'axios';
1821
import { toasterTypes } from '../../../../../constants';
19-
import { useHistory } from '../../../../hooks';
22+
import { useHistory, useLocation } from '../../../../hooks';
2023
import { routePaths } from '../../../../../routes/routePaths';
2124
import { NonEditableConfig } from '../../../NonEditableConfig';
2225
// import { callActionForStacksForPagination } from '../../Stacks/useService';
@@ -27,6 +30,7 @@ export const ListForAll: React.FC<Props> = () => {
2730
const stackComponentsTypes: any[] = useSelector(
2831
stackComponentSelectors.stackComponentTypes,
2932
);
33+
const locationPath = useLocation() as any;
3034
// const { dispatchStackData } = callActionForStacksForPagination();
3135
const history = useHistory();
3236
const dispatch = useDispatch();
@@ -231,7 +235,31 @@ export const ListForAll: React.FC<Props> = () => {
231235
registerStack={() => {
232236
onCreateStack();
233237
}}
234-
onSeeExisting={() => {}}
238+
onSeeExisting={() => {
239+
dispatch(
240+
stackComponentsActions.getMy({
241+
workspace: selectedWorkspace
242+
? selectedWorkspace
243+
: locationPath.split('/')[2],
244+
type: selectedStackBox.type,
245+
246+
page: 1,
247+
size: 1,
248+
id: selectedStackBox.id,
249+
onSuccess: () => {
250+
// setFetching(false);
251+
history.push(
252+
routePaths.stackComponents.configuration(
253+
selectedStackBox.type,
254+
selectedStackBox.id,
255+
selectedWorkspace,
256+
),
257+
);
258+
},
259+
onFailure: () => {},
260+
}),
261+
);
262+
}}
235263
onClose={() => {
236264
setShowPopup(false);
237265
setSelectedStackBox(null);

src/ui/layouts/stacks/StackDetail/Configuration/index.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import React, { useState } from 'react';
22

3-
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
4-
import { okaidia } from 'react-syntax-highlighter/dist/esm/styles/prism';
3+
// import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
4+
// import { okaidia } from 'react-syntax-highlighter/dist/esm/styles/prism';
55
import {
66
FlexBox,
77
Box,
8-
H4,
9-
GhostButton,
10-
icons,
8+
// H4,
9+
// GhostButton,
10+
// icons,
1111
Row,
1212
FullWidthSpinner,
1313
// Container,
1414
EditField,
1515
Paragraph,
1616
} from '../../../../components';
17-
import { iconColors, iconSizes } from '../../../../../constants';
17+
// import { iconColors, iconSizes } from '../../../../../constants';
1818

19-
import { useDispatch } from '../../../../hooks';
20-
import { showToasterAction } from '../../../../../redux/actions';
21-
import { toasterTypes } from '../../../../../constants';
19+
// import { useDispatch } from '../../../../hooks';
20+
// import { showToasterAction } from '../../../../../redux/actions';
21+
// import { toasterTypes } from '../../../../../constants';
2222

23-
import { translate } from '../translate';
23+
// import { translate } from '../translate';
2424

2525
import styles from './index.module.scss';
2626
import { useService } from './useService';
@@ -34,27 +34,27 @@ export const Configuration: React.FC<{
3434
tiles?: any;
3535
fetching?: boolean;
3636
}> = ({ stackId, tiles, fetching = false }) => {
37-
const dispatch = useDispatch();
38-
const { downloadYamlFile, stackConfig, stack } = useService({ stackId });
39-
const [hover, setHover] = useState(false);
37+
// const dispatch = useDispatch();
38+
const { stack } = useService({ stackId });
39+
// const [hover, setHover] = useState(false);
4040
const [showPopup, setShowPopup] = useState<boolean>(false);
4141
const [selectedStackBox, setSelectedStackBox] = useState<any>();
42-
const handleCopy = () => {
43-
navigator.clipboard.writeText(stackConfig);
44-
dispatch(
45-
showToasterAction({
46-
description: 'Config copied to clipboard',
47-
type: toasterTypes.success,
48-
}),
49-
);
50-
};
42+
// const handleCopy = () => {
43+
// navigator.clipboard.writeText(stackConfig);
44+
// dispatch(
45+
// showToasterAction({
46+
// description: 'Config copied to clipboard',
47+
// type: toasterTypes.success,
48+
// }),
49+
// );
50+
// };
5151
if (fetching) {
5252
return <FullWidthSpinner color="black" size="md" />;
5353
}
5454

5555
return (
5656
<FlexBox.Column fullWidth>
57-
<FlexBox
57+
{/* <FlexBox
5858
marginBottom="md"
5959
alignItems="center"
6060
justifyContent="space-between"
@@ -82,8 +82,8 @@ export const Configuration: React.FC<{
8282
/>
8383
</GhostButton>
8484
</Box>
85-
</FlexBox>
86-
<FlexBox.Row marginLeft="md">
85+
</FlexBox> */}
86+
<FlexBox.Row marginLeft="md" marginTop="lg">
8787
{/* <Container> */}
8888
<Box style={{ width: '30%' }}>
8989
<EditField
@@ -134,7 +134,7 @@ export const Configuration: React.FC<{
134134
))}
135135
</Row>
136136
</Box>
137-
<FlexBox className={styles.code}>
137+
{/* <FlexBox className={styles.code}>
138138
<SyntaxHighlighter
139139
customStyle={{ width: '100%' }}
140140
wrapLines={true}
@@ -143,7 +143,7 @@ export const Configuration: React.FC<{
143143
>
144144
{stackConfig}
145145
</SyntaxHighlighter>
146-
</FlexBox>
146+
</FlexBox> */}
147147

148148
{showPopup && (
149149
<SidePopup

0 commit comments

Comments
 (0)