Merge pull request #14111 from Budibase/fix/automations-ux

Automation UX fixes
This commit is contained in:
deanhannigan 2024-07-11 09:06:14 +01:00 committed by GitHub
commit 8306fcdb23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 23 deletions

View File

@ -250,6 +250,7 @@
}, },
})) }))
}, },
placeholder: false,
getOptionLabel: type => type.name, getOptionLabel: type => type.name,
getOptionValue: type => type.id, getOptionValue: type => type.id,
options: [ options: [
@ -280,14 +281,14 @@
tableId: inputData["row"].tableId, tableId: inputData["row"].tableId,
}, },
meta: { meta: {
fields: inputData["meta"].oldFields || {}, fields: inputData["meta"]?.oldFields || {},
}, },
onChange: e => { onChange: e => {
onChange({ onChange({
oldRow: e.detail.row, oldRow: e.detail.row,
meta: { meta: {
fields: inputData["meta"].fields, fields: inputData["meta"]?.fields || {},
oldFields: e.detail.meta.fields, oldFields: e.detail?.meta?.fields || {},
}, },
}) })
}, },
@ -304,7 +305,15 @@
row: inputData["row"], row: inputData["row"],
meta: inputData["meta"] || {}, meta: inputData["meta"] || {},
onChange: e => { onChange: e => {
onChange(e.detail) onChange({
row: e.detail.row,
meta: {
fields: e.detail?.meta?.fields || {},
...(isTestModal
? { oldFields: inputData["meta"]?.oldFields || {} }
: {}),
},
})
}, },
...baseProps, ...baseProps,
}, },
@ -452,7 +461,6 @@
*/ */
const onChange = Utils.sequential(async update => { const onChange = Utils.sequential(async update => {
const request = cloneDeep(update) const request = cloneDeep(update)
// Process app trigger updates // Process app trigger updates
if (isTrigger && !isTestModal) { if (isTrigger && !isTestModal) {
// Row trigger // Row trigger

View File

@ -288,29 +288,27 @@
{/each} {/each}
{#if table && schemaFields} {#if table && schemaFields}
{#key editableFields} <div
<div class="add-fields-btn"
class="add-fields-btn" class:empty={Object.is(editableFields, {})}
class:empty={Object.is(editableFields, {})} bind:this={popoverAnchor}
bind:this={popoverAnchor} >
> <ActionButton
<ActionButton icon="Add"
icon="Add" fullWidth
fullWidth on:click={() => {
on:click={() => { customPopover.show()
customPopover.show() }}
}} disabled={!schemaFields}
disabled={!schemaFields} >Add fields
>Add fields </ActionButton>
</ActionButton> </div>
</div>
{/key}
{/if} {/if}
<Popover <Popover
align="center" align="center"
bind:this={customPopover} bind:this={customPopover}
anchor={popoverAnchor} anchor={editableFields ? popoverAnchor : null}
useAnchorWidth useAnchorWidth
maxHeight={300} maxHeight={300}
resizable={false} resizable={false}