summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/pages
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-22 19:05:58 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-02-17 16:58:40 +0100
commit41e02cdab85ba5db92be7f7bea07ae1f20bcbdd9 (patch)
tree2f32b9b76b7bf05172c0e0d90ba60e06b7f34ae4 /opendc-web/opendc-web-ui/src/pages
parenta5b32960460b2e7b52032471bf23d29832734fba (diff)
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.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/pages')
-rw-r--r--opendc-web/opendc-web-ui/src/pages/projects/[project]/topologies/[topology].js13
1 files changed, 5 insertions, 8 deletions
diff --git a/opendc-web/opendc-web-ui/src/pages/projects/[project]/topologies/[topology].js b/opendc-web/opendc-web-ui/src/pages/projects/[project]/topologies/[topology].js
index 858f9b16..f7188d9f 100644
--- a/opendc-web/opendc-web-ui/src/pages/projects/[project]/topologies/[topology].js
+++ b/opendc-web/opendc-web-ui/src/pages/projects/[project]/topologies/[topology].js
@@ -20,6 +20,7 @@
* SOFTWARE.
*/
+import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import ContextSelectionSection from '../../../../components/context/ContextSelectionSection'
import ProjectSelector from '../../../../components/context/ProjectSelector'
@@ -44,9 +45,10 @@ import {
TextContent,
} from '@patternfly/react-core'
import BreadcrumbLink from '../../../../components/util/BreadcrumbLink'
-import TopologyMap from '../../../../components/topologies/TopologyMap'
import { goToRoom } from '../../../../redux/actions/interaction-level'
-import { openTopology } from '../../../../redux/actions/topologies'
+import { openTopology } from '../../../../redux/actions/topology'
+
+const TopologyMap = dynamic(() => import('../../../../components/topologies/TopologyMap'))
/**
* Page that displays a datacenter topology.
@@ -124,12 +126,7 @@ function Topology() {
}}
/>
</TabContent>
- <TabContent
- id="floor-plan"
- aria-label="Floor Plan tab"
- className="pf-u-h-100"
- hidden={activeTab !== 'floor-plan'}
- >
+ <TabContent id="floor-plan" aria-label="Floor Plan tab" className="pf-u-h-100" hidden={activeTab !== 'floor-plan'}>
<TopologyMap />
</TabContent>
</PageSection>