Skip to content
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

feat(cc): contact center agent login implementation #3919

Draft
wants to merge 48 commits into
base: feat/wxcc
Choose a base branch
from

Conversation

pagour98
Copy link

@pagour98 pagour98 commented Oct 15, 2024

COMPLETES #<SPARK-558555>

This pull request addresses

The user should be able to login to agent desktop/station using the below API and get Login response success or failure with reason.

API:- https://developer.webex-cx.com/documentation/agents/v1/login

webex.cc.LoginAgent({teamId, loginOption: 'DialNumber' | 'Extension' | 'Desktop', dialString}) -> Promise

Description:

Login's the agent to agent station by making a POST to the above API

Files that need to be review:

  1. docs/samples/contact-center/app.js
  2. docs/samples/contact-center/index.html
  3. docs/samples/contact-center/style.css
  4. packages/@webex/plugin-cc/src/AgentLogin/AgentLogin.ts
  5. packages/@webex/plugin-cc/src/AgentLogin/types.ts
  6. packages/@webex/plugin-cc/src/cc.ts
  7. packages/@webex/plugin-cc/test/unit/spec/AgentLogin/AgentLogin.ts

by making the following changes

  1. I have introduces a new class AgentLogin that handles agent login by making post request to /login API.
  2. Added UI and called relevant method inside Samples Page.
  3. Introduced new functions inside cc.ts file
  4. Introduced new functions inside AgentLogin class

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

I have tested my changes through the CC samples app using the UI changes that I have add. I have tested the Post with valid and invalid request.

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@pagour98 pagour98 requested review from a team as code owners October 15, 2024 11:05
@pagour98 pagour98 marked this pull request as draft October 15, 2024 11:06
@pagour98 pagour98 marked this pull request as ready for review October 15, 2024 15:45
@pagour98 pagour98 marked this pull request as draft October 15, 2024 15:46
* @returns {Promise<UserResponse>} A promise that eventually resolves to an API response.
*/

public async getUserUsingCI(ciUserId: string, orgId: string): Promise<UserResponse> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change all the parameter to nested object {}

Copy link
Author

Choose a reason for hiding this comment

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

Will be taken care.

Copy link
Contributor

@sreenara sreenara left a comment

Choose a reason for hiding this comment

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

Please provide a list of files to review for this PR.

listTeams.forEach((team) => {
console.log(team);
if(team.teamType === "AGENT") {
console.log('inside if condition!');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove unnecessary console.log statements from all files.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed!

deviceId
);
// eslint-disable-next-line no-console
console.log('API SUCCESS: agentLoginAPIResponse is', agentLoginResponse);
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
Author

Choose a reason for hiding this comment

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

Addressed!

@pagour98
Copy link
Author

Please provide a list of files to review for this PR.

Description has been updated with the files to review. This PR is still in Work in Progress.

@sreenara sreenara added the validated If the pull request is validated for automation. label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validated If the pull request is validated for automation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants