Fix wrong config form values getting passed into cloneStep

This commit is contained in:
mvdbeek
2021-03-12 17:50:52 +01:00
parent 6e6f762e3b
commit ffdc9ee5ce
2 changed files with 4 additions and 4 deletions
@@ -377,13 +377,14 @@ export default {
},
onClone(node) {
const newId = this.nodeIndex++;
const stepCopy = JSON.parse(JSON.stringify(node.step))
const stepCopy = JSON.parse(JSON.stringify(node.step));
const configFormCopy = JSON.parse(JSON.stringify(node.config_form));
Vue.set(this.steps, newId, {
...stepCopy,
id: newId,
config_form: {
...stepCopy.config_form,
inputs: stepCopy.config_form.inputs.filter((input) => !!!input.skipOnClone),
...configFormCopy,
inputs: configFormCopy.inputs.filter((input) => !input.skipOnClone),
},
uuid: null,
annotation: JSON.parse(JSON.stringify(node.annotation)),
@@ -323,7 +323,6 @@ export default {
},
setData(data) {
this.config_form = data.config_form;
this.config_form.raw_inputs = [...data.config_form.inputs];
this.content_id = data.config_form?.id || data.content_id;
this.tool_state = data.tool_state;
this.errors = data.errors;