1
0
Fork 0
mirror of synced 2024-07-07 07:15:43 +12:00

amended code following recommendations in PR comments

This commit is contained in:
NEOLPAR 2022-07-26 17:22:42 +01:00
parent 5bf9ee38a0
commit 1b3062dfcf
3 changed files with 2 additions and 6 deletions

View file

@ -15,8 +15,6 @@
let trigger = {} let trigger = {}
let schemaProperties = {} let schemaProperties = {}
$: trigger
$: schemaProperties
$: { $: {
// clone the trigger so we're not mutating the reference // clone the trigger so we're not mutating the reference
trigger = cloneDeep( trigger = cloneDeep(
@ -27,7 +25,7 @@
let schema = Object.entries(trigger.schema?.outputs?.properties || {}) let schema = Object.entries(trigger.schema?.outputs?.properties || {})
if (trigger?.event === "app:trigger") { if (trigger?.event === "app:trigger") {
schema = Object.entries({ fields: { customType: "fields" } }) schema = [["fields", { customType: "fields" }]]
} }
schemaProperties = schema schemaProperties = schema

View file

@ -53,7 +53,7 @@
$: getInputData(testData, block.inputs) $: getInputData(testData, block.inputs)
const getInputData = (testData, blockInputs) => { const getInputData = (testData, blockInputs) => {
let newInputData = testData ? testData : blockInputs let newInputData = testData || blockInputs
if (block.event === "app:trigger" && !newInputData?.fields) { if (block.event === "app:trigger" && !newInputData?.fields) {
newInputData = cloneDeep(blockInputs) newInputData = cloneDeep(blockInputs)

View file

@ -87,8 +87,6 @@
} }
</script> </script>
FieldSelector
{#if schemaFields.length && isTestModal} {#if schemaFields.length && isTestModal}
<div class="schema-fields"> <div class="schema-fields">
{#each schemaFields as [field, schema]} {#each schemaFields as [field, schema]}