Browse Source
Merge pull request #4549 from Budibase/fix/screen-creation-roles
Fix role being stale when creating screens
master
Andrew Kingston
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
14 additions and
4 deletions
-
packages/builder/src/components/design/NavigationPanel/ScreenWizard.svelte
-
packages/builder/src/components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte
-
packages/string-templates/src/index.js
-
packages/string-templates/test/basic.spec.js
|
|
|
@ -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() |
|
|
|
|
|
|
|
@ -90,7 +90,7 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<DrawerContent> |
|
|
|
<div className="container"> |
|
|
|
<div class="container"> |
|
|
|
<Layout noPadding> |
|
|
|
<Body size="S"> |
|
|
|
{#if !filters?.length} |
|
|
|
|
|
|
|
@ -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 |
|
|
|
} |
|
|
|
|
|
|
|
@ -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 }}}") |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|