Skip to content

Commit 0f5621f

Browse files
leftExpansionCol changed to MUI list, functionality stripped
2 parents f56dcbc + 4e4d8d9 commit 0f5621f

File tree

11 files changed

+479
-549
lines changed

11 files changed

+479
-549
lines changed

src/actionTypes/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const LOAD_INIT_DATA = 'LOAD_INIT_DATA';
22
export const ADD_COMPONENT = 'ADD_COMPONENT';
3+
export const ADD_CHILD = 'ADD_CHILD';
34
export const UPDATE_COMPONENT = 'UPDATE_COMPONENT';
45
export const DELETE_COMPONENT = 'DELETE_COMPONENT';
56
export const UPDATE_CHILDREN = 'UPDATE_CHILDREN';

src/actions/components.js

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
LOAD_INIT_DATA,
33
ADD_COMPONENT,
4+
ADD_CHILD,
45
UPDATE_COMPONENT,
56
DELETE_COMPONENT,
67
UPDATE_CHILDREN,
@@ -62,6 +63,11 @@ export const addComponent = ({ title }) => (dispatch) => {
6263
dispatch({ type: SET_SELECTABLE_PARENTS });
6364
};
6465

66+
export const addChild = ({ title }) => (dispatch) => {
67+
dispatch({ type: ADD_CHILD, payload: { title } });
68+
// dispatch({ type: SET_SELECTABLE_PARENTS });
69+
};
70+
6571
export const deleteComponent = ({ index, id, parentIds = [] }) => (dispatch) => {
6672
if (parentIds.length) {
6773
// Delete Component from its parent if it has a parent.
@@ -91,21 +97,21 @@ export const updateComponent = ({
9197
dispatch({ type: SET_SELECTABLE_PARENTS });
9298
};
9399

94-
export const exportFiles = ({ components, path }) => (dispatch) => {
95-
dispatch({
96-
type: EXPORT_FILES,
97-
});
98-
99-
createFiles(components, path)
100-
.then(dir => dispatch({
101-
type: EXPORT_FILES_SUCCESS,
102-
payload: { status: true, dir: dir[0] },
103-
}))
104-
.catch(err => dispatch({
105-
type: EXPORT_FILES_ERROR,
106-
payload: { status: true, err },
107-
}));
108-
};
100+
// export const exportFiles = ({ components, path }) => (dispatch) => {
101+
// dispatch({
102+
// type: EXPORT_FILES,
103+
// });
104+
105+
// createFiles(components, path)
106+
// .then(dir => dispatch({
107+
// type: EXPORT_FILES_SUCCESS,
108+
// payload: { status: true, dir: dir[0] },
109+
// }))
110+
// .catch(err => dispatch({
111+
// type: EXPORT_FILES_ERROR,
112+
// payload: { status: true, err },
113+
// }));
114+
// };
109115

110116
export const handleClose = () => ({
111117
type: HANDLE_CLOSE,
@@ -121,71 +127,66 @@ export const handleTransform = (id, {
121127
},
122128
});
123129

124-
// Application generation options
125-
// cosnt genOptions = [
126-
// 'Export into existing project.', 'Export with starter repo.', 'Export with create-react-app.'
127-
// ];
128-
129-
export const createApplication = ({
130-
path, components = [], genOption, appName = 'proto_app', repoUrl,
131-
}) => (dispatch) => {
132-
if (genOption === 0) {
133-
dispatch(exportFiles({ path, components }));
134-
} else if (genOption) {
135-
dispatch({
136-
type: CREATE_APPLICATION,
137-
});
138-
createApplicationUtil({
139-
path, appName, genOption, repoUrl,
140-
})
141-
.then(() => {
142-
dispatch({
143-
type: CREATE_APPLICATION_SUCCESS,
144-
});
145-
dispatch(exportFiles({ path: `${path}/${appName}`, components }));
146-
})
147-
.catch(err => dispatch({
148-
type: CREATE_APPLICATION_ERROR,
149-
payload: { status: true, err },
150-
}));
151-
}
152-
};
130+
// export const createApplication = ({
131+
// path, components = [], genOption, appName = 'proto_app', repoUrl,
132+
// }) => (dispatch) => {
133+
// if (genOption === 0) {
134+
// dispatch(exportFiles({ path, components }));
135+
// } else if (genOption) {
136+
// dispatch({
137+
// type: CREATE_APPLICATION,
138+
// });
139+
// createApplicationUtil({
140+
// path, appName, genOption, repoUrl,
141+
// })
142+
// .then(() => {
143+
// dispatch({
144+
// type: CREATE_APPLICATION_SUCCESS,
145+
// });
146+
// dispatch(exportFiles({ path: `${path}/${appName}`, components }));
147+
// })
148+
// .catch(err => dispatch({
149+
// type: CREATE_APPLICATION_ERROR,
150+
// payload: { status: true, err },
151+
// }));
152+
// }
153+
// };
153154

154155
export const toggleDragging = status => ({
155156
type: TOGGLE_DRAGGING,
156157
payload: status,
157158
});
158159

159-
export const moveToBottom = componentId => ({
160-
type: MOVE_TO_BOTTOM,
161-
payload: componentId,
162-
});
163-
164-
export const moveToTop = componentId => ({
165-
type: MOVE_TO_TOP,
166-
payload: componentId,
167-
});
168-
169-
export const openExpansionPanel = component => ({
170-
type: OPEN_EXPANSION_PANEL,
171-
payload: { component },
172-
});
173-
174-
export const deleteAllData = () => ({
175-
type: DELETE_ALL_DATA,
176-
});
177-
178-
export const changeImagePath = path => ({
179-
type: CHANGE_IMAGE_PATH,
180-
payload: path,
181-
});
182-
183-
export const deleteCompProp = ({ id, index }) => ({
184-
type: DELETE_PROP,
185-
payload: { id, index },
186-
});
187-
188-
export const addCompProp = prop => ({
189-
type: ADD_PROP,
190-
payload: { ...prop },
191-
});
160+
// export const moveToBottom = componentId => ({
161+
// type: MOVE_TO_BOTTOM,
162+
// payload: componentId,
163+
// });
164+
165+
// export const moveToTop = componentId => ({
166+
// type: MOVE_TO_TOP,
167+
// payload: componentId,
168+
// });
169+
170+
// export const openExpansionPanel = component => ({
171+
// type: OPEN_EXPANSION_PANEL,
172+
// payload: { component },
173+
// });
174+
175+
// export const deleteAllData = () => ({
176+
// type: DELETE_ALL_DATA,
177+
// });
178+
179+
// export const changeImagePath = path => ({
180+
// type: CHANGE_IMAGE_PATH,
181+
// payload: path,
182+
// });
183+
184+
// export const deleteCompProp = ({ id, index }) => ({
185+
// type: DELETE_PROP,
186+
// payload: { id, index },
187+
// });
188+
189+
// export const addCompProp = prop => ({
190+
// type: ADD_PROP,
191+
// payload: { ...prop },
192+
// });
File renamed without changes.

0 commit comments

Comments
 (0)