amazon-connect-reference-dialer 1.0.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of amazon-connect-reference-dialer might be problematic. Click here for more details.
- package/.babelrc +10 -0
- package/.eslintrc +24 -0
- package/Dockerfile +12 -0
- package/LICENSE +21 -0
- package/README.md +8 -0
- package/README.salesforce.md +50 -0
- package/config/appconfig.json +10 -0
- package/config/config.js +46 -0
- package/docker-compose.yml +16 -0
- package/index.js +46 -0
- package/nodemon.json +3 -0
- package/package.json +5 -4
- package/src/client/App.js +20 -0
- package/src/client/api/acManager.js +79 -0
- package/src/client/api/agentHandler.js +46 -0
- package/src/client/api/audioFrequencyMonitor.js +62 -0
- package/src/client/api/csioHandler.js +204 -0
- package/src/client/api/databaseManager.js +59 -0
- package/src/client/api/eventhandler.js +278 -0
- package/src/client/api/feedbackHandler.js +21 -0
- package/src/client/api/manager/agent.js +203 -0
- package/src/client/api/manager/connection.js +181 -0
- package/src/client/api/manager/contact.js +114 -0
- package/src/client/api/mediaManager.js +138 -0
- package/src/client/api/networkStrengthMonitor.js +64 -0
- package/src/client/api/precalltest.js +37 -0
- package/src/client/api/sessionManager.js +312 -0
- package/src/client/configs/consts.js +158 -0
- package/src/client/container/agentduration/duration.js +63 -0
- package/src/client/container/agentduration/index.js +3 -0
- package/src/client/container/agentview/conferenceconnection/agentview.css +100 -0
- package/src/client/container/agentview/conferenceconnection/components/bothhold.js +20 -0
- package/src/client/container/agentview/conferenceconnection/components/bothjoined.js +25 -0
- package/src/client/container/agentview/conferenceconnection/components/dialnumber.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/holdall.js +20 -0
- package/src/client/container/agentview/conferenceconnection/components/join.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/oneHoldOtherConnected.js +37 -0
- package/src/client/container/agentview/conferenceconnection/components/resumeall.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/swap.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/togglemute.js +23 -0
- package/src/client/container/agentview/conferenceconnection/index.js +3 -0
- package/src/client/container/agentview/conferenceconnection/lowerBody.js +154 -0
- package/src/client/container/agentview/conferenceconnection/main.js +22 -0
- package/src/client/container/agentview/conferenceconnection/primaryconnection.js +109 -0
- package/src/client/container/agentview/conferenceconnection/quickFeedback.js +118 -0
- package/src/client/container/agentview/conferenceconnection/thirdpartyconnection.js +107 -0
- package/src/client/container/agentview/conferenceconnection/upperBody.js +36 -0
- package/src/client/container/agentview/footer.js +190 -0
- package/src/client/container/agentview/index.js +3 -0
- package/src/client/container/agentview/main.js +39 -0
- package/src/client/container/agentview/primaryconnection/agentMutedLabel.js +23 -0
- package/src/client/container/agentview/primaryconnection/agentStatusAndAudioLabel.js +28 -0
- package/src/client/container/agentview/primaryconnection/agentview.css +73 -0
- package/src/client/container/agentview/primaryconnection/index.js +3 -0
- package/src/client/container/agentview/primaryconnection/lowerBody.js +159 -0
- package/src/client/container/agentview/primaryconnection/main.js +22 -0
- package/src/client/container/agentview/primaryconnection/peerAndAgentDuration.js +48 -0
- package/src/client/container/agentview/primaryconnection/quickFeedback.js +123 -0
- package/src/client/container/agentview/primaryconnection/upperBody.js +59 -0
- package/src/client/container/agentview/thirdparyconnection/agentMutedLabel.js +23 -0
- package/src/client/container/agentview/thirdparyconnection/agentStatusAndAudioLabel.js +28 -0
- package/src/client/container/agentview/thirdparyconnection/agentview.css +73 -0
- package/src/client/container/agentview/thirdparyconnection/index.js +3 -0
- package/src/client/container/agentview/thirdparyconnection/lowerBody.js +139 -0
- package/src/client/container/agentview/thirdparyconnection/main.js +22 -0
- package/src/client/container/agentview/thirdparyconnection/peerAndAgentDuration.js +49 -0
- package/src/client/container/agentview/thirdparyconnection/quickFeedback.js +118 -0
- package/src/client/container/agentview/thirdparyconnection/upperBody.js +59 -0
- package/src/client/container/audiolabelview/controller.js +104 -0
- package/src/client/container/audiolabelview/localaudiolevel.js +157 -0
- package/src/client/container/audiolabelview/noaudio.js +86 -0
- package/src/client/container/audiolabelview/remoteaudiolevel.js +110 -0
- package/src/client/container/audiolabelview/settingpageaudiolevel.js +154 -0
- package/src/client/container/common/contactField.js +30 -0
- package/src/client/container/common/each.contact.js +41 -0
- package/src/client/container/common/findContact.js +31 -0
- package/src/client/container/connectivitycheckview/body.js +113 -0
- package/src/client/container/connectivitycheckview/components/fractionalLoss.js +57 -0
- package/src/client/container/connectivitycheckview/components/mediaConnectivity.js +41 -0
- package/src/client/container/connectivitycheckview/components/roundTripTime.js +57 -0
- package/src/client/container/connectivitycheckview/components/rttgraph/rttgraph.js +176 -0
- package/src/client/container/connectivitycheckview/components/rttgraph/utils.js +96 -0
- package/src/client/container/connectivitycheckview/components/throughput.js +53 -0
- package/src/client/container/connectivitycheckview/components/throughputMessage.js +36 -0
- package/src/client/container/connectivitycheckview/connectivitycheck.css +44 -0
- package/src/client/container/connectivitycheckview/footer.js +43 -0
- package/src/client/container/connectivitycheckview/index.js +3 -0
- package/src/client/container/connectivitycheckview/loading/loading.css +73 -0
- package/src/client/container/connectivitycheckview/loading/loading.js +15 -0
- package/src/client/container/connectivitycheckview/main.js +19 -0
- package/src/client/container/dialerview/body.js +135 -0
- package/src/client/container/dialerview/dialpad.css +104 -0
- package/src/client/container/dialerview/dialpad.js +29 -0
- package/src/client/container/dialerview/index.js +3 -0
- package/src/client/container/dialerview/main.js +19 -0
- package/src/client/container/errors/error.css +30 -0
- package/src/client/container/errors/error.js +58 -0
- package/src/client/container/errors/index.js +3 -0
- package/src/client/container/footer/components/acceptOrReject.js +26 -0
- package/src/client/container/footer/components/availableOrEnd.js +28 -0
- package/src/client/container/footer/components/connectivitycheck.js +21 -0
- package/src/client/container/footer/components/downloadlogs.js +23 -0
- package/src/client/container/footer/components/info.js +22 -0
- package/src/client/container/footer/components/language.js +22 -0
- package/src/client/container/footer/components/reportcall.js +35 -0
- package/src/client/container/footer/components/version.js +22 -0
- package/src/client/container/header/header.css +46 -0
- package/src/client/container/header/header.js +135 -0
- package/src/client/container/header/index.js +3 -0
- package/src/client/container/home.js +129 -0
- package/src/client/container/login/body.js +67 -0
- package/src/client/container/login/ccpinputbox.js +23 -0
- package/src/client/container/login/footer.js +19 -0
- package/src/client/container/login/index.js +2 -0
- package/src/client/container/login/login.css +134 -0
- package/src/client/container/login/main.js +23 -0
- package/src/client/container/networkstrengthview/index.js +3 -0
- package/src/client/container/networkstrengthview/loading/loading.css +74 -0
- package/src/client/container/networkstrengthview/loading/loading.js +15 -0
- package/src/client/container/networkstrengthview/networkstrength.js +102 -0
- package/src/client/container/popups/confirmreport/confirmreport.css +47 -0
- package/src/client/container/popups/confirmreport/confirmreport.js +55 -0
- package/src/client/container/popups/quality/quality.css +32 -0
- package/src/client/container/popups/quality/quality.js +44 -0
- package/src/client/container/quickconnects/body.js +141 -0
- package/src/client/container/quickconnects/close.js +23 -0
- package/src/client/container/quickconnects/index.js +3 -0
- package/src/client/container/quickconnects/main.js +18 -0
- package/src/client/container/quickconnects/quickconnects.css +95 -0
- package/src/client/container/reportissueview/body.js +73 -0
- package/src/client/container/reportissueview/feedbackRatings.js +37 -0
- package/src/client/container/reportissueview/footer.js +20 -0
- package/src/client/container/reportissueview/index.js +3 -0
- package/src/client/container/reportissueview/issueNotes.js +22 -0
- package/src/client/container/reportissueview/issues.js +44 -0
- package/src/client/container/reportissueview/main.js +105 -0
- package/src/client/container/reportissueview/predefinedIssues.js +38 -0
- package/src/client/container/reportissueview/reportissue.css +102 -0
- package/src/client/container/settingsview/body.js +156 -0
- package/src/client/container/settingsview/components/audiooutputdevice.js +25 -0
- package/src/client/container/settingsview/components/deskphone.js +29 -0
- package/src/client/container/settingsview/components/desktopsettings.js +38 -0
- package/src/client/container/settingsview/components/dropdown-options.js +44 -0
- package/src/client/container/settingsview/components/phonetype.js +14 -0
- package/src/client/container/settingsview/components/settings.js +23 -0
- package/src/client/container/settingsview/components/softphone.js +30 -0
- package/src/client/container/settingsview/components/softphonesettings.js +35 -0
- package/src/client/container/settingsview/footer.js +96 -0
- package/src/client/container/settingsview/index.js +3 -0
- package/src/client/container/settingsview/main.js +20 -0
- package/src/client/container/settingsview/settings.css +126 -0
- package/src/client/container/statechangeview/body.js +61 -0
- package/src/client/container/statechangeview/footer.js +43 -0
- package/src/client/container/statechangeview/index.js +3 -0
- package/src/client/container/statechangeview/main.js +21 -0
- package/src/client/container/statechangeview/statuschange.css +47 -0
- package/src/client/container/transfercall/body.js +139 -0
- package/src/client/container/transfercall/close.js +23 -0
- package/src/client/container/transfercall/index.js +3 -0
- package/src/client/container/transfercall/main.js +18 -0
- package/src/client/container/transfercall/transfercall.css +99 -0
- package/src/client/index.js +13 -0
- package/src/client/reducers/acReducer.js +277 -0
- package/src/client/reducers/reducer.js +8 -0
- package/src/client/reducers.js +2 -0
- package/src/client/res/images/agent-voice-freq-icon.svg +61 -0
- package/src/client/res/images/change-status-icon.svg +16 -0
- package/src/client/res/images/csio-logo.png +0 -0
- package/src/client/res/images/csioLogo.png +0 -0
- package/src/client/res/images/dialer-setting-icon.svg +15 -0
- package/src/client/res/images/fa-circle-mark.svg +3 -0
- package/src/client/res/images/fa-circle-unmark.svg +3 -0
- package/src/client/res/images/fa-close-or-dismiss.svg +17 -0
- package/src/client/res/images/fa-danger.svg +3 -0
- package/src/client/res/images/fa-dial-button.svg +13 -0
- package/src/client/res/images/fa-dial-number.svg +15 -0
- package/src/client/res/images/fa-download.svg +3 -0
- package/src/client/res/images/fa-hold.svg +13 -0
- package/src/client/res/images/fa-ico-join.svg +27 -0
- package/src/client/res/images/fa-ico-swap.svg +27 -0
- package/src/client/res/images/fa-info.svg +3 -0
- package/src/client/res/images/fa-input-sound.svg +5 -0
- package/src/client/res/images/fa-language.svg +3 -0
- package/src/client/res/images/fa-mark-false.svg +3 -0
- package/src/client/res/images/fa-mark-true.svg +3 -0
- package/src/client/res/images/fa-mic-freq-temporary.gif +0 -0
- package/src/client/res/images/fa-mic.svg +3 -0
- package/src/client/res/images/fa-mini-endcall.svg +48 -0
- package/src/client/res/images/fa-mini-hold.svg +47 -0
- package/src/client/res/images/fa-mini-resume.svg +45 -0
- package/src/client/res/images/fa-mute.svg +13 -0
- package/src/client/res/images/fa-network-strength-1.svg +5 -0
- package/src/client/res/images/fa-network-strength-2.svg +6 -0
- package/src/client/res/images/fa-network-strength-3.svg +6 -0
- package/src/client/res/images/fa-network-strength-4.svg +6 -0
- package/src/client/res/images/fa-network-strength-5.svg +5 -0
- package/src/client/res/images/fa-network-strength-unknown-2.svg +9 -0
- package/src/client/res/images/fa-network-strength-unknown.svg +6 -0
- package/src/client/res/images/fa-quick-connect.svg +15 -0
- package/src/client/res/images/fa-refresh.svg +3 -0
- package/src/client/res/images/fa-resume.svg +3 -0
- package/src/client/res/images/fa-return.svg +3 -0
- package/src/client/res/images/fa-three-dots.svg +32 -0
- package/src/client/res/images/fa-tick-green.svg +3 -0
- package/src/client/res/images/fa-tick-mark.svg +3 -0
- package/src/client/res/images/fa-transfer.svg +3 -0
- package/src/client/res/images/fa-version.svg +4 -0
- package/src/client/res/images/fa-voice-no-freq.svg +5 -0
- package/src/client/res/images/favicon.ico +0 -0
- package/src/client/res/images/muted-icon.svg +13 -0
- package/src/client/res/images/network-strength-icon.svg +13 -0
- package/src/client/res/images/peer-voice-freq-icon.svg +26 -0
- package/src/client/res/images/star-white.svg +6 -0
- package/src/client/res/images/star-yellow.svg +6 -0
- package/src/client/res/scss/global.css +14 -0
- package/src/client/router.js +17 -0
- package/src/client/store.js +11 -0
- package/src/client/utils/acutils.js +114 -0
- package/src/client/utils/agetStateMap.js +36 -0
- package/src/client/utils/feedback.js +3 -0
- package/src/client/utils/initialStateManager.js +14 -0
- package/src/server/index.js +53 -0
- package/src/server/logger.js +93 -0
- package/src/server/public/fonts/AmazonEmber_Lt.ttf +0 -0
- package/src/server/public/fonts/AmazonEmber_Rg.ttf +0 -0
- package/src/server/public/img/favicon.ico +0 -0
- package/src/server/public/js/amazon-connect-pre-shim.js +2 -0
- package/src/server/router/compare.js +36 -0
- package/src/server/router/index.js +36 -0
- package/src/server/router/stock.js +33 -0
- package/src/server/views/_heap_prod.ejs +8 -0
- package/src/server/views/_hotjar_prod.ejs +14 -0
- package/src/server/views/_hotjar_test.ejs +12 -0
- package/src/server/views/compare.ejs +69 -0
- package/src/server/views/index.ejs +69 -0
- package/src/server/views/stock.ejs +101 -0
- package/webpack.common.config.js +48 -0
- package/webpack.dev.config.js +21 -0
- package/webpack.prod.config.js +10 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
|
|
4
|
+
import activeIcon from '../../res/images/fa-tick-mark.svg';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import lo from 'lodash';
|
|
7
|
+
|
|
8
|
+
import styles from './statuschange.css';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
onRequestAgentStateChange
|
|
12
|
+
} from '../../reducers/acReducer';
|
|
13
|
+
|
|
14
|
+
import sessionManage from '../../api/sessionManager';
|
|
15
|
+
|
|
16
|
+
// change state using api
|
|
17
|
+
const changeAgentState = (currentAgentState) => {
|
|
18
|
+
sessionManage.setAgentState(currentAgentState).then(success => _, err => console.error('->', err));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const isCurrentState = (currentAgentState, currentState) => {
|
|
22
|
+
const state = lo.get(currentState, 'primaryConnectionState.state', '');
|
|
23
|
+
return currentAgentState && currentAgentState.name === state;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Body = ({ currentState = {}, requestAgentStateChange }) => (
|
|
27
|
+
<div className={`card-body`}>
|
|
28
|
+
{sessionManage.getAgentStates().map((currentAgentState) => (
|
|
29
|
+
<div id={`dialer_state_${currentAgentState.name.replace(/\s/g, '')}`} key={`agent-state-${currentAgentState.name}`} className={`row ${styles.acPointer} ${styles.acList}`}
|
|
30
|
+
onClick={() => requestAgentStateChange(currentAgentState)}>
|
|
31
|
+
<div className="col-2">
|
|
32
|
+
{isCurrentState(currentAgentState, currentState) && <img src={activeIcon}/>}
|
|
33
|
+
</div>
|
|
34
|
+
<div className="col-10">
|
|
35
|
+
<span
|
|
36
|
+
className={`${isCurrentState(currentAgentState, currentState) ? styles.acSpanSelected : styles.acSpanNormal}`}> {currentAgentState.name}</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
))}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
Body.propTypes = {
|
|
44
|
+
currentState: PropTypes.object,
|
|
45
|
+
requestAgentStateChange: PropTypes.func.isRequired
|
|
46
|
+
};
|
|
47
|
+
const mapStateToProps = state => ({
|
|
48
|
+
currentState: state.acReducer.currentState
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const mapDispatchToProps = dispatch => ({
|
|
52
|
+
requestAgentStateChange: (currentAgentState) => {
|
|
53
|
+
changeAgentState(currentAgentState);
|
|
54
|
+
dispatch(onRequestAgentStateChange('complete'));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export default connect(
|
|
59
|
+
mapStateToProps,
|
|
60
|
+
mapDispatchToProps
|
|
61
|
+
)(Body);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import styles from './statuschange.css';
|
|
3
|
+
import { sleep } from './../../utils/acutils';
|
|
4
|
+
import databaseManager from '../../api/databaseManager';
|
|
5
|
+
|
|
6
|
+
const logoutURL = () => {
|
|
7
|
+
const connectURL = databaseManager.getDefaultConnectURL(CONNECT_URL || WEB_PACK_CONNECT_URL);
|
|
8
|
+
return `https://${connectURL}/connect/logout`;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
class Footer extends Component {
|
|
12
|
+
constructor (props) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.state = {
|
|
15
|
+
loggedOut: false
|
|
16
|
+
};
|
|
17
|
+
this.logout = this.logout.bind(this);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
logout () {
|
|
21
|
+
this.setState({
|
|
22
|
+
loggedOut: true
|
|
23
|
+
});
|
|
24
|
+
sleep(1000).then(() => window.location.reload());
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
render () {
|
|
28
|
+
return (
|
|
29
|
+
<div className={`card-footer ${styles.acFooter}`}>
|
|
30
|
+
<div className={`row ${styles.acFooterChild}`}>
|
|
31
|
+
<div id='dialer_state_log_out' className="col-12" onClick={this.logout}>
|
|
32
|
+
<a className={`${styles.acLink} ${styles.acPointer}`}>Log out</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div className={`${styles.acNoDisplay}`}>
|
|
36
|
+
{this.state.loggedOut && <iframe src={logoutURL()}/>}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default Footer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Header from './../header/index';
|
|
4
|
+
import Body from './body';
|
|
5
|
+
import Footer from './footer';
|
|
6
|
+
|
|
7
|
+
import styles from './statuschange.css';
|
|
8
|
+
|
|
9
|
+
const StateChangeView = ({}) => (
|
|
10
|
+
<div className={`row h-100 border-right border-top border-bottom`}>
|
|
11
|
+
<div className={`${styles.acZeroPadding} col-12`}>
|
|
12
|
+
<div className={`${styles.acCard} card h-100`}>
|
|
13
|
+
<Header/>
|
|
14
|
+
<Body/>
|
|
15
|
+
<Footer/>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default StateChangeView;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.acCard {
|
|
2
|
+
margin-right: 17%;
|
|
3
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
|
|
4
|
+
background-color: #ffffff
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.acFooter {
|
|
8
|
+
background-color: inherit;
|
|
9
|
+
margin-right: 8%;
|
|
10
|
+
margin-left: 8%;
|
|
11
|
+
min-height: 12%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.acFooterChild {
|
|
15
|
+
margin-left: -18%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.acPointer {
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.acLink {
|
|
23
|
+
font-family: AmazonEmber;
|
|
24
|
+
color: #3885de !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.acSpanSelected {
|
|
28
|
+
font-family: AmazonEmber;
|
|
29
|
+
color: #3885de !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.acSpanNormal {
|
|
33
|
+
font-family: AmazonEmber;
|
|
34
|
+
color: #000000 !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.acList {
|
|
38
|
+
margin-bottom: 5%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.acNoDisplay {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.acZeroPadding {
|
|
46
|
+
padding: 0;
|
|
47
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { connect } from 'react-redux';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import styles from './transfercall.css';
|
|
5
|
+
|
|
6
|
+
import sessionManager from './../../api/sessionManager';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
onRequestShowTransferCall
|
|
10
|
+
} from '../../reducers/acReducer';
|
|
11
|
+
|
|
12
|
+
import CloseQuickConnect from './close';
|
|
13
|
+
import FindContact from '../common/findContact';
|
|
14
|
+
import ContactField from '../common/contactField';
|
|
15
|
+
|
|
16
|
+
const THROTTLE_TIMEOUT = 100;
|
|
17
|
+
|
|
18
|
+
class Body extends Component {
|
|
19
|
+
constructor (props) {
|
|
20
|
+
super(props);
|
|
21
|
+
this.defaultContactList = [];
|
|
22
|
+
this.state = {
|
|
23
|
+
contactList: [...this.defaultContactList],
|
|
24
|
+
contactValue: '',
|
|
25
|
+
lastUpdate: Date.now(),
|
|
26
|
+
isContactListHover: false
|
|
27
|
+
};
|
|
28
|
+
this.updateContactList = this.updateContactList.bind(this);
|
|
29
|
+
this.contactChange = this.contactChange.bind(this);
|
|
30
|
+
this.dialContact = this.dialContact.bind(this);
|
|
31
|
+
this.dialNumber = this.dialNumber.bind(this);
|
|
32
|
+
this.close = this.close.bind(this);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
componentDidMount () {
|
|
36
|
+
sessionManager.getTransferConnList().then(quickContacts => {
|
|
37
|
+
this.defaultContactList = quickContacts;
|
|
38
|
+
this.setState({
|
|
39
|
+
contactList: [...this.defaultContactList]
|
|
40
|
+
});
|
|
41
|
+
}).catch(err => {
|
|
42
|
+
console.error('->', err);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
updateContactList (token) {
|
|
47
|
+
const { lastUpdate } = this.state;
|
|
48
|
+
const curTime = Date.now();
|
|
49
|
+
if (curTime - lastUpdate < THROTTLE_TIMEOUT) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let currentContactList = this.defaultContactList.filter((currentContact) => {
|
|
54
|
+
return (currentContact.name || '').includes(token);
|
|
55
|
+
});
|
|
56
|
+
this.setState({
|
|
57
|
+
contactList: currentContactList,
|
|
58
|
+
lastUpdate: curTime
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
contactChange (event) {
|
|
63
|
+
let { value } = event.target;
|
|
64
|
+
this.setState({
|
|
65
|
+
contactValue: value
|
|
66
|
+
});
|
|
67
|
+
this.updateContactList(value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
dialContact (selectedContact = undefined) {
|
|
71
|
+
sessionManager.dialContact(selectedContact).then(success => {
|
|
72
|
+
this.close();
|
|
73
|
+
}, err => {
|
|
74
|
+
console.error(err);
|
|
75
|
+
});
|
|
76
|
+
this.setState({
|
|
77
|
+
contactList: [...this.defaultContactList],
|
|
78
|
+
contactValue: ''
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
dialNumber () {
|
|
82
|
+
const { contactValue } = this.state;
|
|
83
|
+
sessionManager.dialNumber(contactValue).then(success => {
|
|
84
|
+
this.close();
|
|
85
|
+
}, err => {
|
|
86
|
+
console.error(err);
|
|
87
|
+
});
|
|
88
|
+
this.setState({
|
|
89
|
+
contactList: [...this.defaultContactList],
|
|
90
|
+
contactValue: ''
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
close () {
|
|
95
|
+
this.props.close();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
hoverHandler = (newVal) => {
|
|
99
|
+
this.setState({
|
|
100
|
+
isContactListHover: newVal
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
render () {
|
|
105
|
+
const {contactValue, isContactListHover, contactList} = this.state
|
|
106
|
+
return (
|
|
107
|
+
<div className={`card-body ${styles.cardBody}`}>
|
|
108
|
+
<CloseQuickConnect close={this.close} />
|
|
109
|
+
<FindContact contactChange={this.contactChange}
|
|
110
|
+
dialNumber={this.dialNumber}
|
|
111
|
+
contactValue={contactValue}
|
|
112
|
+
isContactListHover={isContactListHover}
|
|
113
|
+
styles={styles}
|
|
114
|
+
/>
|
|
115
|
+
<ContactField contactList={contactList}
|
|
116
|
+
dialContact={this.dialContact}
|
|
117
|
+
onHover={this.hoverHandler}
|
|
118
|
+
styles={styles}
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
Body.propTypes = {
|
|
126
|
+
close: PropTypes.func.isRequired
|
|
127
|
+
};
|
|
128
|
+
const mapStateToProps = state => ({});
|
|
129
|
+
|
|
130
|
+
const mapDispatchToProps = dispatch => ({
|
|
131
|
+
close: () => {
|
|
132
|
+
dispatch(onRequestShowTransferCall('close'));
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export default connect(
|
|
137
|
+
mapStateToProps,
|
|
138
|
+
mapDispatchToProps
|
|
139
|
+
)(Body);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import closeOrDismissIcon from './../../res/images/fa-close-or-dismiss.svg';
|
|
5
|
+
import styles from './transfercall.css';
|
|
6
|
+
|
|
7
|
+
const CloseQuickConnect = ({ close }) => (
|
|
8
|
+
<div className="row ">
|
|
9
|
+
<div className="col-10">
|
|
10
|
+
<span className={styles.quickConnectText}>Transfer call</span>
|
|
11
|
+
</div>
|
|
12
|
+
<div className="col-2"
|
|
13
|
+
onClick={close}>
|
|
14
|
+
<img src={closeOrDismissIcon} className={styles.cursor}/>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CloseQuickConnect.propTypes = {
|
|
20
|
+
close: PropTypes.func.isRequired
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default CloseQuickConnect;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Header from './../header/index';
|
|
3
|
+
import Body from './body';
|
|
4
|
+
|
|
5
|
+
import styles from './transfercall.css';
|
|
6
|
+
|
|
7
|
+
const TransferCallView = ({}) => (
|
|
8
|
+
<div className={`row h-100`}>
|
|
9
|
+
<div className={`col-12 ${styles.zeroPadding}`}>
|
|
10
|
+
<div className={`card h-100 ${styles.cardBodyMain}`}>
|
|
11
|
+
<Header/>
|
|
12
|
+
<Body/>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export default TransferCallView;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.zeroPadding {
|
|
2
|
+
padding: 0 !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cardBodyMain {
|
|
6
|
+
background: #f2f2f2;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cardBody {
|
|
10
|
+
background-color: #ffffff;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.quickConnectText {
|
|
14
|
+
color: #000000;
|
|
15
|
+
font-size: 18px;
|
|
16
|
+
font-family: AmazonEmber;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.quickConnectSearch {
|
|
20
|
+
font-family: AmazonEmber;
|
|
21
|
+
color: #000000;
|
|
22
|
+
border: 1px solid #000000;
|
|
23
|
+
border-top: 0 !important;
|
|
24
|
+
border-left: 0 !important;
|
|
25
|
+
border-right: 0 !important;
|
|
26
|
+
border-radius: 0;
|
|
27
|
+
box-shadow: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.quickConnectSearch:focus {
|
|
31
|
+
border: 1px solid #000000;
|
|
32
|
+
border-top: 0 !important;
|
|
33
|
+
border-left: 0 !important;
|
|
34
|
+
border-right: 0 !important;
|
|
35
|
+
border-radius: 0;
|
|
36
|
+
box-shadow: inset 0 0 1px 0 rgba(0, 0, 0, 0.29);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.callPhoneDialButton{
|
|
40
|
+
background-color: #46596e;
|
|
41
|
+
font-family: AmazonEmber;
|
|
42
|
+
color: #ffffff !important;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
border-radius: 0 !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
.contactListBox {
|
|
49
|
+
margin-top: 14px;
|
|
50
|
+
background: #FFFFFF;
|
|
51
|
+
border: 1px solid #CCCCCC;
|
|
52
|
+
border-radius: 2px;
|
|
53
|
+
height: 250px;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
/*box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.29);*/
|
|
56
|
+
box-shadow: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.contactItem {
|
|
60
|
+
/*background: #3388DD;*/
|
|
61
|
+
/*color: #FFFFFF;*/
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.contactItem:hover {
|
|
65
|
+
background: #d8d8d8;
|
|
66
|
+
color: #000000;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.contactItem:hover .dialButton {
|
|
70
|
+
visibility: visible;
|
|
71
|
+
color: #FFFFFF !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.contactItem:hover .contactName {
|
|
75
|
+
color: #000000 !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.contactName {
|
|
79
|
+
font-family: AmazonEmber;
|
|
80
|
+
color: #000000 !important;
|
|
81
|
+
text-align: left;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dialButton {
|
|
85
|
+
visibility: hidden;
|
|
86
|
+
background-color: #46596E;
|
|
87
|
+
font-family: AmazonEmber;
|
|
88
|
+
color: #ffffff !important;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
border-radius: 0 !important;
|
|
91
|
+
/*border: 15em;*/
|
|
92
|
+
/*border-top: 15em;*/
|
|
93
|
+
/*border-bottom: 15em;*/
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.cursor {
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
99
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import App from './App';
|
|
4
|
+
import intl from 'intl';
|
|
5
|
+
|
|
6
|
+
import './res/scss/global.css';
|
|
7
|
+
|
|
8
|
+
// apply polyfill
|
|
9
|
+
if (!window.Intl) {
|
|
10
|
+
window.Intl = intl;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
ReactDOM.render(<App/>, document.getElementById('root'));
|