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