feat(task): Create CampaginErrorDialog Component#670
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
| import {withMetrics} from '@webex/cc-ui-logging'; | ||
| import './campaign-error-dialog.style.scss'; | ||
|
|
||
| const CampaignErrorDialog: React.FunctionComponent<CampaignErrorDialogProps> = ({errorType, isOpen, onClose}) => { |
There was a problem hiding this comment.
doesnt momentum have a dialog you can use? and can you make a generic dialog that accepts props and then use that here? That way if we need another one we don't have to do this again
There was a problem hiding this comment.
It does! However the momentum-design package has not been updated in 11 months and the changes necessary to use the newer version are large enough that they should be their own story.
I'd be happy to take that story as well.
There was a problem hiding this comment.
This PR bumps momentum to latest: #665
Is this dialog component still required after the bump PR is merged?
If not, let's have a ticket to use native momentum dialog instead of this new component
eigengravy
left a comment
There was a problem hiding this comment.
Looks good! Two minor things:
File naming: CampaignErrorDialog.tsx should be campaign-error-dialog.tsx to match other exported components (user-state.tsx, station-login.tsx, call-control.tsx, etc.). The supporting files already use kebab-case.
Unused SCSS: .campaign-error-dialog-header and .campaign-error-dialog-close are defined in the stylesheet but never referenced in the JSX. Can be removed if unnecessary.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b39778fb80
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cfaf99fc3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 103eb0a8b0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Thank you for your contribution! |
COMPLETES # https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7665
This pull request addresses
The cc-components package needs a reusable error dialog component to display campaign-related errors (accept failed, skip failed, remove failed) to agents in a consistent, accessible manner.
by making the following changes
Adding a new CampaignErrorDialogComponent to cc-components with support for three error types: ACCEPT_FAILED, SKIP_FAILED, and REMOVE_FAILED
Implementing the dialog using the native HTML element with modal behavior
Adding proper keyboard support (Escape key to close)
Exporting the component and its types from cc-components package
Adding comprehensive unit tests for rendering, user interactions, and accessibility
Vidcast: https://app.vidcast.io/share/dda6e277-f63e-4252-b5f4-ff604d4e2383?playerMode=vidcast
Change Type
The following scenarios were tested
The CampaignErrorDialogComponent:
renders the dialog element correctly
renders the correct title for ACCEPT_FAILED error type ("Can't accept contact")
renders the correct title for SKIP_FAILED error type ("Can't skip contact")
renders the correct title for REMOVE_FAILED error type ("Can't remove contact")
renders the error message
renders the OK button
calls showModal when isOpen changes to true
calls close when isOpen changes to false
calls onClose when OK button is clicked
calls onClose when Escape key is pressed
does not call onClose when other keys are pressed
has proper dialog structure (uses DIALOG element)
has heading element for title
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.