-
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
fix: Added Warning and Error icons to Worlflow settings component #4413
fix: Added Warning and Error icons to Worlflow settings component #4413
Conversation
Hi @rayy40 I think it was included in the issue to update the logic to show the yellow banner even if novu provider is there. The definition of done says "show the yellow warning banner only for the SMS or Email channels if there is only one Novu SMS/Email integration". Please tell me if you need help to find that logic :) |
Hey @davidsoderberg, as I checked I feel like the yellow warning banner will be shown for the SMS or Email channels, I just wasn't able to reproduce it to take a screenshot of the same. I wasn't able to reproduce it because the Novu Email provider was disabled since the free Novu provider doesn't allow sending of emails. In the
So, it already checks if it contains a Novu Provider and sets the type as warning, and then passes it to
If I am missing something or mistaking something, please let me know I'd be happy to take a look into that. |
A yes that makes sense. Will test it out later and see if I can get them to show. |
Hey @davidsoderberg I set the text color of warning and also fixed the color of Warning Icon. I just was curious about one thing, In the design-system/config/colors file the color for warning is set as |
I think we can make color a props and make the orange color default value. |
@@ -18,7 +18,7 @@ export const colors = { | |||
gradientStart, | |||
gradientEnd, | |||
success: '#4D9980', | |||
warning: '#FF8000', | |||
warning: '#EAA900', |
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.
Not sure we can replace it here can you pass it a prop instead and make the "FF8000" as default color prop?
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.
I have already passed it as a prop in my previous commit.
<WarningIcon color={color} onClick={onClick} />;
export function WarningIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
return (
<svg width="18" height="15" viewBox="0 0 18 15" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="M16.8125 13.0312L10.125 1.65625C9.625 0.78125 8.34375 0.78125 7.8125 1.65625L1.15625 13.0312C0.65625 13.9062 1.28125 15 2.3125 15H15.6562C16.6875 15 17.3125 13.9062 16.8125 13.0312ZM8.25 5.25C8.25 4.84375 8.5625 4.5 9 4.5C9.40625 4.5 9.75 4.84375 9.75 5.25V9.25C9.75 9.6875 9.40625 10 9 10C8.5625 10 8.25 9.6875 8.25 9.25V5.25ZM9 13C8.4375 13 8 12.5625 8 12.0312C8 11.5 8.4375 11.0625 9 11.0625C9.53125 11.0625 9.96875 11.5 9.96875 12.0312C9.96875 12.5625 9.53125 13 9 13Z"
fill="currentColor"
/>
</svg>
);
Is this what you mean?
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.
Ah yes but lets not change the color in colors but hardcoded it for now where you need it.
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.
Made the changes as required.
I have made the required changes. |
…/rayy40/novu into fix/add-icons-to-alert-component
Hey @davidsoderberg , any updates? |
There is an issue where |
Okay, I get it. These are the two hex codes:
|
It needs to be the one in colors.ts and then in your case you need to pass the new one in figma as color prop. |
I have fixed the error, can you please review it now? :) |
Hey @davidsoderberg , Are there any other changes required? |
hey @rayy40 👋 thank you so much for the incredible work you did 🤝 Could you please do me a favor and add a few changes that I've missed from the current implementation? 🙏
Thanks in advance and sorry about that 🙏 |
Hey @LetItRock , can you please review the changes? |
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.
Hi @rayy40 :)
A few notes:
- Please take a look at how the alert shows in the editor sidebar itself (for example sms editor), the icons are very small there.
![Screen Shot 2023-10-15 at 15 19 10](https://private-user-images.githubusercontent.com/7778680/275325014-13636002-5587-438e-ba9b-0da64ed90fd4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzQwMDIsIm5iZiI6MTczOTAzMzcwMiwicGF0aCI6Ii83Nzc4NjgwLzI3NTMyNTAxNC0xMzYzNjAwMi01NTg3LTQzOGUtYmE5Yi0wZGE2NGVkOTBmZDQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTY1NTAyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTdmOTU3MmY4MTQ5ZmQyYjc3YTg3ZGJlNjdmMTg3N2E3MzdhMzE4OTZmNWNhNGMxZTRjNTVkNGM1MDU4OGRhYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.3fgYzHNHN-hrXsHetilGOBss1oUbw2xEbM5wZ4VIbLI)
- The warning banner (the yellow) is shown before the novu provider in the providers list. It should show first the novu provider and under it the warning.
<Text color={alertTypeToMessageTextColor(type)}> | ||
{text | ||
? text | ||
: `Please configure or activate a provider instance for the ${stepNames[channelType]} channel to send notifications over this node`} | ||
</Text> | ||
<CircleArrowRight /> |
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.
The correct color should be passed here.
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.
Also, I believe this arrow will be shown immediately after the text, and will not at the end of the row like it should.
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.
Also, I believe this arrow will be shown immediately after the text, and will not at the end of the row like it should.
When placing it just after the text, I need to add another flex container to align the items, and I feel like it's redundant since there is already a flex container Group
which is a parent for AlertIcons
and Text
, so I just added CircleArrowRight
there too.
Please let me know if I am missing something or need to go with a different approach.
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.
@rayy40, in the comment below I added a screenshot 0f your result, as you can see the arrow is not at the end of the row :)
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.
@ainouzgali , Ah sorry. I wasn't able to understand you before ;(
In addition to that logic, you should add a check for the environment. Because currently it will find both the production and development novu integration so the length will not be 1 and the warning banner will not be shown |
Hey @ainouzgali , could you please tell me how to reproduce this issue? |
@rayy40 , after you add the environment check I told you about in ListProviders.tsx. Should be something like this:
That will make the warning alert show at all. |
@ainouzgali , I have actually added the check for environment but what I meant was, how can I check for the warning message? Since currently I am unable to activate the novu email provider in the development environment? As you have shown in your screenshot, that you have connected the novu email provider and getting the warning message. |
I guess, I figured why the warning alert was being shown at the top. Please take a look at it, I was not able to check it myself since couldn't figure out if it was possible to enable the novu email provider. |
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.
It looks great!! Awesome job!
Just remove the duplicate function and we will merge this⭐️
apps/web/src/pages/templates/components/LackIntegrationAlert.tsx
Outdated
Show resolved
Hide resolved
Hey @ainouzgali , I have removed the duplicate function. Can you please take a look? :) |
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.
Thank you @rayy40 ! we appreciate it!
Great work
What change does this PR introduce?
This PR improves the UX of the workflow settings component, by using Warning Icon for warning and Error Icon for error.
Why was this change needed?
The change was to improve the UX of the workflow settings component and add the icons according to the designs.
Fixes: #4255
Screenshots
Previous:
![Screenshot 2023-10-04 025707](https://private-user-images.githubusercontent.com/128903323/272726544-0ad4443e-ed9a-4958-8ba1-79db770ec953.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzQwMDAsIm5iZiI6MTczOTAzMzcwMCwicGF0aCI6Ii8xMjg5MDMzMjMvMjcyNzI2NTQ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T1mZTBkZTFkYTQ1MmMyNzQzMmEwOTJlOTk2N2RhNThjYjE0OWM0MmI4MjJiZmMzN2ZkMGI2MmZkY2M4MTgwY2VjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.yVtEytcL7yZLh22jGF3xaSfkkLGhJXmfXGBkOVGJlP8)
I wasn't able to get the screenshot for the yellow warning banner for the SMS or Email channels when there is only one Novu SMS/Email integration since the Novu Email/SMS provider was disabled because the free Novu provider allows sending 0 emails per month.