From 41e02cdab85ba5db92be7f7bea07ae1f20bcbdd9 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 22 Jul 2021 19:05:58 +0200 Subject: fix(web/ui): Fix creation of topologies This change fixes an issue with the creation of topologies in the frontend. Previously, the frontend relied on Redux to update the state. However, since we removed the reliance on Redux, we also need to create a new topology using the functions from React Query to actually send a request to the API server. --- opendc-web/opendc-web-ui/src/redux/reducers/topology/machine.js | 2 +- opendc-web/opendc-web-ui/src/redux/reducers/topology/rack.js | 2 +- opendc-web/opendc-web-ui/src/redux/reducers/topology/room.js | 2 +- opendc-web/opendc-web-ui/src/redux/reducers/topology/tile.js | 2 +- opendc-web/opendc-web-ui/src/redux/reducers/topology/topology.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'opendc-web/opendc-web-ui/src/redux/reducers') diff --git a/opendc-web/opendc-web-ui/src/redux/reducers/topology/machine.js b/opendc-web/opendc-web-ui/src/redux/reducers/topology/machine.js index 41773014..47af53cf 100644 --- a/opendc-web/opendc-web-ui/src/redux/reducers/topology/machine.js +++ b/opendc-web/opendc-web-ui/src/redux/reducers/topology/machine.js @@ -1,5 +1,5 @@ import produce from 'immer' -import { STORE_TOPOLOGY } from '../../actions/topologies' +import { STORE_TOPOLOGY } from '../../actions/topology' import { DELETE_MACHINE, ADD_UNIT, DELETE_UNIT } from '../../actions/topology/machine' import { ADD_MACHINE, DELETE_RACK } from '../../actions/topology/rack' diff --git a/opendc-web/opendc-web-ui/src/redux/reducers/topology/rack.js b/opendc-web/opendc-web-ui/src/redux/reducers/topology/rack.js index 9cc37124..155837cb 100644 --- a/opendc-web/opendc-web-ui/src/redux/reducers/topology/rack.js +++ b/opendc-web/opendc-web-ui/src/redux/reducers/topology/rack.js @@ -21,7 +21,7 @@ */ import produce from 'immer' -import { STORE_TOPOLOGY } from '../../actions/topologies' +import { STORE_TOPOLOGY } from '../../actions/topology' import { DELETE_MACHINE } from '../../actions/topology/machine' import { DELETE_RACK, EDIT_RACK_NAME, ADD_MACHINE } from '../../actions/topology/rack' import { ADD_RACK_TO_TILE } from '../../actions/topology/room' diff --git a/opendc-web/opendc-web-ui/src/redux/reducers/topology/room.js b/opendc-web/opendc-web-ui/src/redux/reducers/topology/room.js index b61c9d82..d6cc51c1 100644 --- a/opendc-web/opendc-web-ui/src/redux/reducers/topology/room.js +++ b/opendc-web/opendc-web-ui/src/redux/reducers/topology/room.js @@ -21,7 +21,7 @@ */ import produce from 'immer' -import { STORE_TOPOLOGY } from '../../actions/topologies' +import { STORE_TOPOLOGY } from '../../actions/topology' import { ADD_TILE, DELETE_TILE } from '../../actions/topology/building' import { DELETE_ROOM, EDIT_ROOM_NAME, ADD_ROOM } from '../../actions/topology/room' diff --git a/opendc-web/opendc-web-ui/src/redux/reducers/topology/tile.js b/opendc-web/opendc-web-ui/src/redux/reducers/topology/tile.js index e0c5dd33..6dbccb66 100644 --- a/opendc-web/opendc-web-ui/src/redux/reducers/topology/tile.js +++ b/opendc-web/opendc-web-ui/src/redux/reducers/topology/tile.js @@ -21,7 +21,7 @@ */ import produce from 'immer' -import { STORE_TOPOLOGY } from '../../actions/topologies' +import { STORE_TOPOLOGY } from '../../actions/topology' import { ADD_TILE, DELETE_TILE } from '../../actions/topology/building' import { DELETE_RACK } from '../../actions/topology/rack' import { ADD_RACK_TO_TILE } from '../../actions/topology/room' diff --git a/opendc-web/opendc-web-ui/src/redux/reducers/topology/topology.js b/opendc-web/opendc-web-ui/src/redux/reducers/topology/topology.js index da0e6988..cd9b5efd 100644 --- a/opendc-web/opendc-web-ui/src/redux/reducers/topology/topology.js +++ b/opendc-web/opendc-web-ui/src/redux/reducers/topology/topology.js @@ -21,7 +21,7 @@ */ import produce from 'immer' -import { STORE_TOPOLOGY } from '../../actions/topologies' +import { STORE_TOPOLOGY } from "../../actions/topology"; import { ADD_ROOM, DELETE_ROOM } from '../../actions/topology/room' function topology(state = undefined, action) { -- cgit v1.2.3