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

feat: Enable cred setup for workflows created from templates (no-changelog) #8240

Merged

Conversation

tomi
Copy link
Contributor

@tomi tomi commented Jan 5, 2024

Summary

Enable users to open credential setup for workflows that have been created from templates if they skip it.

Next steps (will be their own PRs):

  • Add telemetry events
  • Add e2e test
  • Hide the button when user sets up all the credentials
  • Change the feature flag to a new one
Kapture.2024-01-05.at.13.05.25.mp4

Related tickets and issues

https://linear.app/n8n/issue/ADO-1637/feature-support-template-credential-setup-for-http-request-nodes-that

Review / Merge checklist

  • PR title and summary are descriptive. Remember, the title automatically goes into the changelog. Use (no-changelog) otherwise. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.

    A bug is not considered fixed, unless a test is added to prevent it from happening again.
    A feature is not complete without tests.

@tomi tomi requested a review from mutdmour January 5, 2024 11:08
export type AppCredentialCount = {
appName: string;
count: number;
};

//#region Getter functions

export const groupNodeCredentialsByKey = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything here has been mainly moved useCredentialSetupState.ts


//#region Types

export type NodeCredentials = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of these have been moved (with slight modifications) from setupTemplate.store.ts

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jan 5, 2024
Copy link
Contributor

@mutdmour mutdmour left a comment

Choose a reason for hiding this comment

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

🚀 Looks good. Just a small question to address

@@ -227,6 +227,7 @@ export default defineComponent({

.modal-content {
overflow: hidden;
overflow-y: auto;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you test this across different modals? Could be a problematic change. Putting this behind a prop might be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked a few modals but not all. I think it's more problematic if content gets hidden if there's not enough vertical space


<div>
<ol :class="$style.appCredentialsContainer">
<SetupTemplateFormStep
Copy link
Contributor

Choose a reason for hiding this comment

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

😍 Love this. Such complex functionality, hidden away and reused.

[CREDENTIAL_SELECT_MODAL_KEY]: {
open: false,
},
...Object.fromEntries(
Copy link
Contributor

Choose a reason for hiding this comment

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

😍

@tomi tomi requested a review from mutdmour January 5, 2024 14:21
mutdmour
mutdmour previously approved these changes Jan 5, 2024
Copy link
Contributor

github-actions bot commented Jan 5, 2024

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Jan 5, 2024

2 flaky tests on run #3623 ↗︎

0 327 5 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 tomi 🗃️ e2e/*
Project: n8n Commit: d53f12bf28
Status: Passed Duration: 06:54 💡
Started: Jan 5, 2024 3:57 PM Ended: Jan 5, 2024 4:04 PM
Flakiness  17-sharing.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Sharing > should work for admin role on credentials created by others (also can share it with themselves) Screenshots Video
Flakiness  29-templates.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Templates > should save template id with the workflow Screenshots Video

Review all test suite changes for PR #8240 ↗︎

Copy link
Contributor

github-actions bot commented Jan 5, 2024

⚠️ Some Cypress E2E specs are failing, please fix them before merging

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 5, 2024

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link
Contributor

github-actions bot commented Jan 5, 2024

✅ All Cypress E2E specs passed

@tomi tomi merged commit 3cf6704 into master Jan 5, 2024
19 checks passed
@tomi tomi deleted the ado-1463-feature-enable-users-to-close-and-re-open-the-setup branch January 5, 2024 16:07
tomi added a commit that referenced this pull request Jan 8, 2024
…8245)

## Summary

Follow-up to #8240

Adds e2e tests for the template credential setup in workflow editor


## Related tickets and issues

https://linear.app/n8n/issue/ADO-1463/feature-enable-users-to-close-and-re-open-the-setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants