@@ -17,7 +17,6 @@ import {
1717 MEDIA_TYPE_CHAT ,
1818 MEDIA_TYPE_EMAIL ,
1919 MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE ,
20- MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE ,
2120} from './constants' ;
2221import { DeviceTypeFlags } from '../task.types' ;
2322
@@ -177,20 +176,14 @@ export function getConferenceButtonVisibility(
177176 webRtcEnabled : boolean ,
178177 isCall : boolean ,
179178 isChat : boolean ,
180- isBeingConsulted : boolean
179+ isBeingConsulted : boolean ,
180+ conferenceEnabled : boolean
181181) : Visibility {
182- const isVisible = ( ( isBrowser && isCall && webRtcEnabled ) || isChat ) && ! isBeingConsulted ;
182+ const isVisible = ( ( isBrowser && isCall && webRtcEnabled ) || isChat ) && ! isBeingConsulted && conferenceEnabled ;
183183
184184 return { isVisible, isEnabled : true } ;
185185}
186186
187- /**
188- * Get visibility for Conference In Progress indicator
189- */
190- export function getConferenceInProgressVisibility ( task : ITask ) : boolean {
191- return task ?. data ?. isConferenceInProgress ?? false ;
192- }
193-
194187/**
195188 * Get visibility for Exit Conference button
196189 */
@@ -199,9 +192,10 @@ export function getExitConferenceButtonVisibility(
199192 isConsultInitiatedOrAccepted : boolean ,
200193 consultCallHeld : boolean ,
201194 isHeld : boolean ,
202- isConsultCompleted : boolean
195+ isConsultCompleted : boolean ,
196+ conferenceEnabled : boolean
203197) : Visibility {
204- const isVisible = isConferenceInProgress && ! isConsultInitiatedOrAccepted ;
198+ const isVisible = isConferenceInProgress && ! isConsultInitiatedOrAccepted && conferenceEnabled ;
205199 const isConferenceWithConsultNotHeld = isConferenceInProgress && isConsultInitiatedOrAccepted && ! consultCallHeld ;
206200 // Disable if: conference with consult not held OR (held AND in conference AND consult completed)
207201 const isEnabled = ! isConferenceWithConsultNotHeld && ! ( isHeld && isConferenceInProgress && isConsultCompleted ) ;
@@ -217,9 +211,10 @@ export function getMergeConferenceButtonVisibility(
217211 isConsultAccepted : boolean ,
218212 consultCallHeld : boolean ,
219213 isConferenceInProgress : boolean ,
220- isCustomerInCall : boolean
214+ isCustomerInCall : boolean ,
215+ conferenceEnabled : boolean
221216) : Visibility {
222- const isVisible = isConsultInitiatedOrAccepted && isCustomerInCall ;
217+ const isVisible = isConsultInitiatedOrAccepted && isCustomerInCall && conferenceEnabled ;
223218 const isConferenceWithConsultNotHeld = isConferenceInProgress && isConsultInitiatedOrAccepted && ! consultCallHeld ;
224219 const isEnabled = isConsultAccepted && consultCallHeld && ! isConferenceWithConsultNotHeld ;
225220
@@ -291,9 +286,10 @@ export function getMergeConferenceConsultButtonVisibility(
291286 isConsultAccepted : boolean ,
292287 isConsultInitiated : boolean ,
293288 consultCallHeld : boolean ,
294- isCustomerInCall : boolean
289+ isCustomerInCall : boolean ,
290+ conferenceEnabled : boolean
295291) : Visibility {
296- const isVisible = isConsultAccepted || isConsultInitiated ;
292+ const isVisible = ( isConsultAccepted || isConsultInitiated ) && conferenceEnabled ;
297293 const isEnabled = ! consultCallHeld && isConsultAccepted && isCustomerInCall ;
298294
299295 return { isVisible, isEnabled} ;
@@ -377,7 +373,7 @@ export function getWrapupButtonVisibility(task: ITask): Visibility {
377373 * @param featureFlags Feature flags configuration object
378374 * @param task The task object
379375 * @param agentId The agent ID
380- * @param multiPartyConferenceEnabled Whether multiparty conference is enabled
376+ * @param conferenceEnabled Whether conference is enabled
381377 * @param logger Optional logger instance
382378 * @returns An object containing the visibility and state of various controls
383379 */
@@ -386,7 +382,7 @@ export function getControlsVisibility(
386382 featureFlags : { [ key : string ] : boolean } ,
387383 task : ITask ,
388384 agentId : string ,
389- multiPartyConferenceEnabled : boolean ,
385+ conferenceEnabled : boolean ,
390386 logger ?: ILogger
391387) {
392388 try {
@@ -409,7 +405,7 @@ export function getControlsVisibility(
409405
410406 // Calculate task state flags
411407 const isTransferVisibility = isBrowser ? webRtcEnabled : true ;
412- const isConferenceInProgress = task ?. data ?. isConferenceInProgress ?? false ;
408+ const isConferenceInProgress = ( task ?. data ?. isConferenceInProgress && conferenceEnabled ) ?? false ;
413409 const isConsultInProgress = getIsConsultInProgress ( task ) ;
414410 const isHeld = findHoldStatus ( task , 'mainCall' , agentId ) ;
415411 const isCustomerInCall = getIsCustomerInCall ( task ) ;
@@ -419,9 +415,6 @@ export function getControlsVisibility(
419415
420416 // Calculate conference participants count
421417 const conferenceParticipantsCount = getConferenceParticipantsCount ( task ) ;
422- const maxParticipantsInConference = multiPartyConferenceEnabled
423- ? MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE
424- : MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE ;
425418
426419 // Calculate consult status flags (REUSED CONDITIONS)
427420 const isConsultInitiated = taskConsultStatus === ConsultStatus . CONSULT_INITIATED ;
@@ -472,20 +465,29 @@ export function getControlsVisibility(
472465
473466 // Transfer and conference controls
474467 transfer : getTransferButtonVisibility ( isTransferVisibility , isConferenceInProgress , isConsultInitiatedOrAccepted ) ,
475- conference : getConferenceButtonVisibility ( isBrowser , webRtcEnabled , isCall , isChat , isBeingConsulted ) ,
468+ conference : getConferenceButtonVisibility (
469+ isBrowser ,
470+ webRtcEnabled ,
471+ isCall ,
472+ isChat ,
473+ isBeingConsulted ,
474+ conferenceEnabled
475+ ) ,
476476 exitConference : getExitConferenceButtonVisibility (
477477 isConferenceInProgress ,
478478 isConsultInitiatedOrAccepted ,
479479 consultCallHeld ,
480480 isHeld ,
481- isConsultCompleted
481+ isConsultCompleted ,
482+ conferenceEnabled
482483 ) ,
483484 mergeConference : getMergeConferenceButtonVisibility (
484485 isConsultInitiatedOrAcceptedOnly ,
485486 isConsultAccepted ,
486487 consultCallHeld ,
487488 isConferenceInProgress ,
488- isCustomerInCall
489+ isCustomerInCall ,
490+ conferenceEnabled
489491 ) ,
490492
491493 // Consult controls
@@ -495,7 +497,7 @@ export function getControlsVisibility(
495497 isConsultInProgress ,
496498 isCustomerInCall ,
497499 conferenceParticipantsCount ,
498- maxParticipantsInConference ,
500+ MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE ,
499501 isBeingConsulted ,
500502 isHeld ,
501503 isConsultCompleted ,
@@ -524,7 +526,8 @@ export function getControlsVisibility(
524526 isConsultAccepted ,
525527 isConsultInitiated ,
526528 consultCallHeld ,
527- isCustomerInCall
529+ isCustomerInCall ,
530+ conferenceEnabled
528531 ) ,
529532 muteUnmuteConsult : getMuteUnmuteConsultButtonVisibility (
530533 isBrowser ,
@@ -549,7 +552,7 @@ export function getControlsVisibility(
549552 wrapup : getWrapupButtonVisibility ( task ) ,
550553
551554 // State flags
552- isConferenceInProgress : getConferenceInProgressVisibility ( task ) ,
555+ isConferenceInProgress,
553556 isConsultInitiated,
554557 isConsultInitiatedAndAccepted : isConsultAccepted ,
555558 isConsultReceived : isBeingConsulted ,
0 commit comments