From 16ba7e6ed7fb915b6fe37318a87b513b956e744f Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 7 Jul 2019 19:17:34 +0200 Subject: [PATCH] :bug: Fix bug with displaying node-issues --- .../editor-ui/src/components/mixins/nodeHelpers.ts | 12 +++++++++++- .../src/components/mixins/workflowHelpers.ts | 1 + packages/workflow/src/NodeHelpers.ts | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/components/mixins/nodeHelpers.ts b/packages/editor-ui/src/components/mixins/nodeHelpers.ts index 5ff5307b5a..22e074cb3b 100644 --- a/packages/editor-ui/src/components/mixins/nodeHelpers.ts +++ b/packages/editor-ui/src/components/mixins/nodeHelpers.ts @@ -49,6 +49,11 @@ export const nodeHelpers = mixins( let nodeIssues: INodeIssues | null = null; ignoreIssues = ignoreIssues || []; + if (node.disabled === true) { + // Ignore issues on disabled nodes + return null; + } + if (nodeType === null) { // Node type is not known if (!ignoreIssues.includes('typeUnknown')) { @@ -127,13 +132,18 @@ export const nodeHelpers = mixins( return null; } + if (nodeType!.credentials === undefined) { + // No credentials defined for node type + return null; + } + const foundIssues: INodeIssueObjectProperty = {}; let userCredentials: ICredentialsResponse[] | null; let credentialType: ICredentialType | null; let credentialDisplayName: string; let selectedCredentials: string; - for (const credentialTypeDescription of nodeType!.credentials) { + for (const credentialTypeDescription of nodeType!.credentials!) { // Check if credentials should be displayed else ignore if (this.displayParameter(node.parameters, credentialTypeDescription, '') !== true) { continue; diff --git a/packages/editor-ui/src/components/mixins/workflowHelpers.ts b/packages/editor-ui/src/components/mixins/workflowHelpers.ts index 00fc7305b3..ab563e5a6d 100644 --- a/packages/editor-ui/src/components/mixins/workflowHelpers.ts +++ b/packages/editor-ui/src/components/mixins/workflowHelpers.ts @@ -134,6 +134,7 @@ export const workflowHelpers = mixins( node = workflow.nodes[nodeName]; if (node.disabled === true) { + // Ignore issues on disabled nodes continue; } diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index c5b0c43198..3140bfb7bf 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -447,6 +447,11 @@ export function getNodeParametersIssues(nodePropertiesArray: INodeProperties[], const foundIssues: INodeIssues = {}; let propertyIssues: INodeIssues; + if (node.disabled === true) { + // Ignore issues on disabled nodes + return null; + } + for (const nodeProperty of nodePropertiesArray) { propertyIssues = getParameterIssues(nodeProperty, node.parameters, ''); mergeIssues(foundIssues, propertyIssues);