Rename flowEditors to stepEditors

This commit is contained in:
Mel O'Hagan 2022-10-13 13:07:53 +01:00
parent 34a1d5e36b
commit 881d5d53b0
1 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@
export let editable = true export let editable = true
export let height = 500 export let height = 500
let flowEditors = [] let stepEditors = []
$: urlDisplay = $: urlDisplay =
schema.urlDisplay && schema.urlDisplay &&
@ -38,13 +38,13 @@
function updateEditorsOnDelete(deleteIndex) { function updateEditorsOnDelete(deleteIndex) {
for (let i = deleteIndex; i < query.fields.steps?.length - 1; i++) { for (let i = deleteIndex; i < query.fields.steps?.length - 1; i++) {
flowEditors[i].update(query.fields.steps[i + 1].value.value) stepEditors[i].update(query.fields.steps[i + 1].value.value)
} }
} }
function updateEditorsOnSwap(actionIndex, targetIndex) { function updateEditorsOnSwap(actionIndex, targetIndex) {
const target = query.fields.steps[targetIndex].value.value const target = query.fields.steps[targetIndex].value.value
flowEditors[targetIndex].update(query.fields.steps[actionIndex].value.value) stepEditors[targetIndex].update(query.fields.steps[actionIndex].value.value)
flowEditors[actionIndex].update(target) stepEditors[actionIndex].update(target)
} }
function setEditorTemplate(fromKey, toKey, index) { function setEditorTemplate(fromKey, toKey, index) {
@ -58,7 +58,7 @@
query.fields.steps[index].value.value = schema.steps.filter( query.fields.steps[index].value.value = schema.steps.filter(
step => step.key === toKey step => step.key === toKey
)[0]?.template )[0]?.template
flowEditors[index].update(query.fields.steps[index].value.value) stepEditors[index].update(query.fields.steps[index].value.value)
} }
query.fields.steps[index].key = toKey query.fields.steps[index].key = toKey
} }
@ -174,7 +174,7 @@
}} }}
/> />
<Editor <Editor
bind:this={flowEditors[index]} bind:this={stepEditors[index]}
editorHeight={height / 2} editorHeight={height / 2}
mode="json" mode="json"
value={typeof step.value === "string" value={typeof step.value === "string"