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

fix(editor): When cloud users click on "How to update your n8n version" auto-login them before redirecting to the dashboard (no-changelog) #11467

Conversation

RicardoE105
Copy link
Contributor

@RicardoE105 RicardoE105 commented Oct 29, 2024

Summary

Title self explanatory.

Builds on top of #11466

image

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-2616/bug-when-cloud-users-click-on-update-info-url-they-dont-get-auto

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@RicardoE105 RicardoE105 changed the title ado 2616 bug when cloud users click on update info url they dont get v2 refactor(editor): Migrate UpdatesPanel.vue to composition API Oct 29, 2024
@RicardoE105 RicardoE105 changed the title refactor(editor): Migrate UpdatesPanel.vue to composition API fix(editor): When cloud users click on "How to update your n8n version" auto-login them before redirecting to the dashboard (no-changelog) Oct 29, 2024
@RicardoE105 RicardoE105 changed the base branch from master to move-updates-panel-to-composition October 29, 2024 23:11
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Oct 29, 2024
This helps consolidate all logic to redirect to owner to the cloud dashboard in one place, the uiStore.
@RicardoE105 RicardoE105 force-pushed the ado-2616-bug-when-cloud-users-click-on-update-info-url-they-dont-get-v2 branch from e41bace to abb68a6 Compare October 29, 2024 23:32
packages/editor-ui/src/components/UpdatesPanel.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/UpdatesPanel.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
@@ -628,6 +630,40 @@ export const useUIStore = defineStore(STORES.UI, () => {
lastCancelledConnectionPosition.value = undefined;
}

const isInstanceOwnerInCloud = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

would this be a better fit in the cloud plans or users store?
because ui store is already too big and general, and is slowly getting broken apart.

* cloud dashboard that redirects the user to the manage page where they can upgrade to a new n8n version.
* Otherwise, it redirect them to our docs.
*/
const goToVersions = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

would this be a better fit in the versions store? maybe gotToUpgrade and generateUpgradeLink as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved all method that redirect into their own composable

location.href = versionsLink;
};

const goToDashboard = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

would this be a better fir in the cloud plans store? maybe generateCloudDashboardAutoLoginLink as well?

Base automatically changed from move-updates-panel-to-composition to master October 30, 2024 10:09
@RicardoE105 RicardoE105 changed the base branch from master to openthesaurus October 31, 2024 14:12
@RicardoE105 RicardoE105 changed the base branch from openthesaurus to master October 31, 2024 14:12
mutdmour
mutdmour previously approved these changes Nov 1, 2024
};
});

describe('usePageRedirectionHelper', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for adding all these tests

Copy link
Contributor

github-actions bot commented Nov 1, 2024

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

Copy link

cypress bot commented Nov 1, 2024

n8n    Run #7659

Run Properties:  status check passed Passed #7659  •  git commit 55f6a0d640: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 RicardoE105 🗃️ e2e/*
Project n8n
Branch Review ado-2616-bug-when-cloud-users-click-on-update-info-url-they-dont-get-v2
Run status status check passed Passed #7659
Run duration 04m 24s
Commit git commit 55f6a0d640: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 RicardoE105 🗃️ e2e/*
Committer Ricardo Espinoza
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 461
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Nov 1, 2024

✅ All Cypress E2E specs passed

Copy link
Contributor

github-actions bot commented Nov 1, 2024

✅ All Cypress E2E specs passed

@RicardoE105 RicardoE105 merged commit 78e7d8d into master Nov 1, 2024
33 checks passed
@RicardoE105 RicardoE105 deleted the ado-2616-bug-when-cloud-users-click-on-update-info-url-they-dont-get-v2 branch November 1, 2024 15:01
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