diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 0c55816e..a114e65f 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -4479,6 +4479,18 @@ const AngularWorkflow = (props) => { const [open, setOpen] = React.useState(false) const [anchorEl, setAnchorEl] = React.useState(null) + const duplicateCondition = (conditionIndex) => { + + var newEdge = JSON.parse(JSON.stringify(selectedEdge.conditions[conditionIndex])) + const newUuid = uuid.v4() + newEdge.condition.id = newUuid + newEdge.source.id = newUuid + newEdge.destination.id = newUuid + selectedEdge.conditions.push(newEdge) + + setUpdate(Math.random()) + } + const deleteCondition = (conditionIndex) => { console.log(selectedEdge) if (selectedEdge.conditions.length === 1) { @@ -4511,7 +4523,7 @@ const AngularWorkflow = (props) => { } return ( - {}}> + {}}>
{ @@ -4520,11 +4532,11 @@ const AngularWorkflow = (props) => { setDestinationValue(condition.destination) setConditionsModalOpen(true) }}> -
+
{condition.source.value}
-
{}}> +
{}}> {condition.condition.value}
@@ -4557,13 +4569,13 @@ const AngularWorkflow = (props) => { setAnchorEl(null) }} > + { + duplicateCondition(index) + }} key={"Duplicate"}>{"Duplicate"} { setOpen(false) deleteCondition(index) }} key={"Delete"}>{"Delete"} - { - duplicateCondition(index) - }} key={"Duplicate"}>{"Duplicate"}