summaryrefslogtreecommitdiff
path: root/src/containers/sidebars
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/sidebars')
-rw-r--r--src/containers/sidebars/topology/machine/BackToRackContainer.js16
-rw-r--r--src/containers/sidebars/topology/machine/DeleteMachineContainer.js16
-rw-r--r--src/containers/sidebars/topology/machine/MachineNameContainer.js14
-rw-r--r--src/containers/sidebars/topology/rack/MachineContainer.js5
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)),
};
};