Use setting default value in conditional UI drawer
This commit is contained in:
parent
9c6b8cdd0e
commit
fc21c80d64
|
@ -147,6 +147,15 @@
|
||||||
onOperatorChange(condition, condition.operator)
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
|
@ -189,7 +198,7 @@
|
||||||
<Select
|
<Select
|
||||||
options={settingOptions}
|
options={settingOptions}
|
||||||
bind:value={condition.setting}
|
bind:value={condition.setting}
|
||||||
on:change={() => delete condition.settingValue}
|
on:change={e => onSettingChange(e, condition)}
|
||||||
/>
|
/>
|
||||||
<div>TO</div>
|
<div>TO</div>
|
||||||
{#if definition}
|
{#if definition}
|
||||||
|
|
Loading…
Reference in New Issue