Browse Source
Merge pull request #3101 from Budibase/fix/2955
Fixing handlebars binding bug
master
Michael Drury
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
1 deletions
-
packages/builder/src/builderStore/dataBinding.js
-
packages/builder/src/components/start/CreateAppModal.svelte
|
|
@ -472,7 +472,7 @@ function bindingReplacement(bindableProperties, textWithBindings, convertTo) { |
|
|
idx = searchString.indexOf(from) |
|
|
idx = searchString.indexOf(from) |
|
|
if (idx !== -1) { |
|
|
if (idx !== -1) { |
|
|
let end = idx + from.length, |
|
|
let end = idx + from.length, |
|
|
searchReplace = Array(binding[convertTo].length).join("*") |
|
|
searchReplace = Array(binding[convertTo].length + 1).join("*") |
|
|
// blank out parts of the search string
|
|
|
// blank out parts of the search string
|
|
|
searchString = replaceBetween(searchString, idx, end, searchReplace) |
|
|
searchString = replaceBetween(searchString, idx, end, searchReplace) |
|
|
newBoundValue = replaceBetween( |
|
|
newBoundValue = replaceBetween( |
|
|
|
|
|
@ -66,6 +66,11 @@ |
|
|
const checkValidity = async (values, validator) => { |
|
|
const checkValidity = async (values, validator) => { |
|
|
const obj = object().shape(validator) |
|
|
const obj = object().shape(validator) |
|
|
Object.keys(validator).forEach(key => ($errors[key] = null)) |
|
|
Object.keys(validator).forEach(key => ($errors[key] = null)) |
|
|
|
|
|
if (template?.fromFile && values.file == null) { |
|
|
|
|
|
valid = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
await obj.validate(values, { abortEarly: false }) |
|
|
await obj.validate(values, { abortEarly: false }) |
|
|
} catch (validationErrors) { |
|
|
} catch (validationErrors) { |
|
|
@ -73,6 +78,7 @@ |
|
|
$errors[error.path] = capitalise(error.message) |
|
|
$errors[error.path] = capitalise(error.message) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
valid = await obj.isValid(values) |
|
|
valid = await obj.isValid(values) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|