diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 99cf382585..c88317c79f 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -51,6 +51,8 @@ $: isAppAction && setPermissions(role) $: isAppAction && getPermissions(automationId) + $: triggerInfo = $selectedAutomationDisplayData?.triggerInfo + async function setPermissions(role) { if (!role || !automationId) { return @@ -185,10 +187,10 @@ {block} {webhookModal} /> - {#if isTrigger && $selectedAutomationDisplayData?.triggerInfo} + {#if isTrigger && triggerInfo} {/if} {#if lastStep} diff --git a/packages/server/src/sdk/app/automations/utils.ts b/packages/server/src/sdk/app/automations/utils.ts index fbd0b5700c..bd16c5aca6 100644 --- a/packages/server/src/sdk/app/automations/utils.ts +++ b/packages/server/src/sdk/app/automations/utils.ts @@ -54,8 +54,12 @@ export async function getBuilderData( result[automation._id!] = { displayName: `${tableName}: ${automation.name}`, triggerInfo: { - title: "Automation trigger", - description: `This trigger is tied to the row action ${rowActionName} on your ${tableName} table`, + type: "Automation trigger", + table: { id: tableId, name: tableName }, + rowAction: { + id: rowActionId, + name: rowActionName, + }, }, } } diff --git a/packages/server/src/sdk/app/rowActions.ts b/packages/server/src/sdk/app/rowActions.ts index abfc0f1478..01716a55b4 100644 --- a/packages/server/src/sdk/app/rowActions.ts +++ b/packages/server/src/sdk/app/rowActions.ts @@ -11,7 +11,6 @@ import { VirtualDocumentType, } from "@budibase/types" import automations from "./automations" -import tables from "./tables" function ensureUniqueAndThrow( doc: TableRowActions, @@ -45,8 +44,6 @@ export async function create(tableId: string, rowAction: { name: string }) { doc = { _id: rowActionsId, actions: {} } } - const { name: tableName } = await tables.getTable(tableId) - ensureUniqueAndThrow(doc, action.name) const appId = context.getAppId() @@ -59,7 +56,7 @@ export async function create(tableId: string, rowAction: { name: string }) { }${SEPARATOR}${utils.newid()}` const automation = await automations.create({ - name: `${tableName}: ${action.name}`, + name: action.name, appId, definition: { trigger: { diff --git a/packages/types/src/api/web/automation.ts b/packages/types/src/api/web/automation.ts index 58faf55a41..6c810d5e78 100644 --- a/packages/types/src/api/web/automation.ts +++ b/packages/types/src/api/web/automation.ts @@ -6,8 +6,15 @@ export interface DeleteAutomationResponse extends DocumentDestroyResponse {} export interface AutomationBuilderData { displayName: string triggerInfo?: { - title: string - description: string + type: string + table: { + id: string + name: string + } + rowAction: { + id: string + name: string + } } }