-
Notifications
You must be signed in to change notification settings - Fork 70
fix(cc-task): align consult/transfer tabs and lists with agent desktop (CAI-8354) #733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| export type ConsultTransferAction = 'Consult' | 'Transfer'; | ||
|
|
||
| export type ConsultTransferInteractionContext = { | ||
| contactDirectionType?: string; | ||
| outdialTransferToQueueEnabled?: boolean; | ||
| mediaType?: string; | ||
| }; | ||
|
|
||
| export const isCollaborationAccessEnabled = (access?: string): boolean => access?.toLowerCase() !== 'none'; | ||
|
|
||
| export const isQueueEnabled = ( | ||
| action: ConsultTransferAction, | ||
| allowConsultToQueue: boolean, | ||
| interaction: ConsultTransferInteractionContext, | ||
| isTelephony: boolean | ||
| ): boolean => { | ||
| if (!isTelephony) { | ||
| return true; | ||
| } | ||
|
|
||
| if (action === 'Consult') { | ||
| return allowConsultToQueue; | ||
| } | ||
|
|
||
| const direction = interaction.contactDirectionType?.toUpperCase(); | ||
| if (direction === 'INBOUND') { | ||
| return true; | ||
| } | ||
| if (direction === 'OUTBOUND') { | ||
| return interaction.outdialTransferToQueueEnabled === true; | ||
| } | ||
|
|
||
| return true; | ||
| }; | ||
|
|
||
| export const isAgentsTabVisible = (accessBuddyTeam?: string): boolean => isCollaborationAccessEnabled(accessBuddyTeam); | ||
|
|
||
| export const isQueuesTabVisible = ( | ||
| action: ConsultTransferAction, | ||
| allowConsultToQueue: boolean, | ||
| accessQueue: string | undefined, | ||
| interaction: ConsultTransferInteractionContext, | ||
| isTelephony: boolean | ||
| ): boolean => | ||
| isCollaborationAccessEnabled(accessQueue) && isQueueEnabled(action, allowConsultToQueue, interaction, isTelephony); | ||
|
|
||
| export const isEntryPointTabVisible = ( | ||
| showEntryPointTab: boolean, | ||
| accessEntryPoint: string | undefined, | ||
| isTelephony: boolean | ||
| ): boolean => showEntryPointTab && isTelephony && isCollaborationAccessEnabled(accessEntryPoint); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -468,6 +468,18 @@ export interface ControlProps { | |
| */ | ||
| allowConsultToQueue: boolean; | ||
|
|
||
| /** Desktop Profile collaboration access for queues */ | ||
| accessQueue?: string; | ||
|
|
||
| /** Desktop Profile collaboration access for entry points */ | ||
| accessEntryPoint?: string; | ||
|
|
||
| /** Desktop Profile collaboration access for buddy teams */ | ||
| accessBuddyTeam?: string; | ||
|
Comment on lines
+471
to
+478
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This adds collaboration-access props and changes Consult/Transfer tab behavior in AGENTS.md reference: AGENTS.md:L68-L68 Useful? React with 👍 / 👎. |
||
|
|
||
| /** Interaction context for Consult/Transfer tab visibility */ | ||
| interactionContext?: ConsultTransferInteractionContext; | ||
|
|
||
| /** | ||
| * Flag to enable or disable conference feature | ||
| */ | ||
|
|
@@ -553,6 +565,10 @@ export type CallControlComponentProps = Pick< | |
| | 'consultTimerLabel' | ||
| | 'consultTimerTimestamp' | ||
| | 'allowConsultToQueue' | ||
| | 'accessQueue' | ||
| | 'accessEntryPoint' | ||
| | 'accessBuddyTeam' | ||
| | 'interactionContext' | ||
| | 'lastTargetType' | ||
| | 'setLastTargetType' | ||
| | 'controls' | ||
|
|
@@ -665,6 +681,15 @@ export interface ConsultTransferDialNumberComponentProps { | |
| logger: ILogger; | ||
| } | ||
|
|
||
| /** | ||
| * Interaction fields used for Consult/Transfer tab visibility (Agent Desktop parity). | ||
| */ | ||
| export type ConsultTransferInteractionContext = { | ||
| contactDirectionType?: string; | ||
| outdialTransferToQueueEnabled?: boolean; | ||
| mediaType?: string; | ||
| }; | ||
|
|
||
| /** | ||
| * Interface representing the properties for ConsultTransferPopover component. | ||
| */ | ||
|
|
@@ -682,6 +707,11 @@ export interface ConsultTransferPopoverComponentProps { | |
| onEntryPointSelect: (entryPointId: string, entryPointName: string, allowParticipantsToInteract: boolean) => void; | ||
| onDialNumberSelect: (dialNumber: string, allowParticipantsToInteract: boolean) => void; | ||
| allowConsultToQueue: boolean; | ||
| accessQueue?: string; | ||
| accessEntryPoint?: string; | ||
| accessBuddyTeam?: string; | ||
| interactionContext?: ConsultTransferInteractionContext; | ||
| isTelephony?: boolean; | ||
| /** Options governing popover visibility/behavior */ | ||
| consultTransferOptions?: ConsultTransferOptions; | ||
| isConferenceInProgress?: boolean; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
accessBuddyTeamisNONE, this removes the Agents button but the hook still initializesselectedCategoryto Agents and the list rendering at line 254 is not gated byisAgentsTabVisibleFlag. The popover therefore opens with no visible active tab and can still display/select any preloaded buddy agents despite the profile restriction; initialize the selection to the first permitted category and gate the Agents content as well.Useful? React with 👍 / 👎.