summaryrefslogtreecommitdiff
path: root/src/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'src/reducers')
-rw-r--r--src/reducers/index.js4
-rw-r--r--src/reducers/objects.js2
-rw-r--r--src/reducers/simulations.js (renamed from src/reducers/projects.js)26
3 files changed, 14 insertions, 18 deletions
diff --git a/src/reducers/index.js b/src/reducers/index.js
index 71379a6f..bfafaedd 100644
--- a/src/reducers/index.js
+++ b/src/reducers/index.js
@@ -1,13 +1,13 @@
import {combineReducers} from "redux";
import {auth} from "./auth";
import {objects} from "./objects";
-import {authorizationsOfCurrentUser, authVisibilityFilter, newProjectModalVisible} from "./projects";
+import {authorizationsOfCurrentUser, authVisibilityFilter, newSimulationModalVisible} from "./simulations";
const rootReducer = combineReducers({
auth,
objects,
authorizationsOfCurrentUser,
- newProjectModalVisible,
+ newSimulationModalVisible,
authVisibilityFilter,
});
diff --git a/src/reducers/objects.js b/src/reducers/objects.js
index 69e68ca7..40bd3524 100644
--- a/src/reducers/objects.js
+++ b/src/reducers/objects.js
@@ -1,5 +1,5 @@
import {combineReducers} from "redux";
-import {ADD_TO_AUTHORIZATION_STORE, ADD_TO_SIMULATION_STORE, ADD_TO_USER_STORE} from "../actions/object-stores";
+import {ADD_TO_AUTHORIZATION_STORE, ADD_TO_SIMULATION_STORE, ADD_TO_USER_STORE} from "../actions/objects";
export const objects = combineReducers({
simulations,
diff --git a/src/reducers/projects.js b/src/reducers/simulations.js
index ba3c792d..5a34ee7f 100644
--- a/src/reducers/projects.js
+++ b/src/reducers/simulations.js
@@ -1,37 +1,33 @@
import {
- ADD_PROJECT,
- CLOSE_NEW_PROJECT_MODAL,
- DELETE_PROJECT,
- OPEN_NEW_PROJECT_MODAL,
+ ADD_SIMULATION_SUCCEEDED,
+ CLOSE_NEW_SIMULATION_MODAL,
+ DELETE_SIMULATION,
+ OPEN_NEW_SIMULATION_MODAL,
SET_AUTH_VISIBILITY_FILTER
-} from "../actions/projects";
+} from "../actions/simulations";
import {FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED} from "../actions/users";
export function authorizationsOfCurrentUser(state = [], action) {
switch (action.type) {
case FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED:
return action.authorizationsOfCurrentUser;
- case ADD_PROJECT:
+ case ADD_SIMULATION_SUCCEEDED:
return [
...state,
- {
- userId: -1,
- simulation: {name: action.name, datetimeLastEdited: "2017-08-06T12:43:00", id: state.length},
- authorizationLevel: "OWN"
- }
+ action.authorization
];
- case DELETE_PROJECT:
+ case DELETE_SIMULATION:
return [];
default:
return state;
}
}
-export function newProjectModalVisible(state = false, action) {
+export function newSimulationModalVisible(state = false, action) {
switch (action.type) {
- case OPEN_NEW_PROJECT_MODAL:
+ case OPEN_NEW_SIMULATION_MODAL:
return true;
- case CLOSE_NEW_PROJECT_MODAL:
+ case CLOSE_NEW_SIMULATION_MODAL:
return false;
default:
return state;