diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index b05b127b1c..af48afb1bc 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -65,6 +65,7 @@ const INITIAL_FRONTEND_STATE = { features: { componentValidation: false, disableUserMetadata: false, + enableAutomationChaining: false, }, errors: [], hasAppPackage: false, diff --git a/packages/builder/src/components/start/ChooseIconModal.svelte b/packages/builder/src/components/start/ChooseIconModal.svelte index 1ffaa35e34..1f26cb93ec 100644 --- a/packages/builder/src/components/start/ChooseIconModal.svelte +++ b/packages/builder/src/components/start/ChooseIconModal.svelte @@ -49,6 +49,7 @@ return } try { + console.log(app.instance._id) await apps.update(app.instance._id, { icon: { name, color }, }) diff --git a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte index 373a47aa2e..4ff3409b09 100644 --- a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte @@ -8,6 +8,8 @@ Body, Heading, Divider, + Toggle, + notifications, } from "@budibase/bbui" import DateTimeRenderer from "components/common/renderers/DateTimeRenderer.svelte" import StatusRenderer from "./_components/StatusRenderer.svelte" @@ -16,7 +18,7 @@ import { createPaginationStore } from "helpers/pagination" import { getContext, onDestroy, onMount } from "svelte" import dayjs from "dayjs" - import { auth, licensing, admin } from "stores/portal" + import { auth, licensing, admin, apps } from "stores/portal" import { Constants } from "@budibase/frontend-core" import Portal from "svelte-portal" @@ -35,9 +37,13 @@ let timeRange = null let loaded = false + $: app = $apps.find(app => app.devId === $store.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" }, @@ -124,6 +130,18 @@ sidePanel.open() } + async function save({ detail }) { + try { + await apps.update($store.appId, { + automations: { + chainAutomations: detail, + }, + }) + } catch (error) { + notifications.error("Error updating automation chaining setting") + } + } + onMount(async () => { await automationStore.actions.fetch() const params = new URLSearchParams(window.location.search) @@ -150,11 +168,30 @@ - Automation History - View the automations your app has executed + Automations + See your automation history and edit advanced settings + + Chain automations + Allow automations to trigger from other automations +
+ { + save(e) + }} + value={chainAutomations} + /> +
+
+ + + + History + Free plan stores up to 1 day of automation history +