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(dashboard): promote toast env name #6933

Merged

Conversation

ChmaraX
Copy link
Contributor

@ChmaraX ChmaraX commented Nov 11, 2024

What changed? Why was the change needed?

Ties env name in sync toast to the actual workflow that was synced rather than the current environment.

This fixes an issue where:

  1. wf was synced to e.g. prod
  2. toast showed "synced to prod"
  3. user switched to dev
  4. toast changed labels to "dev"

Copy link

linear bot commented Nov 11, 2024

Copy link
Contributor

@SokratisVidros SokratisVidros left a comment

Choose a reason for hiding this comment

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

Please import types from shared to avoid overloading the dashboard bundle. We haven't been strict about that in the Dashboard code but we should moving forward.

Adding a custom ES lint rule at some point should help.

@@ -4,7 +4,13 @@ import { ConfirmationModal } from '@/components/confirmation-modal';
import { showToast } from '@/components/primitives/sonner-helpers';
import { PromoteSuccessToast } from '@/components/promote-workflow/promote-success-toast';
import { useEnvironment } from '@/context/environment/hooks';
import { WorkflowListResponseDto, WorkflowOriginEnum, WorkflowResponseDto, WorkflowStatusEnum } from '@novu/shared';
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import {
import type {

@@ -1,35 +1,36 @@
import { Button } from '@/components/primitives/button';
import { ToastClose, ToastIcon } from '@/components/primitives/sonner';
import { useEnvironment } from '@/context/environment/hooks';
import { WorkflowListResponseDto } from '@novu/shared';
import { IEnvironment, WorkflowResponseDto } from '@novu/shared';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { IEnvironment, WorkflowResponseDto } from '@novu/shared';
import type { IEnvironment, WorkflowResponseDto } from '@novu/shared';

@ChmaraX ChmaraX merged commit dc4fc26 into next Nov 11, 2024
8 of 9 checks passed
@ChmaraX ChmaraX deleted the nv-4672-sync-workflow-incorrect-banner-environment-shown branch November 11, 2024 14:53
Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 2e67ae8
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67321a472e2a8a00081fbc78
😎 Deploy Preview https://deploy-preview-6933--novu-stg-vite-dashboard-poc.netlify.app
📱 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants