From a1ca9d62b7c8bc7c493b193bba9f88b36a597e5c Mon Sep 17 00:00:00 2001 From: Ari Date: Fri, 15 Jul 2022 23:15:23 -0400 Subject: [PATCH] opening modal when adding new parallel node --- .../components/DAGGraph/elements/index.tsx | 21 ++++++++++--------- .../OptionManager/ActionParallel.tsx | 13 ++---------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/webapp/src/components/DAGGraph/elements/index.tsx b/webapp/src/components/DAGGraph/elements/index.tsx index 69c7598..43628ee 100644 --- a/webapp/src/components/DAGGraph/elements/index.tsx +++ b/webapp/src/components/DAGGraph/elements/index.tsx @@ -591,18 +591,19 @@ export const makeParallelNodes = makeSpecialNodeMaker( { icon: , onClick: () => - args.stateUpdater.basic.sequence.updateNode( - { - ...node, - parallel: [ - ...node.parallel, + args.openModal({ + allowedTypes: ["condition", "action"], + node: args.stateUpdater.basic.sequence.defaultNode, + saveBtnCreateText: true, + update: (n) => + args.stateUpdater.basic.sequence.updateNode( { - sequence: [], + ...node, + parallel: [...node.parallel, n], }, - ], - }, - args.nodeIndex - ), + args.nodeIndex + ), + }), } ); outputState.addNode(addBtn); diff --git a/webapp/src/components/NodeEditor/OptionManager/ActionParallel.tsx b/webapp/src/components/NodeEditor/OptionManager/ActionParallel.tsx index 8649658..f302d27 100644 --- a/webapp/src/components/NodeEditor/OptionManager/ActionParallel.tsx +++ b/webapp/src/components/NodeEditor/OptionManager/ActionParallel.tsx @@ -1,4 +1,3 @@ -import InputYaml from "components/Inputs/InputYaml"; import { ParallelAction } from "types/automations/actions"; import { OptionManager } from "./OptionManager"; @@ -8,15 +7,7 @@ export const ActionParallelState: OptionManager = { parallel: [], }), isReady: () => true, - Component: ({ state, setState }) => { - return ( - <> - setState({ ...state, parallel })} - /> - - ); + Component: () => { + return <>; }, };