From d72094e8adb7fccd245bb8667bb7d48696228766 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 23 Nov 2021 16:41:09 +0000 Subject: [PATCH] Set inputs to readonly when displaying the javascript function helper label to prevent accidentally setting explicit text --- .../common/bindings/DrawerBindableCombobox.svelte | 1 + .../components/common/bindings/DrawerBindableInput.svelte | 1 + .../components/common/bindings/ModalBindableInput.svelte | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte index 08845d1798..c8716352e5 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte @@ -55,6 +55,7 @@ onChange(e.detail, false)} on:pick={e => onChange(e.detail, true)} diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index 5b135e8778..073e575869 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -40,6 +40,7 @@ onChange(event.detail)} {placeholder} diff --git a/packages/builder/src/components/common/bindings/ModalBindableInput.svelte b/packages/builder/src/components/common/bindings/ModalBindableInput.svelte index fa46097142..3776f1dc84 100644 --- a/packages/builder/src/components/common/bindings/ModalBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/ModalBindableInput.svelte @@ -6,6 +6,7 @@ } from "builderStore/dataBinding" import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte" import { createEventDispatcher } from "svelte" + import { isJSBinding } from "@budibase/string-templates" export let panel = ServerBindingPanel export let value = "" @@ -18,8 +19,10 @@ const dispatch = createEventDispatcher() let bindingModal let valid = true + $: readableValue = runtimeToReadableBinding(bindings, value) $: tempValue = readableValue + $: isJS = isJSBinding(value) const saveBinding = () => { onChange(tempValue) @@ -34,7 +37,8 @@
onChange(event.detail)} {placeholder} />