summaryrefslogtreecommitdiff
path: root/src/reducers
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-07 11:38:42 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:58 +0200
commite9909159dc5db91eda12437e18c1474cae848af7 (patch)
treef34e0ca56b666f6a4ab1022e58a6dcd84b779725 /src/reducers
parentd5a92d3006561fd631279b68b23a1f8075b28bb8 (diff)
Implement first machine slot listing
Diffstat (limited to 'src/reducers')
-rw-r--r--src/reducers/construction.js12
-rw-r--r--src/reducers/interaction-level.js8
-rw-r--r--src/reducers/modals.js6
3 files changed, 16 insertions, 10 deletions
diff --git a/src/reducers/construction.js b/src/reducers/construction.js
index 33485842..772135ff 100644
--- a/src/reducers/construction.js
+++ b/src/reducers/construction.js
@@ -3,8 +3,8 @@ import {
CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED,
FINISH_NEW_ROOM_CONSTRUCTION,
START_NEW_ROOM_CONSTRUCTION_SUCCEEDED,
- START_OBJECT_CONSTRUCTION,
- STOP_OBJECT_CONSTRUCTION
+ START_RACK_CONSTRUCTION,
+ STOP_RACK_CONSTRUCTION
} from "../actions/topology";
export function currentRoomInConstruction(state = -1, action) {
@@ -19,11 +19,11 @@ export function currentRoomInConstruction(state = -1, action) {
}
}
-export function inObjectConstructionMode(state = false, action) {
+export function inRackConstructionMode(state = false, action) {
switch (action.type) {
- case START_OBJECT_CONSTRUCTION:
+ case START_RACK_CONSTRUCTION:
return true;
- case STOP_OBJECT_CONSTRUCTION:
+ case STOP_RACK_CONSTRUCTION:
return false;
default:
return state;
@@ -32,5 +32,5 @@ export function inObjectConstructionMode(state = false, action) {
export const construction = combineReducers({
currentRoomInConstruction,
- inObjectConstructionMode,
+ inRackConstructionMode,
});
diff --git a/src/reducers/interaction-level.js b/src/reducers/interaction-level.js
index 5ca917c7..b6287aac 100644
--- a/src/reducers/interaction-level.js
+++ b/src/reducers/interaction-level.js
@@ -1,7 +1,7 @@
import {
GO_DOWN_ONE_INTERACTION_LEVEL,
GO_FROM_BUILDING_TO_ROOM,
- GO_FROM_ROOM_TO_OBJECT
+ GO_FROM_ROOM_TO_RACK
} from "../actions/interaction-level";
export function interactionLevel(state = {mode: "BUILDING"}, action) {
@@ -11,9 +11,9 @@ export function interactionLevel(state = {mode: "BUILDING"}, action) {
mode: "ROOM",
roomId: action.roomId
};
- case GO_FROM_ROOM_TO_OBJECT:
+ case GO_FROM_ROOM_TO_RACK:
return {
- mode: "OBJECT",
+ mode: "RACK",
roomId: state.roomId,
tileId: action.tileId
};
@@ -22,7 +22,7 @@ export function interactionLevel(state = {mode: "BUILDING"}, action) {
return {
mode: "BUILDING"
};
- } else if (state.mode === "OBJECT") {
+ } else if (state.mode === "RACK") {
return {
mode: "ROOM",
roomId: state.roomId
diff --git a/src/reducers/modals.js b/src/reducers/modals.js
index f6d1efea..7a89dae5 100644
--- a/src/reducers/modals.js
+++ b/src/reducers/modals.js
@@ -2,9 +2,13 @@ import {combineReducers} from "redux";
import {CLOSE_DELETE_PROFILE_MODAL, OPEN_DELETE_PROFILE_MODAL} from "../actions/modals/profile";
import {CLOSE_NEW_SIMULATION_MODAL, OPEN_NEW_SIMULATION_MODAL} from "../actions/modals/simulations";
import {
+ CLOSE_DELETE_RACK_MODAL,
CLOSE_DELETE_ROOM_MODAL,
+ CLOSE_EDIT_RACK_NAME_MODAL,
CLOSE_EDIT_ROOM_NAME_MODAL,
+ OPEN_DELETE_RACK_MODAL,
OPEN_DELETE_ROOM_MODAL,
+ OPEN_EDIT_RACK_NAME_MODAL,
OPEN_EDIT_ROOM_NAME_MODAL
} from "../actions/modals/topology";
@@ -26,4 +30,6 @@ export const modals = combineReducers({
deleteProfileModalVisible: modal(OPEN_DELETE_PROFILE_MODAL, CLOSE_DELETE_PROFILE_MODAL),
editRoomNameModalVisible: modal(OPEN_EDIT_ROOM_NAME_MODAL, CLOSE_EDIT_ROOM_NAME_MODAL),
deleteRoomModalVisible: modal(OPEN_DELETE_ROOM_MODAL, CLOSE_DELETE_ROOM_MODAL),
+ editRackNameModalVisible: modal(OPEN_EDIT_RACK_NAME_MODAL, CLOSE_EDIT_RACK_NAME_MODAL),
+ deleteRackModalVisible: modal(OPEN_DELETE_RACK_MODAL, CLOSE_DELETE_RACK_MODAL),
});