diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-07 19:27:13 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:58 +0200 |
| commit | 8218c3d3c21bfa7c4f3ee4872722b9b1261576fb (patch) | |
| tree | 16b8d0b8813aed0c846310a3fa4a01bd8ad18c60 /src/containers/sidebars/topology | |
| parent | a7d2ac48224c4226003d67f77143738cc72aa016 (diff) | |
Add machine mode with title and delete options
Diffstat (limited to 'src/containers/sidebars/topology')
4 files changed, 49 insertions, 2 deletions
diff --git a/src/containers/sidebars/topology/machine/BackToRackContainer.js b/src/containers/sidebars/topology/machine/BackToRackContainer.js new file mode 100644 index 00000000..9f31fab9 --- /dev/null +++ b/src/containers/sidebars/topology/machine/BackToRackContainer.js @@ -0,0 +1,16 @@ +import {connect} from "react-redux"; +import {goDownOneInteractionLevel} from "../../../../actions/interaction-level"; +import BackToRackComponent from "../../../../components/sidebars/topology/machine/BackToRackComponent"; + +const mapDispatchToProps = dispatch => { + return { + onClick: () => dispatch(goDownOneInteractionLevel()), + }; +}; + +const BackToRackContainer = connect( + undefined, + mapDispatchToProps +)(BackToRackComponent); + +export default BackToRackContainer; diff --git a/src/containers/sidebars/topology/machine/DeleteMachineContainer.js b/src/containers/sidebars/topology/machine/DeleteMachineContainer.js new file mode 100644 index 00000000..0c18598b --- /dev/null +++ b/src/containers/sidebars/topology/machine/DeleteMachineContainer.js @@ -0,0 +1,16 @@ +import {connect} from "react-redux"; +import {openDeleteMachineModal} from "../../../../actions/modals/topology"; +import DeleteMachineComponent from "../../../../components/sidebars/topology/machine/DeleteMachineComponent"; + +const mapDispatchToProps = dispatch => { + return { + onClick: () => dispatch(openDeleteMachineModal()), + }; +}; + +const DeleteMachineContainer = connect( + undefined, + mapDispatchToProps +)(DeleteMachineComponent); + +export default DeleteMachineContainer; diff --git a/src/containers/sidebars/topology/machine/MachineNameContainer.js b/src/containers/sidebars/topology/machine/MachineNameContainer.js new file mode 100644 index 00000000..8e5413ef --- /dev/null +++ b/src/containers/sidebars/topology/machine/MachineNameContainer.js @@ -0,0 +1,14 @@ +import {connect} from "react-redux"; +import MachineNameComponent from "../../../../components/sidebars/topology/machine/MachineNameComponent"; + +const mapStateToProps = state => { + return { + position: state.interactionLevel.position, + }; +}; + +const MachineNameContainer = connect( + mapStateToProps +)(MachineNameComponent); + +export default MachineNameContainer; diff --git a/src/containers/sidebars/topology/rack/MachineContainer.js b/src/containers/sidebars/topology/rack/MachineContainer.js index 74a0bfbc..21ab06c4 100644 --- a/src/containers/sidebars/topology/rack/MachineContainer.js +++ b/src/containers/sidebars/topology/rack/MachineContainer.js @@ -1,4 +1,5 @@ import {connect} from "react-redux"; +import {goFromRackToMachine} from "../../../../actions/interaction-level"; import MachineComponent from "../../../../components/sidebars/topology/rack/MachineComponent"; const mapStateToProps = (state, ownProps) => { @@ -7,9 +8,9 @@ const mapStateToProps = (state, ownProps) => { }; }; -const mapDispatchToProps = dispatch => { +const mapDispatchToProps = (dispatch, ownProps) => { return { - onClick: () => undefined, // TODO implement transition to MACHINE mode + onClick: () => dispatch(goFromRackToMachine(ownProps.position)), }; }; |
