summaryrefslogtreecommitdiff
path: root/frontend/views/index
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-02 22:34:16 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-02 22:34:16 +0200
commitabd277bc02d36570038de4c0646a672f5585fa84 (patch)
tree91a8955ce1838892dc55389c920370a06ac04a91 /frontend/views/index
parent70a29089cdb05df27cf50b50fcbc2e53d8975571 (diff)
stubbing in page editor
Diffstat (limited to 'frontend/views/index')
-rw-r--r--frontend/views/index/graph.reducer.js78
1 files changed, 0 insertions, 78 deletions
diff --git a/frontend/views/index/graph.reducer.js b/frontend/views/index/graph.reducer.js
deleted file mode 100644
index 9f42f52..0000000
--- a/frontend/views/index/graph.reducer.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import * as types from '../../types'
-// import { session, getDefault, getDefaultInt } from '../../session'
-
-import { crudState, crudReducer } from '../../api/crud.reducer'
-
-const initialState = crudState('graph', {
- editor: {
- addingPage: false,
- editingPage: false,
- },
- options: {
- }
-})
-
-const reducer = crudReducer('graph')
-
-export default function graphReducer(state = initialState, action) {
- console.log(action.type, action)
- state = reducer(state, action)
- switch (action.type) {
- case types.graph.update_graph_page:
- return {
- ...state,
- show: {
- ...state.show,
- res: {
- ...state.show.res,
- pages: state.show.res.pages.map(page => {
- if (page.id === action.page.id) {
- return { ...action.page }
- } else {
- return page
- }
- }),
- }
- }
- }
-
- case types.graph.show_add_page_form:
- return {
- ...state,
- editor: {
- ...state.editor,
- addingPage: true,
- }
- }
-
- case types.graph.hide_add_page_form:
- return {
- ...state,
- editor: {
- ...state.editor,
- addingPage: false,
- }
- }
-
- case types.graph.show_edit_page_form:
- return {
- ...state,
- editor: {
- ...state.editor,
- addingPage: true,
- }
- }
-
- case types.graph.hide_edit_page_form:
- return {
- ...state,
- editor: {
- ...state.editor,
- addingPage: false,
- }
- }
-
- default:
- return state
- }
-}