Skip to content

Commit 9b5eb20

Browse files
authored
Merge pull request #153 from zenml-io/dev
Dev
2 parents 3c22eb1 + 3bf20eb commit 9b5eb20

File tree

99 files changed

+3788
-553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3788
-553
lines changed

global.d.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ interface TMember {
6767
created: Date;
6868
active: boolean;
6969
activation_token: string;
70-
user: {
70+
user: {
7171
id: TId;
7272
organizationId: any;
7373
fullName: any;
@@ -76,13 +76,13 @@ interface TMember {
7676
created: Date;
7777
active: boolean;
7878
activation_token: any;
79-
},
79+
};
8080
roles: [
81-
{
82-
id: string;
83-
name: string
84-
}
85-
]
81+
{
82+
id: string;
83+
name: string;
84+
},
85+
];
8686
}
8787

8888
interface TWorkspace {
@@ -115,6 +115,7 @@ interface TPipeline {
115115
status: Array;
116116
configuration: object;
117117
spec?: any;
118+
version: string;
118119
}
119120
interface TStack {
120121
id: TId;
@@ -128,7 +129,7 @@ interface TStack {
128129
userId: TId;
129130
createdAt: Date;
130131
type?: string;
131-
flavor?: string;
132+
flavor?: any;
132133
configuration?: any;
133134
workspace?: string;
134135
user?: any;

src/api/endpoints.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export const endpoints = {
3939
`/workspaces/${workspace}/components?scope_type=${type}`,
4040
get: (stackComponentId: TId): string => `/components/${stackComponentId}`,
4141
},
42+
flavors: {
43+
all: '/flavors?sort_by=type',
44+
type: `/flavors`,
45+
get: (stackComponentId: TId): string => `/components/${stackComponentId}`,
46+
},
4247
runs: {
4348
pipeline: {
4449
get: (pipelineId: TId): string => `/runs?pipeline_id=${pipelineId}`,

src/api/flavors/getFlavorAllApi.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getFlavorAllApi = ({
7+
authenticationToken,
8+
sort_by,
9+
logical_operator,
10+
page,
11+
size,
12+
type,
13+
filtersParam,
14+
workspace,
15+
}: {
16+
workspace: string;
17+
authenticationToken: string;
18+
sort_by: string;
19+
logical_operator: string;
20+
type: string;
21+
filtersParam?: object;
22+
page: number;
23+
size: number;
24+
}): Promise<TStack> =>
25+
fetchApiWithAuthRequest({
26+
url: apiUrl(endpoints.flavors.all),
27+
params: { sort_by, logical_operator, page, size, ...filtersParam },
28+
method: httpMethods.get,
29+
authenticationToken,
30+
});
31+
32+
export default getFlavorAllApi;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getFlavorTypeApi = ({
7+
authenticationToken,
8+
type,
9+
page,
10+
size,
11+
name,
12+
}: {
13+
page: number;
14+
size: number;
15+
type: string;
16+
name?: string;
17+
authenticationToken: string;
18+
}): Promise<TStack> =>
19+
fetchApiWithAuthRequest({
20+
url: apiUrl(endpoints.flavors.type),
21+
params: { type, page, size, name },
22+
method: httpMethods.get,
23+
authenticationToken,
24+
});
25+
26+
export default getFlavorTypeApi;

src/constants/spacing.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ export const spacings = {
33
xs: 4,
44
xs2: 6,
55
sm: 8,
6+
sm2: 10,
67
md: 16,
78
lg: 24,
89
lg2: 28,
10+
lg3: 30,
911
xl: 32,
12+
xl1: 34,
1013
xl2: 36,
1114
xxl: 40,
15+
xxl2: 44,
1216
xxxl: 48,
1317
'4xl': 56,
1418
'5xl': 60,

src/redux/actionTypes/constants.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ const stackComponentActionTypes = {
5454
RUNS_GET_STACKCOMPONENT_FOR_ID: 'RUNS_GET_STACKCOMPONENT_FOR_ID',
5555
};
5656

57+
const flavorActionTypes = {
58+
FLAVORS_GET_FLAVORS_ALL: 'FLAVORS_GET_FLAVORS_ALL',
59+
FLAVORS_GET_FLAVORS_TYPE: 'FLAVORS_GET_FLAVORS_TYPE',
60+
// STACKCOMPONENTS_GET_STACKCOMPONENT_FOR_ID:
61+
// 'STACKCOMPONENTS_GET_STACKCOMPONENT_FOR_ID',
62+
// RUNS_GET_STACKCOMPONENT_FOR_ID: 'RUNS_GET_STACKCOMPONENT_FOR_ID',
63+
};
64+
5765
const runActionTypes = {
5866
RUNS_GET_ALL_RUNS: 'RUNS_GET_ALL_RUNS',
5967
RUNS_GET_RUN_FOR_ID: 'RUNS_GET_RUN_FOR_ID',
@@ -79,6 +87,11 @@ const stackComponentPagesActionTypes = {
7987
'STACKCOMPONENT_PAGES_SET_SELECTED_RUN_IDS',
8088
STACKCOMPONENT_PAGES_SET_FETCHING: 'STACKCOMPONENT_PAGES_SET_FETCHING',
8189
};
90+
const flavorPagesActionTypes = {
91+
STACKCOMPONENT_PAGES_SET_SELECTED_RUN_IDS:
92+
'STACKCOMPONENT_PAGES_SET_SELECTED_RUN_IDS',
93+
FLAVOR_PAGES_SET_FETCHING: 'FLAVOR_PAGES_SET_FETCHING',
94+
};
8295

8396
export const actionTypes = {
8497
SHOW_TOASTER: 'SHOW_TOASTER',
@@ -95,6 +108,8 @@ export const actionTypes = {
95108
...stackPagesActionTypes,
96109
...stackComponentPagesActionTypes,
97110
...stackComponentActionTypes,
111+
...flavorActionTypes,
112+
...flavorPagesActionTypes,
98113
};
99114

100115
export const REQUESTED = 'REQUESTED';

src/redux/actionTypes/flavors.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { actionTypes } from './constants';
2+
import { generateApiActionsTypes } from './generateApiActionsTypes';
3+
4+
export const flavorActionTypes = {
5+
getFlavorType: generateApiActionsTypes(actionTypes.FLAVORS_GET_FLAVORS_TYPE),
6+
getFlavorAll: generateApiActionsTypes(actionTypes.FLAVORS_GET_FLAVORS_ALL),
7+
// getStackComponentForId: generateApiActionsTypes(
8+
// actionTypes.STACKCOMPONENTS_GET_STACKCOMPONENT_FOR_ID,
9+
// ),
10+
// getRunsByStackComponentId: generateApiActionsTypes(
11+
// actionTypes.RUNS_GET_STACKCOMPONENT_FOR_ID,
12+
// ),
13+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { actionTypes } from './constants';
2+
3+
export const flavorPagesActionTypes = {
4+
setSelectedRunIds: actionTypes.STACKCOMPONENT_PAGES_SET_SELECTED_RUN_IDS,
5+
setFetching: actionTypes.FLAVOR_PAGES_SET_FETCHING,
6+
};

src/redux/actionTypes/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ export * from './roles';
1414
export * from './pipelinePages';
1515
export * from './stackPages';
1616
export * from './stackComponentPages';
17-
17+
export * from './flavors';
18+
export * from './flavorsPages';
1819
export const SHOW_TOASTER_ACTION_TYPE = actionTypes.SHOW_TOASTER;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { pipelinePagesActionTypes } from '../../actionTypes';
2+
import { flavorPagesActions } from './index';
3+
4+
describe(pipelinePagesActionTypes.setSelectedRunIds, () => {
5+
const runIds = ['id'];
6+
7+
const onAction = () => flavorPagesActions.setSelectedRunIds({ runIds });
8+
9+
it('has correct type', () => {
10+
expect(onAction().type).toEqual(pipelinePagesActionTypes.setSelectedRunIds);
11+
});
12+
13+
it('has correct payload', () => {
14+
expect(onAction().payload).toEqual({ runIds });
15+
});
16+
});
17+
18+
describe(pipelinePagesActionTypes.setFetching, () => {
19+
const onAction = () => flavorPagesActions.setFetching({ fetching: true });
20+
21+
it('has correct type', () => {
22+
expect(onAction().type).toEqual(pipelinePagesActionTypes.setFetching);
23+
});
24+
25+
it('has correct payload', () => {
26+
expect(onAction().payload).toEqual({ fetching: true });
27+
});
28+
});

0 commit comments

Comments
 (0)