mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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
|
// Get the resolved parameter values of the current node
|
||||||
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
||||||
const resolvedNodeParameters = this.getResolveNodeParameters(currentNodeParameters);
|
const resolvedNodeParameters = this.resolveParameter(currentNodeParameters);
|
||||||
|
|
||||||
const returnValues: string[] = [];
|
const returnValues: string[] = [];
|
||||||
for (const parameterPath of loadOptionsDependsOn) {
|
for (const parameterPath of loadOptionsDependsOn) {
|
||||||
|
@ -456,21 +456,6 @@ export default mixins(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
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 () {
|
async loadRemoteParameterOptions () {
|
||||||
if (this.node === null || this.remoteMethod === undefined || this.remoteParameterOptionsLoading) {
|
if (this.node === null || this.remoteMethod === undefined || this.remoteParameterOptionsLoading) {
|
||||||
return;
|
return;
|
||||||
|
@ -481,7 +466,7 @@ export default mixins(
|
||||||
|
|
||||||
// Get the resolved parameter values of the current node
|
// Get the resolved parameter values of the current node
|
||||||
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
||||||
const resolvedNodeParameters = this.getResolveNodeParameters(currentNodeParameters);
|
const resolvedNodeParameters = this.resolveParameter(currentNodeParameters) as INodeParameters;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = await this.restApi().getNodeParameterOptions(this.node.type, this.path, this.remoteMethod, resolvedNodeParameters, this.node.credentials);
|
const options = await this.restApi().getNodeParameterOptions(this.node.type, this.path, this.remoteMethod, resolvedNodeParameters, this.node.credentials);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
INodeExecutionData,
|
INodeExecutionData,
|
||||||
INodeIssues,
|
INodeIssues,
|
||||||
INodeParameters,
|
INodeParameters,
|
||||||
|
NodeParameterValue,
|
||||||
INodeType,
|
INodeType,
|
||||||
INodeTypes,
|
INodeTypes,
|
||||||
INodeTypeData,
|
INodeTypeData,
|
||||||
|
@ -337,7 +338,8 @@ export const workflowHelpers = mixins(
|
||||||
return nodeData;
|
return nodeData;
|
||||||
},
|
},
|
||||||
|
|
||||||
resolveExpression (expression: string, siblingParameters: INodeParameters = {}) {
|
|
||||||
|
resolveParameter(parameter: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[]) {
|
||||||
const inputIndex = 0;
|
const inputIndex = 0;
|
||||||
const itemIndex = 0;
|
const itemIndex = 0;
|
||||||
const runIndex = 0;
|
const runIndex = 0;
|
||||||
|
@ -363,13 +365,19 @@ export const workflowHelpers = mixins(
|
||||||
connectionInputData = [];
|
connectionInputData = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return workflow.expression.getParameterValue(parameter, runExecutionData, runIndex, itemIndex, activeNode.name, connectionInputData, 'manual', false) as IDataObject;
|
||||||
|
},
|
||||||
|
|
||||||
|
resolveExpression(expression: string, siblingParameters: INodeParameters = {}) {
|
||||||
|
|
||||||
const parameters = {
|
const parameters = {
|
||||||
'__xxxxxxx__': expression,
|
'__xxxxxxx__': expression,
|
||||||
...siblingParameters,
|
...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') {
|
if (typeof returnData['__xxxxxxx__'] === 'object') {
|
||||||
|
const workflow = this.getWorkflow();
|
||||||
return workflow.expression.convertObjectValueToString(returnData['__xxxxxxx__'] as object);
|
return workflow.expression.convertObjectValueToString(returnData['__xxxxxxx__'] as object);
|
||||||
}
|
}
|
||||||
return returnData['__xxxxxxx__'];
|
return returnData['__xxxxxxx__'];
|
||||||
|
|
Loading…
Reference in a new issue