mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
🐛 Fix bug with sibling loading with fixedCollections
This commit is contained in:
parent
002f53a4af
commit
bf7800cb15
|
@ -230,7 +230,7 @@ export default mixins(
|
|||
|
||||
// Get the resolved parameter values of the current node
|
||||
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
||||
const resolvedNodeParameters = this.getResolveNodeParameters(currentNodeParameters);
|
||||
const resolvedNodeParameters = this.resolveParameter(currentNodeParameters);
|
||||
|
||||
const returnValues: string[] = [];
|
||||
for (const parameterPath of loadOptionsDependsOn) {
|
||||
|
@ -456,21 +456,6 @@ export default mixins(
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
getResolveNodeParameters (nodeParameters: INodeParameters): INodeParameters {
|
||||
const returnData: INodeParameters = {};
|
||||
for (const key of Object.keys(nodeParameters)) {
|
||||
if (Array.isArray(nodeParameters[key])) {
|
||||
returnData[key] = (nodeParameters[key] as string[]).map(value => {
|
||||
return this.resolveExpression(value as string) as string;
|
||||
});
|
||||
} else if (typeof nodeParameters[key] === 'object') {
|
||||
returnData[key] = this.getResolveNodeParameters(nodeParameters[key] as INodeParameters) as INodeParameters;
|
||||
} else {
|
||||
returnData[key] = this.resolveExpression(nodeParameters[key] as string, nodeParameters) as NodeParameterValue;
|
||||
}
|
||||
}
|
||||
return returnData;
|
||||
},
|
||||
async loadRemoteParameterOptions () {
|
||||
if (this.node === null || this.remoteMethod === undefined || this.remoteParameterOptionsLoading) {
|
||||
return;
|
||||
|
@ -481,7 +466,7 @@ export default mixins(
|
|||
|
||||
// Get the resolved parameter values of the current node
|
||||
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
||||
const resolvedNodeParameters = this.getResolveNodeParameters(currentNodeParameters);
|
||||
const resolvedNodeParameters = this.resolveParameter(currentNodeParameters) as INodeParameters;
|
||||
|
||||
try {
|
||||
const options = await this.restApi().getNodeParameterOptions(this.node.type, this.path, this.remoteMethod, resolvedNodeParameters, this.node.credentials);
|
||||
|
|
|
@ -7,6 +7,7 @@ import {
|
|||
INodeExecutionData,
|
||||
INodeIssues,
|
||||
INodeParameters,
|
||||
NodeParameterValue,
|
||||
INodeType,
|
||||
INodeTypes,
|
||||
INodeTypeData,
|
||||
|
@ -337,7 +338,8 @@ export const workflowHelpers = mixins(
|
|||
return nodeData;
|
||||
},
|
||||
|
||||
resolveExpression (expression: string, siblingParameters: INodeParameters = {}) {
|
||||
|
||||
resolveParameter(parameter: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[]) {
|
||||
const inputIndex = 0;
|
||||
const itemIndex = 0;
|
||||
const runIndex = 0;
|
||||
|
@ -363,13 +365,19 @@ export const workflowHelpers = mixins(
|
|||
connectionInputData = [];
|
||||
}
|
||||
|
||||
return workflow.expression.getParameterValue(parameter, runExecutionData, runIndex, itemIndex, activeNode.name, connectionInputData, 'manual', false) as IDataObject;
|
||||
},
|
||||
|
||||
resolveExpression(expression: string, siblingParameters: INodeParameters = {}) {
|
||||
|
||||
const parameters = {
|
||||
'__xxxxxxx__': expression,
|
||||
...siblingParameters,
|
||||
};
|
||||
const returnData = workflow.expression.getParameterValue(parameters, runExecutionData, runIndex, itemIndex, activeNode.name, connectionInputData, 'manual', false) as IDataObject;
|
||||
const returnData = this.resolveParameter(parameters) as IDataObject;
|
||||
|
||||
if (typeof returnData['__xxxxxxx__'] === 'object') {
|
||||
const workflow = this.getWorkflow();
|
||||
return workflow.expression.convertObjectValueToString(returnData['__xxxxxxx__'] as object);
|
||||
}
|
||||
return returnData['__xxxxxxx__'];
|
||||
|
|
Loading…
Reference in a new issue