Skip to content

Conversation

@akulakum
Copy link
Contributor

@akulakum akulakum commented Dec 16, 2025

COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7419

Vidcast Link: https://app.vidcast.io/share/b8c6a7dc-9b23-4f39-8c3c-06ec0ae84763

This pull request addresses

This PR is to consume engage npm packag and expose the digital widget as part of cc-widgets

< DESCRIBE THE CONTEXT OF THE ISSUE >
consumed "@webex-engage/wxengage-conversations": "^1.0.2", added yarnrc t o have cisco repository config and token.

by making the following changes

Created a new package @webex/cc-digital-channels and consumed "@webex-engage/wxengage-conversations": "^1.0.2"

< DESCRIBE YOUR CHANGES >

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
    < ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

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.

@akulakum akulakum added the validated Indicates that the PR is ready for actions label Dec 17, 2025
@@ -0,0 +1,13 @@
// Declare custom HTML elements used by the Webex Engage components
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we wont require md-theme, we can get rid of this file as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this comment is still applicable... but if so, we can remove this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets check this please.

import {mockTask, mockCC} from '@webex/test-fixtures';

// Mock mobx-react-lite to make observer work properly in tests
jest.mock('mobx-react-lite', () => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid this, we wanna make sure the store changes are being recevied by the widget

Copy link
Contributor

Choose a reason for hiding this comment

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

We are still mocking the store, can we remove that

it('should successfully load and initialize real Engage component without errors', () => {
// This test proves we can test with the real Engage component
expect(() => {
render(<DigitalChannels {...mockProps} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we check something in the dom to ensure the widget is loaded

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, just expecting no error wont gauranteee the widget has actually reached the dom

@aws-amplify-us-east-2
Copy link

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

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

import {createRoot} from 'react-dom/client';

// Initialize AGENTX_SERVICE before any imports that might need it
window['AGENTX_SERVICE'] = {}; // Required by engage widgets
Copy link
Contributor

Choose a reason for hiding this comment

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

lets revisit this after Rajeev comeback if he can fix it

*
* @returns The normalized region string (e.g., 'produs1', 'intgus1') or undefined if parsing fails
*/
export function extractRegionFromRtmsDomain(domain: string): string | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets revisit and discuss with team, how to do it more effectively

@rsarika rsarika requested a review from Shreyas281299 February 2, 2026 04:19
Copy link
Contributor

@adhmenon adhmenon left a comment

Choose a reason for hiding this comment

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

Overall code is LGTM.
Suggested few code changes.

Again, main thing to discuss is the getDataCenter method, ideally we should compute it in the SDK.
Have discussed with Ravi over the call and we are aware of the current method workaround.

@@ -0,0 +1,35 @@
import {ITask} from '@webex/cc-store';

export interface UseDigitalChannelsInitProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe we can rename this and remove the Use part from the names.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, Im assuming this is for hook. We were using this naming convention in web-client, in this repo we just use the work hook

Suggested change
export interface UseDigitalChannelsInitProps {
export interface DigitalChanelsHooksProps {

import {DigitalChannelsComponent} from './DigitalChannelsComponent';
import {DigitalChannelsProps} from './digital-channels.types';

const DigitalChannelsInternal: React.FunctionComponent<DigitalChannelsProps> = observer(({currentTheme}) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to move this to another file just for organisation perspective perhaps.

@@ -0,0 +1,13 @@
// Declare custom HTML elements used by the Webex Engage components
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this comment is still applicable... but if so, we can remove this file.

@@ -0,0 +1,10 @@
// This config is to do type checking in our files while running tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can remove some of these comments.

@@ -0,0 +1,35 @@
import {ITask} from '@webex/cc-store';

export interface UseDigitalChannelsInitProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, Im assuming this is for hook. We were using this naming convention in web-client, in this repo we just use the work hook

Suggested change
export interface UseDigitalChannelsInitProps {
export interface DigitalChanelsHooksProps {


return (
<div>
<md-theme id="app-theme" theme="momentumV2" {...(isDarkTheme ? {darktheme: true} : {lighttheme: true})}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we confirm if this is required? To use widgets we have asked dev to wrap the app in Theme and Icon Provider, so if a developer does that and here we are again wrapping the component that mean the Engage widget is wrapped twice. Just wanna ensure this doesnt break anything. Maybe its worthwhile to check with momentum team about this, We are wrapping a web-component in a react component.

@@ -0,0 +1,13 @@
// Declare custom HTML elements used by the Webex Engage components
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets check this please.

// Initialize the digital channels app only once per session
if (!isDigitalChannelsInitialized) {
logger.log(
`[DIGITAL_CHANNELS_INIT] 🚀 Starting Digital Channels initialization for the FIRST TIME (dataCenter: ${dataCenter})...`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not have emogis in logs.

import {mockTask, mockCC} from '@webex/test-fixtures';

// Mock mobx-react-lite to make observer work properly in tests
jest.mock('mobx-react-lite', () => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

We are still mocking the store, can we remove that

it('should successfully load and initialize real Engage component without errors', () => {
// This test proves we can test with the real Engage component
expect(() => {
render(<DigitalChannels {...mockProps} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, just expecting no error wont gauranteee the widget has actually reached the dom

Comment on lines +76 to +81
it('should demonstrate minimal mocking approach', () => {
// This test suite demonstrates that we only needed to mock:
// 1. AGENTX_SERVICE global (minimal requirement)
// 2. @webex/cc-store (external dependency)
// 3. mobx-react-lite observer (to simplify MobX in tests)
expect(true).toBe(true); // Placeholder assertion
Copy link
Contributor

Choose a reason for hiding this comment

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

This test doesnt have anything

Copy link
Contributor

Choose a reason for hiding this comment

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

I see we have reduced the file, but still this would need to be done to use digital cahnnel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants