From e9909159dc5db91eda12437e18c1474cae848af7 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 7 Sep 2017 11:38:42 +0200 Subject: Implement first machine slot listing --- src/reducers/construction.js | 12 ++++++------ src/reducers/interaction-level.js | 8 ++++---- src/reducers/modals.js | 6 ++++++ 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/reducers') 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), }); -- cgit v1.2.3