From 0877b0779d9ac179fef12db789c2e29044a09e57 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 15 May 2021 18:59:33 -0500 Subject: [PATCH] :bug: Fix issue with displaying parameter with root level reference --- .../src/components/ParameterInputList.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/components/ParameterInputList.vue b/packages/editor-ui/src/components/ParameterInputList.vue index 3eee27653b..21f55127f5 100644 --- a/packages/editor-ui/src/components/ParameterInputList.vue +++ b/packages/editor-ui/src/components/ParameterInputList.vue @@ -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);