|
|
@ -9,7 +9,10 @@ |
|
|
Label, |
|
|
Label, |
|
|
ActionButton, |
|
|
ActionButton, |
|
|
Drawer, |
|
|
Drawer, |
|
|
|
|
|
Modal, |
|
|
} from "@budibase/bbui" |
|
|
} from "@budibase/bbui" |
|
|
|
|
|
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte" |
|
|
|
|
|
|
|
|
import { automationStore } from "builderStore" |
|
|
import { automationStore } from "builderStore" |
|
|
import { tables } from "stores/backend" |
|
|
import { tables } from "stores/backend" |
|
|
import WebhookDisplay from "../Shared/WebhookDisplay.svelte" |
|
|
import WebhookDisplay from "../Shared/WebhookDisplay.svelte" |
|
|
@ -27,13 +30,14 @@ |
|
|
import { buildLuceneQuery } from "helpers/lucene" |
|
|
import { buildLuceneQuery } from "helpers/lucene" |
|
|
|
|
|
|
|
|
export let block |
|
|
export let block |
|
|
export let webhookModal |
|
|
|
|
|
export let testData |
|
|
export let testData |
|
|
export let schemaProperties |
|
|
export let schemaProperties |
|
|
export let isTestModal = false |
|
|
export let isTestModal = false |
|
|
|
|
|
let webhookModal |
|
|
let drawer |
|
|
let drawer |
|
|
let tempFilters = lookForFilters(schemaProperties) || [] |
|
|
let tempFilters = lookForFilters(schemaProperties) || [] |
|
|
let fillWidth = true |
|
|
let fillWidth = true |
|
|
|
|
|
|
|
|
$: stepId = block.stepId |
|
|
$: stepId = block.stepId |
|
|
$: bindings = getAvailableBindings( |
|
|
$: bindings = getAvailableBindings( |
|
|
block || $automationStore.selectedBlock, |
|
|
block || $automationStore.selectedBlock, |
|
|
@ -50,6 +54,18 @@ |
|
|
const onChange = debounce( |
|
|
const onChange = debounce( |
|
|
async function (e, key) { |
|
|
async function (e, key) { |
|
|
if (isTestModal) { |
|
|
if (isTestModal) { |
|
|
|
|
|
// Special case for webhook, as it requires a body, but the schema already brings back the body's contents |
|
|
|
|
|
if (stepId === "WEBHOOK") { |
|
|
|
|
|
automationStore.actions.addTestDataToAutomation({ |
|
|
|
|
|
body: { |
|
|
|
|
|
[key]: e.detail, |
|
|
|
|
|
...$automationStore.selectedAutomation.automation.testData.body, |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
automationStore.actions.addTestDataToAutomation({ |
|
|
|
|
|
[key]: e.detail, |
|
|
|
|
|
}) |
|
|
testData[key] = e.detail |
|
|
testData[key] = e.detail |
|
|
} else { |
|
|
} else { |
|
|
block.inputs[key] = e.detail |
|
|
block.inputs[key] = e.detail |
|
|
@ -206,7 +222,10 @@ |
|
|
{bindings} |
|
|
{bindings} |
|
|
/> |
|
|
/> |
|
|
{:else if value.customType === "webhookUrl"} |
|
|
{:else if value.customType === "webhookUrl"} |
|
|
<WebhookDisplay value={inputData[key]} /> |
|
|
<WebhookDisplay |
|
|
|
|
|
on:change={e => onChange(e, key)} |
|
|
|
|
|
value={inputData[key]} |
|
|
|
|
|
/> |
|
|
{:else if value.customType === "triggerSchema"} |
|
|
{:else if value.customType === "triggerSchema"} |
|
|
<SchemaSetup on:change={e => onChange(e, key)} value={inputData[key]} /> |
|
|
<SchemaSetup on:change={e => onChange(e, key)} value={inputData[key]} /> |
|
|
{:else if value.customType === "code"} |
|
|
{:else if value.customType === "code"} |
|
|
@ -249,6 +268,10 @@ |
|
|
</div> |
|
|
</div> |
|
|
{/each} |
|
|
{/each} |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<Modal bind:this={webhookModal} width="30%"> |
|
|
|
|
|
<CreateWebhookModal /> |
|
|
|
|
|
</Modal> |
|
|
|
|
|
|
|
|
{#if stepId === "WEBHOOK"} |
|
|
{#if stepId === "WEBHOOK"} |
|
|
<Button secondary on:click={() => webhookModal.show()}>Set Up Webhook</Button> |
|
|
<Button secondary on:click={() => webhookModal.show()}>Set Up Webhook</Button> |
|
|
{/if} |
|
|
{/if} |
|
|
|