From e15c9af7cef1abe1230b803aca501a59d80505f0 Mon Sep 17 00:00:00 2001 From: Raphael Schweikert Date: Wed, 30 Oct 2024 17:37:12 +0100 Subject: [PATCH] =?UTF-8?q?feat(editor):=20disable=20the=20existing=20node?= =?UTF-8?q?=20switch=20if=20there=20aren=E2=80=99t=20any=20hops=20to=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/sections/editor/types/CreateChildNodeStep.tsx | 5 +++-- src/main/frontend/widgets/Switch.tsx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx b/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx index e3ba1b0..ccddfea 100644 --- a/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx +++ b/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx @@ -41,6 +41,7 @@ export const CreateChildNodeStep = forwardRef (hop.runOnExistingNode = runOnExistingNode)} /> ) : undefined} @@ -64,8 +65,8 @@ export const CreateChildNodeStep = forwardRefHow to handle the case where the target node already exists.

Run on existing node

- Whether to run the descendant hops if the target node already existed (only applicable if “If the target node - exists” is set to “Ignore conflict”). + Whether to run the descendant hops if the target node already existed and no new node could be created (only + applicable if “If the target node exists” is set to “Ignore conflict”).

diff --git a/src/main/frontend/widgets/Switch.tsx b/src/main/frontend/widgets/Switch.tsx index fd40e4a..9765da1 100644 --- a/src/main/frontend/widgets/Switch.tsx +++ b/src/main/frontend/widgets/Switch.tsx @@ -7,9 +7,10 @@ export type Options = [value: string, label: string, icon?: CoralIcon][]; export const Switch: FC<{ label?: string; + disabled?: boolean; value: boolean; onChange(newValue: boolean): void; -}> = ({ label = 'Conflict Resolution', value, onChange }) => { +}> = ({ label = 'Conflict Resolution', disabled = false, value, onChange }) => { const scriptContext = useContext(ScriptContext); const switchRef = useRef(null); @@ -34,7 +35,7 @@ export const Switch: FC<{ return ( ); };