Skip to content

feat(task): Create CampaginErrorDialog Component#670

Open
brain-frog wants to merge 9 commits intowebex:nextfrom
brain-frog:cai-7665
Open

feat(task): Create CampaginErrorDialog Component#670
brain-frog wants to merge 9 commits intowebex:nextfrom
brain-frog:cai-7665

Conversation

@brain-frog
Copy link
Copy Markdown
Contributor

@brain-frog brain-frog commented Apr 9, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link
    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

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

@brain-frog brain-frog requested a review from a team as a code owner April 9, 2026 14:37
@aws-amplify-us-east-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-670.d1b38q61t1z947.amplifyapp.com

import {withMetrics} from '@webex/cc-ui-logging';
import './campaign-error-dialog.style.scss';

const CampaignErrorDialog: React.FunctionComponent<CampaignErrorDialogProps> = ({errorType, isOpen, onClose}) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@brain-frog brain-frog added validated Indicates that the PR is ready for actions run_e2e Add this label to run E2E test for meeting and CC widgets labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run_e2e Add this label to run E2E test for meeting and CC widgets validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants