|
|
|
@ -20,6 +20,8 @@ |
|
|
|
export let webhookModal |
|
|
|
export let testData |
|
|
|
export let schemaProperties |
|
|
|
export let isTestModal = false |
|
|
|
|
|
|
|
$: stepId = block.stepId |
|
|
|
$: bindings = getAvailableBindings( |
|
|
|
block || $automationStore.selectedBlock, |
|
|
|
@ -29,17 +31,20 @@ |
|
|
|
|
|
|
|
$: inputData = testData ? testData : block.inputs |
|
|
|
|
|
|
|
const onChange = debounce(async function (e, key) { |
|
|
|
if (testData) { |
|
|
|
testData[key] = e.detail |
|
|
|
} else { |
|
|
|
block.inputs[key] = e.detail |
|
|
|
await automationStore.actions.save({ |
|
|
|
instanceId, |
|
|
|
automation: $automationStore.selectedAutomation?.automation, |
|
|
|
}) |
|
|
|
} |
|
|
|
}, 800) |
|
|
|
const onChange = debounce( |
|
|
|
async function (e, key) { |
|
|
|
if (isTestModal) { |
|
|
|
testData[key] = e.detail |
|
|
|
} else { |
|
|
|
block.inputs[key] = e.detail |
|
|
|
await automationStore.actions.save({ |
|
|
|
instanceId, |
|
|
|
automation: $automationStore.selectedAutomation?.automation, |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
isTestModal ? 0 : 800 |
|
|
|
) |
|
|
|
|
|
|
|
function getAvailableBindings(block, automation) { |
|
|
|
if (!block || !automation) { |
|
|
|
@ -91,7 +96,7 @@ |
|
|
|
value={inputData[key]} |
|
|
|
/> |
|
|
|
{:else if value.customType === "email"} |
|
|
|
{#if testData} |
|
|
|
{#if isTestModal} |
|
|
|
<ModalBindableInput |
|
|
|
title={value.title} |
|
|
|
value={inputData[key]} |
|
|
|
@ -99,6 +104,7 @@ |
|
|
|
type="email" |
|
|
|
on:change={e => onChange(e, key)} |
|
|
|
{bindings} |
|
|
|
fillWidth |
|
|
|
/> |
|
|
|
{:else} |
|
|
|
<DrawerBindableInput |
|
|
|
@ -152,7 +158,7 @@ |
|
|
|
/> |
|
|
|
</CodeEditorModal> |
|
|
|
{:else if value.type === "string" || value.type === "number"} |
|
|
|
{#if testData} |
|
|
|
{#if isTestModal} |
|
|
|
<ModalBindableInput |
|
|
|
title={value.title} |
|
|
|
value={inputData[key]} |
|
|
|
@ -164,7 +170,7 @@ |
|
|
|
{:else} |
|
|
|
<div class="test"> |
|
|
|
<DrawerBindableInput |
|
|
|
fillWidth |
|
|
|
fillWidth={true} |
|
|
|
title={value.title} |
|
|
|
panel={AutomationBindingPanel} |
|
|
|
type={value.customType} |
|
|
|
|