Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter credentials by version #3372

Merged
merged 2 commits into from
May 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions packages/editor-ui/src/components/mixins/workflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,24 +330,25 @@ export const workflowHelpers = mixins(
if (node.credentials !== undefined && nodeType.credentials !== undefined) {
const saveCredenetials: INodeCredentials = {};
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')) {
// saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
// continue;
// }

// const credentialTypeDescription = nodeType.credentials
// .find((credentialTypeDescription) => credentialTypeDescription.name === nodeCredentialTypeName);

// if (credentialTypeDescription === undefined) {
// // Credential type is not know so do not save
// continue;
// }

// if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
// // Credential should not be displayed so do also not save
// continue;
// }
if (this.hasProxyAuth(node) || Object.keys(node.parameters).includes('genericAuthType')) {
ivov marked this conversation as resolved.
Show resolved Hide resolved
saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
continue;
}

const credentialTypeDescription = nodeType.credentials
// filter out credentials with same name in different node versions
.filter((c) => this.displayParameter(node.parameters, c, '', node))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome. thanks for figuring this out.

.find((c) => c.name === nodeCredentialTypeName);

if (credentialTypeDescription === undefined) {
// Credential type is not know so do not save
continue;
}

if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
// Credential should not be displayed so do also not save
continue;
}

saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
}
Expand Down