mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
⚡ Ignore node-credential-issues on disabled nodes
This commit is contained in:
@@ -13,7 +13,7 @@ export async function WorkflowCredentials(nodes: INode[]): Promise<IWorkflowCred
|
|||||||
|
|
||||||
let node, type, name, foundCredentials;
|
let node, type, name, foundCredentials;
|
||||||
for (node of nodes) {
|
for (node of nodes) {
|
||||||
if (!node.credentials) {
|
if (node.disabled === true || !node.credentials) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,15 +171,7 @@ export default mixins(nodeBase, workflowHelpers).extend({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
disableNode () {
|
disableNode () {
|
||||||
// Toggle disabled flag
|
this.disableNodes([this.data]);
|
||||||
const updateInformation = {
|
|
||||||
name: this.data.name,
|
|
||||||
properties: {
|
|
||||||
disabled: !this.data.disabled,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$store.commit('updateNodeProperties', updateInformation);
|
|
||||||
},
|
},
|
||||||
executeNode () {
|
executeNode () {
|
||||||
this.$emit('runWorkflow', this.data.name);
|
this.$emit('runWorkflow', this.data.name);
|
||||||
|
|||||||
@@ -288,20 +288,6 @@ export default mixins(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateNodeCredentialIssues (node: INodeUi): void {
|
|
||||||
const fullNodeIssues: INodeIssues | null = this.getNodeCredentialIssues(node);
|
|
||||||
|
|
||||||
let newIssues: INodeIssueObjectProperty | null = null;
|
|
||||||
if (fullNodeIssues !== null) {
|
|
||||||
newIssues = fullNodeIssues.credentials!;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$store.commit('setNodeIssue', {
|
|
||||||
node: node.name,
|
|
||||||
type: 'credentials',
|
|
||||||
value: newIssues,
|
|
||||||
} as INodeIssueData);
|
|
||||||
},
|
|
||||||
credentialSelected (updateInformation: INodeUpdatePropertiesInformation) {
|
credentialSelected (updateInformation: INodeUpdatePropertiesInformation) {
|
||||||
// Update the values on the node
|
// Update the values on the node
|
||||||
this.$store.commit('updateNodeProperties', updateInformation);
|
this.$store.commit('updateNodeProperties', updateInformation);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
INodeParameters,
|
INodeParameters,
|
||||||
INodeExecutionData,
|
INodeExecutionData,
|
||||||
INodeIssues,
|
INodeIssues,
|
||||||
|
INodeIssueData,
|
||||||
INodeIssueObjectProperty,
|
INodeIssueObjectProperty,
|
||||||
INodeProperties,
|
INodeProperties,
|
||||||
INodeTypeDescription,
|
INodeTypeDescription,
|
||||||
@@ -121,8 +122,29 @@ export const nodeHelpers = mixins(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Updates the credential-issues of the node
|
||||||
|
updateNodeCredentialIssues(node: INodeUi): void {
|
||||||
|
const fullNodeIssues: INodeIssues | null = this.getNodeCredentialIssues(node);
|
||||||
|
|
||||||
|
let newIssues: INodeIssueObjectProperty | null = null;
|
||||||
|
if (fullNodeIssues !== null) {
|
||||||
|
newIssues = fullNodeIssues.credentials!;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$store.commit('setNodeIssue', {
|
||||||
|
node: node.name,
|
||||||
|
type: 'credentials',
|
||||||
|
value: newIssues,
|
||||||
|
} as INodeIssueData);
|
||||||
|
},
|
||||||
|
|
||||||
// Returns all the credential-issues of the node
|
// Returns all the credential-issues of the node
|
||||||
getNodeCredentialIssues (node: INodeUi, nodeType?: INodeTypeDescription): INodeIssues | null {
|
getNodeCredentialIssues (node: INodeUi, nodeType?: INodeTypeDescription): INodeIssues | null {
|
||||||
|
if (node.disabled === true) {
|
||||||
|
// Node is disabled
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (nodeType === undefined) {
|
if (nodeType === undefined) {
|
||||||
nodeType = this.$store.getters.nodeType(node.type);
|
nodeType = this.$store.getters.nodeType(node.type);
|
||||||
}
|
}
|
||||||
@@ -257,5 +279,20 @@ export const nodeHelpers = mixins(
|
|||||||
|
|
||||||
return returnData;
|
return returnData;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
disableNodes(nodes: INodeUi[]) {
|
||||||
|
for (const node of nodes) {
|
||||||
|
// Toggle disabled flag
|
||||||
|
const updateInformation = {
|
||||||
|
name: node.name,
|
||||||
|
properties: {
|
||||||
|
disabled: !node.disabled,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$store.commit('updateNodeProperties', updateInformation);
|
||||||
|
this.updateNodeCredentialIssues(node);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -547,19 +547,7 @@ export default mixins(
|
|||||||
if (this.editAllowedCheck() === false) {
|
if (this.editAllowedCheck() === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.disableNodes(this.$store.getters.getSelectedNodes);
|
||||||
let updateInformation;
|
|
||||||
this.$store.getters.getSelectedNodes.forEach((node: INodeUi) => {
|
|
||||||
// Toggle disabled flag
|
|
||||||
updateInformation = {
|
|
||||||
name: node.name,
|
|
||||||
properties: {
|
|
||||||
disabled: !node.disabled,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$store.commit('updateNodeProperties', updateInformation);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteSelectedNodes () {
|
deleteSelectedNodes () {
|
||||||
|
|||||||
Reference in New Issue
Block a user