diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte index 3fd2708186..851c5b39c9 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte @@ -69,7 +69,15 @@ on:change={e => onChange(e, field)} useLabel={false} /> -{:else if schema.type === "string" || schema.type === "number"} +{:else if schema.type === "bb_reference"} + onChange(e, field)} + useLabel={false} + /> +{:else if ["string", "number", "bigint", "barcodeqr"].includes(schema.type)} row?._id || row ) - $: label = capitalise(schema.name) - $: linkedTableId = schema.tableId + $: label = label || capitalise(schema.name) + $: linkedTableId = linkedTableId || schema.tableId $: linkedTable = $tables.list.find(table => table._id === linkedTableId) $: fetchRows(linkedTableId) @@ -57,7 +59,7 @@ {:else} row._id} diff --git a/packages/builder/src/components/common/bindings/DrawerBindableSlot.svelte b/packages/builder/src/components/common/bindings/DrawerBindableSlot.svelte index bfef0acac1..6689ddb650 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableSlot.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableSlot.svelte @@ -113,7 +113,7 @@ if (type === "json" && !isJSBinding(value)) { return "json-slot-icon" } - if (type !== "string" && type !== "number") { + if (!["string", "number", "bigint", "barcodeqr"].includes(type)) { return "slot-icon" } return "" diff --git a/packages/builder/src/components/design/settings/controls/ValidationEditor/ValidationDrawer.svelte b/packages/builder/src/components/design/settings/controls/ValidationEditor/ValidationDrawer.svelte index 0bff2ccce6..cd50f526b5 100644 --- a/packages/builder/src/components/design/settings/controls/ValidationEditor/ValidationDrawer.svelte +++ b/packages/builder/src/components/design/settings/controls/ValidationEditor/ValidationDrawer.svelte @@ -164,7 +164,8 @@ // Required constraint if ( field === dataSourceSchema?.table?.primaryDisplay || - constraints.presence?.allowEmpty === false + constraints.presence?.allowEmpty === false || + constraints.presence === true ) { rules.push({ constraint: "required", diff --git a/packages/client/src/components/app/forms/validation.js b/packages/client/src/components/app/forms/validation.js index 9224572c10..3b3a5d6e1d 100644 --- a/packages/client/src/components/app/forms/validation.js +++ b/packages/client/src/components/app/forms/validation.js @@ -23,7 +23,8 @@ export const createValidatorFromConstraints = ( // Required constraint if ( field === table?.primaryDisplay || - schemaConstraints.presence?.allowEmpty === false + schemaConstraints.presence?.allowEmpty === false || + schemaConstraints.presence === true ) { rules.push({ type: schemaConstraints.type == "array" ? "array" : "string", diff --git a/packages/server/src/automations/steps/updateRow.ts b/packages/server/src/automations/steps/updateRow.ts index 5ed4e19f61..fea3e981f3 100644 --- a/packages/server/src/automations/steps/updateRow.ts +++ b/packages/server/src/automations/steps/updateRow.ts @@ -84,9 +84,11 @@ export async function run({ inputs, appId, emitter }: AutomationStepInput) { // clear any undefined, null or empty string properties so that they aren't updated for (let propKey of Object.keys(inputs.row)) { + const clearRelationships = + inputs.meta?.fields?.[propKey]?.clearRelationships if ( - (inputs.row[propKey] == null || inputs.row[propKey] === "") && - !inputs.meta?.fields?.[propKey]?.clearRelationships + (inputs.row[propKey] == null || inputs.row[propKey]?.length === 0) && + !clearRelationships ) { delete inputs.row[propKey] }