1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-20 09:27:44 +03:00

🐛 Fix issue with displaying parameter with root level reference

This commit is contained in:
Jan Oberhauser 2021-05-15 18:59:33 -05:00
parent 180e1a46d5
commit 0877b0779d

View File

@ -90,7 +90,7 @@ import { genericHelpers } from '@/components/mixins/genericHelpers';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import ParameterInputFull from '@/components/ParameterInputFull.vue';
import { get } from 'lodash';
import { get, set } from 'lodash';
import mixins from 'vue-typed-mixins';
@ -172,6 +172,7 @@ export default mixins(
const resolveKeys = Object.keys(rawValues);
let key: string;
let i = 0;
let parameterGotResolved = false;
do {
key = resolveKeys.shift() as string;
if (typeof rawValues[key] === 'string' && rawValues[key].charAt(0) === '=') {
@ -183,6 +184,7 @@ export default mixins(
} else {
// Contains probably no expression with a missing parameter so resolve
nodeValues[key] = this.resolveExpression(rawValues[key], nodeValues) as NodeParameterValue;
parameterGotResolved = true;
}
} else {
// Does not contain an expression, add directly
@ -195,7 +197,17 @@ export default mixins(
}
} while(resolveKeys.length !== 0);
return this.displayParameter(nodeValues, parameter, '');
if (parameterGotResolved === true) {
if (this.path) {
rawValues = JSON.parse(JSON.stringify(this.nodeValues));
set(rawValues, this.path, nodeValues);
return this.displayParameter(rawValues, parameter, this.path);
} else {
return this.displayParameter(nodeValues, parameter, '');
}
}
return this.displayParameter(this.nodeValues, parameter, this.path);
},
valueChanged (parameterData: IUpdateInformation): void {
this.$emit('valueChanged', parameterData);