diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index b86cffb1f9..9bbca16802 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -15,16 +15,20 @@ let trigger = {} let schemaProperties = {} - // clone the trigger so we're not mutating the reference - $: trigger = cloneDeep( - $automationStore.selectedAutomation.automation.definition.trigger - ) + $: { + // clone the trigger so we're not mutating the reference + trigger = cloneDeep( + $automationStore.selectedAutomation.automation.definition.trigger + ) - // get the outputs so we can define the fields - $: schemaProperties = Object.entries(trigger?.schema?.outputs?.properties) + // get the outputs so we can define the fields + let schema = Object.entries(trigger.schema?.outputs?.properties || {}) - if (!$automationStore.selectedAutomation.automation.testData) { - $automationStore.selectedAutomation.automation.testData = {} + if (trigger?.event === "app:trigger") { + schema = [["fields", { customType: "fields" }]] + } + + schemaProperties = schema } // check to see if there is existing test data in the store diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 8b34cf8cd2..fd0b82a8a6 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -1,6 +1,7 @@ + +{#if schemaFields.length && isTestModal} +
+ {#each schemaFields as [field, schema]} + + {/each} +
+{/if} + +