From fc21c80d64328f423606bc67976a0925731db8c0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 8 Aug 2024 11:58:19 +0100 Subject: [PATCH 1/4] Use setting default value in conditional UI drawer --- .../_components/Component/ConditionalUIDrawer.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte index 8c57e82998..387a7e000b 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte @@ -147,6 +147,15 @@ onOperatorChange(condition, condition.operator) } } + + const onSettingChange = (e, condition) => { + const setting = settings.find(x => x.key === e.detail) + if (setting?.defaultValue != null) { + condition.settingValue = setting?.defaultValue + } else { + delete condition.settingValue + } + } @@ -189,7 +198,7 @@