Skip to content

Commit 8ed3c6e

Browse files
remove commented dead code.
1 parent b5a601c commit 8ed3c6e

File tree

25 files changed

+27
-152
lines changed

25 files changed

+27
-152
lines changed

src/constants/constantCommands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export const constantCommandsToCreatePipeline = {
6161
};
6262

6363
export const constantCommandsToCreateComponent = {
64-
// title: 'Create Pipeline',
6564
documentation: 'https://docs.zenml.io/starter-guide/stacks',
6665
componentCommand: {
6766
type: 'alerter',

src/redux/reducers/runsReducer.ts

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export interface State {
1313
byPipelineId: Record<TId, TId[]>;
1414
byStackId: Record<TId, TId[]>;
1515
byStackComponentId: Record<TId, TId[]>;
16-
// graphForRunId: any;
1716
myRunIds: TId[];
1817
graphForRunId: any;
1918
}
@@ -50,7 +49,6 @@ export const initialState: State = {
5049
byStackId: {},
5150
byStackComponentId: {},
5251
myRunIds: [],
53-
// graphForRunId: [],
5452
graphForRunId: {},
5553
};
5654

@@ -66,11 +64,6 @@ const newStateForGraph = (state: State, graph: any): State => ({
6664

6765
const runsReducer = (state: State = initialState, action: Action): State => {
6866
switch (action.type) {
69-
// case runActionTypes.getAllRuns.success: {
70-
// debugger;
71-
// return { ...state };
72-
// }
73-
// case pipelineActionTypes.getMyPipelines.success:
7467
case runActionTypes.getAllRuns.success: {
7568
const payload = action.payload;
7669

@@ -84,13 +77,11 @@ const runsReducer = (state: State = initialState, action: Action): State => {
8477
}
8578

8679
case runActionTypes.getGraphForRunId.success: {
87-
// debugger;
8880
const payload = action.payload;
89-
// const id = action?.requestParams?.runId;
9081

9182
const graphFromRun = {
9283
...payload,
93-
// projectName: payload.projectName,
84+
9485
runId: action?.requestParams?.runId,
9586
};
9687

@@ -99,11 +90,6 @@ const runsReducer = (state: State = initialState, action: Action): State => {
9990
return {
10091
...newStateForGraph(state, graph),
10192
};
102-
// const run = camelCaseObject({
103-
// ...payload,
104-
// runId: action.requestParams.runId,
105-
// });
106-
// console.log(action.payload);
10793
}
10894
case runActionTypes.getRunForId.success: {
10995
const payload: RunPayload = action.payload;
@@ -118,33 +104,13 @@ const runsReducer = (state: State = initialState, action: Action): State => {
118104
return { ...state, ...newState(state, [run]) };
119105
}
120106

121-
// case pipelineActionTypes.getPipelineForId.success: {
122-
// const payload: PipelinePayload = action.payload;
123-
124-
// const runsFromPipeline = (payload.pipeline_runs || []).map(
125-
// (run: TRun) => ({
126-
// ...run,
127-
// projectName: payload.projectName,
128-
// pipelineId: payload.id,
129-
// }),
130-
// );
131-
132-
// const runs: TRun[] = camelCaseArray(runsFromPipeline);
133-
134-
// const byPipelineId: Record<TId, TId[]> = { ...state.byPipelineId };
135-
136-
// byPipelineId[payload.id] = runs.map((run: TRun) => run.id);
137-
138-
// const temp = { ...state, ...newState(state, runs), byPipelineId };
139-
// return temp;
140-
// }
141107
case pipelineActionTypes.getRunsByPipelineId.success: {
142108
const payload = action.payload;
143109
const id = action?.requestParams?.pipelineId;
144110

145111
const runsFromPipeline = payload.map((run: TRun) => ({
146112
...run,
147-
// projectName: payload.projectName,
113+
148114
pipelineId: action?.requestParams?.pipelineId,
149115
}));
150116

@@ -166,7 +132,7 @@ const runsReducer = (state: State = initialState, action: Action): State => {
166132
const id = action?.requestParams?.stackId;
167133
const runsFromStack = payload.map((run: TRun) => ({
168134
...run,
169-
// projectName: payload.projectName,
135+
170136
stackId: id,
171137
}));
172138

@@ -176,7 +142,7 @@ const runsReducer = (state: State = initialState, action: Action): State => {
176142
const byStackId: Record<TId, TId[]> = {
177143
...state.byStackId,
178144
};
179-
// debugger;
145+
180146
byStackId[id as TId] = runs.map((run: TRun) => run.id);
181147
return {
182148
...state,
@@ -187,11 +153,10 @@ const runsReducer = (state: State = initialState, action: Action): State => {
187153
}
188154
case stackComponentActionTypes.getRunsByStackComponentId.success: {
189155
const payload = action.payload;
190-
// debugger;
156+
191157
const id = action?.requestParams?.stackComponentId;
192158
const runsFromStackComponent = payload.map((run: TRun) => ({
193159
...run,
194-
// projectName: payload.projectName,
195160
stackComponentId: id,
196161
}));
197162

src/redux/sagas/requestSaga.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ function* logoutAndNotifyUserThatSessionExpired(): any {
3333
}
3434

3535
function* unprocessablEntity(): any {
36-
// yield put(sessionActions.logout());
3736
yield put(
3837
showToasterAction({
3938
description: 'Something went wrong',

src/redux/selectors/organizations.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import _ from 'lodash';
2-
// import { Selector } from 'reselect';
3-
// import { createSelector } from './createSelector';
4-
52
import { State } from '../reducers/organizationsReducer';
63

74
const stateKey = (state: State): State =>
@@ -22,14 +19,6 @@ export const myOrganization = (state: State): TOrganization | null => {
2219
return byId[myOrganizationId];
2320
};
2421

25-
// export const inviteForCode = (
26-
// code: string | null,
27-
// ): Selector<any, TInvite | undefined> =>
28-
// createSelector(getInvites, (invites): TInvite | undefined => {
29-
// const invite = invites && invites.find((i) => i.code === code);
30-
// return invite;
31-
// });
32-
3322
const inviteForCode = (state: State): any[] =>
3423
_.get(stateKey(state), 'inviteCode');
3524

src/redux/selectors/runs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const myRuns = (state?: State | null): TRun[] => {
2424
if (!state) return [];
2525
const myRunIds = getMyRunIds(state);
2626
const byId = getById(state);
27-
// debugger;
27+
2828
return (myRunIds || []).reduce((current: TRun[], id: TId) => {
2929
const run = byId[id];
3030

@@ -59,7 +59,7 @@ export const runsForStackComponentId = (
5959
if (!state || !stackComponentId) return [];
6060
const byStackComponentId = getByStackComponentId(state);
6161
const byId = getById(state);
62-
// debugger;
62+
6363
if (!byStackComponentId[stackComponentId]) return [];
6464
return byStackComponentId[stackComponentId].map((id: TId) => byId[id]);
6565
};

src/routes/index.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
useSelector,
1515
useLocationPath,
1616
useGetSearchParam,
17-
useDispatch
17+
useDispatch,
1818
} from '../ui/hooks';
1919

2020
import { sessionSelectors } from '../redux/selectors/session';
@@ -28,10 +28,7 @@ import { WaitToEnter } from '../ui/components';
2828
import { isRouteFound } from './utils/isRouteFound';
2929
import { NotFound } from '../ui/layouts/NotFound';
3030
import { userSelectors } from '../redux/selectors';
31-
import {
32-
userActions,
33-
} from '../redux/actions';
34-
31+
import { userActions } from '../redux/actions';
3532

3633
const useReplaceRouteIfNeeded = ({
3734
currentLocation,
@@ -44,11 +41,6 @@ const useReplaceRouteIfNeeded = ({
4441

4542
const isAuthenticated = useSelector(sessionSelectors.authenticationToken);
4643

47-
// const dispatch = useDispatch();
48-
// React.useEffect(() => {
49-
// dispatch(userActions.getMy({}));
50-
// }, [dispatch, userActions, isAuthenticated])
51-
5244
React.useEffect(() => {
5345
setNotFound(
5446
isRouteFound({

src/routes/routePaths.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export const routePaths = {
22
login: '/login',
33
signup: '/signup',
4-
// userEmail: (userId: TId): string => `/user-email/${userId}`,
54
userEmail: `/user-email`,
65
forgot: '/forgot-password',
76
home: '/',
@@ -74,7 +73,6 @@ export const routePaths = {
7473
configuration: (type: string, id: TId): string =>
7574
`/components/${type}/${id}/configuration`,
7675
runs: (type: string, id: TId): string => `/components/${type}/${id}/runs`,
77-
// list: (type: string): string => `/components/${type}`,
7876
},
7977

8078
settings: {

src/routes/utils/replaceRouteIfNeeded.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ export const replaceRouteIfNeeded = ({
5757
replaceToLoggedInRoute ||
5858
replaceToLoggedOutRoute ||
5959
replaceToLoggedInRouteForEmailOptedIn;
60-
// debugger;
60+
6161
if (shouldReplaceRoute) {
6262
timeout = setTimeout(() => {
6363
let route = routeToReplace();
6464

6565
if (replaceToLoggedOutRoute && currentLocation) {
66-
// route = `${route}?route=${currentLocation.path}`;
6766
route = `${route}?route=/`;
6867
} else if (replaceToLoggedInRoute && routeFromSearchParam) {
6968
route = routeFromSearchParam;

src/ui/components/dag/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const DAG: React.FC<{ runId: TId; fetching?: boolean }> = ({
1414
}) => {
1515
const { graph } = useService({ runId });
1616

17-
console.log('runId', graph, runId);
1817
if (fetching) {
1918
return <FullWidthSpinner color="black" size="md" />;
2019
}

src/ui/components/dag/useService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { runSelectors } from '../../../redux/selectors';
55

66
export const useService = ({ runId }: { runId: TId }) => {
77
const graph = useSelector(runSelectors.graphByRunId(runId));
8-
// debugger;
8+
99
useEffect(() => {}, [graph]);
10-
// const graph: any = useSelector(runSelectors.graphByRunId(runId));
10+
1111
return { graph };
1212
};

0 commit comments

Comments
 (0)