Skip to content

Commit 948466e

Browse files
Merge pull request #207 from zenml-io/QA-Fixes
Qa fixes
2 parents 283f10c + 6adb1b0 commit 948466e

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed
Lines changed: 5 additions & 0 deletions
Loading

src/ui/components/icons/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { ReactComponent as Search } from './assets/Search.svg';
4747
import { ReactComponent as Logs } from './assets/Logs.svg';
4848
import { ReactComponent as PlusCircle } from './assets/PlusCircle.svg';
4949
import { ReactComponent as MinusCircle } from './assets/MinusCircle.svg';
50+
import { ReactComponent as Config } from './assets/Config.svg';
5051
//icons for stackComponents
5152
// import { ReactComponent as PuzzlePiece } from './assets/PuzzlePiece.svg';
5253
import { ReactComponent as Folders } from './assets/Folders.svg';
@@ -176,7 +177,7 @@ const icons = {
176177
search: createIcon({ Component: Search }),
177178
run: createIcon({ Component: Run, useStroke: true }),
178179
logs: createIcon({ Component: Logs, useStroke: true }),
179-
180+
config: createIcon({ Component: Config, useStroke: true }),
180181
plusCircle: createIcon({ Component: PlusCircle, useStroke: true }),
181182
minusCircle: createIcon({ Component: MinusCircle, useStroke: true }),
182183
//icons for stackComponents

src/ui/layouts/common/CustomStackBox/index.module.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
position: absolute;
1818
}
1919

20+
.viewConfig {
21+
height: 18px;
22+
width: 18px;
23+
right:4px;
24+
accent-color: $primaryColor;
25+
position: absolute;
26+
}
27+
2028

2129
.imageWrapper {
2230
display: flex;

src/ui/layouts/common/CustomStackBox/index.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import React from 'react';
2-
import { Box, Paragraph } from '../../../components';
2+
import { Box, Paragraph, icons } from '../../../components';
33

44
import styles from './index.module.scss';
55
import { titleCase } from '../../../../utils/camelCase';
66
import ReactTooltip from 'react-tooltip';
7+
import { iconColors } from '../../../../constants';
78

89
export const CustomStackBox: React.FC<{
910
image: any;
1011
stackName: string;
1112
stackDesc: string;
1213
value?: any;
1314
onCheck: any;
14-
}> = ({ image, stackName, stackDesc, value, onCheck }) => {
15+
onViewConfig: any;
16+
}> = ({ image, stackName, stackDesc, value, onCheck, onViewConfig }) => {
1517
return (
1618
<Box
1719
paddingHorizontal="sm2"
@@ -24,6 +26,15 @@ export const CustomStackBox: React.FC<{
2426
checked={value}
2527
onClick={onCheck}
2628
/>
29+
30+
<icons.config
31+
onClick={onViewConfig}
32+
className={styles.viewConfig}
33+
// size={iconSizes.sm}
34+
// style={{ height: '18px', width: '18px' }}
35+
color={iconColors.primary}
36+
/>
37+
2738
<Box className={styles.imageWrapper}>
2839
<Box className={styles.imageContainer}>
2940
<img src={image} alt="by Zenml" />

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,36 @@ export const GetList: React.FC<Props> = ({
120120
marginLeft="md"
121121
style={{ cursor: 'pointer' }}
122122
onClick={() => {
123-
setShowPopup(true);
123+
// setShowPopup(true);
124124
setSelectedStackBox(item);
125+
var index = selectedStack.findIndex(function (s: any) {
126+
return s.id === item.id;
127+
});
128+
if (index !== -1) {
129+
selectedStack.splice(index, 1);
130+
setSelectedStack([...selectedStack]);
131+
} else {
132+
if (selectedStack.map((t: any) => t.type === item.type)) {
133+
let filterSelectedStack = selectedStack.filter(
134+
(st: any) => st.type !== item.type,
135+
);
136+
setSelectedStack([...filterSelectedStack, item]);
137+
} else {
138+
setSelectedStack([...selectedStack, item]);
139+
}
140+
}
125141
}}
126142
>
127143
{console.log(selectedStack, 'selectedStackselectedStack')}
128144
<CustomStackBox
129145
image={item?.logoUrl}
130146
stackName={item.name}
131147
stackDesc={item?.flavor}
148+
onViewConfig={(e: any) => {
149+
e.stopPropagation();
150+
setSelectedStackBox(item);
151+
setShowPopup(true);
152+
}}
132153
value={checkboxValue?.length > 0 ? true : false}
133154
onCheck={(e: any) => {
134155
e.stopPropagation();

0 commit comments

Comments
 (0)