Skip to content

Commit 58b5183

Browse files
Merge pull request #191 from zenml-io/QA-Fixes
Qa fixes
2 parents 8306b85 + 43bbd77 commit 58b5183

File tree

8 files changed

+63
-26
lines changed

8 files changed

+63
-26
lines changed

src/ui/layouts/NonEditableConfig/useService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const useService = ({ details }: { details: any }): ServiceInterface => {
2121
dispatch(
2222
flavorsActions.getType({
2323
type: details?.type,
24-
name: details?.flavor.name,
24+
name: details?.flavor,
2525
onSuccess: (res: any) => {
2626
setFlavor(res.items[0]);
2727
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const PaginationWithPageSize: React.FC<Props> = ({
5353
);
5454

5555
const DEFAULT_ITEMS_PER_PAGE = 10;
56-
const itemPerPageOptions = [7, 10, 15, 20];
56+
const itemPerPageOptions = [5, 10, 15, 20];
5757
// const itemPerPage = ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE;
5858
const [itemPerPage, setItemPerPage] = useState(
5959
ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const StackBox: React.FC<{
5555

5656
<Box style={{ marginTop: '8px' }}>
5757
<Paragraph className={styles.stackName}>
58-
{titleCase(stackName?.slice(0, 15))}
58+
{titleCase(stackName?.slice(0, 17))}
5959
</Paragraph>
6060
</Box>
6161

src/ui/layouts/stackComponents/RegisterComponents/ListForAll/index.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ import {
2020
FullWidthSpinner,
2121
Paragraph,
2222
SearchInputField,
23-
24-
Row
23+
Row,
2524
} from '../../../../components';
2625
import { PaginationWithPageSize } from '../../../common/PaginationWithPageSize';
27-
import { FlavourBox } from '../../../common/FlavourBox';
26+
// import { FlavourBox } from '../../../common/FlavourBox';
2827
import { CustomFlavourBox } from '../../../common/CustomFlavourBox';
2928
import { callActionForFlavorsForPagination } from '../useService';
3029
import { SidePopup } from '../../../common/SidePopup';
@@ -99,26 +98,26 @@ export const ListForAll: React.FC<Props> = ({ type }: Props) => {
9998
<>
10099
<FlexBox>
101100
<Row>
102-
<Box marginVertical={'sm'} style={{ marginLeft:"30px" }} >
101+
{/* <Box marginVertical={'sm'} style={{ marginLeft:"30px" }} >
103102
<FlavourBox
104103
flavourDesc={'Configure and create a custom flavor'}
105104
flavourName={'Create Custom Flavour'}
106105
/>
107-
</Box>
106+
</Box> */}
108107

109108
{allFlavors.map((item, index) => {
110109
return (
111-
<Row key={index} style={{ marginLeft: '15px' }}>
112-
{console.log(item, 'item.nameitem.name')}
113-
<Box marginVertical={'sm'} marginHorizontal={'md'}>
114-
<CustomFlavourBox
115-
flavourDesc={item.configSchema.description}
116-
flavourName={item.name}
117-
logoUrl={item.logoUrl}
118-
onSelectFlavor={() => onSelectFlavor(item)}
119-
/>
120-
</Box>
121-
</Row>
110+
<Row key={index} style={{ marginLeft: '15px' }}>
111+
{console.log(item, 'item.nameitem.name')}
112+
<Box marginVertical={'sm'} marginHorizontal={'md'}>
113+
<CustomFlavourBox
114+
flavourDesc={item.configSchema.description}
115+
flavourName={item.name}
116+
logoUrl={item.logoUrl}
117+
onSelectFlavor={() => onSelectFlavor(item)}
118+
/>
119+
</Box>
120+
</Row>
122121
);
123122
})}
124123
</Row>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const useService = (): ServiceInterface => {
3737
dispatch(
3838
flavorsActions.getType({
3939
page: 1,
40-
size: 8,
40+
size: ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE,
4141
type: locationPath.split('/')[4],
4242
onSuccess: () => setFetching(false),
4343
onFailure: () => setFetching(false),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const GetList: React.FC<Props> = ({
106106
);
107107
}}
108108
>
109-
<StackBox stackName="Create" stackDesc="Create a stack" />
109+
<StackBox stackName="Create Component" stackDesc="" />
110110
</div>
111111
</Box>
112112
{list?.map((item: any) => {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const ListForAll: React.FC<Props> = () => {
7777
setSelectedStackBox(null);
7878
return dispatch(
7979
showToasterAction({
80-
description: 'Select Atleast one component from Orchestrator',
80+
description: 'Select atleast one component from Orchestrator',
8181
type: toasterTypes.failure,
8282
}),
8383
);
@@ -87,7 +87,7 @@ export const ListForAll: React.FC<Props> = () => {
8787
setSelectedStackBox(null);
8888
return dispatch(
8989
showToasterAction({
90-
description: 'Select Atleast one component from Artifact Store',
90+
description: 'Select atleast one component from Artifact Store',
9191
type: toasterTypes.failure,
9292
}),
9393
);

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

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,25 @@ import { useService } from './useService';
2727
import { StackBox } from '../../../common/StackBox';
2828
import { SidePopup } from '../../CreateStack/ListForAll/SidePopup';
2929
import { NonEditableConfig } from '../../../NonEditableConfig';
30-
import { useDispatch, useSelector } from '../../../../hooks';
30+
import {
31+
useDispatch,
32+
useHistory,
33+
useLocation,
34+
useSelector,
35+
} from '../../../../hooks';
3136
import {
3237
sessionSelectors,
3338
userSelectors,
3439
workspaceSelectors,
3540
} from '../../../../../redux/selectors';
36-
import { showToasterAction, stacksActions } from '../../../../../redux/actions';
41+
import {
42+
showToasterAction,
43+
stackComponentsActions,
44+
stacksActions,
45+
} from '../../../../../redux/actions';
3746
import { toasterTypes } from '../../../../../constants';
3847
import axios from 'axios';
48+
import { routePaths } from '../../../../../routes/routePaths';
3949
// import { SidePopup } from '../../../common/SidePopup';
4050

4151
export const Configuration: React.FC<{
@@ -51,6 +61,9 @@ export const Configuration: React.FC<{
5161
const workspaces = useSelector(workspaceSelectors.myWorkspaces);
5262
const [loading, setLoading] = useState(false);
5363
const dispatch = useDispatch();
64+
const locationPath = useLocation() as any;
65+
// const { dispatchStackData } = callActionForStacksForPagination();
66+
const history = useHistory();
5467
// const [hover, setHover] = useState(false);
5568
const [showPopup, setShowPopup] = useState<boolean>(false);
5669
const [selectedStackBox, setSelectedStackBox] = useState<any>();
@@ -199,6 +212,7 @@ export const Configuration: React.FC<{
199212
tiles.map((tile: any, index: number) => (
200213
<Box
201214
key={index}
215+
style={{ cursor: 'pointer' }}
202216
className={styles.tile}
203217
marginTop="md"
204218
marginLeft="md"
@@ -233,7 +247,31 @@ export const Configuration: React.FC<{
233247
// onCreateStack();
234248
// }}
235249
isCreate={false}
236-
onSeeExisting={() => {}}
250+
onSeeExisting={() => {
251+
dispatch(
252+
stackComponentsActions.getMy({
253+
workspace: selectedWorkspace
254+
? selectedWorkspace
255+
: locationPath.split('/')[2],
256+
type: selectedStackBox.type,
257+
258+
page: 1,
259+
size: 1,
260+
id: selectedStackBox.id,
261+
onSuccess: () => {
262+
// setFetching(false);
263+
history.push(
264+
routePaths.stackComponents.configuration(
265+
selectedStackBox.type,
266+
selectedStackBox.id,
267+
selectedWorkspace,
268+
),
269+
);
270+
},
271+
onFailure: () => {},
272+
}),
273+
);
274+
}}
237275
onClose={() => {
238276
setShowPopup(false);
239277
setSelectedStackBox(null);

0 commit comments

Comments
 (0)