Merge branch 'feature/sync-automations' of github.com:Budibase/budibase into feature/sync-automations
This commit is contained in:
commit
7bb7b916fd
|
@ -7,8 +7,6 @@
|
|||
export let parameters = {}
|
||||
export let bindings = []
|
||||
|
||||
let synchronous = parameters.synchronous
|
||||
|
||||
const AUTOMATION_STATUS = {
|
||||
NEW: "new",
|
||||
EXISTING: "existing",
|
||||
|
@ -20,14 +18,11 @@
|
|||
|
||||
$: {
|
||||
if (automationStatus === AUTOMATION_STATUS.NEW) {
|
||||
synchronous = false
|
||||
}
|
||||
|
||||
if (automationStatus === AUTOMATION_STATUS.EXISTING) {
|
||||
synchronous = automations.find(
|
||||
automation => automation._id === parameters.automationId
|
||||
).synchronous
|
||||
parameters.synchronous = false
|
||||
}
|
||||
parameters.synchronous = automations.find(
|
||||
automation => automation._id === parameters.automationId
|
||||
)?.synchronous
|
||||
}
|
||||
$: automations = $automationStore.automations
|
||||
.filter(a => a.definition.trigger?.stepId === TriggerStepID.APP)
|
||||
|
@ -80,11 +75,10 @@
|
|||
|
||||
const onChange = value => {
|
||||
let automationId = value.detail
|
||||
synchronous = automations.find(
|
||||
parameters.synchronous = automations.find(
|
||||
automation => automation._id === automationId
|
||||
).synchronous
|
||||
)?.synchronous
|
||||
parameters.automationId = automationId
|
||||
parameters.synchronous = synchronous
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -128,7 +122,7 @@
|
|||
/>
|
||||
{/if}
|
||||
|
||||
{#if synchronous}
|
||||
{#if parameters.synchronous}
|
||||
<Label small />
|
||||
|
||||
<div class="synchronous-info">
|
||||
|
|
|
@ -14,7 +14,7 @@ import { deleteEntityMetadata } from "../../utilities"
|
|||
import { MetadataTypes } from "../../constants"
|
||||
import { setTestFlag, clearTestFlag } from "../../utilities/redis"
|
||||
import { context, cache, events } from "@budibase/backend-core"
|
||||
import { automations } from "@budibase/pro"
|
||||
import { automations, features } from "@budibase/pro"
|
||||
import {
|
||||
Automation,
|
||||
AutomationActionStepId,
|
||||
|
@ -266,7 +266,7 @@ export async function trigger(ctx: BBContext) {
|
|||
let automation = await db.get(ctx.params.id)
|
||||
|
||||
let hasCollectStep = sdk.automations.utils.checkForCollectStep(automation)
|
||||
if (hasCollectStep) {
|
||||
if (hasCollectStep && (await features.isSyncAutomationsEnabled())) {
|
||||
const response: AutomationResults = await triggers.externalTrigger(
|
||||
automation,
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue