-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(dashboard): unify success toasts #6937
Conversation
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
apps/dashboard/src/components/workflow-editor/test-workflow/test-workflow-tabs.tsx
Outdated
Show resolved
Hide resolved
<SuccessButtonToast | ||
title={`Workflow synced to ${environment?.name}`} | ||
description={`Workflow '${workflow.name}' has been successfully synced to ${environment?.name}.`} | ||
actionLabel={`Switch to ${environment?.name}`} | ||
onAction={() => { | ||
close(); | ||
switchEnvironment(environment?.slug || ''); | ||
}} | ||
onClose={close} | ||
/> | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ question: The environment
should be defined at this point. If it's easy to do so, can we fix the types or return a loading state whilst it's not defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an issue across the new Dashboard as the returned type of environment
from the useEnvironment
hook. We can use discriminated unions to make sure the environment is not optional if a loaded: true flag is true or we can use an env guard that ensures all its children have an environment set.
I suggest we tackled this in a separate PR across all the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
What changed? Why was the change needed?
Before:
Now: