Merge remote-tracking branch 'origin/master' into feature/automation-row-ux-update
This commit is contained in:
commit
ec9ff57493
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.29.3",
|
"version": "2.29.4",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
|
|
@ -495,11 +495,7 @@
|
||||||
newError.name = `Column name cannot start with an underscore.`
|
newError.name = `Column name cannot start with an underscore.`
|
||||||
} else if (fieldInfo.name && !fieldInfo.name.match(ValidColumnNameRegex)) {
|
} else if (fieldInfo.name && !fieldInfo.name.match(ValidColumnNameRegex)) {
|
||||||
newError.name = `Illegal character; must be alpha-numeric.`
|
newError.name = `Illegal character; must be alpha-numeric.`
|
||||||
} else if (
|
} else if (prohibited.some(name => fieldInfo?.name === name)) {
|
||||||
prohibited.some(
|
|
||||||
name => fieldInfo?.name?.toLowerCase() === name.toLowerCase()
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
newError.name = `${prohibited.join(
|
newError.name = `${prohibited.join(
|
||||||
", "
|
", "
|
||||||
)} are not allowed as column names - case insensitive.`
|
)} are not allowed as column names - case insensitive.`
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
|
|
||||||
// If we don't have a next page then we're at the bottom and can scroll to
|
// If we don't have a next page then we're at the bottom and can scroll to
|
||||||
// the max available offset
|
// the max available offset
|
||||||
else {
|
if (!$hasNextPage) {
|
||||||
scroll.update(state => ({
|
scroll.update(state => ({
|
||||||
...state,
|
...state,
|
||||||
top: $maxScrollTop,
|
top: $maxScrollTop,
|
||||||
|
|
|
@ -7,6 +7,7 @@ export const PreprocessorNames = {
|
||||||
SWAP_TO_DOT: "swap-to-dot-notation",
|
SWAP_TO_DOT: "swap-to-dot-notation",
|
||||||
FIX_FUNCTIONS: "fix-functions",
|
FIX_FUNCTIONS: "fix-functions",
|
||||||
FINALISE: "finalise",
|
FINALISE: "finalise",
|
||||||
|
NORMALIZE_SPACES: "normalize-spaces",
|
||||||
}
|
}
|
||||||
|
|
||||||
class Preprocessor {
|
class Preprocessor {
|
||||||
|
@ -50,6 +51,9 @@ export const processors = [
|
||||||
return statement
|
return statement
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
new Preprocessor(PreprocessorNames.NORMALIZE_SPACES, (statement: string) => {
|
||||||
|
return statement.replace(/{{(\s{2,})/g, "{{ ")
|
||||||
|
}),
|
||||||
new Preprocessor(
|
new Preprocessor(
|
||||||
PreprocessorNames.FINALISE,
|
PreprocessorNames.FINALISE,
|
||||||
(statement: string, opts: { noHelpers: any }) => {
|
(statement: string, opts: { noHelpers: any }) => {
|
||||||
|
|
|
@ -320,3 +320,21 @@ describe("should leave HBS blocks if not found using option", () => {
|
||||||
expect(output).toBe("{{ a }}, 1")
|
expect(output).toBe("{{ a }}, 1")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("check multiple space behaviour", () => {
|
||||||
|
it("should remove whitespace and use the helper correctly", async () => {
|
||||||
|
const output = await processString("{{ add num1 num2 }}", {
|
||||||
|
num1: 1,
|
||||||
|
num2: 2,
|
||||||
|
})
|
||||||
|
expect(output).toEqual("3")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should ensure that whitespace within a string is respected", async () => {
|
||||||
|
const output = await processString("{{ trimRight 'test string ' }}", {
|
||||||
|
num1: 1,
|
||||||
|
num2: 2,
|
||||||
|
})
|
||||||
|
expect(output).toEqual("test string")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue