summaryrefslogtreecommitdiff
path: root/frontend/src/containers
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/containers')
-rw-r--r--frontend/src/containers/app/map/DatacenterContainer.js24
-rw-r--r--frontend/src/containers/app/map/GrayContainer.js18
-rw-r--r--frontend/src/containers/app/map/MapStage.js46
-rw-r--r--frontend/src/containers/app/map/RackContainer.js46
-rw-r--r--frontend/src/containers/app/map/RackEnergyFillContainer.js70
-rw-r--r--frontend/src/containers/app/map/RackSpaceFillContainer.js24
-rw-r--r--frontend/src/containers/app/map/RoomContainer.js30
-rw-r--r--frontend/src/containers/app/map/TileContainer.js66
-rw-r--r--frontend/src/containers/app/map/WallContainer.js20
-rw-r--r--frontend/src/containers/app/map/controls/ScaleIndicatorContainer.js18
-rw-r--r--frontend/src/containers/app/map/controls/ZoomControlContainer.js28
-rw-r--r--frontend/src/containers/app/map/layers/MapLayer.js18
-rw-r--r--frontend/src/containers/app/map/layers/ObjectHoverLayer.js54
-rw-r--r--frontend/src/containers/app/map/layers/RoomHoverLayer.js88
-rw-r--r--frontend/src/containers/app/sidebars/elements/LoadBarContainer.js50
-rw-r--r--frontend/src/containers/app/sidebars/elements/LoadChartContainer.js50
-rw-r--r--frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js62
-rw-r--r--frontend/src/containers/app/sidebars/simulation/LoadMetricContainer.js16
-rw-r--r--frontend/src/containers/app/sidebars/simulation/TaskContainer.js40
-rw-r--r--frontend/src/containers/app/sidebars/simulation/TraceContainer.js40
-rw-r--r--frontend/src/containers/app/sidebars/topology/TopologySidebar.js16
-rw-r--r--frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js19
-rw-r--r--frontend/src/containers/app/sidebars/topology/building/NewRoomConstructionContainer.js39
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/BackToRackContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/DeleteMachineContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/MachineNameContainer.js16
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js26
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js28
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js30
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js28
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/UnitTabsContainer.js16
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/BackToRoomContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/DeleteRackContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/EmptySlotContainer.js28
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js60
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js22
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js34
-rw-r--r--frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js18
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js36
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js36
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/RoomNameContainer.js28
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js20
-rw-r--r--frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js16
-rw-r--r--frontend/src/containers/app/timeline/PlayButtonContainer.js38
-rw-r--r--frontend/src/containers/app/timeline/TimelineContainer.js62
-rw-r--r--frontend/src/containers/app/timeline/TimelineControlsContainer.js54
-rw-r--r--frontend/src/containers/app/timeline/TimelineLabelsContainer.js20
-rw-r--r--frontend/src/containers/auth/Login.js100
-rw-r--r--frontend/src/containers/auth/Logout.js18
-rw-r--r--frontend/src/containers/auth/ProfileName.js18
-rw-r--r--frontend/src/containers/experiments/ExperimentListContainer.js44
-rw-r--r--frontend/src/containers/experiments/ExperimentRowContainer.js44
-rw-r--r--frontend/src/containers/experiments/NewExperimentButtonContainer.js20
-rw-r--r--frontend/src/containers/modals/DeleteMachineModal.js54
-rw-r--r--frontend/src/containers/modals/DeleteProfileModal.js54
-rw-r--r--frontend/src/containers/modals/DeleteRackModal.js54
-rw-r--r--frontend/src/containers/modals/DeleteRoomModal.js54
-rw-r--r--frontend/src/containers/modals/EditRackNameModal.js68
-rw-r--r--frontend/src/containers/modals/EditRoomNameModal.js64
-rw-r--r--frontend/src/containers/modals/NewExperimentModal.js62
-rw-r--r--frontend/src/containers/modals/NewSimulationModal.js54
-rw-r--r--frontend/src/containers/simulations/FilterLink.js26
-rw-r--r--frontend/src/containers/simulations/NewSimulationButtonContainer.js20
-rw-r--r--frontend/src/containers/simulations/SimulationActions.js31
-rw-r--r--frontend/src/containers/simulations/VisibleSimulationAuthList.js70
67 files changed, 1237 insertions, 1236 deletions
diff --git a/frontend/src/containers/app/map/DatacenterContainer.js b/frontend/src/containers/app/map/DatacenterContainer.js
index 125739f3..9ed1d38c 100644
--- a/frontend/src/containers/app/map/DatacenterContainer.js
+++ b/frontend/src/containers/app/map/DatacenterContainer.js
@@ -1,17 +1,17 @@
-import { connect } from "react-redux";
-import DatacenterGroup from "../../../components/app/map/groups/DatacenterGroup";
+import { connect } from 'react-redux'
+import DatacenterGroup from '../../../components/app/map/groups/DatacenterGroup'
const mapStateToProps = state => {
- if (state.currentDatacenterId === -1) {
- return {};
- }
+ if (state.currentDatacenterId === -1) {
+ return {}
+ }
- return {
- datacenter: state.objects.datacenter[state.currentDatacenterId],
- interactionLevel: state.interactionLevel
- };
-};
+ return {
+ datacenter: state.objects.datacenter[state.currentDatacenterId],
+ interactionLevel: state.interactionLevel,
+ }
+}
-const DatacenterContainer = connect(mapStateToProps)(DatacenterGroup);
+const DatacenterContainer = connect(mapStateToProps)(DatacenterGroup)
-export default DatacenterContainer;
+export default DatacenterContainer
diff --git a/frontend/src/containers/app/map/GrayContainer.js b/frontend/src/containers/app/map/GrayContainer.js
index d215bf6c..4ae3beac 100644
--- a/frontend/src/containers/app/map/GrayContainer.js
+++ b/frontend/src/containers/app/map/GrayContainer.js
@@ -1,13 +1,13 @@
-import { connect } from "react-redux";
-import { goDownOneInteractionLevel } from "../../../actions/interaction-level";
-import GrayLayer from "../../../components/app/map/elements/GrayLayer";
+import { connect } from 'react-redux'
+import { goDownOneInteractionLevel } from '../../../actions/interaction-level'
+import GrayLayer from '../../../components/app/map/elements/GrayLayer'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(goDownOneInteractionLevel())
- };
-};
+ return {
+ onClick: () => dispatch(goDownOneInteractionLevel()),
+ }
+}
-const GrayContainer = connect(undefined, mapDispatchToProps)(GrayLayer);
+const GrayContainer = connect(undefined, mapDispatchToProps)(GrayLayer)
-export default GrayContainer;
+export default GrayContainer
diff --git a/frontend/src/containers/app/map/MapStage.js b/frontend/src/containers/app/map/MapStage.js
index a8467171..e8abb86f 100644
--- a/frontend/src/containers/app/map/MapStage.js
+++ b/frontend/src/containers/app/map/MapStage.js
@@ -1,31 +1,31 @@
-import { connect } from "react-redux";
+import { connect } from 'react-redux'
import {
- setMapDimensions,
- setMapPositionWithBoundsCheck,
- zoomInOnPosition
-} from "../../../actions/map";
-import MapStageComponent from "../../../components/app/map/MapStageComponent";
+ setMapDimensions,
+ setMapPositionWithBoundsCheck,
+ zoomInOnPosition,
+} from '../../../actions/map'
+import MapStageComponent from '../../../components/app/map/MapStageComponent'
const mapStateToProps = state => {
- return {
- mapPosition: state.map.position,
- mapDimensions: state.map.dimensions
- };
-};
+ return {
+ mapPosition: state.map.position,
+ mapDimensions: state.map.dimensions,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- zoomInOnPosition: (zoomIn, x, y) =>
- dispatch(zoomInOnPosition(zoomIn, x, y)),
- setMapPositionWithBoundsCheck: (x, y) =>
- dispatch(setMapPositionWithBoundsCheck(x, y)),
- setMapDimensions: (width, height) =>
- dispatch(setMapDimensions(width, height))
- };
-};
+ return {
+ zoomInOnPosition: (zoomIn, x, y) =>
+ dispatch(zoomInOnPosition(zoomIn, x, y)),
+ setMapPositionWithBoundsCheck: (x, y) =>
+ dispatch(setMapPositionWithBoundsCheck(x, y)),
+ setMapDimensions: (width, height) =>
+ dispatch(setMapDimensions(width, height)),
+ }
+}
const MapStage = connect(mapStateToProps, mapDispatchToProps)(
- MapStageComponent
-);
+ MapStageComponent,
+)
-export default MapStage;
+export default MapStage
diff --git a/frontend/src/containers/app/map/RackContainer.js b/frontend/src/containers/app/map/RackContainer.js
index 365bb062..614421b4 100644
--- a/frontend/src/containers/app/map/RackContainer.js
+++ b/frontend/src/containers/app/map/RackContainer.js
@@ -1,30 +1,30 @@
-import { connect } from "react-redux";
-import RackGroup from "../../../components/app/map/groups/RackGroup";
-import { getStateLoad } from "../../../util/simulation-load";
+import { connect } from 'react-redux'
+import RackGroup from '../../../components/app/map/groups/RackGroup'
+import { getStateLoad } from '../../../util/simulation-load'
const mapStateToProps = (state, ownProps) => {
- const inSimulation = state.currentExperimentId !== -1;
+ const inSimulation = state.currentExperimentId !== -1
- let rackLoad = undefined;
- if (inSimulation) {
- if (
- state.states.rack[state.currentTick] &&
- state.states.rack[state.currentTick][ownProps.tile.objectId]
- ) {
- rackLoad = getStateLoad(
- state.loadMetric,
- state.states.rack[state.currentTick][ownProps.tile.objectId]
- );
+ let rackLoad = undefined
+ if (inSimulation) {
+ if (
+ state.states.rack[state.currentTick] &&
+ state.states.rack[state.currentTick][ownProps.tile.objectId]
+ ) {
+ rackLoad = getStateLoad(
+ state.loadMetric,
+ state.states.rack[state.currentTick][ownProps.tile.objectId],
+ )
+ }
}
- }
- return {
- interactionLevel: state.interactionLevel,
- inSimulation,
- rackLoad
- };
-};
+ return {
+ interactionLevel: state.interactionLevel,
+ inSimulation,
+ rackLoad,
+ }
+}
-const RackContainer = connect(mapStateToProps)(RackGroup);
+const RackContainer = connect(mapStateToProps)(RackGroup)
-export default RackContainer;
+export default RackContainer
diff --git a/frontend/src/containers/app/map/RackEnergyFillContainer.js b/frontend/src/containers/app/map/RackEnergyFillContainer.js
index 0b7921d9..e25cd37d 100644
--- a/frontend/src/containers/app/map/RackEnergyFillContainer.js
+++ b/frontend/src/containers/app/map/RackEnergyFillContainer.js
@@ -1,40 +1,40 @@
-import { connect } from "react-redux";
-import RackFillBar from "../../../components/app/map/elements/RackFillBar";
+import { connect } from 'react-redux'
+import RackFillBar from '../../../components/app/map/elements/RackFillBar'
const mapStateToProps = (state, ownProps) => {
- let energyConsumptionTotal = 0;
- const rack = state.objects.rack[state.objects.tile[ownProps.tileId].objectId];
- const machineIds = rack.machineIds;
- machineIds.forEach(machineId => {
- if (machineId !== null) {
- const machine = state.objects.machine[machineId];
- machine.cpuIds.forEach(
- id =>
- (energyConsumptionTotal += state.objects.cpu[id].energyConsumptionW)
- );
- machine.gpuIds.forEach(
- id =>
- (energyConsumptionTotal += state.objects.gpu[id].energyConsumptionW)
- );
- machine.memoryIds.forEach(
- id =>
- (energyConsumptionTotal +=
- state.objects.memory[id].energyConsumptionW)
- );
- machine.storageIds.forEach(
- id =>
- (energyConsumptionTotal +=
- state.objects.storage[id].energyConsumptionW)
- );
- }
- });
+ let energyConsumptionTotal = 0
+ const rack = state.objects.rack[state.objects.tile[ownProps.tileId].objectId]
+ const machineIds = rack.machineIds
+ machineIds.forEach(machineId => {
+ if (machineId !== null) {
+ const machine = state.objects.machine[machineId]
+ machine.cpuIds.forEach(
+ id =>
+ (energyConsumptionTotal += state.objects.cpu[id].energyConsumptionW),
+ )
+ machine.gpuIds.forEach(
+ id =>
+ (energyConsumptionTotal += state.objects.gpu[id].energyConsumptionW),
+ )
+ machine.memoryIds.forEach(
+ id =>
+ (energyConsumptionTotal +=
+ state.objects.memory[id].energyConsumptionW),
+ )
+ machine.storageIds.forEach(
+ id =>
+ (energyConsumptionTotal +=
+ state.objects.storage[id].energyConsumptionW),
+ )
+ }
+ })
- return {
- type: "energy",
- fillFraction: Math.min(1, energyConsumptionTotal / rack.powerCapacityW)
- };
-};
+ return {
+ type: 'energy',
+ fillFraction: Math.min(1, energyConsumptionTotal / rack.powerCapacityW),
+ }
+}
-const RackSpaceFillContainer = connect(mapStateToProps)(RackFillBar);
+const RackSpaceFillContainer = connect(mapStateToProps)(RackFillBar)
-export default RackSpaceFillContainer;
+export default RackSpaceFillContainer
diff --git a/frontend/src/containers/app/map/RackSpaceFillContainer.js b/frontend/src/containers/app/map/RackSpaceFillContainer.js
index cc4d1251..c43695a9 100644
--- a/frontend/src/containers/app/map/RackSpaceFillContainer.js
+++ b/frontend/src/containers/app/map/RackSpaceFillContainer.js
@@ -1,16 +1,16 @@
-import { connect } from "react-redux";
-import RackFillBar from "../../../components/app/map/elements/RackFillBar";
+import { connect } from 'react-redux'
+import RackFillBar from '../../../components/app/map/elements/RackFillBar'
const mapStateToProps = (state, ownProps) => {
- const machineIds =
- state.objects.rack[state.objects.tile[ownProps.tileId].objectId].machineIds;
- return {
- type: "space",
- fillFraction:
- machineIds.filter(id => id !== null).length / machineIds.length
- };
-};
+ const machineIds =
+ state.objects.rack[state.objects.tile[ownProps.tileId].objectId].machineIds
+ return {
+ type: 'space',
+ fillFraction:
+ machineIds.filter(id => id !== null).length / machineIds.length,
+ }
+}
-const RackSpaceFillContainer = connect(mapStateToProps)(RackFillBar);
+const RackSpaceFillContainer = connect(mapStateToProps)(RackFillBar)
-export default RackSpaceFillContainer;
+export default RackSpaceFillContainer
diff --git a/frontend/src/containers/app/map/RoomContainer.js b/frontend/src/containers/app/map/RoomContainer.js
index b83c7fa0..91bf4e5d 100644
--- a/frontend/src/containers/app/map/RoomContainer.js
+++ b/frontend/src/containers/app/map/RoomContainer.js
@@ -1,21 +1,21 @@
-import { connect } from "react-redux";
-import { goFromBuildingToRoom } from "../../../actions/interaction-level";
-import RoomGroup from "../../../components/app/map/groups/RoomGroup";
+import { connect } from 'react-redux'
+import { goFromBuildingToRoom } from '../../../actions/interaction-level'
+import RoomGroup from '../../../components/app/map/groups/RoomGroup'
const mapStateToProps = (state, ownProps) => {
- return {
- interactionLevel: state.interactionLevel,
- currentRoomInConstruction: state.construction.currentRoomInConstruction,
- room: state.objects.room[ownProps.roomId]
- };
-};
+ return {
+ interactionLevel: state.interactionLevel,
+ currentRoomInConstruction: state.construction.currentRoomInConstruction,
+ room: state.objects.room[ownProps.roomId],
+ }
+}
const mapDispatchToProps = (dispatch, ownProps) => {
- return {
- onClick: () => dispatch(goFromBuildingToRoom(ownProps.roomId))
- };
-};
+ return {
+ onClick: () => dispatch(goFromBuildingToRoom(ownProps.roomId)),
+ }
+}
-const RoomContainer = connect(mapStateToProps, mapDispatchToProps)(RoomGroup);
+const RoomContainer = connect(mapStateToProps, mapDispatchToProps)(RoomGroup)
-export default RoomContainer;
+export default RoomContainer
diff --git a/frontend/src/containers/app/map/TileContainer.js b/frontend/src/containers/app/map/TileContainer.js
index 9e179924..6122be96 100644
--- a/frontend/src/containers/app/map/TileContainer.js
+++ b/frontend/src/containers/app/map/TileContainer.js
@@ -1,43 +1,43 @@
-import { connect } from "react-redux";
-import { goFromRoomToRack } from "../../../actions/interaction-level";
-import TileGroup from "../../../components/app/map/groups/TileGroup";
-import { getStateLoad } from "../../../util/simulation-load";
+import { connect } from 'react-redux'
+import { goFromRoomToRack } from '../../../actions/interaction-level'
+import TileGroup from '../../../components/app/map/groups/TileGroup'
+import { getStateLoad } from '../../../util/simulation-load'
const mapStateToProps = (state, ownProps) => {
- const tile = state.objects.tile[ownProps.tileId];
- const inSimulation = state.currentExperimentId !== -1;
+ const tile = state.objects.tile[ownProps.tileId]
+ const inSimulation = state.currentExperimentId !== -1
- let roomLoad = undefined;
- if (inSimulation) {
- if (
- state.states.room[state.currentTick] &&
- state.states.room[state.currentTick][tile.roomId]
- ) {
- roomLoad = getStateLoad(
- state.loadMetric,
- state.states.room[state.currentTick][tile.roomId]
- );
+ let roomLoad = undefined
+ if (inSimulation) {
+ if (
+ state.states.room[state.currentTick] &&
+ state.states.room[state.currentTick][tile.roomId]
+ ) {
+ roomLoad = getStateLoad(
+ state.loadMetric,
+ state.states.room[state.currentTick][tile.roomId],
+ )
+ }
}
- }
- return {
- interactionLevel: state.interactionLevel,
- tile,
- inSimulation,
- roomLoad
- };
-};
+ return {
+ interactionLevel: state.interactionLevel,
+ tile,
+ inSimulation,
+ roomLoad,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onClick: tile => {
- if (tile.objectType) {
- dispatch(goFromRoomToRack(tile.id));
- }
+ return {
+ onClick: tile => {
+ if (tile.objectType) {
+ dispatch(goFromRoomToRack(tile.id))
+ }
+ },
}
- };
-};
+}
-const TileContainer = connect(mapStateToProps, mapDispatchToProps)(TileGroup);
+const TileContainer = connect(mapStateToProps, mapDispatchToProps)(TileGroup)
-export default TileContainer;
+export default TileContainer
diff --git a/frontend/src/containers/app/map/WallContainer.js b/frontend/src/containers/app/map/WallContainer.js
index 38192b05..b288a534 100644
--- a/frontend/src/containers/app/map/WallContainer.js
+++ b/frontend/src/containers/app/map/WallContainer.js
@@ -1,14 +1,14 @@
-import { connect } from "react-redux";
-import WallGroup from "../../../components/app/map/groups/WallGroup";
+import { connect } from 'react-redux'
+import WallGroup from '../../../components/app/map/groups/WallGroup'
const mapStateToProps = (state, ownProps) => {
- return {
- tiles: state.objects.room[ownProps.roomId].tileIds.map(
- tileId => state.objects.tile[tileId]
- )
- };
-};
+ return {
+ tiles: state.objects.room[ownProps.roomId].tileIds.map(
+ tileId => state.objects.tile[tileId],
+ ),
+ }
+}
-const WallContainer = connect(mapStateToProps)(WallGroup);
+const WallContainer = connect(mapStateToProps)(WallGroup)
-export default WallContainer;
+export default WallContainer
diff --git a/frontend/src/containers/app/map/controls/ScaleIndicatorContainer.js b/frontend/src/containers/app/map/controls/ScaleIndicatorContainer.js
index f075cde5..6e443479 100644
--- a/frontend/src/containers/app/map/controls/ScaleIndicatorContainer.js
+++ b/frontend/src/containers/app/map/controls/ScaleIndicatorContainer.js
@@ -1,14 +1,14 @@
-import { connect } from "react-redux";
-import ScaleIndicatorComponent from "../../../../components/app/map/controls/ScaleIndicatorComponent";
+import { connect } from 'react-redux'
+import ScaleIndicatorComponent from '../../../../components/app/map/controls/ScaleIndicatorComponent'
const mapStateToProps = state => {
- return {
- scale: state.map.scale
- };
-};
+ return {
+ scale: state.map.scale,
+ }
+}
const ScaleIndicatorContainer = connect(mapStateToProps)(
- ScaleIndicatorComponent
-);
+ ScaleIndicatorComponent,
+)
-export default ScaleIndicatorContainer;
+export default ScaleIndicatorContainer
diff --git a/frontend/src/containers/app/map/controls/ZoomControlContainer.js b/frontend/src/containers/app/map/controls/ZoomControlContainer.js
index 50910bd6..20811989 100644
--- a/frontend/src/containers/app/map/controls/ZoomControlContainer.js
+++ b/frontend/src/containers/app/map/controls/ZoomControlContainer.js
@@ -1,21 +1,21 @@
-import { connect } from "react-redux";
-import { zoomInOnCenter } from "../../../../actions/map";
-import ZoomControlComponent from "../../../../components/app/map/controls/ZoomControlComponent";
+import { connect } from 'react-redux'
+import { zoomInOnCenter } from '../../../../actions/map'
+import ZoomControlComponent from '../../../../components/app/map/controls/ZoomControlComponent'
const mapStateToProps = state => {
- return {
- mapScale: state.map.scale
- };
-};
+ return {
+ mapScale: state.map.scale,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- zoomInOnCenter: zoomIn => dispatch(zoomInOnCenter(zoomIn))
- };
-};
+ return {
+ zoomInOnCenter: zoomIn => dispatch(zoomInOnCenter(zoomIn)),
+ }
+}
const ZoomControlContainer = connect(mapStateToProps, mapDispatchToProps)(
- ZoomControlComponent
-);
+ ZoomControlComponent,
+)
-export default ZoomControlContainer;
+export default ZoomControlContainer
diff --git a/frontend/src/containers/app/map/layers/MapLayer.js b/frontend/src/containers/app/map/layers/MapLayer.js
index cf971350..3c5ff8be 100644
--- a/frontend/src/containers/app/map/layers/MapLayer.js
+++ b/frontend/src/containers/app/map/layers/MapLayer.js
@@ -1,13 +1,13 @@
-import { connect } from "react-redux";
-import MapLayerComponent from "../../../../components/app/map/layers/MapLayerComponent";
+import { connect } from 'react-redux'
+import MapLayerComponent from '../../../../components/app/map/layers/MapLayerComponent'
const mapStateToProps = state => {
- return {
- mapPosition: state.map.position,
- mapScale: state.map.scale
- };
-};
+ return {
+ mapPosition: state.map.position,
+ mapScale: state.map.scale,
+ }
+}
-const MapLayer = connect(mapStateToProps)(MapLayerComponent);
+const MapLayer = connect(mapStateToProps)(MapLayerComponent)
-export default MapLayer;
+export default MapLayer
diff --git a/frontend/src/containers/app/map/layers/ObjectHoverLayer.js b/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
index 9b28575e..dc489e82 100644
--- a/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
+++ b/frontend/src/containers/app/map/layers/ObjectHoverLayer.js
@@ -1,37 +1,37 @@
-import { connect } from "react-redux";
-import { addRackToTile } from "../../../../actions/topology/room";
-import ObjectHoverLayerComponent from "../../../../components/app/map/layers/ObjectHoverLayerComponent";
-import { findTileWithPosition } from "../../../../util/tile-calculations";
+import { connect } from 'react-redux'
+import { addRackToTile } from '../../../../actions/topology/room'
+import ObjectHoverLayerComponent from '../../../../components/app/map/layers/ObjectHoverLayerComponent'
+import { findTileWithPosition } from '../../../../util/tile-calculations'
const mapStateToProps = state => {
- return {
- mapPosition: state.map.position,
- mapScale: state.map.scale,
- isEnabled: () => state.construction.inRackConstructionMode,
- isValid: (x, y) => {
- if (state.interactionLevel.mode !== "ROOM") {
- return false;
- }
+ return {
+ mapPosition: state.map.position,
+ mapScale: state.map.scale,
+ isEnabled: () => state.construction.inRackConstructionMode,
+ isValid: (x, y) => {
+ if (state.interactionLevel.mode !== 'ROOM') {
+ return false
+ }
- const currentRoom = state.objects.room[state.interactionLevel.roomId];
- const tiles = currentRoom.tileIds.map(
- tileId => state.objects.tile[tileId]
- );
- const tile = findTileWithPosition(tiles, x, y);
+ const currentRoom = state.objects.room[state.interactionLevel.roomId]
+ const tiles = currentRoom.tileIds.map(
+ tileId => state.objects.tile[tileId],
+ )
+ const tile = findTileWithPosition(tiles, x, y)
- return !(tile === null || tile.objectType);
+ return !(tile === null || tile.objectType)
+ },
}
- };
-};
+}
const mapDispatchToProps = dispatch => {
- return {
- onClick: (x, y) => dispatch(addRackToTile(x, y))
- };
-};
+ return {
+ onClick: (x, y) => dispatch(addRackToTile(x, y)),
+ }
+}
const ObjectHoverLayer = connect(mapStateToProps, mapDispatchToProps)(
- ObjectHoverLayerComponent
-);
+ ObjectHoverLayerComponent,
+)
-export default ObjectHoverLayer;
+export default ObjectHoverLayer
diff --git a/frontend/src/containers/app/map/layers/RoomHoverLayer.js b/frontend/src/containers/app/map/layers/RoomHoverLayer.js
index 020102bf..b5a891ce 100644
--- a/frontend/src/containers/app/map/layers/RoomHoverLayer.js
+++ b/frontend/src/containers/app/map/layers/RoomHoverLayer.js
@@ -1,55 +1,55 @@
-import { connect } from "react-redux";
-import { toggleTileAtLocation } from "../../../../actions/topology/building";
-import RoomHoverLayerComponent from "../../../../components/app/map/layers/RoomHoverLayerComponent";
+import { connect } from 'react-redux'
+import { toggleTileAtLocation } from '../../../../actions/topology/building'
+import RoomHoverLayerComponent from '../../../../components/app/map/layers/RoomHoverLayerComponent'
import {
- deriveValidNextTilePositions,
- findPositionInPositions,
- findPositionInRooms
-} from "../../../../util/tile-calculations";
+ deriveValidNextTilePositions,
+ findPositionInPositions,
+ findPositionInRooms,
+} from '../../../../util/tile-calculations'
const mapStateToProps = state => {
- return {
- mapPosition: state.map.position,
- mapScale: state.map.scale,
- isEnabled: () => state.construction.currentRoomInConstruction !== -1,
- isValid: (x, y) => {
- const newRoom = Object.assign(
- {},
- state.objects.room[state.construction.currentRoomInConstruction]
- );
- const oldRooms = Object.keys(state.objects.room)
- .map(id => Object.assign({}, state.objects.room[id]))
- .filter(
- room =>
- state.objects.datacenter[state.currentDatacenterId].roomIds.indexOf(
- room.id
- ) !== -1 && room.id !== state.construction.currentRoomInConstruction
- );
+ return {
+ mapPosition: state.map.position,
+ mapScale: state.map.scale,
+ isEnabled: () => state.construction.currentRoomInConstruction !== -1,
+ isValid: (x, y) => {
+ const newRoom = Object.assign(
+ {},
+ state.objects.room[state.construction.currentRoomInConstruction],
+ )
+ const oldRooms = Object.keys(state.objects.room)
+ .map(id => Object.assign({}, state.objects.room[id]))
+ .filter(
+ room =>
+ state.objects.datacenter[state.currentDatacenterId].roomIds.indexOf(
+ room.id,
+ ) !== -1 && room.id !== state.construction.currentRoomInConstruction,
+ );
- [...oldRooms, newRoom].forEach(room => {
- room.tiles = room.tileIds.map(tileId => state.objects.tile[tileId]);
- });
- if (newRoom.tileIds.length === 0) {
- return findPositionInRooms(oldRooms, x, y) === -1;
- }
+ [...oldRooms, newRoom].forEach(room => {
+ room.tiles = room.tileIds.map(tileId => state.objects.tile[tileId])
+ })
+ if (newRoom.tileIds.length === 0) {
+ return findPositionInRooms(oldRooms, x, y) === -1
+ }
- const validNextPositions = deriveValidNextTilePositions(
- oldRooms,
- newRoom.tiles
- );
- return findPositionInPositions(validNextPositions, x, y) !== -1;
+ const validNextPositions = deriveValidNextTilePositions(
+ oldRooms,
+ newRoom.tiles,
+ )
+ return findPositionInPositions(validNextPositions, x, y) !== -1
+ },
}
- };
-};
+}
const mapDispatchToProps = dispatch => {
- return {
- onClick: (x, y) => dispatch(toggleTileAtLocation(x, y))
- };
-};
+ return {
+ onClick: (x, y) => dispatch(toggleTileAtLocation(x, y)),
+ }
+}
const RoomHoverLayer = connect(mapStateToProps, mapDispatchToProps)(
- RoomHoverLayerComponent
-);
+ RoomHoverLayerComponent,
+)
-export default RoomHoverLayer;
+export default RoomHoverLayer
diff --git a/frontend/src/containers/app/sidebars/elements/LoadBarContainer.js b/frontend/src/containers/app/sidebars/elements/LoadBarContainer.js
index 2e637f9a..5c423490 100644
--- a/frontend/src/containers/app/sidebars/elements/LoadBarContainer.js
+++ b/frontend/src/containers/app/sidebars/elements/LoadBarContainer.js
@@ -1,32 +1,32 @@
-import { connect } from "react-redux";
-import LoadBarComponent from "../../../../components/app/sidebars/elements/LoadBarComponent";
-import { getStateLoad } from "../../../../util/simulation-load";
+import { connect } from 'react-redux'
+import LoadBarComponent from '../../../../components/app/sidebars/elements/LoadBarComponent'
+import { getStateLoad } from '../../../../util/simulation-load'
const mapStateToProps = (state, ownProps) => {
- let percent = 0;
- let enabled = false;
+ let percent = 0
+ let enabled = false
- const objectStates = state.states[ownProps.objectType];
- if (
- objectStates[state.currentTick] &&
- objectStates[state.currentTick][ownProps.objectId]
- ) {
- percent = Math.floor(
- 100 *
- getStateLoad(
- state.loadMetric,
- objectStates[state.currentTick][ownProps.objectId]
+ const objectStates = state.states[ownProps.objectType]
+ if (
+ objectStates[state.currentTick] &&
+ objectStates[state.currentTick][ownProps.objectId]
+ ) {
+ percent = Math.floor(
+ 100 *
+ getStateLoad(
+ state.loadMetric,
+ objectStates[state.currentTick][ownProps.objectId],
+ ),
)
- );
- enabled = true;
- }
+ enabled = true
+ }
- return {
- percent,
- enabled
- };
-};
+ return {
+ percent,
+ enabled,
+ }
+}
-const LoadBarContainer = connect(mapStateToProps)(LoadBarComponent);
+const LoadBarContainer = connect(mapStateToProps)(LoadBarComponent)
-export default LoadBarContainer;
+export default LoadBarContainer
diff --git a/frontend/src/containers/app/sidebars/elements/LoadChartContainer.js b/frontend/src/containers/app/sidebars/elements/LoadChartContainer.js
index 57bfec38..49962d57 100644
--- a/frontend/src/containers/app/sidebars/elements/LoadChartContainer.js
+++ b/frontend/src/containers/app/sidebars/elements/LoadChartContainer.js
@@ -1,31 +1,31 @@
-import { connect } from "react-redux";
-import LoadChartComponent from "../../../../components/app/sidebars/elements/LoadChartComponent";
-import { getStateLoad } from "../../../../util/simulation-load";
+import { connect } from 'react-redux'
+import LoadChartComponent from '../../../../components/app/sidebars/elements/LoadChartComponent'
+import { getStateLoad } from '../../../../util/simulation-load'
const mapStateToProps = (state, ownProps) => {
- const data = [];
+ const data = []
- if (state.lastSimulatedTick !== -1) {
- const objectStates = state.states[ownProps.objectType];
- Object.keys(objectStates).forEach(tick => {
- if (objectStates[tick][ownProps.objectId]) {
- data.push({
- x: tick,
- y: getStateLoad(
- state.loadMetric,
- objectStates[tick][ownProps.objectId]
- )
- });
- }
- });
- }
+ if (state.lastSimulatedTick !== -1) {
+ const objectStates = state.states[ownProps.objectType]
+ Object.keys(objectStates).forEach(tick => {
+ if (objectStates[tick][ownProps.objectId]) {
+ data.push({
+ x: tick,
+ y: getStateLoad(
+ state.loadMetric,
+ objectStates[tick][ownProps.objectId],
+ ),
+ })
+ }
+ })
+ }
- return {
- data,
- currentTick: state.currentTick
- };
-};
+ return {
+ data,
+ currentTick: state.currentTick,
+ }
+}
-const LoadChartContainer = connect(mapStateToProps)(LoadChartComponent);
+const LoadChartContainer = connect(mapStateToProps)(LoadChartComponent)
-export default LoadChartContainer;
+export default LoadChartContainer
diff --git a/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js b/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js
index 25a0d9e9..06d0b88a 100644
--- a/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js
+++ b/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js
@@ -1,38 +1,38 @@
-import { connect } from "react-redux";
-import ExperimentMetadataComponent from "../../../../components/app/sidebars/simulation/ExperimentMetadataComponent";
+import { connect } from 'react-redux'
+import ExperimentMetadataComponent from '../../../../components/app/sidebars/simulation/ExperimentMetadataComponent'
const mapStateToProps = state => {
- if (!state.objects.experiment[state.currentExperimentId]) {
- return {
- experimentName: "Loading experiment",
- pathName: "",
- traceName: "",
- schedulerName: ""
- };
- }
+ if (!state.objects.experiment[state.currentExperimentId]) {
+ return {
+ experimentName: 'Loading experiment',
+ pathName: '',
+ traceName: '',
+ schedulerName: '',
+ }
+ }
- const path =
- state.objects.path[
- state.objects.experiment[state.currentExperimentId].pathId
- ];
- const pathName = path.name ? path.name : "Path " + path.id;
+ const path =
+ state.objects.path[
+ state.objects.experiment[state.currentExperimentId].pathId
+ ]
+ const pathName = path.name ? path.name : 'Path ' + path.id
- return {
- experimentName: state.objects.experiment[state.currentExperimentId].name,
- pathName,
- traceName:
- state.objects.trace[
- state.objects.experiment[state.currentExperimentId].traceId
- ].name,
- schedulerName:
- state.objects.scheduler[
- state.objects.experiment[state.currentExperimentId].schedulerName
- ].name
- };
-};
+ return {
+ experimentName: state.objects.experiment[state.currentExperimentId].name,
+ pathName,
+ traceName:
+ state.objects.trace[
+ state.objects.experiment[state.currentExperimentId].traceId
+ ].name,
+ schedulerName:
+ state.objects.scheduler[
+ state.objects.experiment[state.currentExperimentId].schedulerName
+ ].name,
+ }
+}
const ExperimentMetadataContainer = connect(mapStateToProps)(
- ExperimentMetadataComponent
-);
+ ExperimentMetadataComponent,
+)
-export default ExperimentMetadataContainer;
+export default ExperimentMetadataContainer
diff --git a/frontend/src/containers/app/sidebars/simulation/LoadMetricContainer.js b/frontend/src/containers/app/sidebars/simulation/LoadMetricContainer.js
index 0c66b582..a8654698 100644
--- a/frontend/src/containers/app/sidebars/simulation/LoadMetricContainer.js
+++ b/frontend/src/containers/app/sidebars/simulation/LoadMetricContainer.js
@@ -1,12 +1,12 @@
-import { connect } from "react-redux";
-import LoadMetricComponent from "../../../../components/app/sidebars/simulation/LoadMetricComponent";
+import { connect } from 'react-redux'
+import LoadMetricComponent from '../../../../components/app/sidebars/simulation/LoadMetricComponent'
const mapStateToProps = state => {
- return {
- loadMetric: state.loadMetric
- };
-};
+ return {
+ loadMetric: state.loadMetric,
+ }
+}
-const LoadMetricContainer = connect(mapStateToProps)(LoadMetricComponent);
+const LoadMetricContainer = connect(mapStateToProps)(LoadMetricComponent)
-export default LoadMetricContainer;
+export default LoadMetricContainer
diff --git a/frontend/src/containers/app/sidebars/simulation/TaskContainer.js b/frontend/src/containers/app/sidebars/simulation/TaskContainer.js
index 093d4266..c4c86284 100644
--- a/frontend/src/containers/app/sidebars/simulation/TaskContainer.js
+++ b/frontend/src/containers/app/sidebars/simulation/TaskContainer.js
@@ -1,26 +1,26 @@
-import { connect } from "react-redux";
-import TaskComponent from "../../../../components/app/sidebars/simulation/TaskComponent";
+import { connect } from 'react-redux'
+import TaskComponent from '../../../../components/app/sidebars/simulation/TaskComponent'
const mapStateToProps = (state, ownProps) => {
- let flopsLeft = state.objects.task[ownProps.taskId].totalFlopCount;
+ let flopsLeft = state.objects.task[ownProps.taskId].totalFlopCount
- if (
- state.states.task[state.currentTick] &&
- state.states.task[state.currentTick][ownProps.taskId]
- ) {
- flopsLeft = state.states.task[state.currentTick][ownProps.taskId].flopsLeft;
- } else if (
- state.objects.task[ownProps.taskId].startTick < state.currentTick
- ) {
- flopsLeft = 0;
- }
+ if (
+ state.states.task[state.currentTick] &&
+ state.states.task[state.currentTick][ownProps.taskId]
+ ) {
+ flopsLeft = state.states.task[state.currentTick][ownProps.taskId].flopsLeft
+ } else if (
+ state.objects.task[ownProps.taskId].startTick < state.currentTick
+ ) {
+ flopsLeft = 0
+ }
- return {
- task: state.objects.task[ownProps.taskId],
- flopsLeft
- };
-};
+ return {
+ task: state.objects.task[ownProps.taskId],
+ flopsLeft,
+ }
+}
-const TaskContainer = connect(mapStateToProps)(TaskComponent);
+const TaskContainer = connect(mapStateToProps)(TaskComponent)
-export default TaskContainer;
+export default TaskContainer
diff --git a/frontend/src/containers/app/sidebars/simulation/TraceContainer.js b/frontend/src/containers/app/sidebars/simulation/TraceContainer.js
index 682b6cc9..907c8874 100644
--- a/frontend/src/containers/app/sidebars/simulation/TraceContainer.js
+++ b/frontend/src/containers/app/sidebars/simulation/TraceContainer.js
@@ -1,25 +1,25 @@
-import { connect } from "react-redux";
-import TraceComponent from "../../../../components/app/sidebars/simulation/TraceComponent";
+import { connect } from 'react-redux'
+import TraceComponent from '../../../../components/app/sidebars/simulation/TraceComponent'
const mapStateToProps = state => {
- if (
- !state.objects.experiment[state.currentExperimentId] ||
- !state.objects.trace[
- state.objects.experiment[state.currentExperimentId].traceId
- ].jobIds
- ) {
- return {
- jobs: []
- };
- }
+ if (
+ !state.objects.experiment[state.currentExperimentId] ||
+ !state.objects.trace[
+ state.objects.experiment[state.currentExperimentId].traceId
+ ].jobIds
+ ) {
+ return {
+ jobs: [],
+ }
+ }
- return {
- jobs: state.objects.trace[
- state.objects.experiment[state.currentExperimentId].traceId
- ].jobIds.map(id => state.objects.job[id])
- };
-};
+ return {
+ jobs: state.objects.trace[
+ state.objects.experiment[state.currentExperimentId].traceId
+ ].jobIds.map(id => state.objects.job[id]),
+ }
+}
-const TraceContainer = connect(mapStateToProps)(TraceComponent);
+const TraceContainer = connect(mapStateToProps)(TraceComponent)
-export default TraceContainer;
+export default TraceContainer
diff --git a/frontend/src/containers/app/sidebars/topology/TopologySidebar.js b/frontend/src/containers/app/sidebars/topology/TopologySidebar.js
index 31c902fc..8e929d3d 100644
--- a/frontend/src/containers/app/sidebars/topology/TopologySidebar.js
+++ b/frontend/src/containers/app/sidebars/topology/TopologySidebar.js
@@ -1,12 +1,12 @@
-import { connect } from "react-redux";
-import TopologySidebarComponent from "../../../../components/app/sidebars/topology/TopologySidebarComponent";
+import { connect } from 'react-redux'
+import TopologySidebarComponent from '../../../../components/app/sidebars/topology/TopologySidebarComponent'
const mapStateToProps = state => {
- return {
- interactionLevel: state.interactionLevel
- };
-};
+ return {
+ interactionLevel: state.interactionLevel,
+ }
+}
-const TopologySidebar = connect(mapStateToProps)(TopologySidebarComponent);
+const TopologySidebar = connect(mapStateToProps)(TopologySidebarComponent)
-export default TopologySidebar;
+export default TopologySidebar
diff --git a/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js
index da24b8f0..711b2b82 100644
--- a/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js
@@ -1,14 +1,15 @@
-import { connect } from "react-redux";
-import BuildingSidebarComponent from "../../../../../components/app/sidebars/topology/building/BuildingSidebarComponent";
+import { connect } from 'react-redux'
+import BuildingSidebarComponent
+ from '../../../../../components/app/sidebars/topology/building/BuildingSidebarComponent'
const mapStateToProps = state => {
- return {
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
const BuildingSidebarContainer = connect(mapStateToProps)(
- BuildingSidebarComponent
-);
+ BuildingSidebarComponent,
+)
-export default BuildingSidebarContainer;
+export default BuildingSidebarContainer
diff --git a/frontend/src/containers/app/sidebars/topology/building/NewRoomConstructionContainer.js b/frontend/src/containers/app/sidebars/topology/building/NewRoomConstructionContainer.js
index bb64cbb4..e1dfdc50 100644
--- a/frontend/src/containers/app/sidebars/topology/building/NewRoomConstructionContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/building/NewRoomConstructionContainer.js
@@ -1,27 +1,28 @@
-import { connect } from "react-redux";
+import { connect } from 'react-redux'
import {
- cancelNewRoomConstruction,
- finishNewRoomConstruction,
- startNewRoomConstruction
-} from "../../../../../actions/topology/building";
-import StartNewRoomConstructionComponent from "../../../../../components/app/sidebars/topology/building/NewRoomConstructionComponent";
+ cancelNewRoomConstruction,
+ finishNewRoomConstruction,
+ startNewRoomConstruction,
+} from '../../../../../actions/topology/building'
+import StartNewRoomConstructionComponent
+ from '../../../../../components/app/sidebars/topology/building/NewRoomConstructionComponent'
const mapStateToProps = state => {
- return {
- currentRoomInConstruction: state.construction.currentRoomInConstruction
- };
-};
+ return {
+ currentRoomInConstruction: state.construction.currentRoomInConstruction,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onStart: () => dispatch(startNewRoomConstruction()),
- onFinish: () => dispatch(finishNewRoomConstruction()),
- onCancel: () => dispatch(cancelNewRoomConstruction())
- };
-};
+ return {
+ onStart: () => dispatch(startNewRoomConstruction()),
+ onFinish: () => dispatch(finishNewRoomConstruction()),
+ onCancel: () => dispatch(cancelNewRoomConstruction()),
+ }
+}
const NewRoomConstructionButton = connect(mapStateToProps, mapDispatchToProps)(
- StartNewRoomConstructionComponent
-);
+ StartNewRoomConstructionComponent,
+)
-export default NewRoomConstructionButton;
+export default NewRoomConstructionButton
diff --git a/frontend/src/containers/app/sidebars/topology/machine/BackToRackContainer.js b/frontend/src/containers/app/sidebars/topology/machine/BackToRackContainer.js
index 885c533d..61cb79a8 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/BackToRackContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/BackToRackContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { goDownOneInteractionLevel } from "../../../../../actions/interaction-level";
-import BackToRackComponent from "../../../../../components/app/sidebars/topology/machine/BackToRackComponent";
+import { connect } from 'react-redux'
+import { goDownOneInteractionLevel } from '../../../../../actions/interaction-level'
+import BackToRackComponent from '../../../../../components/app/sidebars/topology/machine/BackToRackComponent'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(goDownOneInteractionLevel())
- };
-};
+ return {
+ onClick: () => dispatch(goDownOneInteractionLevel()),
+ }
+}
const BackToRackContainer = connect(undefined, mapDispatchToProps)(
- BackToRackComponent
-);
+ BackToRackComponent,
+)
-export default BackToRackContainer;
+export default BackToRackContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/DeleteMachineContainer.js b/frontend/src/containers/app/sidebars/topology/machine/DeleteMachineContainer.js
index f42c8ba7..2dfb0d46 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/DeleteMachineContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/DeleteMachineContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { openDeleteMachineModal } from "../../../../../actions/modals/topology";
-import DeleteMachineComponent from "../../../../../components/app/sidebars/topology/machine/DeleteMachineComponent";
+import { connect } from 'react-redux'
+import { openDeleteMachineModal } from '../../../../../actions/modals/topology'
+import DeleteMachineComponent from '../../../../../components/app/sidebars/topology/machine/DeleteMachineComponent'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(openDeleteMachineModal())
- };
-};
+ return {
+ onClick: () => dispatch(openDeleteMachineModal()),
+ }
+}
const DeleteMachineContainer = connect(undefined, mapDispatchToProps)(
- DeleteMachineComponent
-);
+ DeleteMachineComponent,
+)
-export default DeleteMachineContainer;
+export default DeleteMachineContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/MachineNameContainer.js b/frontend/src/containers/app/sidebars/topology/machine/MachineNameContainer.js
index 05d2bf80..5c29f85f 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/MachineNameContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/MachineNameContainer.js
@@ -1,12 +1,12 @@
-import { connect } from "react-redux";
-import MachineNameComponent from "../../../../../components/app/sidebars/topology/machine/MachineNameComponent";
+import { connect } from 'react-redux'
+import MachineNameComponent from '../../../../../components/app/sidebars/topology/machine/MachineNameComponent'
const mapStateToProps = state => {
- return {
- position: state.interactionLevel.position
- };
-};
+ return {
+ position: state.interactionLevel.position,
+ }
+}
-const MachineNameContainer = connect(mapStateToProps)(MachineNameComponent);
+const MachineNameContainer = connect(mapStateToProps)(MachineNameComponent)
-export default MachineNameContainer;
+export default MachineNameContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js
index 7729385e..f5baee44 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js
@@ -1,18 +1,18 @@
-import { connect } from "react-redux";
-import MachineSidebarComponent from "../../../../../components/app/sidebars/topology/machine/MachineSidebarComponent";
+import { connect } from 'react-redux'
+import MachineSidebarComponent from '../../../../../components/app/sidebars/topology/machine/MachineSidebarComponent'
const mapStateToProps = state => {
- return {
- inSimulation: state.currentExperimentId !== -1,
- machineId:
- state.objects.rack[
- state.objects.tile[state.interactionLevel.tileId].objectId
- ].machineIds[state.interactionLevel.position - 1]
- };
-};
+ return {
+ inSimulation: state.currentExperimentId !== -1,
+ machineId:
+ state.objects.rack[
+ state.objects.tile[state.interactionLevel.tileId].objectId
+ ].machineIds[state.interactionLevel.position - 1],
+ }
+}
const MachineSidebarContainer = connect(mapStateToProps)(
- MachineSidebarComponent
-);
+ MachineSidebarComponent,
+)
-export default MachineSidebarContainer;
+export default MachineSidebarContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js
index 0e5a6073..7ff06f4f 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js
@@ -1,21 +1,21 @@
-import { connect } from "react-redux";
-import { addUnit } from "../../../../../actions/topology/machine";
-import UnitAddComponent from "../../../../../components/app/sidebars/topology/machine/UnitAddComponent";
+import { connect } from 'react-redux'
+import { addUnit } from '../../../../../actions/topology/machine'
+import UnitAddComponent from '../../../../../components/app/sidebars/topology/machine/UnitAddComponent'
const mapStateToProps = (state, ownProps) => {
- return {
- units: Object.values(state.objects[ownProps.unitType])
- };
-};
+ return {
+ units: Object.values(state.objects[ownProps.unitType]),
+ }
+}
const mapDispatchToProps = (dispatch, ownProps) => {
- return {
- onAdd: id => dispatch(addUnit(ownProps.unitType, id))
- };
-};
+ return {
+ onAdd: id => dispatch(addUnit(ownProps.unitType, id)),
+ }
+}
const UnitAddContainer = connect(mapStateToProps, mapDispatchToProps)(
- UnitAddComponent
-);
+ UnitAddComponent,
+)
-export default UnitAddContainer;
+export default UnitAddContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js
index a919e8d3..1a01cad0 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js
@@ -1,22 +1,22 @@
-import { connect } from "react-redux";
-import { deleteUnit } from "../../../../../actions/topology/machine";
-import UnitComponent from "../../../../../components/app/sidebars/topology/machine/UnitComponent";
+import { connect } from 'react-redux'
+import { deleteUnit } from '../../../../../actions/topology/machine'
+import UnitComponent from '../../../../../components/app/sidebars/topology/machine/UnitComponent'
const mapStateToProps = (state, ownProps) => {
- return {
- unit: state.objects[ownProps.unitType][ownProps.unitId],
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ unit: state.objects[ownProps.unitType][ownProps.unitId],
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
const mapDispatchToProps = (dispatch, ownProps) => {
- return {
- onDelete: () => dispatch(deleteUnit(ownProps.unitType, ownProps.index))
- };
-};
+ return {
+ onDelete: () => dispatch(deleteUnit(ownProps.unitType, ownProps.index)),
+ }
+}
const UnitContainer = connect(mapStateToProps, mapDispatchToProps)(
- UnitComponent
-);
+ UnitComponent,
+)
-export default UnitContainer;
+export default UnitContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js
index 6554b8f8..fce657d4 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js
@@ -1,18 +1,18 @@
-import { connect } from "react-redux";
-import UnitListComponent from "../../../../../components/app/sidebars/topology/machine/UnitListComponent";
+import { connect } from 'react-redux'
+import UnitListComponent from '../../../../../components/app/sidebars/topology/machine/UnitListComponent'
const mapStateToProps = (state, ownProps) => {
- return {
- unitIds:
- state.objects.machine[
- state.objects.rack[
- state.objects.tile[state.interactionLevel.tileId].objectId
- ].machineIds[state.interactionLevel.position - 1]
- ][ownProps.unitType + "Ids"],
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ unitIds:
+ state.objects.machine[
+ state.objects.rack[
+ state.objects.tile[state.interactionLevel.tileId].objectId
+ ].machineIds[state.interactionLevel.position - 1]
+ ][ownProps.unitType + 'Ids'],
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
-const UnitListContainer = connect(mapStateToProps)(UnitListComponent);
+const UnitListContainer = connect(mapStateToProps)(UnitListComponent)
-export default UnitListContainer;
+export default UnitListContainer
diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitTabsContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitTabsContainer.js
index 85d83877..3490cce6 100644
--- a/frontend/src/containers/app/sidebars/topology/machine/UnitTabsContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/machine/UnitTabsContainer.js
@@ -1,12 +1,12 @@
-import { connect } from "react-redux";
-import UnitTabsComponent from "../../../../../components/app/sidebars/topology/machine/UnitTabsComponent";
+import { connect } from 'react-redux'
+import UnitTabsComponent from '../../../../../components/app/sidebars/topology/machine/UnitTabsComponent'
const mapStateToProps = state => {
- return {
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
-const UnitTabsContainer = connect(mapStateToProps)(UnitTabsComponent);
+const UnitTabsContainer = connect(mapStateToProps)(UnitTabsComponent)
-export default UnitTabsContainer;
+export default UnitTabsContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/BackToRoomContainer.js b/frontend/src/containers/app/sidebars/topology/rack/BackToRoomContainer.js
index 1b1bb2b0..35b76d70 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/BackToRoomContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/BackToRoomContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { goDownOneInteractionLevel } from "../../../../../actions/interaction-level";
-import BackToRoomComponent from "../../../../../components/app/sidebars/topology/rack/BackToRoomComponent";
+import { connect } from 'react-redux'
+import { goDownOneInteractionLevel } from '../../../../../actions/interaction-level'
+import BackToRoomComponent from '../../../../../components/app/sidebars/topology/rack/BackToRoomComponent'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(goDownOneInteractionLevel())
- };
-};
+ return {
+ onClick: () => dispatch(goDownOneInteractionLevel()),
+ }
+}
const BackToRoomContainer = connect(undefined, mapDispatchToProps)(
- BackToRoomComponent
-);
+ BackToRoomComponent,
+)
-export default BackToRoomContainer;
+export default BackToRoomContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/DeleteRackContainer.js b/frontend/src/containers/app/sidebars/topology/rack/DeleteRackContainer.js
index a54ceb23..b45a419b 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/DeleteRackContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/DeleteRackContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { openDeleteRackModal } from "../../../../../actions/modals/topology";
-import DeleteRackComponent from "../../../../../components/app/sidebars/topology/rack/DeleteRackComponent";
+import { connect } from 'react-redux'
+import { openDeleteRackModal } from '../../../../../actions/modals/topology'
+import DeleteRackComponent from '../../../../../components/app/sidebars/topology/rack/DeleteRackComponent'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(openDeleteRackModal())
- };
-};
+ return {
+ onClick: () => dispatch(openDeleteRackModal()),
+ }
+}
const DeleteRackContainer = connect(undefined, mapDispatchToProps)(
- DeleteRackComponent
-);
+ DeleteRackComponent,
+)
-export default DeleteRackContainer;
+export default DeleteRackContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/EmptySlotContainer.js b/frontend/src/containers/app/sidebars/topology/rack/EmptySlotContainer.js
index 527805a2..07439dc9 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/EmptySlotContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/EmptySlotContainer.js
@@ -1,21 +1,21 @@
-import { connect } from "react-redux";
-import { addMachine } from "../../../../../actions/topology/rack";
-import EmptySlotComponent from "../../../../../components/app/sidebars/topology/rack/EmptySlotComponent";
+import { connect } from 'react-redux'
+import { addMachine } from '../../../../../actions/topology/rack'
+import EmptySlotComponent from '../../../../../components/app/sidebars/topology/rack/EmptySlotComponent'
const mapStateToProps = state => {
- return {
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
const mapDispatchToProps = (dispatch, ownProps) => {
- return {
- onAdd: () => dispatch(addMachine(ownProps.position))
- };
-};
+ return {
+ onAdd: () => dispatch(addMachine(ownProps.position)),
+ }
+}
const EmptySlotContainer = connect(mapStateToProps, mapDispatchToProps)(
- EmptySlotComponent
-);
+ EmptySlotComponent,
+)
-export default EmptySlotContainer;
+export default EmptySlotContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js b/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js
index 8cd177e7..f205257e 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js
@@ -1,40 +1,40 @@
-import { connect } from "react-redux";
-import { goFromRackToMachine } from "../../../../../actions/interaction-level";
-import MachineComponent from "../../../../../components/app/sidebars/topology/rack/MachineComponent";
-import { getStateLoad } from "../../../../../util/simulation-load";
+import { connect } from 'react-redux'
+import { goFromRackToMachine } from '../../../../../actions/interaction-level'
+import MachineComponent from '../../../../../components/app/sidebars/topology/rack/MachineComponent'
+import { getStateLoad } from '../../../../../util/simulation-load'
const mapStateToProps = (state, ownProps) => {
- const machine = state.objects.machine[ownProps.machineId];
- const inSimulation = state.currentExperimentId !== -1;
+ const machine = state.objects.machine[ownProps.machineId]
+ const inSimulation = state.currentExperimentId !== -1
- let machineLoad = undefined;
- if (inSimulation) {
- if (
- state.states.machine[state.currentTick] &&
- state.states.machine[state.currentTick][machine.id]
- ) {
- machineLoad = getStateLoad(
- state.loadMetric,
- state.states.machine[state.currentTick][machine.id]
- );
+ let machineLoad = undefined
+ if (inSimulation) {
+ if (
+ state.states.machine[state.currentTick] &&
+ state.states.machine[state.currentTick][machine.id]
+ ) {
+ machineLoad = getStateLoad(
+ state.loadMetric,
+ state.states.machine[state.currentTick][machine.id],
+ )
+ }
}
- }
- return {
- machine,
- inSimulation,
- machineLoad
- };
-};
+ return {
+ machine,
+ inSimulation,
+ machineLoad,
+ }
+}
const mapDispatchToProps = (dispatch, ownProps) => {
- return {
- onClick: () => dispatch(goFromRackToMachine(ownProps.position))
- };
-};
+ return {
+ onClick: () => dispatch(goFromRackToMachine(ownProps.position)),
+ }
+}
const MachineContainer = connect(mapStateToProps, mapDispatchToProps)(
- MachineComponent
-);
+ MachineComponent,
+)
-export default MachineContainer;
+export default MachineContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js b/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js
index b19a50ae..3a797ed5 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import MachineListComponent from "../../../../../components/app/sidebars/topology/rack/MachineListComponent";
+import { connect } from 'react-redux'
+import MachineListComponent from '../../../../../components/app/sidebars/topology/rack/MachineListComponent'
const mapStateToProps = state => {
- return {
- machineIds:
- state.objects.rack[
- state.objects.tile[state.interactionLevel.tileId].objectId
- ].machineIds
- };
-};
+ return {
+ machineIds:
+ state.objects.rack[
+ state.objects.tile[state.interactionLevel.tileId].objectId
+ ].machineIds,
+ }
+}
-const MachineListContainer = connect(mapStateToProps)(MachineListComponent);
+const MachineListContainer = connect(mapStateToProps)(MachineListComponent)
-export default MachineListContainer;
+export default MachineListContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js b/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js
index 8f364ca0..11173b82 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js
@@ -1,24 +1,24 @@
-import { connect } from "react-redux";
-import { openEditRackNameModal } from "../../../../../actions/modals/topology";
-import RackNameComponent from "../../../../../components/app/sidebars/topology/rack/RackNameComponent";
+import { connect } from 'react-redux'
+import { openEditRackNameModal } from '../../../../../actions/modals/topology'
+import RackNameComponent from '../../../../../components/app/sidebars/topology/rack/RackNameComponent'
const mapStateToProps = state => {
- return {
- rackName:
- state.objects.rack[
- state.objects.tile[state.interactionLevel.tileId].objectId
- ].name
- };
-};
+ return {
+ rackName:
+ state.objects.rack[
+ state.objects.tile[state.interactionLevel.tileId].objectId
+ ].name,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onEdit: () => dispatch(openEditRackNameModal())
- };
-};
+ return {
+ onEdit: () => dispatch(openEditRackNameModal()),
+ }
+}
const RackNameContainer = connect(mapStateToProps, mapDispatchToProps)(
- RackNameComponent
-);
+ RackNameComponent,
+)
-export default RackNameContainer;
+export default RackNameContainer
diff --git a/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js
index 0a2bfdcc..89382ef0 100644
--- a/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js
@@ -1,13 +1,13 @@
-import { connect } from "react-redux";
-import RackSidebarComponent from "../../../../../components/app/sidebars/topology/rack/RackSidebarComponent";
+import { connect } from 'react-redux'
+import RackSidebarComponent from '../../../../../components/app/sidebars/topology/rack/RackSidebarComponent'
const mapStateToProps = state => {
- return {
- rackId: state.objects.tile[state.interactionLevel.tileId].objectId,
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ rackId: state.objects.tile[state.interactionLevel.tileId].objectId,
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
-const RackSidebarContainer = connect(mapStateToProps)(RackSidebarComponent);
+const RackSidebarContainer = connect(mapStateToProps)(RackSidebarComponent)
-export default RackSidebarContainer;
+export default RackSidebarContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js b/frontend/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js
index 02288b7b..bf4ecbb5 100644
--- a/frontend/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/BackToBuildingContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { goDownOneInteractionLevel } from "../../../../../actions/interaction-level";
-import BackToBuildingComponent from "../../../../../components/app/sidebars/topology/room/BackToBuildingComponent";
+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())
- };
-};
+ return {
+ onClick: () => dispatch(goDownOneInteractionLevel()),
+ }
+}
const BackToBuildingContainer = connect(undefined, mapDispatchToProps)(
- BackToBuildingComponent
-);
+ BackToBuildingComponent,
+)
-export default BackToBuildingContainer;
+export default BackToBuildingContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js b/frontend/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js
index 5223061d..0f699888 100644
--- a/frontend/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/DeleteRoomContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { openDeleteRoomModal } from "../../../../../actions/modals/topology";
-import DeleteRoomComponent from "../../../../../components/app/sidebars/topology/room/DeleteRoomComponent";
+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())
- };
-};
+ return {
+ onClick: () => dispatch(openDeleteRoomModal()),
+ }
+}
const DeleteRoomContainer = connect(undefined, mapDispatchToProps)(
- DeleteRoomComponent
-);
+ DeleteRoomComponent,
+)
-export default DeleteRoomContainer;
+export default DeleteRoomContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js b/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js
index 81052f54..29014022 100644
--- a/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js
@@ -1,26 +1,26 @@
-import { connect } from "react-redux";
+import { connect } from 'react-redux'
import {
- finishRoomEdit,
- startRoomEdit
-} from "../../../../../actions/topology/building";
-import EditRoomComponent from "../../../../../components/app/sidebars/topology/room/EditRoomComponent";
+ 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
- };
-};
+ return {
+ isEditing: state.construction.currentRoomInConstruction !== -1,
+ isInRackConstructionMode: state.construction.inRackConstructionMode,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onEdit: () => dispatch(startRoomEdit()),
- onFinish: () => dispatch(finishRoomEdit())
- };
-};
+ return {
+ onEdit: () => dispatch(startRoomEdit()),
+ onFinish: () => dispatch(finishRoomEdit()),
+ }
+}
const EditRoomContainer = connect(mapStateToProps, mapDispatchToProps)(
- EditRoomComponent
-);
+ EditRoomComponent,
+)
-export default EditRoomContainer;
+export default EditRoomContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js b/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js
index c784d3ae..fe42647c 100644
--- a/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js
@@ -1,26 +1,26 @@
-import { connect } from "react-redux";
+import { connect } from 'react-redux'
import {
- startRackConstruction,
- stopRackConstruction
-} from "../../../../../actions/topology/room";
-import RackConstructionComponent from "../../../../../components/app/sidebars/topology/room/RackConstructionComponent";
+ 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
- };
-};
+ return {
+ inRackConstructionMode: state.construction.inRackConstructionMode,
+ isEditingRoom: state.construction.currentRoomInConstruction !== -1,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onStart: () => dispatch(startRackConstruction()),
- onStop: () => dispatch(stopRackConstruction())
- };
-};
+ return {
+ onStart: () => dispatch(startRackConstruction()),
+ onStop: () => dispatch(stopRackConstruction()),
+ }
+}
const RackConstructionContainer = connect(mapStateToProps, mapDispatchToProps)(
- RackConstructionComponent
-);
+ RackConstructionComponent,
+)
-export default RackConstructionContainer;
+export default RackConstructionContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/RoomNameContainer.js b/frontend/src/containers/app/sidebars/topology/room/RoomNameContainer.js
index 36125521..dae7dcc0 100644
--- a/frontend/src/containers/app/sidebars/topology/room/RoomNameContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/RoomNameContainer.js
@@ -1,21 +1,21 @@
-import { connect } from "react-redux";
-import { openEditRoomNameModal } from "../../../../../actions/modals/topology";
-import RoomNameComponent from "../../../../../components/app/sidebars/topology/room/RoomNameComponent";
+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
- };
-};
+ return {
+ roomName: state.objects.room[state.interactionLevel.roomId].name,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onEdit: () => dispatch(openEditRoomNameModal())
- };
-};
+ return {
+ onEdit: () => dispatch(openEditRoomNameModal()),
+ }
+}
const RoomNameContainer = connect(mapStateToProps, mapDispatchToProps)(
- RoomNameComponent
-);
+ RoomNameComponent,
+)
-export default RoomNameContainer;
+export default RoomNameContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js
index 38d5fb80..f940b282 100644
--- a/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js
@@ -1,14 +1,14 @@
-import { connect } from "react-redux";
-import RoomSidebarComponent from "../../../../../components/app/sidebars/topology/room/RoomSidebarComponent";
+import { connect } from 'react-redux'
+import RoomSidebarComponent from '../../../../../components/app/sidebars/topology/room/RoomSidebarComponent'
const mapStateToProps = state => {
- return {
- roomId: state.interactionLevel.roomId,
- roomType: state.objects.room[state.interactionLevel.roomId].roomType,
- inSimulation: state.currentExperimentId !== -1
- };
-};
+ return {
+ roomId: state.interactionLevel.roomId,
+ roomType: state.objects.room[state.interactionLevel.roomId].roomType,
+ inSimulation: state.currentExperimentId !== -1,
+ }
+}
-const RoomSidebarContainer = connect(mapStateToProps)(RoomSidebarComponent);
+const RoomSidebarContainer = connect(mapStateToProps)(RoomSidebarComponent)
-export default RoomSidebarContainer;
+export default RoomSidebarContainer
diff --git a/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js b/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js
index 414852f1..de4c8c85 100644
--- a/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js
+++ b/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js
@@ -1,12 +1,12 @@
-import { connect } from "react-redux";
-import RoomTypeComponent from "../../../../../components/app/sidebars/topology/room/RoomTypeComponent";
+import { connect } from 'react-redux'
+import RoomTypeComponent from '../../../../../components/app/sidebars/topology/room/RoomTypeComponent'
const mapStateToProps = state => {
- return {
- roomType: state.objects.room[state.interactionLevel.roomId].roomType
- };
-};
+ return {
+ roomType: state.objects.room[state.interactionLevel.roomId].roomType,
+ }
+}
-const RoomNameContainer = connect(mapStateToProps)(RoomTypeComponent);
+const RoomNameContainer = connect(mapStateToProps)(RoomTypeComponent)
-export default RoomNameContainer;
+export default RoomNameContainer
diff --git a/frontend/src/containers/app/timeline/PlayButtonContainer.js b/frontend/src/containers/app/timeline/PlayButtonContainer.js
index 4e3c3d81..e332f08b 100644
--- a/frontend/src/containers/app/timeline/PlayButtonContainer.js
+++ b/frontend/src/containers/app/timeline/PlayButtonContainer.js
@@ -1,27 +1,27 @@
-import { connect } from "react-redux";
+import { connect } from 'react-redux'
import {
- pauseSimulation,
- playSimulation
-} from "../../../actions/simulation/playback";
-import PlayButtonComponent from "../../../components/app/timeline/PlayButtonComponent";
+ pauseSimulation,
+ playSimulation,
+} from '../../../actions/simulation/playback'
+import PlayButtonComponent from '../../../components/app/timeline/PlayButtonComponent'
const mapStateToProps = state => {
- return {
- isPlaying: state.isPlaying,
- currentTick: state.currentTick,
- lastSimulatedTick: state.lastSimulatedTick
- };
-};
+ return {
+ isPlaying: state.isPlaying,
+ currentTick: state.currentTick,
+ lastSimulatedTick: state.lastSimulatedTick,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onPlay: () => dispatch(playSimulation()),
- onPause: () => dispatch(pauseSimulation())
- };
-};
+ return {
+ onPlay: () => dispatch(playSimulation()),
+ onPause: () => dispatch(pauseSimulation()),
+ }
+}
const PlayButtonContainer = connect(mapStateToProps, mapDispatchToProps)(
- PlayButtonComponent
-);
+ PlayButtonComponent,
+)
-export default PlayButtonContainer;
+export default PlayButtonContainer
diff --git a/frontend/src/containers/app/timeline/TimelineContainer.js b/frontend/src/containers/app/timeline/TimelineContainer.js
index 74d37d58..4fcaaaaf 100644
--- a/frontend/src/containers/app/timeline/TimelineContainer.js
+++ b/frontend/src/containers/app/timeline/TimelineContainer.js
@@ -1,41 +1,41 @@
-import { connect } from "react-redux";
-import { pauseSimulation } from "../../../actions/simulation/playback";
-import { incrementTick } from "../../../actions/simulation/tick";
-import { setCurrentDatacenter } from "../../../actions/topology/building";
-import TimelineComponent from "../../../components/app/timeline/TimelineComponent";
+import { connect } from 'react-redux'
+import { pauseSimulation } from '../../../actions/simulation/playback'
+import { incrementTick } from '../../../actions/simulation/tick'
+import { setCurrentDatacenter } from '../../../actions/topology/building'
+import TimelineComponent from '../../../components/app/timeline/TimelineComponent'
const mapStateToProps = state => {
- let sections = [];
- if (state.currentExperimentId !== -1) {
- const sectionIds =
- state.objects.path[
- state.objects.experiment[state.currentExperimentId].pathId
- ].sectionIds;
+ let sections = []
+ if (state.currentExperimentId !== -1) {
+ const sectionIds =
+ state.objects.path[
+ state.objects.experiment[state.currentExperimentId].pathId
+ ].sectionIds
- if (sectionIds) {
- sections = sectionIds.map(sectionId => state.objects.section[sectionId]);
+ if (sectionIds) {
+ sections = sectionIds.map(sectionId => state.objects.section[sectionId])
+ }
}
- }
- return {
- isPlaying: state.isPlaying,
- currentTick: state.currentTick,
- lastSimulatedTick: state.lastSimulatedTick,
- currentDatacenterId: state.currentDatacenterId,
- sections
- };
-};
+ return {
+ isPlaying: state.isPlaying,
+ currentTick: state.currentTick,
+ lastSimulatedTick: state.lastSimulatedTick,
+ currentDatacenterId: state.currentDatacenterId,
+ sections,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- incrementTick: () => dispatch(incrementTick()),
- pauseSimulation: () => dispatch(pauseSimulation()),
- setCurrentDatacenter: id => dispatch(setCurrentDatacenter(id))
- };
-};
+ return {
+ incrementTick: () => dispatch(incrementTick()),
+ pauseSimulation: () => dispatch(pauseSimulation()),
+ setCurrentDatacenter: id => dispatch(setCurrentDatacenter(id)),
+ }
+}
const TimelineContainer = connect(mapStateToProps, mapDispatchToProps)(
- TimelineComponent
-);
+ TimelineComponent,
+)
-export default TimelineContainer;
+export default TimelineContainer
diff --git a/frontend/src/containers/app/timeline/TimelineControlsContainer.js b/frontend/src/containers/app/timeline/TimelineControlsContainer.js
index ac851b2e..92e03e6a 100644
--- a/frontend/src/containers/app/timeline/TimelineControlsContainer.js
+++ b/frontend/src/containers/app/timeline/TimelineControlsContainer.js
@@ -1,36 +1,36 @@
-import { connect } from "react-redux";
-import { goToTick } from "../../../actions/simulation/tick";
-import TimelineControlsComponent from "../../../components/app/timeline/TimelineControlsComponent";
+import { connect } from 'react-redux'
+import { goToTick } from '../../../actions/simulation/tick'
+import TimelineControlsComponent from '../../../components/app/timeline/TimelineControlsComponent'
const mapStateToProps = state => {
- let sectionTicks = [];
- if (state.currentExperimentId !== -1) {
- const sectionIds =
- state.objects.path[
- state.objects.experiment[state.currentExperimentId].pathId
- ].sectionIds;
- if (sectionIds) {
- sectionTicks = sectionIds
- .filter(sectionId => state.objects.section[sectionId].startTick !== 0)
- .map(sectionId => state.objects.section[sectionId].startTick);
+ let sectionTicks = []
+ if (state.currentExperimentId !== -1) {
+ const sectionIds =
+ state.objects.path[
+ state.objects.experiment[state.currentExperimentId].pathId
+ ].sectionIds
+ if (sectionIds) {
+ sectionTicks = sectionIds
+ .filter(sectionId => state.objects.section[sectionId].startTick !== 0)
+ .map(sectionId => state.objects.section[sectionId].startTick)
+ }
}
- }
- return {
- currentTick: state.currentTick,
- lastSimulatedTick: state.lastSimulatedTick,
- sectionTicks
- };
-};
+ return {
+ currentTick: state.currentTick,
+ lastSimulatedTick: state.lastSimulatedTick,
+ sectionTicks,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- goToTick: tick => dispatch(goToTick(tick))
- };
-};
+ return {
+ goToTick: tick => dispatch(goToTick(tick)),
+ }
+}
const TimelineControlsContainer = connect(mapStateToProps, mapDispatchToProps)(
- TimelineControlsComponent
-);
+ TimelineControlsComponent,
+)
-export default TimelineControlsContainer;
+export default TimelineControlsContainer
diff --git a/frontend/src/containers/app/timeline/TimelineLabelsContainer.js b/frontend/src/containers/app/timeline/TimelineLabelsContainer.js
index 9d7f268d..192d21c3 100644
--- a/frontend/src/containers/app/timeline/TimelineLabelsContainer.js
+++ b/frontend/src/containers/app/timeline/TimelineLabelsContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import TimelineLabelsComponent from "../../../components/app/timeline/TimelineLabelsComponent";
+import { connect } from 'react-redux'
+import TimelineLabelsComponent from '../../../components/app/timeline/TimelineLabelsComponent'
const mapStateToProps = state => {
- return {
- currentTick: state.currentTick,
- lastSimulatedTick: state.lastSimulatedTick
- };
-};
+ return {
+ currentTick: state.currentTick,
+ lastSimulatedTick: state.lastSimulatedTick,
+ }
+}
const TimelineLabelsContainer = connect(mapStateToProps)(
- TimelineLabelsComponent
-);
+ TimelineLabelsComponent,
+)
-export default TimelineLabelsContainer;
+export default TimelineLabelsContainer
diff --git a/frontend/src/containers/auth/Login.js b/frontend/src/containers/auth/Login.js
index 15af8e62..951f6b10 100644
--- a/frontend/src/containers/auth/Login.js
+++ b/frontend/src/containers/auth/Login.js
@@ -1,65 +1,63 @@
-import PropTypes from "prop-types";
-import React from "react";
-import GoogleLogin from "react-google-login";
-import { connect } from "react-redux";
-import { logIn } from "../../actions/auth";
+import PropTypes from 'prop-types'
+import React from 'react'
+import GoogleLogin from 'react-google-login'
+import { connect } from 'react-redux'
+import { logIn } from '../../actions/auth'
class LoginContainer extends React.Component {
- static propTypes = {
- visible: PropTypes.bool.isRequired,
- onLogin: PropTypes.func.isRequired
- };
-
- onAuthResponse(response) {
- this.props.onLogin({
- email: response.getBasicProfile().getEmail(),
- givenName: response.getBasicProfile().getGivenName(),
- familyName: response.getBasicProfile().getFamilyName(),
- googleId: response.googleId,
- authToken: response.getAuthResponse().id_token,
- expiresAt: response.getAuthResponse().expires_at
- });
- }
+ static propTypes = {
+ visible: PropTypes.bool.isRequired,
+ onLogin: PropTypes.func.isRequired,
+ }
- onAuthFailure(error) {
- console.error(error);
- }
+ onAuthResponse(response) {
+ this.props.onLogin({
+ email: response.getBasicProfile().getEmail(),
+ givenName: response.getBasicProfile().getGivenName(),
+ familyName: response.getBasicProfile().getFamilyName(),
+ googleId: response.googleId,
+ authToken: response.getAuthResponse().id_token,
+ expiresAt: response.getAuthResponse().expires_at,
+ })
+ }
- render() {
- if (!this.props.visible) {
- return <span />;
+ onAuthFailure(error) {
+ console.error(error)
}
- return (
- <GoogleLogin
- clientId={process.env.REACT_APP_OAUTH_CLIENT_ID}
- onSuccess={this.onAuthResponse.bind(this)}
- onFailure={this.onAuthFailure.bind(this)}
- render={renderProps => (
- <span onClick={renderProps.onClick} className="login btn btn-primary">
- <span className="fa fa-google" /> Login with Google
+ render() {
+ if (!this.props.visible) {
+ return <span/>
+ }
+
+ return (
+ <GoogleLogin
+ clientId={process.env.REACT_APP_OAUTH_CLIENT_ID}
+ onSuccess={this.onAuthResponse.bind(this)}
+ onFailure={this.onAuthFailure.bind(this)}
+ render={renderProps => (
+ <span onClick={renderProps.onClick} className="login btn btn-primary">
+ <span className="fa fa-google"/> Login with Google
</span>
- )}
- />
- );
- }
+ )}
+ >
+ </GoogleLogin>
+ )
+ }
}
const mapStateToProps = (state, ownProps) => {
- return {
- visible: ownProps.visible
- };
-};
+ return {
+ visible: ownProps.visible,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onLogin: payload => dispatch(logIn(payload))
- };
-};
+ return {
+ onLogin: payload => dispatch(logIn(payload)),
+ }
+}
-const Login = connect(
- mapStateToProps,
- mapDispatchToProps
-)(LoginContainer);
+const Login = connect(mapStateToProps, mapDispatchToProps)(LoginContainer)
-export default Login;
+export default Login
diff --git a/frontend/src/containers/auth/Logout.js b/frontend/src/containers/auth/Logout.js
index 918932f6..6e885fb1 100644
--- a/frontend/src/containers/auth/Logout.js
+++ b/frontend/src/containers/auth/Logout.js
@@ -1,13 +1,13 @@
-import { connect } from "react-redux";
-import { logOut } from "../../actions/auth";
-import LogoutButton from "../../components/navigation/LogoutButton";
+import { connect } from 'react-redux'
+import { logOut } from '../../actions/auth'
+import LogoutButton from '../../components/navigation/LogoutButton'
const mapDispatchToProps = dispatch => {
- return {
- onLogout: () => dispatch(logOut())
- };
-};
+ return {
+ onLogout: () => dispatch(logOut()),
+ }
+}
-const Logout = connect(undefined, mapDispatchToProps)(LogoutButton);
+const Logout = connect(undefined, mapDispatchToProps)(LogoutButton)
-export default Logout;
+export default Logout
diff --git a/frontend/src/containers/auth/ProfileName.js b/frontend/src/containers/auth/ProfileName.js
index 21941bd2..8511a9b1 100644
--- a/frontend/src/containers/auth/ProfileName.js
+++ b/frontend/src/containers/auth/ProfileName.js
@@ -1,14 +1,14 @@
-import React from "react";
-import { connect } from "react-redux";
+import React from 'react'
+import { connect } from 'react-redux'
const mapStateToProps = state => {
- return {
- text: state.auth.givenName + " " + state.auth.familyName
- };
-};
+ return {
+ text: state.auth.givenName + ' ' + state.auth.familyName,
+ }
+}
-const SpanElement = ({ text }) => <span>{text}</span>;
+const SpanElement = ({ text }) => <span>{text}</span>
-const ProfileName = connect(mapStateToProps)(SpanElement);
+const ProfileName = connect(mapStateToProps)(SpanElement)
-export default ProfileName;
+export default ProfileName
diff --git a/frontend/src/containers/experiments/ExperimentListContainer.js b/frontend/src/containers/experiments/ExperimentListContainer.js
index 53bb1dad..44fc8620 100644
--- a/frontend/src/containers/experiments/ExperimentListContainer.js
+++ b/frontend/src/containers/experiments/ExperimentListContainer.js
@@ -1,28 +1,28 @@
-import { connect } from "react-redux";
-import ExperimentListComponent from "../../components/experiments/ExperimentListComponent";
+import { connect } from 'react-redux'
+import ExperimentListComponent from '../../components/experiments/ExperimentListComponent'
const mapStateToProps = state => {
- if (
- state.currentSimulationId === -1 ||
- !("experimentIds" in state.objects.simulation[state.currentSimulationId])
- ) {
- return {
- loading: true,
- experimentIds: []
- };
- }
+ if (
+ state.currentSimulationId === -1 ||
+ !('experimentIds' in state.objects.simulation[state.currentSimulationId])
+ ) {
+ return {
+ loading: true,
+ experimentIds: [],
+ }
+ }
- const experimentIds =
- state.objects.simulation[state.currentSimulationId].experimentIds;
- if (experimentIds) {
- return {
- experimentIds
- };
- }
-};
+ const experimentIds =
+ state.objects.simulation[state.currentSimulationId].experimentIds
+ if (experimentIds) {
+ return {
+ experimentIds,
+ }
+ }
+}
const ExperimentListContainer = connect(mapStateToProps)(
- ExperimentListComponent
-);
+ ExperimentListComponent,
+)
-export default ExperimentListContainer;
+export default ExperimentListContainer
diff --git a/frontend/src/containers/experiments/ExperimentRowContainer.js b/frontend/src/containers/experiments/ExperimentRowContainer.js
index 96ebc3db..bec32617 100644
--- a/frontend/src/containers/experiments/ExperimentRowContainer.js
+++ b/frontend/src/containers/experiments/ExperimentRowContainer.js
@@ -1,30 +1,30 @@
-import { connect } from "react-redux";
-import { deleteExperiment } from "../../actions/experiments";
-import ExperimentRowComponent from "../../components/experiments/ExperimentRowComponent";
+import { connect } from 'react-redux'
+import { deleteExperiment } from '../../actions/experiments'
+import ExperimentRowComponent from '../../components/experiments/ExperimentRowComponent'
const mapStateToProps = (state, ownProps) => {
- const experiment = Object.assign(
- {},
- state.objects.experiment[ownProps.experimentId]
- );
- experiment.trace = state.objects.trace[experiment.traceId];
- experiment.scheduler = state.objects.scheduler[experiment.schedulerName];
- experiment.path = state.objects.path[experiment.pathId];
+ const experiment = Object.assign(
+ {},
+ state.objects.experiment[ownProps.experimentId],
+ )
+ experiment.trace = state.objects.trace[experiment.traceId]
+ experiment.scheduler = state.objects.scheduler[experiment.schedulerName]
+ experiment.path = state.objects.path[experiment.pathId]
- return {
- experiment,
- simulationId: state.currentSimulationId
- };
-};
+ return {
+ experiment,
+ simulationId: state.currentSimulationId,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onDelete: id => dispatch(deleteExperiment(id))
- };
-};
+ return {
+ onDelete: id => dispatch(deleteExperiment(id)),
+ }
+}
const ExperimentRowContainer = connect(mapStateToProps, mapDispatchToProps)(
- ExperimentRowComponent
-);
+ ExperimentRowComponent,
+)
-export default ExperimentRowContainer;
+export default ExperimentRowContainer
diff --git a/frontend/src/containers/experiments/NewExperimentButtonContainer.js b/frontend/src/containers/experiments/NewExperimentButtonContainer.js
index 60eb92a6..41895d8a 100644
--- a/frontend/src/containers/experiments/NewExperimentButtonContainer.js
+++ b/frontend/src/containers/experiments/NewExperimentButtonContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { openNewExperimentModal } from "../../actions/modals/experiments";
-import NewExperimentButtonComponent from "../../components/experiments/NewExperimentButtonComponent";
+import { connect } from 'react-redux'
+import { openNewExperimentModal } from '../../actions/modals/experiments'
+import NewExperimentButtonComponent from '../../components/experiments/NewExperimentButtonComponent'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(openNewExperimentModal())
- };
-};
+ return {
+ onClick: () => dispatch(openNewExperimentModal()),
+ }
+}
const NewExperimentButtonContainer = connect(undefined, mapDispatchToProps)(
- NewExperimentButtonComponent
-);
+ NewExperimentButtonComponent,
+)
-export default NewExperimentButtonContainer;
+export default NewExperimentButtonContainer
diff --git a/frontend/src/containers/modals/DeleteMachineModal.js b/frontend/src/containers/modals/DeleteMachineModal.js
index eba37833..02dfe8bb 100644
--- a/frontend/src/containers/modals/DeleteMachineModal.js
+++ b/frontend/src/containers/modals/DeleteMachineModal.js
@@ -1,37 +1,37 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeDeleteMachineModal } from "../../actions/modals/topology";
-import { deleteMachine } from "../../actions/topology/machine";
-import ConfirmationModal from "../../components/modals/ConfirmationModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeDeleteMachineModal } from '../../actions/modals/topology'
+import { deleteMachine } from '../../actions/topology/machine'
+import ConfirmationModal from '../../components/modals/ConfirmationModal'
const DeleteMachineModalComponent = ({ visible, callback }) => (
- <ConfirmationModal
- title="Delete this machine"
- message="Are you sure you want to delete this machine?"
- show={visible}
- callback={callback}
- />
-);
+ <ConfirmationModal
+ title="Delete this machine"
+ message="Are you sure you want to delete this machine?"
+ show={visible}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.deleteMachineModalVisible
- };
-};
+ return {
+ visible: state.modals.deleteMachineModalVisible,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: isConfirmed => {
- if (isConfirmed) {
- dispatch(deleteMachine());
- }
- dispatch(closeDeleteMachineModal());
+ return {
+ callback: isConfirmed => {
+ if (isConfirmed) {
+ dispatch(deleteMachine())
+ }
+ dispatch(closeDeleteMachineModal())
+ },
}
- };
-};
+}
const DeleteMachineModal = connect(mapStateToProps, mapDispatchToProps)(
- DeleteMachineModalComponent
-);
+ DeleteMachineModalComponent,
+)
-export default DeleteMachineModal;
+export default DeleteMachineModal
diff --git a/frontend/src/containers/modals/DeleteProfileModal.js b/frontend/src/containers/modals/DeleteProfileModal.js
index 674e9408..7518c4ba 100644
--- a/frontend/src/containers/modals/DeleteProfileModal.js
+++ b/frontend/src/containers/modals/DeleteProfileModal.js
@@ -1,37 +1,37 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeDeleteProfileModal } from "../../actions/modals/profile";
-import { deleteCurrentUser } from "../../actions/users";
-import ConfirmationModal from "../../components/modals/ConfirmationModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeDeleteProfileModal } from '../../actions/modals/profile'
+import { deleteCurrentUser } from '../../actions/users'
+import ConfirmationModal from '../../components/modals/ConfirmationModal'
const DeleteProfileModalComponent = ({ visible, callback }) => (
- <ConfirmationModal
- title="Delete my account"
- message="Are you sure you want to delete your OpenDC account?"
- show={visible}
- callback={callback}
- />
-);
+ <ConfirmationModal
+ title="Delete my account"
+ message="Are you sure you want to delete your OpenDC account?"
+ show={visible}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.deleteProfileModalVisible
- };
-};
+ return {
+ visible: state.modals.deleteProfileModalVisible,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: isConfirmed => {
- if (isConfirmed) {
- dispatch(deleteCurrentUser());
- }
- dispatch(closeDeleteProfileModal());
+ return {
+ callback: isConfirmed => {
+ if (isConfirmed) {
+ dispatch(deleteCurrentUser())
+ }
+ dispatch(closeDeleteProfileModal())
+ },
}
- };
-};
+}
const DeleteProfileModal = connect(mapStateToProps, mapDispatchToProps)(
- DeleteProfileModalComponent
-);
+ DeleteProfileModalComponent,
+)
-export default DeleteProfileModal;
+export default DeleteProfileModal
diff --git a/frontend/src/containers/modals/DeleteRackModal.js b/frontend/src/containers/modals/DeleteRackModal.js
index 41bacb37..a271522d 100644
--- a/frontend/src/containers/modals/DeleteRackModal.js
+++ b/frontend/src/containers/modals/DeleteRackModal.js
@@ -1,37 +1,37 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeDeleteRackModal } from "../../actions/modals/topology";
-import { deleteRack } from "../../actions/topology/rack";
-import ConfirmationModal from "../../components/modals/ConfirmationModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeDeleteRackModal } from '../../actions/modals/topology'
+import { deleteRack } from '../../actions/topology/rack'
+import ConfirmationModal from '../../components/modals/ConfirmationModal'
const DeleteRackModalComponent = ({ visible, callback }) => (
- <ConfirmationModal
- title="Delete this rack"
- message="Are you sure you want to delete this rack?"
- show={visible}
- callback={callback}
- />
-);
+ <ConfirmationModal
+ title="Delete this rack"
+ message="Are you sure you want to delete this rack?"
+ show={visible}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.deleteRackModalVisible
- };
-};
+ return {
+ visible: state.modals.deleteRackModalVisible,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: isConfirmed => {
- if (isConfirmed) {
- dispatch(deleteRack());
- }
- dispatch(closeDeleteRackModal());
+ return {
+ callback: isConfirmed => {
+ if (isConfirmed) {
+ dispatch(deleteRack())
+ }
+ dispatch(closeDeleteRackModal())
+ },
}
- };
-};
+}
const DeleteRackModal = connect(mapStateToProps, mapDispatchToProps)(
- DeleteRackModalComponent
-);
+ DeleteRackModalComponent,
+)
-export default DeleteRackModal;
+export default DeleteRackModal
diff --git a/frontend/src/containers/modals/DeleteRoomModal.js b/frontend/src/containers/modals/DeleteRoomModal.js
index 339ff22c..71f2f040 100644
--- a/frontend/src/containers/modals/DeleteRoomModal.js
+++ b/frontend/src/containers/modals/DeleteRoomModal.js
@@ -1,37 +1,37 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeDeleteRoomModal } from "../../actions/modals/topology";
-import { deleteRoom } from "../../actions/topology/room";
-import ConfirmationModal from "../../components/modals/ConfirmationModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeDeleteRoomModal } from '../../actions/modals/topology'
+import { deleteRoom } from '../../actions/topology/room'
+import ConfirmationModal from '../../components/modals/ConfirmationModal'
const DeleteRoomModalComponent = ({ visible, callback }) => (
- <ConfirmationModal
- title="Delete this room"
- message="Are you sure you want to delete this room?"
- show={visible}
- callback={callback}
- />
-);
+ <ConfirmationModal
+ title="Delete this room"
+ message="Are you sure you want to delete this room?"
+ show={visible}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.deleteRoomModalVisible
- };
-};
+ return {
+ visible: state.modals.deleteRoomModalVisible,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: isConfirmed => {
- if (isConfirmed) {
- dispatch(deleteRoom());
- }
- dispatch(closeDeleteRoomModal());
+ return {
+ callback: isConfirmed => {
+ if (isConfirmed) {
+ dispatch(deleteRoom())
+ }
+ dispatch(closeDeleteRoomModal())
+ },
}
- };
-};
+}
const DeleteRoomModal = connect(mapStateToProps, mapDispatchToProps)(
- DeleteRoomModalComponent
-);
+ DeleteRoomModalComponent,
+)
-export default DeleteRoomModal;
+export default DeleteRoomModal
diff --git a/frontend/src/containers/modals/EditRackNameModal.js b/frontend/src/containers/modals/EditRackNameModal.js
index 748e847b..e5c87e35 100644
--- a/frontend/src/containers/modals/EditRackNameModal.js
+++ b/frontend/src/containers/modals/EditRackNameModal.js
@@ -1,44 +1,44 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeEditRackNameModal } from "../../actions/modals/topology";
-import { editRackName } from "../../actions/topology/rack";
-import TextInputModal from "../../components/modals/TextInputModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeEditRackNameModal } from '../../actions/modals/topology'
+import { editRackName } from '../../actions/topology/rack'
+import TextInputModal from '../../components/modals/TextInputModal'
const EditRackNameModalComponent = ({ visible, previousName, callback }) => (
- <TextInputModal
- title="Edit rack name"
- label="Rack name"
- show={visible}
- initialValue={previousName}
- callback={callback}
- />
-);
+ <TextInputModal
+ title="Edit rack name"
+ label="Rack name"
+ show={visible}
+ initialValue={previousName}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.editRackNameModalVisible,
- previousName:
- state.interactionLevel.mode === "RACK"
- ? state.objects.rack[
- state.objects.tile[state.interactionLevel.tileId].objectId
- ].name
- : ""
- };
-};
+ return {
+ visible: state.modals.editRackNameModalVisible,
+ previousName:
+ state.interactionLevel.mode === 'RACK'
+ ? state.objects.rack[
+ state.objects.tile[state.interactionLevel.tileId].objectId
+ ].name
+ : '',
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: name => {
- if (name) {
- dispatch(editRackName(name));
- }
- dispatch(closeEditRackNameModal());
+ return {
+ callback: name => {
+ if (name) {
+ dispatch(editRackName(name))
+ }
+ dispatch(closeEditRackNameModal())
+ },
}
- };
-};
+}
const EditRackNameModal = connect(mapStateToProps, mapDispatchToProps)(
- EditRackNameModalComponent
-);
+ EditRackNameModalComponent,
+)
-export default EditRackNameModal;
+export default EditRackNameModal
diff --git a/frontend/src/containers/modals/EditRoomNameModal.js b/frontend/src/containers/modals/EditRoomNameModal.js
index be6c547c..973216ac 100644
--- a/frontend/src/containers/modals/EditRoomNameModal.js
+++ b/frontend/src/containers/modals/EditRoomNameModal.js
@@ -1,42 +1,42 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeEditRoomNameModal } from "../../actions/modals/topology";
-import { editRoomName } from "../../actions/topology/room";
-import TextInputModal from "../../components/modals/TextInputModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeEditRoomNameModal } from '../../actions/modals/topology'
+import { editRoomName } from '../../actions/topology/room'
+import TextInputModal from '../../components/modals/TextInputModal'
const EditRoomNameModalComponent = ({ visible, previousName, callback }) => (
- <TextInputModal
- title="Edit room name"
- label="Room name"
- show={visible}
- initialValue={previousName}
- callback={callback}
- />
-);
+ <TextInputModal
+ title="Edit room name"
+ label="Room name"
+ show={visible}
+ initialValue={previousName}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.editRoomNameModalVisible,
- previousName:
- state.interactionLevel.mode === "ROOM"
- ? state.objects.room[state.interactionLevel.roomId].name
- : ""
- };
-};
+ return {
+ visible: state.modals.editRoomNameModalVisible,
+ previousName:
+ state.interactionLevel.mode === 'ROOM'
+ ? state.objects.room[state.interactionLevel.roomId].name
+ : '',
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: name => {
- if (name) {
- dispatch(editRoomName(name));
- }
- dispatch(closeEditRoomNameModal());
+ return {
+ callback: name => {
+ if (name) {
+ dispatch(editRoomName(name))
+ }
+ dispatch(closeEditRoomNameModal())
+ },
}
- };
-};
+}
const EditRoomNameModal = connect(mapStateToProps, mapDispatchToProps)(
- EditRoomNameModalComponent
-);
+ EditRoomNameModalComponent,
+)
-export default EditRoomNameModal;
+export default EditRoomNameModal
diff --git a/frontend/src/containers/modals/NewExperimentModal.js b/frontend/src/containers/modals/NewExperimentModal.js
index c703c39a..db60f088 100644
--- a/frontend/src/containers/modals/NewExperimentModal.js
+++ b/frontend/src/containers/modals/NewExperimentModal.js
@@ -1,39 +1,39 @@
-import { connect } from "react-redux";
-import { addExperiment } from "../../actions/experiments";
-import { closeNewExperimentModal } from "../../actions/modals/experiments";
-import NewExperimentModalComponent from "../../components/modals/custom-components/NewExperimentModalComponent";
+import { connect } from 'react-redux'
+import { addExperiment } from '../../actions/experiments'
+import { closeNewExperimentModal } from '../../actions/modals/experiments'
+import NewExperimentModalComponent from '../../components/modals/custom-components/NewExperimentModalComponent'
const mapStateToProps = state => {
- return {
- show: state.modals.newExperimentModalVisible,
- paths: Object.values(state.objects.path).filter(
- path => path.simulationId === state.currentSimulationId
- ),
- traces: Object.values(state.objects.trace),
- schedulers: Object.values(state.objects.scheduler)
- };
-};
+ return {
+ show: state.modals.newExperimentModalVisible,
+ paths: Object.values(state.objects.path).filter(
+ path => path.simulationId === state.currentSimulationId,
+ ),
+ traces: Object.values(state.objects.trace),
+ schedulers: Object.values(state.objects.scheduler),
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: (name, pathId, traceId, schedulerName) => {
- if (name) {
- dispatch(
- addExperiment({
- name,
- pathId,
- traceId,
- schedulerName
- })
- );
- }
- dispatch(closeNewExperimentModal());
+ return {
+ callback: (name, pathId, traceId, schedulerName) => {
+ if (name) {
+ dispatch(
+ addExperiment({
+ name,
+ pathId,
+ traceId,
+ schedulerName,
+ }),
+ )
+ }
+ dispatch(closeNewExperimentModal())
+ },
}
- };
-};
+}
const NewExperimentModal = connect(mapStateToProps, mapDispatchToProps)(
- NewExperimentModalComponent
-);
+ NewExperimentModalComponent,
+)
-export default NewExperimentModal;
+export default NewExperimentModal
diff --git a/frontend/src/containers/modals/NewSimulationModal.js b/frontend/src/containers/modals/NewSimulationModal.js
index 80789cd2..e95ac4b0 100644
--- a/frontend/src/containers/modals/NewSimulationModal.js
+++ b/frontend/src/containers/modals/NewSimulationModal.js
@@ -1,37 +1,37 @@
-import React from "react";
-import { connect } from "react-redux";
-import { closeNewSimulationModal } from "../../actions/modals/simulations";
-import { addSimulation } from "../../actions/simulations";
-import TextInputModal from "../../components/modals/TextInputModal";
+import React from 'react'
+import { connect } from 'react-redux'
+import { closeNewSimulationModal } from '../../actions/modals/simulations'
+import { addSimulation } from '../../actions/simulations'
+import TextInputModal from '../../components/modals/TextInputModal'
const NewSimulationModalComponent = ({ visible, callback }) => (
- <TextInputModal
- title="New Simulation"
- label="Simulation title"
- show={visible}
- callback={callback}
- />
-);
+ <TextInputModal
+ title="New Simulation"
+ label="Simulation title"
+ show={visible}
+ callback={callback}
+ />
+)
const mapStateToProps = state => {
- return {
- visible: state.modals.newSimulationModalVisible
- };
-};
+ return {
+ visible: state.modals.newSimulationModalVisible,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- callback: text => {
- if (text) {
- dispatch(addSimulation(text));
- }
- dispatch(closeNewSimulationModal());
+ return {
+ callback: text => {
+ if (text) {
+ dispatch(addSimulation(text))
+ }
+ dispatch(closeNewSimulationModal())
+ },
}
- };
-};
+}
const NewSimulationModal = connect(mapStateToProps, mapDispatchToProps)(
- NewSimulationModalComponent
-);
+ NewSimulationModalComponent,
+)
-export default NewSimulationModal;
+export default NewSimulationModal
diff --git a/frontend/src/containers/simulations/FilterLink.js b/frontend/src/containers/simulations/FilterLink.js
index 2c5f4ed5..9eedd549 100644
--- a/frontend/src/containers/simulations/FilterLink.js
+++ b/frontend/src/containers/simulations/FilterLink.js
@@ -1,19 +1,19 @@
-import { connect } from "react-redux";
-import { setAuthVisibilityFilter } from "../../actions/simulations";
-import FilterButton from "../../components/simulations/FilterButton";
+import { connect } from 'react-redux'
+import { setAuthVisibilityFilter } from '../../actions/simulations'
+import FilterButton from '../../components/simulations/FilterButton'
const mapStateToProps = (state, ownProps) => {
- return {
- active: state.simulationList.authVisibilityFilter === ownProps.filter
- };
-};
+ return {
+ active: state.simulationList.authVisibilityFilter === ownProps.filter,
+ }
+}
const mapDispatchToProps = (dispatch, ownProps) => {
- return {
- onClick: () => dispatch(setAuthVisibilityFilter(ownProps.filter))
- };
-};
+ return {
+ onClick: () => dispatch(setAuthVisibilityFilter(ownProps.filter)),
+ }
+}
-const FilterLink = connect(mapStateToProps, mapDispatchToProps)(FilterButton);
+const FilterLink = connect(mapStateToProps, mapDispatchToProps)(FilterButton)
-export default FilterLink;
+export default FilterLink
diff --git a/frontend/src/containers/simulations/NewSimulationButtonContainer.js b/frontend/src/containers/simulations/NewSimulationButtonContainer.js
index 3ea04d24..2d7c7385 100644
--- a/frontend/src/containers/simulations/NewSimulationButtonContainer.js
+++ b/frontend/src/containers/simulations/NewSimulationButtonContainer.js
@@ -1,15 +1,15 @@
-import { connect } from "react-redux";
-import { openNewSimulationModal } from "../../actions/modals/simulations";
-import NewSimulationButtonComponent from "../../components/simulations/NewSimulationButtonComponent";
+import { connect } from 'react-redux'
+import { openNewSimulationModal } from '../../actions/modals/simulations'
+import NewSimulationButtonComponent from '../../components/simulations/NewSimulationButtonComponent'
const mapDispatchToProps = dispatch => {
- return {
- onClick: () => dispatch(openNewSimulationModal())
- };
-};
+ return {
+ onClick: () => dispatch(openNewSimulationModal()),
+ }
+}
const NewSimulationButtonContainer = connect(undefined, mapDispatchToProps)(
- NewSimulationButtonComponent
-);
+ NewSimulationButtonComponent,
+)
-export default NewSimulationButtonContainer;
+export default NewSimulationButtonContainer
diff --git a/frontend/src/containers/simulations/SimulationActions.js b/frontend/src/containers/simulations/SimulationActions.js
index 32243eff..6c662912 100644
--- a/frontend/src/containers/simulations/SimulationActions.js
+++ b/frontend/src/containers/simulations/SimulationActions.js
@@ -1,22 +1,23 @@
-import { connect } from "react-redux";
-import { deleteSimulation } from "../../actions/simulations";
-import SimulationActionButtons from "../../components/simulations/SimulationActionButtons";
+import { connect } from 'react-redux'
+import { deleteSimulation } from '../../actions/simulations'
+import SimulationActionButtons from '../../components/simulations/SimulationActionButtons'
const mapStateToProps = (state, ownProps) => {
- return {
- simulationId: ownProps.simulationId
- };
-};
+ return {
+ simulationId: ownProps.simulationId,
+ }
+}
const mapDispatchToProps = dispatch => {
- return {
- onViewUsers: id => {}, // TODO implement user viewing
- onDelete: id => dispatch(deleteSimulation(id))
- };
-};
+ return {
+ onViewUsers: id => {
+ }, // TODO implement user viewing
+ onDelete: id => dispatch(deleteSimulation(id)),
+ }
+}
const SimulationActions = connect(mapStateToProps, mapDispatchToProps)(
- SimulationActionButtons
-);
+ SimulationActionButtons,
+)
-export default SimulationActions;
+export default SimulationActions
diff --git a/frontend/src/containers/simulations/VisibleSimulationAuthList.js b/frontend/src/containers/simulations/VisibleSimulationAuthList.js
index ffc74d9e..f2b30542 100644
--- a/frontend/src/containers/simulations/VisibleSimulationAuthList.js
+++ b/frontend/src/containers/simulations/VisibleSimulationAuthList.js
@@ -1,42 +1,42 @@
-import { connect } from "react-redux";
-import SimulationList from "../../components/simulations/SimulationAuthList";
+import { connect } from 'react-redux'
+import SimulationList from '../../components/simulations/SimulationAuthList'
const getVisibleSimulationAuths = (simulationAuths, filter) => {
- switch (filter) {
- case "SHOW_ALL":
- return simulationAuths;
- case "SHOW_OWN":
- return simulationAuths.filter(
- simulationAuth => simulationAuth.authorizationLevel === "OWN"
- );
- case "SHOW_SHARED":
- return simulationAuths.filter(
- simulationAuth => simulationAuth.authorizationLevel !== "OWN"
- );
- default:
- return simulationAuths;
- }
-};
-
-const mapStateToProps = state => {
- const denormalizedAuthorizations = state.simulationList.authorizationsOfCurrentUser.map(
- authorizationIds => {
- const authorization = state.objects.authorization[authorizationIds];
- authorization.user = state.objects.user[authorization.userId];
- authorization.simulation =
- state.objects.simulation[authorization.simulationId];
- return authorization;
+ switch (filter) {
+ case 'SHOW_ALL':
+ return simulationAuths
+ case 'SHOW_OWN':
+ return simulationAuths.filter(
+ simulationAuth => simulationAuth.authorizationLevel === 'OWN',
+ )
+ case 'SHOW_SHARED':
+ return simulationAuths.filter(
+ simulationAuth => simulationAuth.authorizationLevel !== 'OWN',
+ )
+ default:
+ return simulationAuths
}
- );
+}
- return {
- authorizations: getVisibleSimulationAuths(
- denormalizedAuthorizations,
- state.simulationList.authVisibilityFilter
+const mapStateToProps = state => {
+ const denormalizedAuthorizations = state.simulationList.authorizationsOfCurrentUser.map(
+ authorizationIds => {
+ const authorization = state.objects.authorization[authorizationIds]
+ authorization.user = state.objects.user[authorization.userId]
+ authorization.simulation =
+ state.objects.simulation[authorization.simulationId]
+ return authorization
+ },
)
- };
-};
-const VisibleSimulationAuthList = connect(mapStateToProps)(SimulationList);
+ return {
+ authorizations: getVisibleSimulationAuths(
+ denormalizedAuthorizations,
+ state.simulationList.authVisibilityFilter,
+ ),
+ }
+}
+
+const VisibleSimulationAuthList = connect(mapStateToProps)(SimulationList)
-export default VisibleSimulationAuthList;
+export default VisibleSimulationAuthList