diff --git a/packages/account-portal b/packages/account-portal index 485ec16a9e..52f51dcfb9 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 485ec16a9eed48c548a5f1239772139f3319f028 +Subproject commit 52f51dcfb96d3fe58c8cc7a905e7d733f7cd84c2 diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 4d43869f8e..55208bb97e 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -158,6 +158,7 @@ export const getFrontendStore = () => { ...INITIAL_FRONTEND_STATE.features, ...application.features, }, + automations: application.automations || {}, icon: application.icon || {}, initialised: true, })) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index af54e4d2da..a9e7ab0d39 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -157,6 +157,7 @@ let bindings = [] let loopBlockCount = 0 const addBinding = (name, value, icon, idx, isLoopBlock, bindingName) => { + if (!name) return const runtimeBinding = determineRuntimeBinding(name, idx, isLoopBlock) const categoryName = determineCategoryName(idx, isLoopBlock, bindingName) @@ -291,7 +292,6 @@ loopBlockCount++ continue } - Object.entries(schema).forEach(([name, value]) => addBinding(name, value, icon, idx, isLoopBlock, bindingName) ) diff --git a/packages/builder/src/pages/builder/app/[application]/settings/automations/index.svelte b/packages/builder/src/pages/builder/app/[application]/settings/automations/index.svelte index fde392e31d..9c45eb7eb1 100644 --- a/packages/builder/src/pages/builder/app/[application]/settings/automations/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/settings/automations/index.svelte @@ -36,15 +36,12 @@ let status = null let timeRange = null let loaded = false - - $: app = $apps.find(app => app.devId === $store.appId?.includes(app.appId)) + $: app = $apps.find(app => $store.appId?.includes(app.appId)) $: licensePlan = $auth.user?.license?.plan $: page = $pageInfo.page $: fetchLogs(automationId, status, page, timeRange) $: isCloud = $admin.cloud - $: chainAutomations = app?.automations?.chainAutomations ?? !isCloud - const timeOptions = [ { value: "90-d", label: "Past 90 days" }, { value: "30-d", label: "Past 30 days" }, diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 68b7c84878..ef529985b2 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -211,29 +211,27 @@ const deleteRowHandler = async action => { const triggerAutomationHandler = async action => { const { fields, notificationOverride, timeout } = action.parameters - if (fields) { - try { - const result = await API.triggerAutomation({ - automationId: action.parameters.automationId, - fields, - timeout, - }) - - // Value will exist if automation is synchronous, so return it. - if (result.value) { - if (!notificationOverride) { - notificationStore.actions.success("Automation ran successfully") - } - return { result } - } + try { + const result = await API.triggerAutomation({ + automationId: action.parameters.automationId, + fields, + timeout, + }) + // Value will exist if automation is synchronous, so return it. + if (result.value) { if (!notificationOverride) { - notificationStore.actions.success("Automation triggered") + notificationStore.actions.success("Automation ran successfully") } - } catch (error) { - // Abort next actions - return false + return { result } } + + if (!notificationOverride) { + notificationStore.actions.success("Automation triggered") + } + } catch (error) { + // Abort next actions + return false } } const navigationHandler = action => { diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index 70298c7172..33582cf656 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -445,6 +445,9 @@ export async function update(ctx: UserCtx) { name: app.name, url: app.url, icon: app.icon, + automations: { + chainAutomations: app.automations?.chainAutomations, + }, }) }