Merge branch 'master' into fix/icon-borders

This commit is contained in:
Andrew Kingston 2025-03-12 13:43:43 +00:00 committed by GitHub
commit 5ce2c1e3a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 71 additions and 49 deletions

View File

@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.5.0",
"version": "3.5.2",
"npmClient": "yarn",
"concurrency": 20,
"command": {

View File

@ -220,7 +220,18 @@
const stepStore = writable({})
$: stepState = $stepStore?.[block.id]
$: customStepLayouts($memoBlock, schemaProperties, stepState, fetchedRows)
const updateSelectedRow = testData => {
selectedRow = testData?.row
}
$: updateSelectedRow(testData)
$: customStepLayouts(
$memoBlock,
schemaProperties,
stepState,
fetchedRows,
selectedRow
)
const customStepLayouts = block => {
if (
@ -387,6 +398,57 @@
]
}
const getTestDataSelector = () => {
if (!isTestModal) {
return []
}
return [
{
type: CoreSelect,
title: "Row",
props: {
disabled: !table,
placeholder: "Select a row",
options: fetchedRows,
loading: fetchLoading,
value: selectedRow,
autocomplete: true,
filter: false,
getOptionLabel: row => row?.[primaryDisplay] || "",
compare: (a, b) => a?.[primaryDisplay] === b?.[primaryDisplay],
onChange: e => {
if (isTestModal) {
onChange({
id: e.detail?._id,
revision: e.detail?._rev,
row: e.detail,
oldRow: e.detail,
meta: {
fields: inputData["meta"]?.fields || {},
oldFields: e.detail?.meta?.fields || {},
},
})
}
},
},
},
{
type: InfoDisplay,
props: {
warning: true,
icon: "AlertCircleFilled",
body: `Be careful when testing this automation because your data may be modified or deleted.`,
},
},
{
type: Divider,
props: {
noMargin: true,
},
},
]
}
stepLayouts[block.stepId] = {
row: {
schema: schema["row"],
@ -413,49 +475,7 @@
disabled: isTestModal,
},
},
{
type: CoreSelect,
title: "Row",
props: {
disabled: !table,
placeholder: "Select a row",
options: fetchedRows,
loading: fetchLoading,
value: selectedRow,
autocomplete: true,
filter: false,
getOptionLabel: row => row?.[primaryDisplay] || "",
compare: (a, b) => a?.[primaryDisplay] === b?.[primaryDisplay],
onChange: e => {
if (isTestModal) {
onChange({
id: e.detail?._id,
revision: e.detail?._rev,
row: e.detail,
oldRow: e.detail,
meta: {
fields: inputData["meta"]?.fields || {},
oldFields: e.detail?.meta?.fields || {},
},
})
}
},
},
},
{
type: InfoDisplay,
props: {
warning: true,
icon: "AlertCircleFilled",
body: `Be careful when testing this automation because your data may be modified or deleted.`,
},
},
{
type: Divider,
props: {
noMargin: true,
},
},
...getTestDataSelector(),
...getIdConfig(),
...getRevConfig(),
...getRowTypeConfig(),

View File

@ -31,10 +31,12 @@
let attachRequest = new FormData()
attachRequest.append("file", signatureFile)
const resp = await API.uploadAttachment(
formContext?.dataSource?.tableId,
attachRequest
)
let sourceId = formContext?.dataSource?.tableId
if (formContext?.dataSource?.type === "viewV2") {
sourceId = formContext.dataSource.id
}
const resp = await API.uploadAttachment(sourceId, attachRequest)
const [signatureAttachment] = resp
updateValue = signatureAttachment
} else {