mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): Fix credential display bug (#3372)
* ⚡ Filter credentials by version * ⚡ Reuse helper
This commit is contained in:
parent
96a109a57c
commit
ed69c3cc18
|
@ -330,24 +330,25 @@ export const workflowHelpers = mixins(
|
||||||
if (node.credentials !== undefined && nodeType.credentials !== undefined) {
|
if (node.credentials !== undefined && nodeType.credentials !== undefined) {
|
||||||
const saveCredenetials: INodeCredentials = {};
|
const saveCredenetials: INodeCredentials = {};
|
||||||
for (const nodeCredentialTypeName of Object.keys(node.credentials)) {
|
for (const nodeCredentialTypeName of Object.keys(node.credentials)) {
|
||||||
// todo revert to only set actually used credentials on workflow
|
if (this.hasProxyAuth(node) || Object.keys(node.parameters).includes('genericAuthType')) {
|
||||||
// if (this.hasProxyAuth(node) || Object.keys(node.parameters).includes('genericAuthType')) {
|
saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
|
||||||
// saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
|
continue;
|
||||||
// continue;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// const credentialTypeDescription = nodeType.credentials
|
const credentialTypeDescription = nodeType.credentials
|
||||||
// .find((credentialTypeDescription) => credentialTypeDescription.name === nodeCredentialTypeName);
|
// filter out credentials with same name in different node versions
|
||||||
|
.filter((c) => this.displayParameter(node.parameters, c, '', node))
|
||||||
|
.find((c) => c.name === nodeCredentialTypeName);
|
||||||
|
|
||||||
// if (credentialTypeDescription === undefined) {
|
if (credentialTypeDescription === undefined) {
|
||||||
// // Credential type is not know so do not save
|
// Credential type is not know so do not save
|
||||||
// continue;
|
continue;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
|
if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
|
||||||
// // Credential should not be displayed so do also not save
|
// Credential should not be displayed so do also not save
|
||||||
// continue;
|
continue;
|
||||||
// }
|
}
|
||||||
|
|
||||||
saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
|
saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue