Skip to content

Conversation

@adhmenon
Copy link
Contributor

@adhmenon adhmenon commented Oct 3, 2025

COMPLETES #< CAI-7147 >

This pull request addresses

  • Adds addresbook changes in widgets
  • Also adds entry point list changes with consult-transfer flows
  • Removes older dial number flow code

by making the following changes

  • Added code for addressbook changes by updating consult transfer popover and store
  • NOTE PR is a draft as E2E tests and some snapshot tests still need to be fixed.

Vidcast - https://app.vidcast.io/share/2f481e6b-227a-4652-92e9-0f228b48ca03

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
  • Received call and tried to consult-transfer via queue, agent, dial number and entrypoint
  • Reloaed the popover multiple times and tried to cancel consult and end consult
  • Tried blind transfer for above cases as well

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 - Cursor
  • 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

@adhmenon adhmenon added the validated Indicates that the PR is ready for actions label Oct 3, 2025
@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-537.d1b38q61t1z947.amplifyapp.com

Copy link

@cmullenx cmullenx left a comment

Choose a reason for hiding this comment

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

you will need to add props to show/hide consult/transfer to address book and show/hide transfer to entry point based on feature flags that you will receive from our app.

@adhmenon adhmenon marked this pull request as ready for review October 9, 2025 13:17
@adhmenon adhmenon added the run_e2e Add this label to run E2E test for meeting and CC widgets label Oct 9, 2025
apiParams.search = search;
}

logger?.info(`CC-Components: Loading ${categoryName} - page: ${currentPage}, search: "${search}"`);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Is logger optional? If not, we can remove the null check from here. Applicable everywhere
  2. We can add the context containing the file and method name in the same way we have at all the places. Applicable everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. In this case, we want logger to be optional as users need not specify a logger when they use our widgets or SDK...
  2. I will make that change here.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. I thought this is our logging which gets uploaded to mats. If that's the case, we can't have this optional. Correct me if I am wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the rationale behind this was since we use these components in our tests (both unit and e2e) - sometimes we don't provide the logger, hence it was made optional...
Again, I am alright changing it to compulsory but that not sure how it would affect tests.
Perhaps we can discuss this with Shreyas also.

Comment on lines 702 to 710
getEntryPoints = async (params?: EntryPointSearchParams): Promise<EntryPointListResponse> => {
try {
const response: EntryPointListResponse = await this.store.cc.getEntryPoints(params);
return response;
} catch (error) {
console.error('Error fetching entry points:', error);
return Promise.reject(error);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to create this method? This is just one line logic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I feel so - we can catch any errors here in this method and it makes it uniform.
I feel we should retain this.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. console.error('Error fetching entry points:', error); Please use the logger here and also add proper logging at the top and for the success as well
  2. We can simply throw the error from the catch block instead of calling the promise.reject

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added here as well

Comment on lines 712 to 720
getAddressBookEntries = async (params?: AddressBookEntrySearchParams): Promise<AddressBookEntriesResponse> => {
try {
const response: AddressBookEntriesResponse = await this.store.cc.addressBook.getEntries(params ?? {});
return response;
} catch (error) {
console.error('Error fetching address book entries:', error);
return Promise.reject(error);
}
};
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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned above, I feel it makes sense to keep it as we cna do error handling and it is uniform.

Copy link
Contributor

@rarajes2 rarajes2 Oct 13, 2025

Choose a reason for hiding this comment

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

Same here. Let's improve the logging and error throwing

Copy link
Contributor Author

@adhmenon adhmenon Oct 14, 2025

Choose a reason for hiding this comment

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

Added here also.. not sure why it's not showing outdated.. code changes are there in the code tabs.

@adhmenon adhmenon requested a review from rarajes2 October 13, 2025 10:00
@adhmenon adhmenon requested a review from rarajes2 October 14, 2025 04:32
Copy link
Contributor

@rarajes2 rarajes2 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +161 to +164
{renderList(
queuesData.map((q) => ({id: q.id, name: q.name})),
(item) => handleQueueSelection(item.id, item.name, onQueueSelect, logger)
)}

Choose a reason for hiding this comment

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

Ideally we want to simplify this all we should see in presentational is

Suggested change
{renderList(
queuesData.map((q) => ({id: q.id, name: q.name})),
(item) => handleQueueSelection(item.id, item.name, onQueueSelect, logger)
)}
{renderList(queuesData)}

We can process the data in utils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned above - this convolutes things and adds extra complexity to this PR... perhaps we can look at it later on.

Copy link

@Shreyas281299 Shreyas281299 left a comment

Choose a reason for hiding this comment

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

Looks good.

@adhmenon adhmenon merged commit 0997d10 into webex:ccwidgets Oct 15, 2025
7 of 8 checks passed
@adhmenon adhmenon deleted the address-book branch October 15, 2025 14:40
github-actions bot pushed a commit that referenced this pull request Oct 15, 2025
# [1.28.0-ccwidgets.118](v1.28.0-ccwidgets.117...v1.28.0-ccwidgets.118) (2025-10-15)

### Features

* **cc-widgets:** added-address-book ([#537](#537)) ([0997d10](0997d10))
@sreenara
Copy link
Contributor

🎉 This PR is included in version 1.28.0-ccwidgets.118 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

released on @ccwidgets run_e2e Add this label to run E2E test for meeting and CC widgets validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants