Merge pull request #4549 from Budibase/fix/screen-creation-roles
Fix role being stale when creating screens
This commit is contained in:
commit
03529d1450
|
@ -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 }}}")
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue