fix(cc-widgets): Incoming Transfer showing Call control fix - #510
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
…nto transfer-issue
| const taskState = task.data.interaction.state; | ||
| const startTimeStamp = task.data.interaction.createdTimestamp; | ||
| const isIncomingTask = !task?.data.wrapUpRequired && (taskState === 'new' || taskState === 'consult'); | ||
| const isIncomingTask = store.isIncomingTask(task); |
There was a problem hiding this comment.
As discussed, Let's export it outside the store object
| const taskWithoutJoined: ITask = { | ||
| data: { | ||
| interactionId: 'taskWithoutJoined', | ||
| interaction: { | ||
| state: 'connected', | ||
| participants: { | ||
| agent1: { | ||
| hasJoined: false, | ||
| }, | ||
| }, | ||
| }, | ||
| agentId: 'agent1', | ||
| }, | ||
| } as ITask; |
There was a problem hiding this comment.
Just a note: This is the case where we transfer the call but agent has not accepted it yet.
| }); | ||
| }); | ||
|
|
||
| it('renders TaskListPresentational with incoming task behavior when isIncomingTask returns true', () => { |
There was a problem hiding this comment.
its already tested in cc-components packages/contact-center/cc-components/tests/components/task/TaskList/task-list.tsx
// Verify selected task has buttons (incoming), unselected task doesn't (active)
| // Verify that `TaskListPresentational` is called with the correct props | ||
| expect(taskListComponentSpy).toHaveBeenCalledWith( | ||
| { | ||
| currentTask: undefined, |
There was a problem hiding this comment.
Let's have a currentTask and with incoming task check if the current task is unchanged.
There was a problem hiding this comment.
its already tested in cc-components packages/contact-center/cc-components/tests/components/task/TaskList/task-list.tsx
// Verify selected task has buttons (incoming), unselected task doesn't (active)
rarajes2
left a comment
There was a problem hiding this comment.
Please address the last comment before merging.
| export const isIncomingTask = (task: ITask): boolean => { | ||
| const taskData = task?.data; | ||
| const taskState = taskData?.interaction?.state; | ||
| const agentId = taskData?.agentId; | ||
| const participants = taskData?.interaction?.participants; | ||
| const hasJoined = agentId && participants?.[agentId]?.hasJoined; | ||
|
|
||
| return ( | ||
| !taskData?.wrapUpRequired && | ||
| !hasJoined && | ||
| (taskState === 'new' || taskState === 'consult' || taskState === 'connected') | ||
| ); | ||
| }; |
There was a problem hiding this comment.
We will need to create tests for this file as well, right?
# [1.28.0-ccwidgets.104](v1.28.0-ccwidgets.103...v1.28.0-ccwidgets.104) (2025-08-08) ### Bug Fixes * **cc-widgets:** Incoming Transfer showing Call control fix ([#510](#510)) ([25b3025](25b3025))
|
🎉 This PR is included in version 1.28.0-ccwidgets.104 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
COMPLETES #507 https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6889
This pull request addresses
Issue of showing call controls for incoming transfer before accepting call.
by making the following changes
Updated isIncomingTask logic in store and using it everywhere.
Change Type
The following scenarios were tested
Transfer, consult, consult transfer
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging