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

upcoming: [DI - 22836] - Added AddNotificationChannel component #11511

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

santoshp210-akamai
Copy link
Contributor

Description 📝

Added the AddNotificationChannel Drawer component to the Create Alert form

Changes 🔄

  • Added the relevant types for the Notification Channel for the Alerting use-case.
  • Added the AddNotificationChannel component with Unit Tests.
  • The AddNotificationChannel component has two Autocomplete components for the Type and Channel fields.
  • Added state variables to the CreateAlertDefinition component to handle the Drawer.

Target release date 🗓️

Please specify a release date (and environment, if applicable) to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.

Preview 📷

Include a screenshot or screen recording of the change.

🔒 Use the Mask Sensitive Data setting for security.

💡 Use <video src="" /> tag when including recordings in table.

Before After
image image image

How to test 🧪

Prerequisites

  • The API endpoints are not live yet, so use Legacy MSW Handlers for the mock responses
  • In Monitor (once the prerequisites are followed) , Alerts tab should be visible next to Dashboards.
  • Under that, Definition tab and a Create button should be visible.
  • On clicking Create, the Form Page should be visible
  • At the bottom of the form there's Add Notification Channel button, clicking on that should show the Add Notification Channel Drawer

Reproduction steps

Verification steps

  • Verification of the Add Notification Channel button
  • Verification of the Form and the Autocomplete components inside the form
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@santoshp210-akamai santoshp210-akamai requested a review from a team as a code owner January 13, 2025 09:38
@santoshp210-akamai santoshp210-akamai requested review from carrillo-erik and pmakode-akamai and removed request for a team January 13, 2025 09:38
@santoshp210-akamai
Copy link
Contributor Author

Note

Currently once the Notification Channel is selected and Submit button is pressed in the Add Notification Channel Drawer, it does not reflect the saved Channel on the form. That is part of a different component that will added as part of subsequent PR. Thank you!

Copy link

github-actions bot commented Jan 13, 2025

Coverage Report:
Base Coverage: 87.16%
Current Coverage: 87.16%

Copy link
Contributor

@pmakode-akamai pmakode-akamai left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I’ve left a couple of comments. Also, it looks like there’s a conflict with /CloudPulse/Alerts/constants.ts that needs to be resolved.

<Box paddingTop={2}>
<Grid container>
<Grid item md={1} sm={1} xs={2}>
<Typography variant="h3">To:</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

When selecting Email and Channel, the To: label appears empty. Is this intentional, or should a placeholder or dynamic value be displayed here for clarity?

Screenshot 2025-01-15 at 5 51 40 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is supposed to be another component that shows the details. That'll be part of next PR , we couldn't add it because of the line count.

Copy link
Contributor

Choose a reason for hiding this comment

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

The To: label is empty, which could be confusing. Since the full details will be part of the next PR, would it make sense to add both the To: label and its details together then? This would ensure the UI is complete and functional, without leaving any incomplete or ambiguous elements in this PR. I defer to @jaalah-akamai and others for input

Copy link
Contributor Author

@santoshp210-akamai santoshp210-akamai Jan 17, 2025

Choose a reason for hiding this comment

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

Yeah, that makes sense. I will take a look if it's possible. If others agree then I will make that change

Comment on lines +201 to +209
<Box mt={1}>
<Button
buttonType="outlined"
onClick={onAddNotifications}
size="medium"
>
Add notification channel
</Button>
</Box>
Copy link
Contributor

Choose a reason for hiding this comment

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

The top spacing for the Add Notification Channel button seems smaller and inconsistent with the Add Metric button. Can we adjust the spacing to make them consistent?

Screenshot 2025-01-15 at 4 35 12 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing here, There is supposed to be a different section, but The button is part of another component which will be in the next PR so to test the drawer functionality, I put it as placeholder for this PR.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 3 failing tests on test run #5 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
3 Failing471 Passing2 Skipped110m 4s

Details

Failing Tests
SpecTest
smoke-linode-landing-table.spec.tslinode landing checks » checks the landing page side menu items
clone-linode.spec.tsclone linode » can clone a Linode from Linode details page
cloudpulse-navigation.spec.tsCloudPulse navigation » can navigate to Cloudpulse landing page

Troubleshooting

Use this command to re-run the failing tests:

yarn cy:run -s "cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/cloudpulse/cloudpulse-navigation.spec.ts"

Copy link
Contributor

@pmakode-akamai pmakode-akamai left a comment

Choose a reason for hiding this comment

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

Looks good to me! Left a comment for further inputs on the To: label from others.

✅ Confirmed clicking the Add Notification Channel button displays the Add Notification Channel Drawer

Comment on lines +222 to +236
{openAddNotification && (
<Drawer
onClose={onExitNotifications}
open={openAddNotification}
title="Add Notification Channel"
>
<AddNotificationChannel
isNotificationChannelsError={false}
isNotificationChannelsLoading={false}
onCancel={onExitNotifications}
onSubmitAddNotification={onSubmitAddNotification}
templateData={notificationChannelFactory.buildList(2)}
/>
</Drawer>
)}
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this conditional. It breaks the drawer open/close animation

Suggested change
{openAddNotification && (
<Drawer
onClose={onExitNotifications}
open={openAddNotification}
title="Add Notification Channel"
>
<AddNotificationChannel
isNotificationChannelsError={false}
isNotificationChannelsLoading={false}
onCancel={onExitNotifications}
onSubmitAddNotification={onSubmitAddNotification}
templateData={notificationChannelFactory.buildList(2)}
/>
</Drawer>
)}
<Drawer
onClose={onExitNotifications}
open={openAddNotification}
title="Add Notification Channel"
>
<AddNotificationChannel
isNotificationChannelsError={false}
isNotificationChannelsLoading={false}
onCancel={onExitNotifications}
onSubmitAddNotification={onSubmitAddNotification}
templateData={notificationChannelFactory.buildList(2)}
/>
</Drawer>

The Drawer component should be smart enough to not render its children when open is false so performance should still be okay

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.

5 participants