From 019243a3298b67a2a7a3c565353580521a5992b7 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 28 Jul 2021 17:05:14 +0200 Subject: [PATCH] add duplicate condition button --- .../PropertyControls/ConditionalUIDrawer.svelte | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ConditionalUIDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ConditionalUIDrawer.svelte index ebe60c7110..67315c620c 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ConditionalUIDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ConditionalUIDrawer.svelte @@ -101,6 +101,12 @@ conditions = conditions.filter(link => link.id !== id) } + const duplicateCondition = id => { + const condition = conditions.find(link => link.id === id); + const duplicate = {...condition, id: generate()} + conditions = [...conditions, duplicate] + } + const handleFinalize = e => { updateConditions(e) dragDisabled = true @@ -235,6 +241,12 @@ bind:value={condition.referenceValue} /> {/if} + duplicateCondition(condition.id)} + />