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(dashboard): unify success toasts #6937

Merged
merged 6 commits into from
Nov 12, 2024
Merged

feat(dashboard): unify success toasts #6937

merged 6 commits into from
Nov 12, 2024

Conversation

ChmaraX
Copy link
Contributor

@ChmaraX ChmaraX commented Nov 11, 2024

What changed? Why was the change needed?

Before:

image

Now:

image

image

Copy link

netlify bot commented Nov 11, 2024

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

Name Link
🔨 Latest commit 6e421f9
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67331964f6567c000899385a
😎 Deploy Preview https://deploy-preview-6937--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.

Comment on lines +67 to +77
<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}
/>
),
Copy link
Collaborator

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?‏

Copy link
Contributor

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.

Copy link
Collaborator

@rifont rifont left a comment

Choose a reason for hiding this comment

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

@ChmaraX ChmaraX merged commit adfbd74 into next Nov 12, 2024
26 checks passed
@ChmaraX ChmaraX deleted the chore/unify-toasts branch November 12, 2024 09:28
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.

3 participants