From 1777f171bddc3eabc523b6824ccee5d4362c5a25 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 9 Feb 2020 23:37:08 -0800 Subject: [PATCH] :zap: Ignore node-parameter-issues on disabled nodes --- .../editor-ui/src/components/NodeSettings.vue | 15 +---------- .../src/components/mixins/nodeHelpers.ts | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/packages/editor-ui/src/components/NodeSettings.vue b/packages/editor-ui/src/components/NodeSettings.vue index 029b66fd54..98c4069e5c 100644 --- a/packages/editor-ui/src/components/NodeSettings.vue +++ b/packages/editor-ui/src/components/NodeSettings.vue @@ -379,20 +379,7 @@ export default mixins( }; this.$store.commit('setNodeParameters', updateInformation); - // All data got updated everywhere so update now the issues - const fullNodeIssues: INodeIssues | null = NodeHelpers.getNodeParametersIssues(nodeType.properties, node); - - let newIssues: INodeIssueObjectProperty | null = null; - if (fullNodeIssues !== null) { - newIssues = fullNodeIssues.parameters!; - } - - this.$store.commit('setNodeIssue', { - node: node.name, - type: 'parameters', - value: newIssues, - } as INodeIssueData); - + this.updateNodeParameterIssues(node, nodeType); this.updateNodeCredentialIssues(node); } else { // A property on the node itself changed diff --git a/packages/editor-ui/src/components/mixins/nodeHelpers.ts b/packages/editor-ui/src/components/mixins/nodeHelpers.ts index 9808898c18..8577044946 100644 --- a/packages/editor-ui/src/components/mixins/nodeHelpers.ts +++ b/packages/editor-ui/src/components/mixins/nodeHelpers.ts @@ -138,6 +138,32 @@ export const nodeHelpers = mixins( } as INodeIssueData); }, + // Updates the parameter-issues of the node + updateNodeParameterIssues(node: INodeUi, nodeType?: INodeTypeDescription): void { + if (nodeType === undefined) { + nodeType = this.$store.getters.nodeType(node.type); + } + + if (nodeType === null) { + // Could not find nodeType so can not update issues + return; + } + + // All data got updated everywhere so update now the issues + const fullNodeIssues: INodeIssues | null = NodeHelpers.getNodeParametersIssues(nodeType!.properties, node); + + let newIssues: INodeIssueObjectProperty | null = null; + if (fullNodeIssues !== null) { + newIssues = fullNodeIssues.parameters!; + } + + this.$store.commit('setNodeIssue', { + node: node.name, + type: 'parameters', + value: newIssues, + } as INodeIssueData); + }, + // Returns all the credential-issues of the node getNodeCredentialIssues (node: INodeUi, nodeType?: INodeTypeDescription): INodeIssues | null { if (node.disabled === true) { @@ -291,6 +317,7 @@ export const nodeHelpers = mixins( }; this.$store.commit('updateNodeProperties', updateInformation); + this.updateNodeParameterIssues(node); this.updateNodeCredentialIssues(node); } },