Loading js-apps/meep-frontend/src/js/containers/meep-container.js +1 −1 Original line number Diff line number Diff line Loading @@ -471,7 +471,7 @@ const mapDispatchToProps = dispatch => { cfgChangeTable: (data) => dispatch(cfgChangeTable(data)), execChangeOkToTerminate: (ok) => dispatch(execChangeOkToTerminate(ok)), toggleMainDrawer: () => dispatch(uiToggleMainDrawer()), addMetricsEpoch: (epoch) => dispatch(execAddMetricsEpoch(epoch)), addMetricsEpoch: (epoch) => dispatch(execAddMetricsEpoch(epoch)) }; }; Loading js-apps/meep-frontend/src/js/meep-controller.js +0 −114 Original line number Diff line number Diff line Loading @@ -30,8 +30,6 @@ import meepReducer from './state/meep-reducer'; import { execDisplayedScenarioMiddleware } from './middlewares/exec-displayed-scenario-middleware'; import { fixMetricsValuesMiddleware } from './middlewares/fix-metrics-values-middleware'; // To uncomment when save state is fixed import { saveUIState, loadUIState Loading @@ -44,119 +42,8 @@ import { // UI Components import MeepContainer from './containers/meep-container'; // Constants import { TYPE_CFG, TYPE_EXEC, CFG_STATE_IDLE, EXEC_STATE_IDLE, NO_SCENARIO_NAME, PAGE_CONFIGURE } from './meep-constants'; import { createNewScenario } from './util/scenario-utils'; // MEEP Controller Frontend state information const meep = { ui: { page: PAGE_CONFIGURE }, cfg: { type: TYPE_CFG, state: CFG_STATE_IDLE, scenario: createNewScenario(NO_SCENARIO_NAME), vis: { type: TYPE_CFG, network: {}, options: {}, data: { nodes: [], edges: [] }, showConfig: false }, table: { data: [], selected: [], order: 'asc', orderBy: 'name', rowsPerPage: 10, page: 0, refresh: () => {} } }, exec: { type: TYPE_EXEC, state: EXEC_STATE_IDLE, scenario: { name: NO_SCENARIO_NAME }, vis: { type: TYPE_EXEC, network: {}, options: {}, data: { nodes: [], edges: [] }, showConfig: false }, table: { data: [], selected: [], order: 'asc', orderBy: 'name', rowsPerPage: 10, page: 0, refresh: () => {} } }, settings: { debug: false } }; // Attempting to load the meep (state) from localStorage first. // If not found, initialize the Redux store with the above meep object. // Will mode that code out when references to DOM elements are factored out (VIS stuff) // function createState(meepObject) { // var state = JSON.parse(JSON.stringify(meepObject)); // delete state.cfg.vis.reportContainer; // delete state.cfg.table.refresh; // delete state.exec.vis.containers; // delete state.exec.table.refresh; // delete state.exec.vis.reportContainer; // state.exec.state = { // scenario: meepObject.exec.state, // corePodsPhases: [], // scenarioPodsPhases: [], // serviceMaps: [] // }; // state.cfg.table.selected = []; // state.cfg.elementConfiguration = { // configuredElement: null, // configurationMode: null // }; // // state.ui = { // // devMode: false, // // currentDialog: '', // // execShowApps: false, // // mainDrawerOpen: true // // }; // return state; // } // Initialize variables and listeners when document ready var loadedUIState = loadUIState(); // let meepUIState = loadedUIState ? loadedUIState : createState(meep); // Uncomment if logger middleware is needed // var logger = store => () => action => { Loading @@ -169,7 +56,6 @@ const meepState = createMeepState({ui: loadedUIState}); const meepStore = createStore(meepReducer, meepState, applyMiddleware(thunk, execDisplayedScenarioMiddleware, fixMetricsValuesMiddleware)); window.meepStore = meepStore; // TODO: fix circularity in store meepStore.subscribe(() => { saveUIState(meepStore.getState().ui); }); Loading Loading
js-apps/meep-frontend/src/js/containers/meep-container.js +1 −1 Original line number Diff line number Diff line Loading @@ -471,7 +471,7 @@ const mapDispatchToProps = dispatch => { cfgChangeTable: (data) => dispatch(cfgChangeTable(data)), execChangeOkToTerminate: (ok) => dispatch(execChangeOkToTerminate(ok)), toggleMainDrawer: () => dispatch(uiToggleMainDrawer()), addMetricsEpoch: (epoch) => dispatch(execAddMetricsEpoch(epoch)), addMetricsEpoch: (epoch) => dispatch(execAddMetricsEpoch(epoch)) }; }; Loading
js-apps/meep-frontend/src/js/meep-controller.js +0 −114 Original line number Diff line number Diff line Loading @@ -30,8 +30,6 @@ import meepReducer from './state/meep-reducer'; import { execDisplayedScenarioMiddleware } from './middlewares/exec-displayed-scenario-middleware'; import { fixMetricsValuesMiddleware } from './middlewares/fix-metrics-values-middleware'; // To uncomment when save state is fixed import { saveUIState, loadUIState Loading @@ -44,119 +42,8 @@ import { // UI Components import MeepContainer from './containers/meep-container'; // Constants import { TYPE_CFG, TYPE_EXEC, CFG_STATE_IDLE, EXEC_STATE_IDLE, NO_SCENARIO_NAME, PAGE_CONFIGURE } from './meep-constants'; import { createNewScenario } from './util/scenario-utils'; // MEEP Controller Frontend state information const meep = { ui: { page: PAGE_CONFIGURE }, cfg: { type: TYPE_CFG, state: CFG_STATE_IDLE, scenario: createNewScenario(NO_SCENARIO_NAME), vis: { type: TYPE_CFG, network: {}, options: {}, data: { nodes: [], edges: [] }, showConfig: false }, table: { data: [], selected: [], order: 'asc', orderBy: 'name', rowsPerPage: 10, page: 0, refresh: () => {} } }, exec: { type: TYPE_EXEC, state: EXEC_STATE_IDLE, scenario: { name: NO_SCENARIO_NAME }, vis: { type: TYPE_EXEC, network: {}, options: {}, data: { nodes: [], edges: [] }, showConfig: false }, table: { data: [], selected: [], order: 'asc', orderBy: 'name', rowsPerPage: 10, page: 0, refresh: () => {} } }, settings: { debug: false } }; // Attempting to load the meep (state) from localStorage first. // If not found, initialize the Redux store with the above meep object. // Will mode that code out when references to DOM elements are factored out (VIS stuff) // function createState(meepObject) { // var state = JSON.parse(JSON.stringify(meepObject)); // delete state.cfg.vis.reportContainer; // delete state.cfg.table.refresh; // delete state.exec.vis.containers; // delete state.exec.table.refresh; // delete state.exec.vis.reportContainer; // state.exec.state = { // scenario: meepObject.exec.state, // corePodsPhases: [], // scenarioPodsPhases: [], // serviceMaps: [] // }; // state.cfg.table.selected = []; // state.cfg.elementConfiguration = { // configuredElement: null, // configurationMode: null // }; // // state.ui = { // // devMode: false, // // currentDialog: '', // // execShowApps: false, // // mainDrawerOpen: true // // }; // return state; // } // Initialize variables and listeners when document ready var loadedUIState = loadUIState(); // let meepUIState = loadedUIState ? loadedUIState : createState(meep); // Uncomment if logger middleware is needed // var logger = store => () => action => { Loading @@ -169,7 +56,6 @@ const meepState = createMeepState({ui: loadedUIState}); const meepStore = createStore(meepReducer, meepState, applyMiddleware(thunk, execDisplayedScenarioMiddleware, fixMetricsValuesMiddleware)); window.meepStore = meepStore; // TODO: fix circularity in store meepStore.subscribe(() => { saveUIState(meepStore.getState().ui); }); Loading