mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
addressing comments
This commit is contained in:
parent
f5b7ecdcda
commit
814eec2c19
|
@ -299,7 +299,10 @@ export class DynamicNodeParametersService {
|
||||||
return new LoadOptionsContext(workflow, node, additionalData, path);
|
return new LoadOptionsContext(workflow, node, additionalData, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLocalLoadOptionsContext(path: string, additionalData: IWorkflowExecuteAdditionalData) {
|
private getLocalLoadOptionsContext(
|
||||||
|
path: string,
|
||||||
|
additionalData: IWorkflowExecuteAdditionalData,
|
||||||
|
): ILocalLoadOptionsFunctions {
|
||||||
return new LocalLoadOptionsContext(
|
return new LocalLoadOptionsContext(
|
||||||
this.nodeTypes,
|
this.nodeTypes,
|
||||||
additionalData,
|
additionalData,
|
||||||
|
|
|
@ -26,25 +26,29 @@ export class LocalLoadOptionsContext implements ILocalLoadOptionsFunctions {
|
||||||
|
|
||||||
const workflowId = value as string;
|
const workflowId = value as string;
|
||||||
if (!workflowId) {
|
if (!workflowId) {
|
||||||
throw new ApplicationError('No workflowId parameter defined on node!');
|
throw new ApplicationError(`No workflowId parameter defined on node of type "${nodeType}"!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const dbWorkflow = await this.workflowLoader.get(workflowId);
|
const dbWorkflow = await this.workflowLoader.get(workflowId);
|
||||||
|
|
||||||
const workflowNode = dbWorkflow.nodes.find((node) => node.type === nodeType) as INode;
|
const selectedWorkflowNode = dbWorkflow.nodes.find((node) => node.type === nodeType) as INode;
|
||||||
|
|
||||||
if (workflowNode) {
|
if (selectedWorkflowNode) {
|
||||||
const workflow = new Workflow({
|
const selectedSingleNodeWorkflow = new Workflow({
|
||||||
nodes: [workflowNode],
|
nodes: [selectedWorkflowNode],
|
||||||
connections: {},
|
connections: {},
|
||||||
active: false,
|
active: false,
|
||||||
nodeTypes: this.nodeTypes,
|
nodeTypes: this.nodeTypes,
|
||||||
});
|
});
|
||||||
|
|
||||||
const workflowAdditionalData = deepCopy(this.additionalData);
|
const workflowAdditionalData = { ...this.additionalData };
|
||||||
workflowAdditionalData.currentNodeParameters = workflowNode.parameters;
|
workflowAdditionalData.currentNodeParameters = selectedWorkflowNode.parameters;
|
||||||
|
|
||||||
return new LoadWorkflowNodeContext(workflow, workflowNode, workflowAdditionalData);
|
return new LoadWorkflowNodeContext(
|
||||||
|
selectedSingleNodeWorkflow,
|
||||||
|
selectedWorkflowNode,
|
||||||
|
workflowAdditionalData,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue