From d8eb2d7fd4cf15706bced6c6ceca320cfaecb2f7 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 22 Jul 2020 14:31:03 +0200 Subject: Implement topology duplication --- frontend/src/actions/topologies.js | 5 +++-- .../custom-components/NewTopologyModalComponent.js | 3 +-- frontend/src/containers/modals/NewTopologyModal.js | 7 +++---- frontend/src/sagas/objects.js | 20 ++++++++++++-------- frontend/src/sagas/topology.js | 11 +++++++++-- 5 files changed, 28 insertions(+), 18 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/actions/topologies.js b/frontend/src/actions/topologies.js index c80ef6b2..dcce3b7d 100644 --- a/frontend/src/actions/topologies.js +++ b/frontend/src/actions/topologies.js @@ -1,10 +1,11 @@ export const ADD_TOPOLOGY = 'ADD_TOPOLOGY' export const DELETE_TOPOLOGY = 'DELETE_TOPOLOGY' -export function addTopology(topology) { +export function addTopology(name, duplicateId) { return { type: ADD_TOPOLOGY, - topology, + name, + duplicateId, } } diff --git a/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js b/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js index bbec9ebb..a244b730 100644 --- a/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js @@ -31,7 +31,7 @@ class NewTopologyModalComponent extends React.Component { } onDuplicate() { - this.props.onCreateTopology(this.textInput.value, this.originTopology.value) + this.props.onDuplicateTopology(this.textInput.value, this.originTopology.value) this.reset() } @@ -67,7 +67,6 @@ class NewTopologyModalComponent extends React.Component {