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(web,api-service): redirect edit action of v1 workflows to old web app when opt-in #7460

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

LetItRock
Copy link
Contributor

What changed? Why was the change needed?

Redirect the edit v1 workflow action to the old Web application when the user is opt-in.
Also, improve the logic of redirecting to the new Dashboard pages in the Web app.

Screenshots

Screen.Recording.2025-01-08.at.15.10.15.mov

Copy link

linear bot commented Jan 8, 2025

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit f90512e
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/677ebaa1a6ca7100082f27bd
😎 Deploy Preview https://deploy-preview-7460.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +73 to +75
if (typeof template.type === 'undefined' && typeof template.origin === 'undefined') {
return WorkflowOriginEnum.NOVU_CLOUD_V1;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes the workflow badge in the Dashboard workflows list page.
The old v1 workflows like I do have in prod don't have type and origin fields that were introduced later. In that case the origin of the workflow is v1.

Comment on lines +19 to +31
switch (currentRoute) {
case ROUTES.GET_STARTED:
return `${newDashboardUrl}/env/${environment?.slug}/welcome`;
case ROUTES.WORKFLOWS:
return `${newDashboardUrl}/env/${environment?.slug}/workflows`;
case ROUTES.ACTIVITIES:
return `${newDashboardUrl}/env/${environment?.slug}/activity-feed`;
case ROUTES.INTEGRATIONS:
return `${newDashboardUrl}/integrations`;
case ROUTES.API_KEYS:
return `${newDashboardUrl}/env/${environment?.slug}/api-keys`;
default:
return undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on the Web application's current route calculate the new Dashboard URL and redirect the user when he is opt-in.

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 had to refactor the previous code because we want to allow editing the v1 workflows in the old Web app if the user is opt-in. Also at the same time clicking in the side navigation in the Web app should redirect user to the new Dashboard corresponding page.

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit f90512e
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/677ebaa1addaa1000897a92e
😎 Deploy Preview https://deploy-preview-7460.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@LetItRock LetItRock merged commit c1f020e into next Jan 9, 2025
33 of 38 checks passed
@LetItRock LetItRock deleted the nv-5151-redirect-v1-workflows-to-old-web-app branch January 9, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants