diff --git a/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte b/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte index 394975e9da..144592035c 100644 --- a/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte @@ -12,11 +12,12 @@ let screenName = "" let url = "" let selectedScreens = [] - let roleId = $selectedAccessRole || "BASIC" let showProgressCircle = false let routeError let createdScreens = [] + $: roleId = $selectedAccessRole || "BASIC" + const createScreens = async () => { for (let screen of selectedScreens) { let test = screen.create() diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte index bca78f6cbb..1441d3834b 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte @@ -90,7 +90,7 @@ -
+
{#if !filters?.length} diff --git a/packages/string-templates/src/index.js b/packages/string-templates/src/index.js index c0b5563f3d..41dd7381ad 100644 --- a/packages/string-templates/src/index.js +++ b/packages/string-templates/src/index.js @@ -139,8 +139,13 @@ module.exports.disableEscaping = string => { if (matches == null) { return string } - for (let match of matches) { - string = string.replace(match, `{${match}}`) + + // find the unique set + const unique = [...new Set(matches)] + for (let match of unique) { + // add a negative lookahead to exclude any already + const regex = new RegExp(`${match}(?!})`, "g") + string = string.replace(regex, `{${match}}`) } return string } diff --git a/packages/string-templates/test/basic.spec.js b/packages/string-templates/test/basic.spec.js index c5aac2a628..fbd1c5f440 100644 --- a/packages/string-templates/test/basic.spec.js +++ b/packages/string-templates/test/basic.spec.js @@ -194,5 +194,9 @@ describe("check that disabling escaping function works", () => { it("should work with a combination", () => { expect(disableEscaping("{{ name }} welcome to {{{ platform }}}")).toEqual("{{{ name }}} welcome to {{{ platform }}}") }) + + it("should work with multiple escaped", () => { + expect(disableEscaping("{{ name }} welcome to {{ name }}")).toEqual("{{{ name }}} welcome to {{{ name }}}") + }) })