From d1916cfe49e2a8b4f585c0128be6183a4b1f72fc Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 12 Oct 2021 16:52:56 +0100 Subject: [PATCH] Enable JS bindings in all design fields where HBS is also enabled --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 2 ++ .../automation/SetupPanel/QueryParamSelector.svelte | 1 + .../components/automation/SetupPanel/RowSelector.svelte | 1 + .../common/bindings/DrawerBindableCombobox.svelte | 7 ++++++- .../components/common/bindings/DrawerBindableInput.svelte | 7 ++++++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index ff52c7d11a..9ae4801fba 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -178,6 +178,7 @@ value={inputData[key]} on:change={e => onChange(e, key)} {bindings} + allowJS={false} /> {/if} {:else if value.customType === "query"} @@ -240,6 +241,7 @@ value={inputData[key]} on:change={e => onChange(e, key)} {bindings} + allowJS={false} /> {/if} diff --git a/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte b/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte index 91dc369d80..7a4bda3047 100644 --- a/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte @@ -39,6 +39,7 @@ type="string" {bindings} fillWidth={true} + allowJS={false} /> {/each} diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index 1d54c86b4a..9eacc99fb1 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -88,6 +88,7 @@ type="string" {bindings} fillWidth={true} + allowJS={false} /> {/if} {/if} diff --git a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte index a48a91a44f..655093e684 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte @@ -6,6 +6,7 @@ } from "builderStore/dataBinding" import BindingPanel from "components/common/bindings/BindingPanel.svelte" import { createEventDispatcher } from "svelte" + import { isJSBinding } from "@budibase/string-templates" export let panel = BindingPanel export let value = "" @@ -15,11 +16,14 @@ export let label export let disabled = false export let options + export let allowJS = true const dispatch = createEventDispatcher() let bindingDrawer + $: readableValue = runtimeToReadableBinding(bindings, value) $: tempValue = readableValue + $: isJS = isJSBinding(value) const handleClose = () => { onChange(tempValue) @@ -35,7 +39,7 @@ onChange(event.detail)} {placeholder} {options} @@ -58,6 +62,7 @@ close={handleClose} on:change={event => (tempValue = event.detail)} bindableProperties={bindings} + {allowJS} /> diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index e5bfab583c..e03e07710f 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -6,6 +6,7 @@ } from "builderStore/dataBinding" import BindingPanel from "components/common/bindings/BindingPanel.svelte" import { createEventDispatcher } from "svelte" + import { isJSBinding } from "@budibase/string-templates" export let panel = BindingPanel export let value = "" @@ -15,12 +16,15 @@ export let label export let disabled = false export let fillWidth + export let allowJS = true const dispatch = createEventDispatcher() let bindingDrawer let valid = true + $: readableValue = runtimeToReadableBinding(bindings, value) $: tempValue = readableValue + $: isJS = isJSBinding(value) const saveBinding = () => { onChange(tempValue) @@ -36,7 +40,7 @@ onChange(event.detail)} {placeholder} /> @@ -60,6 +64,7 @@ value={readableValue} on:change={event => (tempValue = event.detail)} bindableProperties={bindings} + {allowJS} />