diff --git a/packages/contact-center/cc-components/src/components/task/task.types.ts b/packages/contact-center/cc-components/src/components/task/task.types.ts index e78530c82..deff5ce4c 100644 --- a/packages/contact-center/cc-components/src/components/task/task.types.ts +++ b/packages/contact-center/cc-components/src/components/task/task.types.ts @@ -386,9 +386,9 @@ export interface ControlProps { allowConsultToQueue: boolean; /** - * Flag to enable or disable multi-party conference feature + * Flag to enable or disable conference feature */ - multiPartyConferenceEnabled: boolean; + conferenceEnabled: boolean; /** * Function to set the last target type diff --git a/packages/contact-center/task/src/CallControl/index.tsx b/packages/contact-center/task/src/CallControl/index.tsx index 2f740ced8..022629749 100644 --- a/packages/contact-center/task/src/CallControl/index.tsx +++ b/packages/contact-center/task/src/CallControl/index.tsx @@ -8,15 +8,7 @@ import {CallControlProps} from '../task.types'; import {CallControlComponent} from '@webex/cc-components'; const CallControlInternal: React.FunctionComponent = observer( - ({ - onHoldResume, - onEnd, - onWrapUp, - onRecordingToggle, - onToggleMute, - consultTransferOptions, - multiPartyConferenceEnabled, - }) => { + ({onHoldResume, onEnd, onWrapUp, onRecordingToggle, onToggleMute, consultTransferOptions, conferenceEnabled}) => { const { logger, currentTask, @@ -42,7 +34,7 @@ const CallControlInternal: React.FunctionComponent = observer( deviceType, featureFlags, isMuted, - multiPartyConferenceEnabled, + conferenceEnabled, agentId, }), wrapupCodes, @@ -65,7 +57,7 @@ const CallControl: React.FunctionComponent = (props) => { if (store.onErrorCallback) store.onErrorCallback('CallControl', error); }} > - + ); }; diff --git a/packages/contact-center/task/src/CallControlCAD/index.tsx b/packages/contact-center/task/src/CallControlCAD/index.tsx index 24979239d..df353bd8b 100644 --- a/packages/contact-center/task/src/CallControlCAD/index.tsx +++ b/packages/contact-center/task/src/CallControlCAD/index.tsx @@ -16,7 +16,7 @@ const CallControlCADInternal: React.FunctionComponent = observ onToggleMute, callControlClassName, callControlConsultClassName, - multiPartyConferenceEnabled, + conferenceEnabled, consultTransferOptions, }) => { const { @@ -43,7 +43,7 @@ const CallControlCADInternal: React.FunctionComponent = observ deviceType, featureFlags, isMuted, - multiPartyConferenceEnabled, + conferenceEnabled, agentId, }), wrapupCodes, @@ -68,7 +68,7 @@ const CallControlCAD: React.FunctionComponent = (props) => { if (store.onErrorCallback) store.onErrorCallback('CallControlCAD', error); }} > - + ); }; diff --git a/packages/contact-center/task/src/Utils/constants.ts b/packages/contact-center/task/src/Utils/constants.ts index dcad63c28..c9f9cb695 100644 --- a/packages/contact-center/task/src/Utils/constants.ts +++ b/packages/contact-center/task/src/Utils/constants.ts @@ -3,4 +3,3 @@ export const MEDIA_TYPE_TELEPHONY = 'telephony'; export const MEDIA_TYPE_CHAT = 'chat'; export const MEDIA_TYPE_EMAIL = 'email'; export const MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE = 7; -export const MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE = 2; diff --git a/packages/contact-center/task/src/Utils/task-util.ts b/packages/contact-center/task/src/Utils/task-util.ts index 24f997584..41314c297 100644 --- a/packages/contact-center/task/src/Utils/task-util.ts +++ b/packages/contact-center/task/src/Utils/task-util.ts @@ -17,7 +17,6 @@ import { MEDIA_TYPE_CHAT, MEDIA_TYPE_EMAIL, MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE, - MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE, } from './constants'; import {DeviceTypeFlags} from '../task.types'; @@ -177,20 +176,14 @@ export function getConferenceButtonVisibility( webRtcEnabled: boolean, isCall: boolean, isChat: boolean, - isBeingConsulted: boolean + isBeingConsulted: boolean, + conferenceEnabled: boolean ): Visibility { - const isVisible = ((isBrowser && isCall && webRtcEnabled) || isChat) && !isBeingConsulted; + const isVisible = ((isBrowser && isCall && webRtcEnabled) || isChat) && !isBeingConsulted && conferenceEnabled; return {isVisible, isEnabled: true}; } -/** - * Get visibility for Conference In Progress indicator - */ -export function getConferenceInProgressVisibility(task: ITask): boolean { - return task?.data?.isConferenceInProgress ?? false; -} - /** * Get visibility for Exit Conference button */ @@ -199,9 +192,10 @@ export function getExitConferenceButtonVisibility( isConsultInitiatedOrAccepted: boolean, consultCallHeld: boolean, isHeld: boolean, - isConsultCompleted: boolean + isConsultCompleted: boolean, + conferenceEnabled: boolean ): Visibility { - const isVisible = isConferenceInProgress && !isConsultInitiatedOrAccepted; + const isVisible = isConferenceInProgress && !isConsultInitiatedOrAccepted && conferenceEnabled; const isConferenceWithConsultNotHeld = isConferenceInProgress && isConsultInitiatedOrAccepted && !consultCallHeld; // Disable if: conference with consult not held OR (held AND in conference AND consult completed) const isEnabled = !isConferenceWithConsultNotHeld && !(isHeld && isConferenceInProgress && isConsultCompleted); @@ -217,9 +211,10 @@ export function getMergeConferenceButtonVisibility( isConsultAccepted: boolean, consultCallHeld: boolean, isConferenceInProgress: boolean, - isCustomerInCall: boolean + isCustomerInCall: boolean, + conferenceEnabled: boolean ): Visibility { - const isVisible = isConsultInitiatedOrAccepted && isCustomerInCall; + const isVisible = isConsultInitiatedOrAccepted && isCustomerInCall && conferenceEnabled; const isConferenceWithConsultNotHeld = isConferenceInProgress && isConsultInitiatedOrAccepted && !consultCallHeld; const isEnabled = isConsultAccepted && consultCallHeld && !isConferenceWithConsultNotHeld; @@ -291,9 +286,10 @@ export function getMergeConferenceConsultButtonVisibility( isConsultAccepted: boolean, isConsultInitiated: boolean, consultCallHeld: boolean, - isCustomerInCall: boolean + isCustomerInCall: boolean, + conferenceEnabled: boolean ): Visibility { - const isVisible = isConsultAccepted || isConsultInitiated; + const isVisible = (isConsultAccepted || isConsultInitiated) && conferenceEnabled; const isEnabled = !consultCallHeld && isConsultAccepted && isCustomerInCall; return {isVisible, isEnabled}; @@ -377,7 +373,7 @@ export function getWrapupButtonVisibility(task: ITask): Visibility { * @param featureFlags Feature flags configuration object * @param task The task object * @param agentId The agent ID - * @param multiPartyConferenceEnabled Whether multiparty conference is enabled + * @param conferenceEnabled Whether conference is enabled * @param logger Optional logger instance * @returns An object containing the visibility and state of various controls */ @@ -386,7 +382,7 @@ export function getControlsVisibility( featureFlags: {[key: string]: boolean}, task: ITask, agentId: string, - multiPartyConferenceEnabled: boolean, + conferenceEnabled: boolean, logger?: ILogger ) { try { @@ -409,7 +405,7 @@ export function getControlsVisibility( // Calculate task state flags const isTransferVisibility = isBrowser ? webRtcEnabled : true; - const isConferenceInProgress = task?.data?.isConferenceInProgress ?? false; + const isConferenceInProgress = (task?.data?.isConferenceInProgress && conferenceEnabled) ?? false; const isConsultInProgress = getIsConsultInProgress(task); const isHeld = findHoldStatus(task, 'mainCall', agentId); const isCustomerInCall = getIsCustomerInCall(task); @@ -419,9 +415,6 @@ export function getControlsVisibility( // Calculate conference participants count const conferenceParticipantsCount = getConferenceParticipantsCount(task); - const maxParticipantsInConference = multiPartyConferenceEnabled - ? MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE - : MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE; // Calculate consult status flags (REUSED CONDITIONS) const isConsultInitiated = taskConsultStatus === ConsultStatus.CONSULT_INITIATED; @@ -472,20 +465,29 @@ export function getControlsVisibility( // Transfer and conference controls transfer: getTransferButtonVisibility(isTransferVisibility, isConferenceInProgress, isConsultInitiatedOrAccepted), - conference: getConferenceButtonVisibility(isBrowser, webRtcEnabled, isCall, isChat, isBeingConsulted), + conference: getConferenceButtonVisibility( + isBrowser, + webRtcEnabled, + isCall, + isChat, + isBeingConsulted, + conferenceEnabled + ), exitConference: getExitConferenceButtonVisibility( isConferenceInProgress, isConsultInitiatedOrAccepted, consultCallHeld, isHeld, - isConsultCompleted + isConsultCompleted, + conferenceEnabled ), mergeConference: getMergeConferenceButtonVisibility( isConsultInitiatedOrAcceptedOnly, isConsultAccepted, consultCallHeld, isConferenceInProgress, - isCustomerInCall + isCustomerInCall, + conferenceEnabled ), // Consult controls @@ -495,7 +497,7 @@ export function getControlsVisibility( isConsultInProgress, isCustomerInCall, conferenceParticipantsCount, - maxParticipantsInConference, + MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE, isBeingConsulted, isHeld, isConsultCompleted, @@ -524,7 +526,8 @@ export function getControlsVisibility( isConsultAccepted, isConsultInitiated, consultCallHeld, - isCustomerInCall + isCustomerInCall, + conferenceEnabled ), muteUnmuteConsult: getMuteUnmuteConsultButtonVisibility( isBrowser, @@ -549,7 +552,7 @@ export function getControlsVisibility( wrapup: getWrapupButtonVisibility(task), // State flags - isConferenceInProgress: getConferenceInProgressVisibility(task), + isConferenceInProgress, isConsultInitiated, isConsultInitiatedAndAccepted: isConsultAccepted, isConsultReceived: isBeingConsulted, diff --git a/packages/contact-center/task/src/helper.ts b/packages/contact-center/task/src/helper.ts index 5f8b8827d..17cbc6c32 100644 --- a/packages/contact-center/task/src/helper.ts +++ b/packages/contact-center/task/src/helper.ts @@ -280,7 +280,7 @@ export const useCallControl = (props: useCallControlProps) => { deviceType, featureFlags, isMuted, - multiPartyConferenceEnabled, + conferenceEnabled, agentId, } = props; const [isRecording, setIsRecording] = useState(true); @@ -868,8 +868,8 @@ export const useCallControl = (props: useCallControlProps) => { }; const controlVisibility = useMemo( - () => getControlsVisibility(deviceType, featureFlags, currentTask, agentId, multiPartyConferenceEnabled, logger), - [deviceType, featureFlags, currentTask, agentId, multiPartyConferenceEnabled, logger] + () => getControlsVisibility(deviceType, featureFlags, currentTask, agentId, conferenceEnabled, logger), + [deviceType, featureFlags, currentTask, agentId, conferenceEnabled, logger] ); // Add useEffect for auto wrap-up timer diff --git a/packages/contact-center/task/src/task.types.ts b/packages/contact-center/task/src/task.types.ts index 0cbfb7e67..995165002 100644 --- a/packages/contact-center/task/src/task.types.ts +++ b/packages/contact-center/task/src/task.types.ts @@ -20,14 +20,14 @@ export type CallControlProps = Partial< | 'callControlClassName' | 'callControlConsultClassName' | 'onToggleMute' - | 'multiPartyConferenceEnabled' + | 'conferenceEnabled' | 'consultTransferOptions' > >; export type useCallControlProps = Pick< ControlProps, - 'currentTask' | 'logger' | 'deviceType' | 'featureFlags' | 'isMuted' | 'multiPartyConferenceEnabled' | 'agentId' + 'currentTask' | 'logger' | 'deviceType' | 'featureFlags' | 'isMuted' | 'conferenceEnabled' | 'agentId' > & Partial>; diff --git a/packages/contact-center/task/tests/CallControl/index.tsx b/packages/contact-center/task/tests/CallControl/index.tsx index 1328bbaae..269c5fce1 100644 --- a/packages/contact-center/task/tests/CallControl/index.tsx +++ b/packages/contact-center/task/tests/CallControl/index.tsx @@ -104,7 +104,7 @@ describe('CallControl Component', () => { expect(useCallControlSpy).toHaveBeenCalledWith({ currentTask: null, onHoldResume: onHoldResumeCb, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, onEnd: onEndCb, onWrapUp: onWrapUpCb, onRecordingToggle: onRecordingToggleCb, diff --git a/packages/contact-center/task/tests/CallControlCAD/index.tsx b/packages/contact-center/task/tests/CallControlCAD/index.tsx index dafb095c1..c377b6fe8 100644 --- a/packages/contact-center/task/tests/CallControlCAD/index.tsx +++ b/packages/contact-center/task/tests/CallControlCAD/index.tsx @@ -111,12 +111,12 @@ describe('CallControlCAD Component', () => { featureFlags: store.featureFlags, deviceType: '', isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: store.agentId, }); }); - it('should use default multiPartyConferenceEnabled value when not provided', () => { + it('should use default conferenceEnabled value when not provided', () => { const useCallControlSpy = jest.spyOn(helper, 'useCallControl').mockReturnValue({ currentTask: mockTask, endCall: jest.fn(), @@ -185,12 +185,12 @@ describe('CallControlCAD Component', () => { // Should default to true when not provided expect(useCallControlSpy).toHaveBeenCalledWith( expect.objectContaining({ - multiPartyConferenceEnabled: true, + conferenceEnabled: true, }) ); }); - it('should use provided multiPartyConferenceEnabled value', () => { + it('should use provided conferenceEnabled value', () => { const useCallControlSpy = jest.spyOn(helper, 'useCallControl').mockReturnValue({ currentTask: mockTask, endCall: jest.fn(), @@ -255,18 +255,13 @@ describe('CallControlCAD Component', () => { }); render( - + ); // Should use the provided value expect(useCallControlSpy).toHaveBeenCalledWith( expect.objectContaining({ - multiPartyConferenceEnabled: false, + conferenceEnabled: false, }) ); }); diff --git a/packages/contact-center/task/tests/helper.ts b/packages/contact-center/task/tests/helper.ts index 3ce939d00..8afa26fde 100644 --- a/packages/contact-center/task/tests/helper.ts +++ b/packages/contact-center/task/tests/helper.ts @@ -847,7 +847,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -874,7 +874,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -911,7 +911,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -936,7 +936,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -963,7 +963,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -989,7 +989,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1013,7 +1013,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1039,7 +1039,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1072,7 +1072,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1109,7 +1109,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1132,7 +1132,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1159,7 +1159,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1187,7 +1187,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1216,7 +1216,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1243,7 +1243,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1265,7 +1265,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1285,7 +1285,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1309,7 +1309,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1336,7 +1336,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1368,7 +1368,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1393,7 +1393,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1420,7 +1420,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1447,7 +1447,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1476,7 +1476,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1501,7 +1501,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1522,7 +1522,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1557,7 +1557,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1584,7 +1584,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1607,7 +1607,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1636,7 +1636,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1703,7 +1703,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1772,7 +1772,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1834,7 +1834,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }); return hook; @@ -1873,7 +1873,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }); // Set initial value @@ -1895,7 +1895,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1946,7 +1946,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -1998,7 +1998,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2044,7 +2044,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }), {initialProps: {task: mockTaskWithHold}} @@ -2114,7 +2114,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2171,7 +2171,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2233,7 +2233,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2259,7 +2259,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2298,7 +2298,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2336,7 +2336,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2366,7 +2366,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2389,7 +2389,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'test-agent-id', }) ); @@ -2409,7 +2409,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'test-agent-id', }) ); @@ -2432,7 +2432,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'test-agent-id', }) ); @@ -2455,7 +2455,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2482,7 +2482,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2527,7 +2527,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2561,7 +2561,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: true, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2595,7 +2595,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2617,7 +2617,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2642,7 +2642,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2672,7 +2672,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: true, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2706,7 +2706,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2726,7 +2726,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2754,7 +2754,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2785,7 +2785,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2815,7 +2815,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2847,7 +2847,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2877,7 +2877,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2909,7 +2909,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2935,7 +2935,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2967,7 +2967,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -2997,7 +2997,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3036,7 +3036,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3073,7 +3073,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3133,7 +3133,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3176,7 +3176,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'test-agent-id', }) ); @@ -3218,7 +3218,7 @@ describe('useCallControl', () => { featureFlags: store.featureFlags, deviceType: store.deviceType, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3270,7 +3270,7 @@ describe('useCallControl', () => { deviceType: 'BROWSER', featureFlags: {webRtcEnabled: true}, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3303,7 +3303,7 @@ describe('useCallControl', () => { deviceType: 'BROWSER', featureFlags: {webRtcEnabled: true}, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3344,7 +3344,7 @@ describe('useCallControl', () => { deviceType: 'BROWSER', featureFlags: {webRtcEnabled: true}, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -3377,7 +3377,7 @@ describe('useCallControl', () => { deviceType: 'BROWSER', featureFlags: {webRtcEnabled: true}, isMuted: false, - multiPartyConferenceEnabled: true, + conferenceEnabled: true, agentId: 'test-agent-id', }) ); @@ -4054,7 +4054,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4089,7 +4089,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4121,7 +4121,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4156,7 +4156,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4193,7 +4193,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4230,7 +4230,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4293,7 +4293,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4323,7 +4323,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4353,7 +4353,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4381,7 +4381,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4411,7 +4411,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4438,7 +4438,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4487,7 +4487,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4544,7 +4544,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4606,7 +4606,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4652,7 +4652,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); @@ -4698,7 +4698,7 @@ describe('Task Hook Error Handling and Logging', () => { deviceType: 'BROWSER', featureFlags: {}, isMuted: false, - multiPartyConferenceEnabled: false, + conferenceEnabled: false, agentId: 'agent1', }) ); diff --git a/packages/contact-center/task/tests/utils/task-util.ts b/packages/contact-center/task/tests/utils/task-util.ts index 22fe1ad88..1083db07d 100644 --- a/packages/contact-center/task/tests/utils/task-util.ts +++ b/packages/contact-center/task/tests/utils/task-util.ts @@ -57,7 +57,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is BROWSER, webRtcEnabled is disbaled and media type is telehphony', () => { @@ -98,7 +98,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is BROWSER, isEndCallEnabled is disbaled and media type is telehphony', () => { @@ -139,7 +139,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is BROWSER, isEndConsultEnabled is disbaled and media type is telehphony', () => { @@ -186,7 +186,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is AGENT_DN, all flags are enabled and media type is telehphony', () => { @@ -227,7 +227,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, mockTask, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is EXTENSION, all flags are enabled and media type is telehphony', () => { @@ -271,7 +271,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is EXTENSION, all flags are enabled and media type is chat', () => { @@ -315,7 +315,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', true)).toEqual(expectedControls); }); it('should show correct controls when station logis is BROWSER, all flags are enabled and media type is email', () => { @@ -359,7 +359,7 @@ describe('getControlsVisibility', () => { consultCallHeld: false, }; - expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', false)).toEqual(expectedControls); + expect(getControlsVisibility(deviceType, featureFlags, task, 'agent1', true)).toEqual(expectedControls); }); it('should handle errors when accessing featureFlags and return safe defaults', () => { diff --git a/widgets-samples/cc/samples-cc-react-app/src/App.tsx b/widgets-samples/cc/samples-cc-react-app/src/App.tsx index 8ffda809e..f13443a17 100644 --- a/widgets-samples/cc/samples-cc-react-app/src/App.tsx +++ b/widgets-samples/cc/samples-cc-react-app/src/App.tsx @@ -74,6 +74,10 @@ function App() { const savedintegrationEnv = window.localStorage.getItem('integrationEnv'); return savedintegrationEnv === 'true'; }); + const [conferenceEnabled, setConferenceEnabled] = useState(() => { + const savedMultiPartyConferenceEnabled = window.localStorage.getItem('conferenceEnabled'); + return savedMultiPartyConferenceEnabled !== null ? savedMultiPartyConferenceEnabled === 'true' : true; + }); const handleSaveStart = () => { setShowLoader(true); @@ -339,6 +343,9 @@ function App() { useEffect(() => { window.localStorage.setItem('integrationEnv', JSON.stringify(integrationEnv)); }, [integrationEnv]); + useEffect(() => { + window.localStorage.setItem('conferenceEnabled', JSON.stringify(conferenceEnabled)); + }, [conferenceEnabled]); useEffect(() => { store.setIncomingTaskCb(onIncomingTaskCB); @@ -742,40 +749,53 @@ function App() { )} - {selectedWidgets.callControl && store.currentTask && ( -
-
-
- Call Control - -
-
-
- )} - {selectedWidgets.callControlCAD && store.currentTask && ( -
-
-
- Call Control with Call Associated Data (CAD) - -
-
-
- )} + +
+
+
+  Call Control and Call Control with CAD  + { + setConferenceEnabled(!conferenceEnabled); + }} + /> + {selectedWidgets.callControl && store.currentTask && ( +
+ Call Control + + +
+ )} + {selectedWidgets.callControlCAD && store.currentTask && ( +
+ Call Control with Call Associated Data (CAD) + +
+ )} +
+
+
{selectedWidgets.incomingTask && ( <>