summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/actions/scenarios.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-25 21:53:42 +0200
committerGitHub <noreply@github.com>2021-04-25 21:53:42 +0200
commit128f76f7fd7c8abb41a3bbbd9f1980cbc20ae7a5 (patch)
treeadd513890005233a7784466797bfe6f5052e9eeb /opendc-web/opendc-web-ui/src/actions/scenarios.js
parent128a1db017545597a5c035b7960eb3fd36b5f987 (diff)
parent57b54b59ed74ec37338ae26b3864d051255aba49 (diff)
build: Flatten project structure
This change updates the project structure to become flattened. Previously, the simulator, frontend and API each lived into their own directory. With this change, all modules of the project live in the top-level directory of the repository.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/actions/scenarios.js')
-rw-r--r--opendc-web/opendc-web-ui/src/actions/scenarios.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-ui/src/actions/scenarios.js b/opendc-web/opendc-web-ui/src/actions/scenarios.js
new file mode 100644
index 00000000..c8a90762
--- /dev/null
+++ b/opendc-web/opendc-web-ui/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,
+ }
+}