feat(task): Create CampaginErrorDialog Component#670
feat(task): Create CampaginErrorDialog Component#670brain-frog wants to merge 9 commits intowebex:nextfrom
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.
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.
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.