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
Draft
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bc5c420
feat(contact-center): Added new package for contact-center
Kesari3008 Oct 4, 2024
ae08fe7
feat(contact-center): few more additions
Kesari3008 Oct 4, 2024
d1655fa
feat(contact-center): sample page fixes
Kesari3008 Oct 5, 2024
602f66e
feat(contact-center): divergent branch fix
Kesari3008 Oct 5, 2024
21b4fb9
feat(contact-center): added dummy promise for register function
Kesari3008 Oct 5, 2024
2db8dea
feat(CC): initial changes for CC SDK
Oct 8, 2024
a9b5d98
feat(cc): implementation changes
Oct 9, 2024
280e2fc
feat(contact-center): fixed jest config to run tests in cc package
Kesari3008 Oct 9, 2024
65e86a6
feat(cc): local changes
Oct 9, 2024
8c1d9ea
feat(contact-center): added types to contact center
Kesari3008 Oct 10, 2024
5c1cc72
feat(contact-center): fixed failing UT
Kesari3008 Oct 10, 2024
c940205
feat(contact-center): fixed style failures
Kesari3008 Oct 10, 2024
f313e0e
feat(contact-center): fixed the error in ut
Kesari3008 Oct 10, 2024
d2e0b18
feat(contact-center): added get() under services for WebexSDK type
Kesari3008 Oct 10, 2024
81c7027
feat(cc): local changes
Oct 10, 2024
fdbb379
feat(cc): merge latest changes
Oct 10, 2024
39874a5
feat(cc): local changes
Oct 10, 2024
cadb245
local changes
Oct 12, 2024
48cd4a4
feat(cc): implementation for Agent Profile
Oct 13, 2024
6c52d92
feat(cc): latest pull
Oct 13, 2024
05dfed6
feat(cc): local changes
Oct 14, 2024
4144625
feat(cc): local changes
Oct 14, 2024
f566f99
feat(cc): updated PR with latest changes
Oct 14, 2024
8832712
feat(cc): updated PR with latest changes
Oct 14, 2024
adbfb90
feat(cc): updated PR with latest changes
Oct 14, 2024
5e7cc99
feat(cc): updated PR with latest changes
Oct 14, 2024
2391d50
feat(cc): added back jest config
Oct 14, 2024
227b89e
feat(cc): replaced console with logger
Oct 14, 2024
2614b4f
feat(cc): added back jest config
Oct 14, 2024
d4bf768
feat(cc): added back jest config
Oct 14, 2024
7080ca9
feat(cc): removed eslint disable no console flags
Oct 14, 2024
8a2cb9f
feat(cc): removed eslint disable no console flags
Oct 14, 2024
b9bd6cb
feat(cc): removed eslint disable no console flags
Oct 14, 2024
a331519
feat(cc): removed unwantedfiles
Oct 14, 2024
95404f2
feat(cc): removed unwantedfiles
Oct 14, 2024
5d1a00a
feat(cc): fix for min js file
Oct 15, 2024
745de99
feat(cc): fixed min.js issue
Oct 15, 2024
a15760e
feat(cc): fixed min.js issue
Oct 15, 2024
54a27f8
feat(cc): fixed min.js issue
Oct 15, 2024
492c746
feat(cc): fixed min.js issue
Oct 15, 2024
65a866d
feat(cc): pull for ccc mercury event
Oct 15, 2024
8027ec6
feat(cc): pull for ccc mercury event
Oct 15, 2024
bf15f10
local changes for agent login
Oct 16, 2024
757d146
feat(cc): address comments from sreekanth
Oct 16, 2024
cd74acf
feat(cc): address comments from sreekanth
Oct 16, 2024
2e14ad2
feat(wxcc): addressed comments
Oct 17, 2024
8c8a9e1
feat(wxcc): addressed comments
Oct 17, 2024
aa08103
feat(wxcc): addressed comments
Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions docs/samples/contact-center/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const tokenElm = document.querySelector('#access-token');
const saveElm = document.querySelector('#access-token-save');
const authStatusElm = document.querySelector('#access-token-status');
const registerBtn = document.querySelector('#webexcc-register');
const teamsDropdown = document.querySelector('#teamsDropdown');
const agentLogin = document.querySelector('#AgentLogin');
const agentLoginButton = document.querySelector('#loginAgent');


// Store and Grab `access-token` from localstorage
Expand Down Expand Up @@ -103,14 +106,55 @@ function initWebex(e) {

credentialsFormElm.addEventListener('submit', initWebex);


function register() {
webex.cc.register(true).then((data) => {
webex.cc.register().then((data) => {
console.log('Event subscription successful: ', data);
}).catch(() => {
console.log('Event subscription failed');
const agentProfile = webex.cc.getAgentProfileData();
console.log('agent profile is', agentProfile);
teamsDropdown.innerHTML = ''; // Clear previously selected option on teamsDropdown
const listTeams = agentProfile.teamsList;
console.log('teams list is', listTeams);
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!

const option = document.createElement('option');
option.value = team.id;
option.text = team.name;
teamsDropdown.add(option);
}
});
const loginVoiceOptions = agentProfile.agentDesktopProfile.loginVoiceOptions;
agentLogin.innerHTML = '' // Clear previously selected option on agentLogin.
console.log('loginVoiceOptions is', loginVoiceOptions);
if(loginVoiceOptions.length > 0) agentLoginButton.disabled = false;
loginVoiceOptions.forEach((voiceOptions)=> {
const option = document.createElement('option');
option.text = voiceOptions;
option.value = voiceOptions;
agentLogin.add(option);
});
}).catch((error) => {
console.log('Event subscription failed', error);
})
}

async function handleAgentLogin(e) {
const value = e.target.value;
if (value === 'Desktop') {
agentDeviceType = 'BROWSER';
deviceId = 'webrtc-6b310dff-569e-4ac7-b064-70f834ea56d8'
} else {
agentDeviceType = 'EXTENSION';
deviceId = '1001'
}
}

function doAgentLogin() {
webex.cc.doAgentLogin(teamsDropdown.value, agentDeviceType, deviceId);
}

const allCollapsibleElements = document.querySelectorAll('.collapsible');
allCollapsibleElements.forEach((el) => {
el.addEventListener('click', (event) => {
Expand Down
51 changes: 39 additions & 12 deletions docs/samples/contact-center/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,46 @@ <h2 class="collapsible">
</section>
</div>

<div class="box">
<section class="section-box">
<h2 class="collapsible">
Agent Desktop Using Webex CC SDK
<i class="arrow fa fa-angle-down" aria-hidden="true"></i>
</h2>

<div class="section-content">
<div class="box">
<section class="section-box">
<h2 class="collapsible">
Agent Desktop Using Webex CC SDK
<i class="arrow fa fa-angle-down" aria-hidden="true"></i>
</h2>

<div class="section-content">
<fieldset>
<legend>Agent</legend>
<p class="note">
NOTE: Teams are fetched automatically for the Agent Login.
</p>
<div class="screenshare-section">
<div style="display: flex; gap: 1rem;">
<fieldset style="flex: 0.69;">
<legend>Select Team</legend>
<select id="teamsDropdown" class="form-control w-auto my-3">Teams</select>
</fieldset>
<fieldset>
<legend>Agent Login</legend>
<select name="AgentLogin" id="AgentLogin" class="AgentLogin" onchange="handleAgentLogin(event)">
<option value="" selected hidden>Choose Agent Login ...</option>
</select>
<button id="loginAgent" disabled class="btn btn-primary my-3" onclick="doAgentLogin()">Login With
Selected Team</button>
<button id="logoutAgent" class="btn btn-primary my-3 ml-2" onclick="logoutAgent()">Logout Agent</button>
</fieldset>
<fieldset>
<legend>Agent status</legend>
<select id="statusDropdown" class="form-control w-auto my-3"></select>
<button id="setAgentStatus" class="btn btn-primary my-3 ml-2" onclick="setAgentStatus()">set
sate</button>
</fieldset>
</div>
</div>
</div>
</fieldset>
</div>
</section>
</fieldset>
</div>
</section>
</div>
</div>

<script src="../webex.min.js"></script>
Expand Down
Loading
Loading