diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte
index d105253e14..7ba1c44853 100644
--- a/packages/builder/src/components/common/bindings/BindingPanel.svelte
+++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte
@@ -39,6 +39,7 @@
export let value = ""
export let valid
export let allowJS = false
+ export let allowHelpers = true
let helpers = handlebarsCompletions()
let getCaretPosition
@@ -54,6 +55,7 @@
let popoverAnchor
let hoverTarget
+ $: console.log("HELPERS ", allowHelpers)
$: usingJS = mode === "JavaScript"
$: searchRgx = new RegExp(search, "ig")
$: categories = Object.entries(groupBy("category", bindings))
@@ -85,7 +87,7 @@
return helper.label.match(searchRgx) || helper.description.match(searchRgx)
})
- $: categoryNames = [...categories.map(cat => cat[0]), "Helpers"]
+ $: categoryNames = getCategoryNames(categories)
$: codeMirrorHints = bindings?.map(x => `$("${x.readableBinding}")`)
@@ -96,6 +98,14 @@
}
}
+ const getCategoryNames = categories => {
+ let names = [...categories.map(cat => cat[0])]
+ if (allowHelpers) {
+ names.push("Helpers")
+ }
+ return names
+ }
+
// Adds a JS/HBS helper to the expression
const addHelper = (helper, js) => {
let tempVal
@@ -343,7 +353,7 @@
for more details.
{/if}
- {#if $admin.isDev}
+ {#if $admin.isDev && allowJS}
diff --git a/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte b/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte
index b220a15fc8..74e14574ab 100644
--- a/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte
+++ b/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte
@@ -5,6 +5,7 @@
export let valid
export let value = ""
export let allowJS = false
+ export let allowHelpers = true
$: enrichedBindings = enrichBindings(bindings)
@@ -25,5 +26,6 @@
bindings={enrichedBindings}
{value}
{allowJS}
+ {allowHelpers}
on:change
/>
diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte
index 22d322985d..cc64e28835 100644
--- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte
+++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte
@@ -17,6 +17,7 @@
export let disabled = false
export let fillWidth
export let allowJS = true
+ export let allowHelpers = true
export let updateOnChange = true
export let drawerLeft
@@ -77,6 +78,7 @@
on:change={event => (tempValue = event.detail)}
{bindings}
{allowJS}
+ {allowHelpers}
/>
diff --git a/packages/builder/src/components/integration/KeyValueBuilder.svelte b/packages/builder/src/components/integration/KeyValueBuilder.svelte
index 28db6b61c6..5d35498cfe 100644
--- a/packages/builder/src/components/integration/KeyValueBuilder.svelte
+++ b/packages/builder/src/components/integration/KeyValueBuilder.svelte
@@ -33,6 +33,7 @@
export let showMenu = false
export let bindings = []
export let bindingDrawerLeft
+ export let allowHelpers = true
let fields = Object.entries(object || {}).map(([name, value]) => ({
name,
@@ -122,6 +123,7 @@
disabled={readOnly}
value={field.value}
allowJS={false}
+ {allowHelpers}
fillWidth={true}
drawerLeft={bindingDrawerLeft}
/>
diff --git a/packages/builder/src/components/integration/QueryViewerBindingBuilder.svelte b/packages/builder/src/components/integration/QueryViewerBindingBuilder.svelte
index 8372e2af7e..049eecafcc 100644
--- a/packages/builder/src/components/integration/QueryViewerBindingBuilder.svelte
+++ b/packages/builder/src/components/integration/QueryViewerBindingBuilder.svelte
@@ -37,6 +37,7 @@
valuePlaceholder="Default"
bindings={[...userBindings]}
bindingDrawerLeft="260px"
+ allowHelpers={false}
on:change
/>