Skip to content

Commit c76e7a8

Browse files
committed
Merge branch 'dev' into main
2 parents 3761058 + 82c36d1 commit c76e7a8

File tree

53 files changed

+594
-149
lines changed

Some content is hidden

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

53 files changed

+594
-149
lines changed

src/api/runs/getGraphRunByIdApi.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { fetchApiWithAuthRequest } from '../fetchApi';
22
import { endpoints } from '../endpoints';
33
import { httpMethods } from '../constants';
44
import { apiUrl } from '../apiUrl';
5-
import mockApi from '../mockApiData';
65

76
const getGraphRunByIdApi = ({
87
authenticationToken,
@@ -15,13 +14,6 @@ const getGraphRunByIdApi = ({
1514
url: apiUrl(endpoints.runs.graphById.get(runId)),
1615
method: httpMethods.get,
1716
authenticationToken,
18-
}).catch((res) => {
19-
if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
20-
res = {
21-
data: mockApi.runByIdMockResponse,
22-
};
23-
}
24-
return res;
2517
});
2618
};
2719

src/constants/constantCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const constantCommandsToCreatePipeline = {
6262

6363
export const constantCommandsToCreateComponent = {
6464
// title: 'Create Pipeline',
65-
documentation: 'https://docs.zenml.io/starter-guide/stacks/stacks-components',
65+
documentation: 'https://docs.zenml.io/starter-guide/stacks',
6666
componentCommand: {
6767
type: 'alerter',
6868
body: [

src/redux/actionTypes/constants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const userActionTypes = {
1010
USERS_GET_MY_USER: 'USERS_GET_MY_USER',
1111
USERS_GET_USER_FOR_ID: 'USERS_GET_USER_FOR_ID',
1212
UPDATE_USER_EMAIL: 'UPDATE_USER_EMAIL',
13-
SAVE_USER_EMAIL: 'SAVE_USER_EMAIL'
13+
SAVE_USER_EMAIL: 'SAVE_USER_EMAIL',
1414
};
1515

1616
const organizationActionTypes = {
@@ -56,7 +56,7 @@ const stackComponentActionTypes = {
5656
const runActionTypes = {
5757
RUNS_GET_ALL_RUNS: 'RUNS_GET_ALL_RUNS',
5858
RUNS_GET_RUN_FOR_ID: 'RUNS_GET_RUN_FOR_ID',
59-
GRAPH_FOR_RUN_ID: 'RUNS_GET_RUN_FOR_ID',
59+
GRAPH_FOR_RUN_ID: 'GRAPH_FOR_RUN_ID',
6060
};
6161

6262
const billingActionTypes = {
@@ -78,7 +78,7 @@ const pipelinePagesActionTypes = {
7878
PIPELINE_PAGES_SET_FETCHING: 'PIPELINE_PAGES_SET_FETCHING',
7979
};
8080

81-
const runsPagesActionTypes = {
81+
const runPagesActionTypes = {
8282
RUNS_PAGES_SET_FETCHING: 'RUNS_PAGES_SET_FETCHING',
8383
};
8484

@@ -109,7 +109,7 @@ export const actionTypes = {
109109
...pipelineActionTypes,
110110
...stackActionTypes,
111111
...runActionTypes,
112-
...runsPagesActionTypes,
112+
...runPagesActionTypes,
113113
...billingActionTypes,
114114
...pipelinePagesActionTypes,
115115
...stackPagesActionTypes,

src/redux/actionTypes/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from './pipelines';
88
export * from './stacks';
99
export * from './stackComponents';
1010
export * from './runs';
11+
export * from './runPages';
1112
export * from './billing';
1213
export * from './pipelinePages';
1314
export * from './stackPages';

src/redux/actionTypes/runPages.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { actionTypes } from './constants';
2+
3+
export const runPagesActionTypes = {
4+
setCurrentWorkspace: actionTypes.PIPELINE_PAGES_SET_CURRENT_WORKSPACE,
5+
setSelectedRunIds: actionTypes.PIPELINE_PAGES_SET_SELECTED_RUN_IDS,
6+
setFetching: actionTypes.PIPELINE_PAGES_SET_FETCHING,
7+
};

src/redux/actions/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from './pipelines';
77
export * from './stacks';
88
export * from './stackComponents';
99
export * from './runs';
10+
export * from './runPages';
1011
export * from './billing';
1112
export * from './pipelinePages';
1213
export * from './stackPages';
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { runPagesActionTypes } from '../../actionTypes';
2+
3+
const setCurrentWorkspaceAction = ({
4+
workspace,
5+
}: {
6+
workspace: TWorkspace | null;
7+
}): TAction => ({
8+
type: runPagesActionTypes.setCurrentWorkspace,
9+
payload: {
10+
workspace,
11+
},
12+
});
13+
14+
const setSelectedRunIdsAction = ({ runIds }: { runIds: TId[] }): TAction => ({
15+
type: runPagesActionTypes.setSelectedRunIds,
16+
payload: {
17+
runIds,
18+
},
19+
});
20+
21+
const setFetchingAction = ({ fetching }: { fetching: boolean }): TAction => ({
22+
type: runPagesActionTypes.setFetching,
23+
payload: {
24+
fetching,
25+
},
26+
});
27+
28+
export const runPagesActions = {
29+
setCurrentWorkspace: setCurrentWorkspaceAction,
30+
setSelectedRunIds: setSelectedRunIdsAction,
31+
setFetching: setFetchingAction,
32+
};

src/redux/persistedReducers.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import stackComponentReducer from './reducers/stackComponentsReducer';
1010
import runsReducer from './reducers/runsReducer';
1111
import billingReducer from './reducers/billingReducer';
1212
import pipelinePagesReducer from './reducers/pipelinePagesReducer';
13+
import runPagesReducer from './reducers/runPagesReducer';
1314
import stackPagesReducer from './reducers/stackPagesReducer';
1415

1516
jest.mock('redux', () => ({
@@ -33,6 +34,7 @@ describe('expect to map keys', () => {
3334
expectToMap('stacks', stacksReducer);
3435
expectToMap('stackComponents', stackComponentReducer);
3536
expectToMap('runs', runsReducer);
37+
expectToMap('run', runPagesReducer);
3638
expectToMap('billing', billingReducer);
3739
expectToMap('pipelinePages', pipelinePagesReducer);
3840
expectToMap('stackPages', stackPagesReducer);

src/redux/persistedReducers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ import pipelinePagesReducer, {
4141
initialState as pipelinePagesInitialState,
4242
} from './reducers/pipelinePagesReducer';
4343

44+
import runPagesReducer, {
45+
initialState as runPagesInitialState,
46+
} from './reducers/runPagesReducer';
47+
4448
import stackPagesReducer, {
4549
initialState as stackPagesInitialState,
4650
} from './reducers/stackPagesReducer';
@@ -58,6 +62,7 @@ const initialState = {
5862
stacks: stacksInitialState,
5963
stackComponents: stackComponentsInitialState,
6064
runs: runsInitialState,
65+
runPages: runPagesInitialState,
6166
billing: billingInitialState,
6267
pipelinePages: pipelinePagesInitialState,
6368
stacksPages: stackPagesInitialState,
@@ -73,6 +78,7 @@ export const persisted = combineReducers({
7378
stacks: stacksReducer,
7479
stackComponents: stackComponentsReducer,
7580
runs: runsReducer,
81+
runPages: runPagesReducer,
7682
billing: billingReducer,
7783
pipelinePages: pipelinePagesReducer,
7884
stackPages: stackPagesReducer,
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { pipelinePagesActionTypes, runPagesActionTypes } from '../actionTypes';
2+
3+
export interface State {
4+
currentWorkspace: TWorkspace | null;
5+
selectedRunIds: TId[];
6+
fetching: boolean;
7+
}
8+
9+
export const initialState: State = {
10+
currentWorkspace: null,
11+
selectedRunIds: [],
12+
fetching: false,
13+
};
14+
15+
export type Action = {
16+
type: string;
17+
payload: {
18+
workspace?: TWorkspace | null;
19+
runIds?: TId[];
20+
fetching?: boolean;
21+
};
22+
};
23+
24+
const runPagesReducer = (
25+
state: State = initialState,
26+
action: Action,
27+
): State => {
28+
switch (action.type) {
29+
case pipelinePagesActionTypes.setCurrentWorkspace: {
30+
const currentWorkspace = action.payload.workspace;
31+
32+
if (currentWorkspace === undefined) {
33+
return state;
34+
}
35+
36+
return { ...state, currentWorkspace };
37+
}
38+
39+
case pipelinePagesActionTypes.setSelectedRunIds: {
40+
const selectedRunIds = action.payload.runIds;
41+
42+
if (selectedRunIds === undefined) {
43+
return state;
44+
}
45+
46+
return { ...state, selectedRunIds };
47+
}
48+
49+
case runPagesActionTypes.setFetching: {
50+
const fetching = action.payload.fetching;
51+
52+
if (fetching === undefined) {
53+
return state;
54+
}
55+
56+
return { ...state, fetching };
57+
}
58+
59+
default:
60+
return state;
61+
}
62+
};
63+
64+
export default runPagesReducer;

0 commit comments

Comments
 (0)