diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-10 10:21:46 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:01 +0200 |
| commit | 8aa174e70c01631ae4e00a6d208966fcd77cf972 (patch) | |
| tree | 35ec6527e8d7a0b4093e18c8cb501c293a18b5eb /frontend/src/actions | |
| parent | 607e8c72d85bf79dcd9bf28df96b239e2764bc30 (diff) | |
Add implementation of portfolio and scenario UI structure
Diffstat (limited to 'frontend/src/actions')
| -rw-r--r-- | frontend/src/actions/experiments.js | 33 | ||||
| -rw-r--r-- | frontend/src/actions/modals/experiments.js | 14 | ||||
| -rw-r--r-- | frontend/src/actions/modals/portfolios.js | 14 | ||||
| -rw-r--r-- | frontend/src/actions/modals/scenarios.js | 14 | ||||
| -rw-r--r-- | frontend/src/actions/portfolios.js | 41 | ||||
| -rw-r--r-- | frontend/src/actions/scenarios.js | 43 | ||||
| -rw-r--r-- | frontend/src/actions/topology/building.js | 7 |
7 files changed, 112 insertions, 54 deletions
diff --git a/frontend/src/actions/experiments.js b/frontend/src/actions/experiments.js deleted file mode 100644 index dce48a09..00000000 --- a/frontend/src/actions/experiments.js +++ /dev/null @@ -1,33 +0,0 @@ -export const FETCH_EXPERIMENTS_OF_PROJECT = 'FETCH_EXPERIMENTS_OF_PROJECT' -export const ADD_EXPERIMENT = 'ADD_EXPERIMENT' -export const DELETE_EXPERIMENT = 'DELETE_EXPERIMENT' -export const OPEN_EXPERIMENT_SUCCEEDED = 'OPEN_EXPERIMENT_SUCCEEDED' - -export function fetchExperimentsOfProject(projectId) { - return { - type: FETCH_EXPERIMENTS_OF_PROJECT, - projectId, - } -} - -export function addExperiment(experiment) { - return { - type: ADD_EXPERIMENT, - experiment, - } -} - -export function deleteExperiment(id) { - return { - type: DELETE_EXPERIMENT, - id, - } -} - -export function openExperimentSucceeded(projectId, experimentId) { - return { - type: OPEN_EXPERIMENT_SUCCEEDED, - projectId, - experimentId, - } -} diff --git a/frontend/src/actions/modals/experiments.js b/frontend/src/actions/modals/experiments.js deleted file mode 100644 index 37f1922f..00000000 --- a/frontend/src/actions/modals/experiments.js +++ /dev/null @@ -1,14 +0,0 @@ -export const OPEN_NEW_EXPERIMENT_MODAL = 'OPEN_NEW_EXPERIMENT_MODAL' -export const CLOSE_NEW_EXPERIMENT_MODAL = 'CLOSE_EXPERIMENT_MODAL' - -export function openNewExperimentModal() { - return { - type: OPEN_NEW_EXPERIMENT_MODAL, - } -} - -export function closeNewExperimentModal() { - return { - type: CLOSE_NEW_EXPERIMENT_MODAL, - } -} diff --git a/frontend/src/actions/modals/portfolios.js b/frontend/src/actions/modals/portfolios.js new file mode 100644 index 00000000..f6dce2e3 --- /dev/null +++ b/frontend/src/actions/modals/portfolios.js @@ -0,0 +1,14 @@ +export const OPEN_NEW_PORTFOLIO_MODAL = 'OPEN_NEW_PORTFOLIO_MODAL' +export const CLOSE_NEW_PORTFOLIO_MODAL = 'CLOSE_PORTFOLIO_MODAL' + +export function openNewPortfolioModal() { + return { + type: OPEN_NEW_PORTFOLIO_MODAL, + } +} + +export function closeNewPortfolioModal() { + return { + type: CLOSE_NEW_PORTFOLIO_MODAL, + } +} diff --git a/frontend/src/actions/modals/scenarios.js b/frontend/src/actions/modals/scenarios.js new file mode 100644 index 00000000..b71cb27b --- /dev/null +++ b/frontend/src/actions/modals/scenarios.js @@ -0,0 +1,14 @@ +export const OPEN_NEW_SCENARIO_MODAL = 'OPEN_NEW_SCENARIO_MODAL' +export const CLOSE_NEW_SCENARIO_MODAL = 'CLOSE_SCENARIO_MODAL' + +export function openNewScenarioModal() { + return { + type: OPEN_NEW_SCENARIO_MODAL, + } +} + +export function closeNewScenarioModal() { + return { + type: CLOSE_NEW_SCENARIO_MODAL, + } +} diff --git a/frontend/src/actions/portfolios.js b/frontend/src/actions/portfolios.js new file mode 100644 index 00000000..d37886d8 --- /dev/null +++ b/frontend/src/actions/portfolios.js @@ -0,0 +1,41 @@ +export const ADD_PORTFOLIO = 'ADD_PORTFOLIO' +export const UPDATE_PORTFOLIO = 'UPDATE_PORTFOLIO' +export const DELETE_PORTFOLIO = 'DELETE_PORTFOLIO' +export const OPEN_PORTFOLIO_SUCCEEDED = 'OPEN_PORTFOLIO_SUCCEEDED' +export const SET_CURRENT_PORTFOLIO = 'SET_CURRENT_PORTFOLIO' + +export function addPortfolio(portfolio) { + return { + type: ADD_PORTFOLIO, + portfolio, + } +} + +export function updatePortfolio(portfolio) { + return { + type: UPDATE_PORTFOLIO, + portfolio, + } +} + +export function deletePortfolio(id) { + return { + type: DELETE_PORTFOLIO, + id, + } +} + +export function openPortfolioSucceeded(projectId, portfolioId) { + return { + type: OPEN_PORTFOLIO_SUCCEEDED, + projectId, + portfolioId, + } +} + +export function setCurrentPortfolio(portfolioId) { + return { + type: SET_CURRENT_PORTFOLIO, + portfolioId, + } +} diff --git a/frontend/src/actions/scenarios.js b/frontend/src/actions/scenarios.js new file mode 100644 index 00000000..c8a90762 --- /dev/null +++ b/frontend/src/actions/scenarios.js @@ -0,0 +1,43 @@ +export const ADD_SCENARIO = 'ADD_SCENARIO' +export const UPDATE_SCENARIO = 'UPDATE_SCENARIO' +export const DELETE_SCENARIO = 'DELETE_SCENARIO' +export const OPEN_SCENARIO_SUCCEEDED = 'OPEN_SCENARIO_SUCCEEDED' +export const SET_CURRENT_SCENARIO = 'SET_CURRENT_SCENARIO' + +export function addScenario(scenario) { + return { + type: ADD_SCENARIO, + scenario, + } +} + +export function updateScenario(scenario) { + return { + type: UPDATE_SCENARIO, + scenario, + } +} + +export function deleteScenario(id) { + return { + type: DELETE_SCENARIO, + id, + } +} + +export function openScenarioSucceeded(projectId, portfolioId, scenarioId) { + return { + type: OPEN_SCENARIO_SUCCEEDED, + projectId, + portfolioId, + scenarioId, + } +} + +export function setCurrentScenario(portfolioId, scenarioId) { + return { + type: SET_CURRENT_SCENARIO, + portfolioId, + scenarioId, + } +} diff --git a/frontend/src/actions/topology/building.js b/frontend/src/actions/topology/building.js index da2dc311..d6c53af9 100644 --- a/frontend/src/actions/topology/building.js +++ b/frontend/src/actions/topology/building.js @@ -1,5 +1,4 @@ export const SET_CURRENT_TOPOLOGY = 'SET_CURRENT_TOPOLOGY' -export const RESET_CURRENT_TOPOLOGY = 'RESET_CURRENT_TOPOLOGY' export const START_NEW_ROOM_CONSTRUCTION = 'START_NEW_ROOM_CONSTRUCTION' export const START_NEW_ROOM_CONSTRUCTION_SUCCEEDED = 'START_NEW_ROOM_CONSTRUCTION_SUCCEEDED' @@ -19,12 +18,6 @@ export function setCurrentTopology(topologyId) { } } -export function resetCurrentTopology() { - return { - type: RESET_CURRENT_TOPOLOGY, - } -} - export function startNewRoomConstruction() { return { type: START_NEW_ROOM_CONSTRUCTION, |
