upcoming: [DI-23778] - Added. confirmation dialog in alerts contextual view#11785
Conversation
|
Coverage Report: ✅ |
| entityName={entityName} | ||
| handleCancel={handleCancel} | ||
| handleConfirm={handleConfirm} | ||
| isActive={selectedAlert?.entity_ids?.includes(entityId) ?? false} |
There was a problem hiding this comment.
| isActive={selectedAlert?.entity_ids?.includes(entityId) ?? false} | |
| isActive={selectedAlert.entity_ids.includes(entityId)} |
There was a problem hiding this comment.
on initial loading of action table component this object will be undefined that's why that is necessary
| })) | ||
| ); | ||
|
|
||
| const DatabaseAlert = React.lazy(() => |
There was a problem hiding this comment.
I've added these changes for PR testing purpose and will remove it before merging the PR
| entityId: string, | ||
| data: { 'alert-definition-id': number } | ||
| ) => | ||
| Request<{}>( |
There was a problem hiding this comment.
@nikhagra-akamai , here we are returning a json object {}, is there any valid return type like, alert with entity details like that?, API should return some response right?
same below as well
There was a problem hiding this comment.
as of now no any confirmation on its return type because some discussions are going on about this update APIs
There was a problem hiding this comment.
So is this PR just for the visual presentation of the confirmation dialog? When is the API response expected to be finalized?
There was a problem hiding this comment.
@mjac0bs Yes!! This PR is just for preparing from the UI side. Since it's a reusable component, it won’t be visible anywhere in the UI until the service-specific APIs are finalized and approved in terms of spec and implementation. Discussions with service owners are ongoing to finalize these APIs. Once that’s done, we’ll integrate them and submit a final PR, allowing this feature to be fully integrated and visible in the UI. Until then, this remains a UI-ready code update.
There was a problem hiding this comment.
@nikhagra-akamai May be you can place a comment /ToDo task in this to clear the confusion and setting the expectation.
There was a problem hiding this comment.
I've added a todo comment in the query function
packages/manager/src/features/CloudPulse/Alerts/AlertsLanding/AlertConfirmationDialog.tsx
Outdated
Show resolved
Hide resolved
| ); | ||
| }) | ||
| .catch(() => { | ||
| enqueueSnackbar( |
There was a problem hiding this comment.
@nikhagra-akamai , here it is a generic error? do we need to display error message from API?
There was a problem hiding this comment.
will update the logic here once the API responses will be finalized
| }); | ||
| }; | ||
|
|
||
| export const useAddEntityToAlert = () => { |
There was a problem hiding this comment.
@nikhagra-akamai , for my better understanding, can you explain how this is different from invalidating the queries on success as well error, why we need this much complexities, if just invalidating works fine?
One more point to ask, since we are waiting for the API call to get completed before closing the confirmation dialog, we don't need immediate feedback in the UI, this makes one more point for just invalidating queries?
There was a problem hiding this comment.
updated, thanks
venkymano-akamai
left a comment
There was a problem hiding this comment.
Gave some simple comments, as well as one explanation in terms of invalidating queries, Rest looks good.
Thanks for review, I've updated the logic |
venkymano-akamai
left a comment
There was a problem hiding this comment.
Approving, pending fix for typecheck and UT's
| entityName={entityName} | ||
| handleCancel={vi.fn()} | ||
| handleConfirm={confirmFunction} | ||
| isActive={true} |
There was a problem hiding this comment.
Can we add some coverage to this test so that we test both an alert that is active and not active?
We could include assertions for whether:
- the title includes "Enable" vs "Disable"
- the body includes "enable" vs "disable"
- the
entityNameis included in the text
packages/manager/src/features/CloudPulse/Alerts/ContextualView/AlertInformationActionTable.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/CloudPulse/Alerts/ContextualView/AlertInformationActionTable.tsx
Outdated
Show resolved
Hide resolved
| entityId: string, | ||
| data: { 'alert-definition-id': number } | ||
| ) => | ||
| Request<{}>( |
There was a problem hiding this comment.
So is this PR just for the visual presentation of the confirmation dialog? When is the API response expected to be finalized?
mjac0bs
left a comment
There was a problem hiding this comment.
Thanks for addressing feedback.
Cloud Manager UI test results🔺 1 failing test on test run #14 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/linode-config.spec.ts" |
|||||||||||||||||
Cloud Manager E2E
|
||||||||||||||||||||||||||||
| Project |
Cloud Manager E2E
|
| Branch Review |
develop
|
| Run status |
|
| Run duration | 57m 50s |
| Commit |
|
| Committer | Nikhil Agrawal |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
6
|
|
|
3
|
|
|
0
|
|
|
538
|
| View all changes introduced in this branch ↗︎ | |
Description 📝
Added confirmation dialog in contextual view while enabling/disabling an alert for the selected entity
Changes 🔄
List any change(s) relevant to the reviewer.
Target release date 🗓️
15th March
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.How to test 🧪
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
As an Author, before moving this PR from Draft to Open, I confirmed ✅