amended code following recommendations in PR comments
This commit is contained in:
parent
5bf9ee38a0
commit
1b3062dfcf
|
@ -15,8 +15,6 @@
|
|||
let trigger = {}
|
||||
let schemaProperties = {}
|
||||
|
||||
$: trigger
|
||||
$: schemaProperties
|
||||
$: {
|
||||
// clone the trigger so we're not mutating the reference
|
||||
trigger = cloneDeep(
|
||||
|
@ -27,7 +25,7 @@
|
|||
let schema = Object.entries(trigger.schema?.outputs?.properties || {})
|
||||
|
||||
if (trigger?.event === "app:trigger") {
|
||||
schema = Object.entries({ fields: { customType: "fields" } })
|
||||
schema = [["fields", { customType: "fields" }]]
|
||||
}
|
||||
|
||||
schemaProperties = schema
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
$: getInputData(testData, block.inputs)
|
||||
const getInputData = (testData, blockInputs) => {
|
||||
let newInputData = testData ? testData : blockInputs
|
||||
let newInputData = testData || blockInputs
|
||||
|
||||
if (block.event === "app:trigger" && !newInputData?.fields) {
|
||||
newInputData = cloneDeep(blockInputs)
|
||||
|
|
|
@ -87,8 +87,6 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
FieldSelector
|
||||
|
||||
{#if schemaFields.length && isTestModal}
|
||||
<div class="schema-fields">
|
||||
{#each schemaFields as [field, schema]}
|
||||
|
|
Loading…
Reference in New Issue