diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-11-08 10:28:33 +0100 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-11-08 10:28:33 +0100 |
| commit | 1f4616cbf9c82e4976d1f4b4c018d5e9ff83ad10 (patch) | |
| tree | 114400610f6d9708f774ac8af8954588bbf50fb3 /src/reducers | |
| parent | 2f71cb1c9fd3e649a1f0e6f713922a73372f064e (diff) | |
Implement room editing
Allows for rooms to be edited from the room context menu.
Fixes #24
Diffstat (limited to 'src/reducers')
| -rw-r--r-- | src/reducers/construction-mode.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/reducers/construction-mode.js b/src/reducers/construction-mode.js index c4c0c010..b5e6e781 100644 --- a/src/reducers/construction-mode.js +++ b/src/reducers/construction-mode.js @@ -1,20 +1,30 @@ -import {combineReducers} from "redux"; -import {OPEN_EXPERIMENT_SUCCEEDED} from "../actions/experiments"; -import {GO_DOWN_ONE_INTERACTION_LEVEL} from "../actions/interaction-level"; +import { combineReducers } from "redux"; +import { OPEN_EXPERIMENT_SUCCEEDED } from "../actions/experiments"; +import { GO_DOWN_ONE_INTERACTION_LEVEL } from "../actions/interaction-level"; import { CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED, FINISH_NEW_ROOM_CONSTRUCTION, - START_NEW_ROOM_CONSTRUCTION_SUCCEEDED + FINISH_ROOM_EDIT, + START_NEW_ROOM_CONSTRUCTION_SUCCEEDED, + START_ROOM_EDIT } from "../actions/topology/building"; -import {START_RACK_CONSTRUCTION, STOP_RACK_CONSTRUCTION} from "../actions/topology/room"; +import { + DELETE_ROOM, + START_RACK_CONSTRUCTION, + STOP_RACK_CONSTRUCTION +} from "../actions/topology/room"; export function currentRoomInConstruction(state = -1, action) { switch (action.type) { case START_NEW_ROOM_CONSTRUCTION_SUCCEEDED: return action.roomId; + case START_ROOM_EDIT: + return action.roomId; case CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED: case FINISH_NEW_ROOM_CONSTRUCTION: case OPEN_EXPERIMENT_SUCCEEDED: + case FINISH_ROOM_EDIT: + case DELETE_ROOM: return -1; default: return state; |
