diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-25 21:53:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-25 21:53:42 +0200 |
| commit | 128f76f7fd7c8abb41a3bbbd9f1980cbc20ae7a5 (patch) | |
| tree | add513890005233a7784466797bfe6f5052e9eeb /opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room | |
| parent | 128a1db017545597a5c035b7960eb3fd36b5f987 (diff) | |
| parent | 57b54b59ed74ec37338ae26b3864d051255aba49 (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/containers/app/sidebars/topology/room')
6 files changed, 99 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js new file mode 100644 index 00000000..4c1ab99d --- /dev/null +++ b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js @@ -0,0 +1,13 @@ +import { connect } from 'react-redux' +import { goDownOneInteractionLevel } from '../../../../../actions/interaction-level' +import BackToBuildingComponent from '../../../../../components/app/sidebars/topology/room/BackToBuildingComponent' + +const mapDispatchToProps = (dispatch) => { + return { + onClick: () => dispatch(goDownOneInteractionLevel()), + } +} + +const BackToBuildingContainer = connect(undefined, mapDispatchToProps)(BackToBuildingComponent) + +export default BackToBuildingContainer diff --git a/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js new file mode 100644 index 00000000..636fa5c5 --- /dev/null +++ b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js @@ -0,0 +1,13 @@ +import { connect } from 'react-redux' +import { openDeleteRoomModal } from '../../../../../actions/modals/topology' +import DeleteRoomComponent from '../../../../../components/app/sidebars/topology/room/DeleteRoomComponent' + +const mapDispatchToProps = (dispatch) => { + return { + onClick: () => dispatch(openDeleteRoomModal()), + } +} + +const DeleteRoomContainer = connect(undefined, mapDispatchToProps)(DeleteRoomComponent) + +export default DeleteRoomContainer diff --git a/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/EditRoomContainer.js b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/EditRoomContainer.js new file mode 100644 index 00000000..d17a45d1 --- /dev/null +++ b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/EditRoomContainer.js @@ -0,0 +1,21 @@ +import { connect } from 'react-redux' +import { finishRoomEdit, startRoomEdit } from '../../../../../actions/topology/building' +import EditRoomComponent from '../../../../../components/app/sidebars/topology/room/EditRoomComponent' + +const mapStateToProps = (state) => { + return { + isEditing: state.construction.currentRoomInConstruction !== '-1', + isInRackConstructionMode: state.construction.inRackConstructionMode, + } +} + +const mapDispatchToProps = (dispatch) => { + return { + onEdit: () => dispatch(startRoomEdit()), + onFinish: () => dispatch(finishRoomEdit()), + } +} + +const EditRoomContainer = connect(mapStateToProps, mapDispatchToProps)(EditRoomComponent) + +export default EditRoomContainer diff --git a/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RackConstructionContainer.js b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RackConstructionContainer.js new file mode 100644 index 00000000..cd8319de --- /dev/null +++ b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RackConstructionContainer.js @@ -0,0 +1,21 @@ +import { connect } from 'react-redux' +import { startRackConstruction, stopRackConstruction } from '../../../../../actions/topology/room' +import RackConstructionComponent from '../../../../../components/app/sidebars/topology/room/RackConstructionComponent' + +const mapStateToProps = (state) => { + return { + inRackConstructionMode: state.construction.inRackConstructionMode, + isEditingRoom: state.construction.currentRoomInConstruction !== '-1', + } +} + +const mapDispatchToProps = (dispatch) => { + return { + onStart: () => dispatch(startRackConstruction()), + onStop: () => dispatch(stopRackConstruction()), + } +} + +const RackConstructionContainer = connect(mapStateToProps, mapDispatchToProps)(RackConstructionComponent) + +export default RackConstructionContainer diff --git a/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RoomNameContainer.js b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RoomNameContainer.js new file mode 100644 index 00000000..cab16016 --- /dev/null +++ b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RoomNameContainer.js @@ -0,0 +1,19 @@ +import { connect } from 'react-redux' +import { openEditRoomNameModal } from '../../../../../actions/modals/topology' +import RoomNameComponent from '../../../../../components/app/sidebars/topology/room/RoomNameComponent' + +const mapStateToProps = (state) => { + return { + roomName: state.objects.room[state.interactionLevel.roomId].name, + } +} + +const mapDispatchToProps = (dispatch) => { + return { + onEdit: () => dispatch(openEditRoomNameModal()), + } +} + +const RoomNameContainer = connect(mapStateToProps, mapDispatchToProps)(RoomNameComponent) + +export default RoomNameContainer diff --git a/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js new file mode 100644 index 00000000..8c3ca8ab --- /dev/null +++ b/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js @@ -0,0 +1,12 @@ +import { connect } from 'react-redux' +import RoomSidebarComponent from '../../../../../components/app/sidebars/topology/room/RoomSidebarComponent' + +const mapStateToProps = (state) => { + return { + roomId: state.interactionLevel.roomId, + } +} + +const RoomSidebarContainer = connect(mapStateToProps)(RoomSidebarComponent) + +export default RoomSidebarContainer |
