Merge remote-tracking branch 'origin/master' into feat/configure-automation-chaining

This commit is contained in:
Peter Clement 2024-01-19 16:35:02 +00:00
commit 0992618956
15 changed files with 52 additions and 58 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.15.0",
"version": "2.15.2",
"npmClient": "yarn",
"packages": [
"packages/*",

@ -1 +1 @@
Subproject commit 1bc012871496ff55e376931b620075b565e34d09
Subproject commit 05c90ce55144e260da6688335c16783eab79bf96

View File

@ -43,7 +43,7 @@
},
TRIGGER_AUTOMATION_RUN: {
disabled: !triggerAutomationRunEnabled,
message: collectDisabledMessage(),
message: "Please upgrade to a paid plan",
},
}
}

View File

@ -77,7 +77,7 @@
</Tab>
<Tab title="Output">
<div class="wrap">
{#if filteredResults?.[idx]?.inputs}
{#if filteredResults?.[idx]?.outputs}
<JsonView
depth={2}
json={filteredResults?.[idx]?.outputs}

View File

@ -172,22 +172,6 @@
}
}
}
if (!savingColumn && !originalName) {
let highestNumber = 0
Object.keys(table.schema).forEach(columnName => {
const columnNumber = extractColumnNumber(columnName)
if (columnNumber > highestNumber) {
highestNumber = columnNumber
}
return highestNumber
})
if (highestNumber >= 1) {
editableColumn.name = `Column 0${highestNumber + 1}`
} else {
editableColumn.name = "Column 01"
}
}
if (!savingColumn) {
editableColumn.fieldId = makeFieldId(
@ -389,11 +373,6 @@
deleteColName = ""
}
function extractColumnNumber(columnName) {
const match = columnName.match(/Column (\d+)/)
return match ? parseInt(match[1]) : 0
}
function getAllowedTypes() {
if (
originalName &&

View File

@ -17,7 +17,7 @@
export let table
let editorModal
let editorModal, editTableNameModal
let confirmDeleteDialog
let error = ""
@ -101,18 +101,21 @@
<Modal bind:this={editorModal} on:show={initForm}>
<ModalContent
bind:this={editTableNameModal}
title="Edit Table"
confirmText="Save"
onConfirm={save}
disabled={updatedName === originalName || error}
>
<Input
label="Table Name"
thin
bind:value={updatedName}
on:input={checkValid}
{error}
/>
<form on:submit|preventDefault={() => editTableNameModal.confirm()}>
<Input
label="Table Name"
thin
bind:value={updatedName}
on:input={checkValid}
{error}
/>
</form>
</ModalContent>
</Modal>
<ConfirmDialog

View File

@ -88,7 +88,7 @@
<BlockComponent
type="form"
bind:id={formId}
props={{ dataSource, disableValidation: true }}
props={{ dataSource, disableSchemaValidation: true }}
>
{#if title || enrichedSearchColumns?.length || showTitleButton}
<BlockComponent

View File

@ -147,7 +147,7 @@
bind:id={formId}
props={{
dataSource,
disableValidation: true,
disableSchemaValidation: true,
editAutoColumns: true,
size,
}}

View File

@ -14,7 +14,7 @@
// Not exposed as a builder setting. Used internally to disable validation
// for fields rendered in things like search blocks.
export let disableValidation = false
export let disableSchemaValidation = false
// Not exposed as a builder setting. Used internally to allow searching on
// auto columns.
@ -103,7 +103,7 @@
{schema}
{table}
{initialValues}
{disableValidation}
{disableSchemaValidation}
{editAutoColumns}
{currentStep}
>

View File

@ -11,7 +11,7 @@
export let size
export let schema
export let table
export let disableValidation = false
export let disableSchemaValidation = false
export let editAutoColumns = false
// We export this store so that when we remount the inner form we can still
@ -156,17 +156,16 @@
if (!field) {
return
}
// Create validation function based on field schema
const schemaConstraints = schema?.[field]?.constraints
const validator = disableValidation
const schemaConstraints = disableSchemaValidation
? null
: createValidatorFromConstraints(
schemaConstraints,
validationRules,
field,
table
)
: schema?.[field]?.constraints
const validator = createValidatorFromConstraints(
schemaConstraints,
validationRules,
field,
table
)
// Sanitise the default value to ensure it doesn't contain invalid data
defaultValue = sanitiseValue(defaultValue, schema?.[field], type)
@ -332,15 +331,15 @@
const { value, error } = fieldState
// Create new validator
const schemaConstraints = schema?.[field]?.constraints
const validator = disableValidation
const schemaConstraints = disableSchemaValidation
? null
: createValidatorFromConstraints(
schemaConstraints,
validationRules,
field,
table
)
: schema?.[field]?.constraints
const validator = createValidatorFromConstraints(
schemaConstraints,
validationRules,
field,
table
)
// Update validator
fieldInfo.update(state => {

@ -1 +1 @@
Subproject commit 9d80daaa5b79da68730d6c5f497f629c47a78ef8
Subproject commit ce7722ed4474718596b465dcfd49bef36cab2e42

View File

@ -94,7 +94,7 @@ export async function setTestFlag(id: string) {
}
export async function checkTestFlag(id: string) {
const flag = await flagClient.get(id)
const flag = await flagClient?.get(id)
return !!(flag && flag.testing)
}

View File

@ -112,7 +112,7 @@ module.exports.convertHBSBlock = (block, blockNumber) => {
const list = getHelperList()
for (let layer of layers) {
const parts = splitBySpace(layer)
if (value || parts.length > 1) {
if (value || parts.length > 1 || list[parts[0]]) {
// first of layer should always be the helper
const helper = parts.splice(0, 1)
if (list[helper]) {

View File

@ -127,4 +127,12 @@ describe("Test that the string processing works correctly", () => {
"return `average: ${var1} add: ${var2}`;",
])
})
it("should handle uuids", () => {
const response = convertToJS("This is: {{ uuid }}")
checkLines(response, [
"const var1 = helpers.uuid();",
"return `This is: ${var1}`;",
])
})
})

View File

@ -6290,6 +6290,11 @@
js-yaml "^3.10.0"
tslib "^2.4.0"
"@zerodevx/svelte-json-view@^1.0.7":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@zerodevx/svelte-json-view/-/svelte-json-view-1.0.7.tgz#abf3efa71dedcb3e9d16bc9cc61d5ea98c8d00b1"
integrity sha512-yW0MV+9BCKOwzt3h86y3xDqYdI5st+Rxk+L5pa0Utq7nlPD+VvxyhL7R1gJoLxQvWwjyAvY/fyUCFTdwDyI14w==
"@zkochan/js-yaml@0.0.6":
version "0.0.6"
resolved "https://registry.yarnpkg.com/@zkochan/js-yaml/-/js-yaml-0.0.6.tgz#975f0b306e705e28b8068a07737fa46d3fc04826"