From 52865c97f820b883977179930ce4961abdb39c12 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 3 Jul 2020 11:46:29 +0200 Subject: Fix integer IDs and topology deletion --- frontend/src/containers/app/map/RackContainer.js | 2 +- frontend/src/containers/app/map/TileContainer.js | 2 +- frontend/src/containers/app/map/TopologyContainer.js | 2 +- frontend/src/containers/app/map/layers/RoomHoverLayer.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'frontend/src/containers/app/map') diff --git a/frontend/src/containers/app/map/RackContainer.js b/frontend/src/containers/app/map/RackContainer.js index 362ba2e2..34e7bbab 100644 --- a/frontend/src/containers/app/map/RackContainer.js +++ b/frontend/src/containers/app/map/RackContainer.js @@ -3,7 +3,7 @@ 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) { diff --git a/frontend/src/containers/app/map/TileContainer.js b/frontend/src/containers/app/map/TileContainer.js index 7d9f7754..28289206 100644 --- a/frontend/src/containers/app/map/TileContainer.js +++ b/frontend/src/containers/app/map/TileContainer.js @@ -5,7 +5,7 @@ import { getStateLoad } from '../../../util/simulation-load' const mapStateToProps = (state, ownProps) => { const tile = state.objects.tile[ownProps.tileId] - const inSimulation = state.currentExperimentId !== -1 + const inSimulation = state.currentExperimentId !== '-1' let roomLoad = undefined if (inSimulation) { diff --git a/frontend/src/containers/app/map/TopologyContainer.js b/frontend/src/containers/app/map/TopologyContainer.js index 37cc5a06..6f14d6cd 100644 --- a/frontend/src/containers/app/map/TopologyContainer.js +++ b/frontend/src/containers/app/map/TopologyContainer.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import TopologyGroup from '../../../components/app/map/groups/TopologyGroup' const mapStateToProps = state => { - if (state.currentTopologyId === -1) { + if (state.currentTopologyId === '-1') { return {} } diff --git a/frontend/src/containers/app/map/layers/RoomHoverLayer.js b/frontend/src/containers/app/map/layers/RoomHoverLayer.js index c05627ea..2c886c2f 100644 --- a/frontend/src/containers/app/map/layers/RoomHoverLayer.js +++ b/frontend/src/containers/app/map/layers/RoomHoverLayer.js @@ -11,7 +11,7 @@ const mapStateToProps = state => { return { mapPosition: state.map.position, mapScale: state.map.scale, - isEnabled: () => state.construction.currentRoomInConstruction !== -1, + isEnabled: () => state.construction.currentRoomInConstruction !== '-1', isValid: (x, y) => { const newRoom = Object.assign( {}, -- cgit v1.2.3