amazon-connect-reference-dialer 1.0.0 → 1.4.3

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.

Files changed (239) hide show
  1. package/.babelrc +10 -0
  2. package/.eslintrc +24 -0
  3. package/Dockerfile +12 -0
  4. package/LICENSE +21 -0
  5. package/README.md +8 -0
  6. package/README.salesforce.md +50 -0
  7. package/config/appconfig.json +10 -0
  8. package/config/config.js +46 -0
  9. package/docker-compose.yml +16 -0
  10. package/index.js +46 -0
  11. package/nodemon.json +3 -0
  12. package/package.json +5 -4
  13. package/src/client/App.js +20 -0
  14. package/src/client/api/acManager.js +79 -0
  15. package/src/client/api/agentHandler.js +46 -0
  16. package/src/client/api/audioFrequencyMonitor.js +62 -0
  17. package/src/client/api/csioHandler.js +204 -0
  18. package/src/client/api/databaseManager.js +59 -0
  19. package/src/client/api/eventhandler.js +278 -0
  20. package/src/client/api/feedbackHandler.js +21 -0
  21. package/src/client/api/manager/agent.js +203 -0
  22. package/src/client/api/manager/connection.js +181 -0
  23. package/src/client/api/manager/contact.js +114 -0
  24. package/src/client/api/mediaManager.js +138 -0
  25. package/src/client/api/networkStrengthMonitor.js +64 -0
  26. package/src/client/api/precalltest.js +37 -0
  27. package/src/client/api/sessionManager.js +312 -0
  28. package/src/client/configs/consts.js +158 -0
  29. package/src/client/container/agentduration/duration.js +63 -0
  30. package/src/client/container/agentduration/index.js +3 -0
  31. package/src/client/container/agentview/conferenceconnection/agentview.css +100 -0
  32. package/src/client/container/agentview/conferenceconnection/components/bothhold.js +20 -0
  33. package/src/client/container/agentview/conferenceconnection/components/bothjoined.js +25 -0
  34. package/src/client/container/agentview/conferenceconnection/components/dialnumber.js +21 -0
  35. package/src/client/container/agentview/conferenceconnection/components/holdall.js +20 -0
  36. package/src/client/container/agentview/conferenceconnection/components/join.js +21 -0
  37. package/src/client/container/agentview/conferenceconnection/components/oneHoldOtherConnected.js +37 -0
  38. package/src/client/container/agentview/conferenceconnection/components/resumeall.js +21 -0
  39. package/src/client/container/agentview/conferenceconnection/components/swap.js +21 -0
  40. package/src/client/container/agentview/conferenceconnection/components/togglemute.js +23 -0
  41. package/src/client/container/agentview/conferenceconnection/index.js +3 -0
  42. package/src/client/container/agentview/conferenceconnection/lowerBody.js +154 -0
  43. package/src/client/container/agentview/conferenceconnection/main.js +22 -0
  44. package/src/client/container/agentview/conferenceconnection/primaryconnection.js +109 -0
  45. package/src/client/container/agentview/conferenceconnection/quickFeedback.js +118 -0
  46. package/src/client/container/agentview/conferenceconnection/thirdpartyconnection.js +107 -0
  47. package/src/client/container/agentview/conferenceconnection/upperBody.js +36 -0
  48. package/src/client/container/agentview/footer.js +190 -0
  49. package/src/client/container/agentview/index.js +3 -0
  50. package/src/client/container/agentview/main.js +39 -0
  51. package/src/client/container/agentview/primaryconnection/agentMutedLabel.js +23 -0
  52. package/src/client/container/agentview/primaryconnection/agentStatusAndAudioLabel.js +28 -0
  53. package/src/client/container/agentview/primaryconnection/agentview.css +73 -0
  54. package/src/client/container/agentview/primaryconnection/index.js +3 -0
  55. package/src/client/container/agentview/primaryconnection/lowerBody.js +159 -0
  56. package/src/client/container/agentview/primaryconnection/main.js +22 -0
  57. package/src/client/container/agentview/primaryconnection/peerAndAgentDuration.js +48 -0
  58. package/src/client/container/agentview/primaryconnection/quickFeedback.js +123 -0
  59. package/src/client/container/agentview/primaryconnection/upperBody.js +59 -0
  60. package/src/client/container/agentview/thirdparyconnection/agentMutedLabel.js +23 -0
  61. package/src/client/container/agentview/thirdparyconnection/agentStatusAndAudioLabel.js +28 -0
  62. package/src/client/container/agentview/thirdparyconnection/agentview.css +73 -0
  63. package/src/client/container/agentview/thirdparyconnection/index.js +3 -0
  64. package/src/client/container/agentview/thirdparyconnection/lowerBody.js +139 -0
  65. package/src/client/container/agentview/thirdparyconnection/main.js +22 -0
  66. package/src/client/container/agentview/thirdparyconnection/peerAndAgentDuration.js +49 -0
  67. package/src/client/container/agentview/thirdparyconnection/quickFeedback.js +118 -0
  68. package/src/client/container/agentview/thirdparyconnection/upperBody.js +59 -0
  69. package/src/client/container/audiolabelview/controller.js +104 -0
  70. package/src/client/container/audiolabelview/localaudiolevel.js +157 -0
  71. package/src/client/container/audiolabelview/noaudio.js +86 -0
  72. package/src/client/container/audiolabelview/remoteaudiolevel.js +110 -0
  73. package/src/client/container/audiolabelview/settingpageaudiolevel.js +154 -0
  74. package/src/client/container/common/contactField.js +30 -0
  75. package/src/client/container/common/each.contact.js +41 -0
  76. package/src/client/container/common/findContact.js +31 -0
  77. package/src/client/container/connectivitycheckview/body.js +113 -0
  78. package/src/client/container/connectivitycheckview/components/fractionalLoss.js +57 -0
  79. package/src/client/container/connectivitycheckview/components/mediaConnectivity.js +41 -0
  80. package/src/client/container/connectivitycheckview/components/roundTripTime.js +57 -0
  81. package/src/client/container/connectivitycheckview/components/rttgraph/rttgraph.js +176 -0
  82. package/src/client/container/connectivitycheckview/components/rttgraph/utils.js +96 -0
  83. package/src/client/container/connectivitycheckview/components/throughput.js +53 -0
  84. package/src/client/container/connectivitycheckview/components/throughputMessage.js +36 -0
  85. package/src/client/container/connectivitycheckview/connectivitycheck.css +44 -0
  86. package/src/client/container/connectivitycheckview/footer.js +43 -0
  87. package/src/client/container/connectivitycheckview/index.js +3 -0
  88. package/src/client/container/connectivitycheckview/loading/loading.css +73 -0
  89. package/src/client/container/connectivitycheckview/loading/loading.js +15 -0
  90. package/src/client/container/connectivitycheckview/main.js +19 -0
  91. package/src/client/container/dialerview/body.js +135 -0
  92. package/src/client/container/dialerview/dialpad.css +104 -0
  93. package/src/client/container/dialerview/dialpad.js +29 -0
  94. package/src/client/container/dialerview/index.js +3 -0
  95. package/src/client/container/dialerview/main.js +19 -0
  96. package/src/client/container/errors/error.css +30 -0
  97. package/src/client/container/errors/error.js +58 -0
  98. package/src/client/container/errors/index.js +3 -0
  99. package/src/client/container/footer/components/acceptOrReject.js +26 -0
  100. package/src/client/container/footer/components/availableOrEnd.js +28 -0
  101. package/src/client/container/footer/components/connectivitycheck.js +21 -0
  102. package/src/client/container/footer/components/downloadlogs.js +23 -0
  103. package/src/client/container/footer/components/info.js +22 -0
  104. package/src/client/container/footer/components/language.js +22 -0
  105. package/src/client/container/footer/components/reportcall.js +35 -0
  106. package/src/client/container/footer/components/version.js +22 -0
  107. package/src/client/container/header/header.css +46 -0
  108. package/src/client/container/header/header.js +135 -0
  109. package/src/client/container/header/index.js +3 -0
  110. package/src/client/container/home.js +129 -0
  111. package/src/client/container/login/body.js +67 -0
  112. package/src/client/container/login/ccpinputbox.js +23 -0
  113. package/src/client/container/login/footer.js +19 -0
  114. package/src/client/container/login/index.js +2 -0
  115. package/src/client/container/login/login.css +134 -0
  116. package/src/client/container/login/main.js +23 -0
  117. package/src/client/container/networkstrengthview/index.js +3 -0
  118. package/src/client/container/networkstrengthview/loading/loading.css +74 -0
  119. package/src/client/container/networkstrengthview/loading/loading.js +15 -0
  120. package/src/client/container/networkstrengthview/networkstrength.js +102 -0
  121. package/src/client/container/popups/confirmreport/confirmreport.css +47 -0
  122. package/src/client/container/popups/confirmreport/confirmreport.js +55 -0
  123. package/src/client/container/popups/quality/quality.css +32 -0
  124. package/src/client/container/popups/quality/quality.js +44 -0
  125. package/src/client/container/quickconnects/body.js +141 -0
  126. package/src/client/container/quickconnects/close.js +23 -0
  127. package/src/client/container/quickconnects/index.js +3 -0
  128. package/src/client/container/quickconnects/main.js +18 -0
  129. package/src/client/container/quickconnects/quickconnects.css +95 -0
  130. package/src/client/container/reportissueview/body.js +73 -0
  131. package/src/client/container/reportissueview/feedbackRatings.js +37 -0
  132. package/src/client/container/reportissueview/footer.js +20 -0
  133. package/src/client/container/reportissueview/index.js +3 -0
  134. package/src/client/container/reportissueview/issueNotes.js +22 -0
  135. package/src/client/container/reportissueview/issues.js +44 -0
  136. package/src/client/container/reportissueview/main.js +105 -0
  137. package/src/client/container/reportissueview/predefinedIssues.js +38 -0
  138. package/src/client/container/reportissueview/reportissue.css +102 -0
  139. package/src/client/container/settingsview/body.js +156 -0
  140. package/src/client/container/settingsview/components/audiooutputdevice.js +25 -0
  141. package/src/client/container/settingsview/components/deskphone.js +29 -0
  142. package/src/client/container/settingsview/components/desktopsettings.js +38 -0
  143. package/src/client/container/settingsview/components/dropdown-options.js +44 -0
  144. package/src/client/container/settingsview/components/phonetype.js +14 -0
  145. package/src/client/container/settingsview/components/settings.js +23 -0
  146. package/src/client/container/settingsview/components/softphone.js +30 -0
  147. package/src/client/container/settingsview/components/softphonesettings.js +35 -0
  148. package/src/client/container/settingsview/footer.js +96 -0
  149. package/src/client/container/settingsview/index.js +3 -0
  150. package/src/client/container/settingsview/main.js +20 -0
  151. package/src/client/container/settingsview/settings.css +126 -0
  152. package/src/client/container/statechangeview/body.js +61 -0
  153. package/src/client/container/statechangeview/footer.js +43 -0
  154. package/src/client/container/statechangeview/index.js +3 -0
  155. package/src/client/container/statechangeview/main.js +21 -0
  156. package/src/client/container/statechangeview/statuschange.css +47 -0
  157. package/src/client/container/transfercall/body.js +139 -0
  158. package/src/client/container/transfercall/close.js +23 -0
  159. package/src/client/container/transfercall/index.js +3 -0
  160. package/src/client/container/transfercall/main.js +18 -0
  161. package/src/client/container/transfercall/transfercall.css +99 -0
  162. package/src/client/index.js +13 -0
  163. package/src/client/reducers/acReducer.js +277 -0
  164. package/src/client/reducers/reducer.js +8 -0
  165. package/src/client/reducers.js +2 -0
  166. package/src/client/res/images/agent-voice-freq-icon.svg +61 -0
  167. package/src/client/res/images/change-status-icon.svg +16 -0
  168. package/src/client/res/images/csio-logo.png +0 -0
  169. package/src/client/res/images/csioLogo.png +0 -0
  170. package/src/client/res/images/dialer-setting-icon.svg +15 -0
  171. package/src/client/res/images/fa-circle-mark.svg +3 -0
  172. package/src/client/res/images/fa-circle-unmark.svg +3 -0
  173. package/src/client/res/images/fa-close-or-dismiss.svg +17 -0
  174. package/src/client/res/images/fa-danger.svg +3 -0
  175. package/src/client/res/images/fa-dial-button.svg +13 -0
  176. package/src/client/res/images/fa-dial-number.svg +15 -0
  177. package/src/client/res/images/fa-download.svg +3 -0
  178. package/src/client/res/images/fa-hold.svg +13 -0
  179. package/src/client/res/images/fa-ico-join.svg +27 -0
  180. package/src/client/res/images/fa-ico-swap.svg +27 -0
  181. package/src/client/res/images/fa-info.svg +3 -0
  182. package/src/client/res/images/fa-input-sound.svg +5 -0
  183. package/src/client/res/images/fa-language.svg +3 -0
  184. package/src/client/res/images/fa-mark-false.svg +3 -0
  185. package/src/client/res/images/fa-mark-true.svg +3 -0
  186. package/src/client/res/images/fa-mic-freq-temporary.gif +0 -0
  187. package/src/client/res/images/fa-mic.svg +3 -0
  188. package/src/client/res/images/fa-mini-endcall.svg +48 -0
  189. package/src/client/res/images/fa-mini-hold.svg +47 -0
  190. package/src/client/res/images/fa-mini-resume.svg +45 -0
  191. package/src/client/res/images/fa-mute.svg +13 -0
  192. package/src/client/res/images/fa-network-strength-1.svg +5 -0
  193. package/src/client/res/images/fa-network-strength-2.svg +6 -0
  194. package/src/client/res/images/fa-network-strength-3.svg +6 -0
  195. package/src/client/res/images/fa-network-strength-4.svg +6 -0
  196. package/src/client/res/images/fa-network-strength-5.svg +5 -0
  197. package/src/client/res/images/fa-network-strength-unknown-2.svg +9 -0
  198. package/src/client/res/images/fa-network-strength-unknown.svg +6 -0
  199. package/src/client/res/images/fa-quick-connect.svg +15 -0
  200. package/src/client/res/images/fa-refresh.svg +3 -0
  201. package/src/client/res/images/fa-resume.svg +3 -0
  202. package/src/client/res/images/fa-return.svg +3 -0
  203. package/src/client/res/images/fa-three-dots.svg +32 -0
  204. package/src/client/res/images/fa-tick-green.svg +3 -0
  205. package/src/client/res/images/fa-tick-mark.svg +3 -0
  206. package/src/client/res/images/fa-transfer.svg +3 -0
  207. package/src/client/res/images/fa-version.svg +4 -0
  208. package/src/client/res/images/fa-voice-no-freq.svg +5 -0
  209. package/src/client/res/images/favicon.ico +0 -0
  210. package/src/client/res/images/muted-icon.svg +13 -0
  211. package/src/client/res/images/network-strength-icon.svg +13 -0
  212. package/src/client/res/images/peer-voice-freq-icon.svg +26 -0
  213. package/src/client/res/images/star-white.svg +6 -0
  214. package/src/client/res/images/star-yellow.svg +6 -0
  215. package/src/client/res/scss/global.css +14 -0
  216. package/src/client/router.js +17 -0
  217. package/src/client/store.js +11 -0
  218. package/src/client/utils/acutils.js +114 -0
  219. package/src/client/utils/agetStateMap.js +36 -0
  220. package/src/client/utils/feedback.js +3 -0
  221. package/src/client/utils/initialStateManager.js +14 -0
  222. package/src/server/index.js +53 -0
  223. package/src/server/logger.js +93 -0
  224. package/src/server/public/fonts/AmazonEmber_Lt.ttf +0 -0
  225. package/src/server/public/fonts/AmazonEmber_Rg.ttf +0 -0
  226. package/src/server/public/img/favicon.ico +0 -0
  227. package/src/server/public/js/amazon-connect-pre-shim.js +2 -0
  228. package/src/server/router/compare.js +36 -0
  229. package/src/server/router/index.js +36 -0
  230. package/src/server/router/stock.js +33 -0
  231. package/src/server/views/_heap_prod.ejs +8 -0
  232. package/src/server/views/_hotjar_prod.ejs +14 -0
  233. package/src/server/views/_hotjar_test.ejs +12 -0
  234. package/src/server/views/compare.ejs +69 -0
  235. package/src/server/views/index.ejs +69 -0
  236. package/src/server/views/stock.ejs +101 -0
  237. package/webpack.common.config.js +48 -0
  238. package/webpack.dev.config.js +21 -0
  239. package/webpack.prod.config.js +10 -0
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import dialButton from './../../../res/images/fa-dial-button.svg';
5
+
6
+ const AcceptOrReject = ({ divClass = '', linkClass = '', style = {}, onClickHandler, text = '', isReject = false }) => (
7
+ <div className={divClass}>
8
+ <a className={linkClass}
9
+ style={style}
10
+ onClick={onClickHandler}>
11
+ {isReject && <img src={dialButton}/>}
12
+ {text}
13
+ </a>
14
+ </div>
15
+ );
16
+
17
+ AcceptOrReject.propTypes = {
18
+ divClass: PropTypes.string,
19
+ linkClass: PropTypes.string,
20
+ style: PropTypes.object,
21
+ text: PropTypes.string.isRequired,
22
+ isReject: PropTypes.bool,
23
+ onClickHandler: PropTypes.func.isRequired
24
+ };
25
+
26
+ export default AcceptOrReject;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import dialButton from './../../../res/images/fa-dial-button.svg';
5
+
6
+ const AvailableOrEnd = ({ divClass = '', linkClass = '', style = {}, onClickHandler, text = '', isEnded = false }) => (
7
+ <div className={'row'}>
8
+ <div className={divClass}>
9
+ <a className={linkClass}
10
+ style={style}
11
+ onClick={onClickHandler}>
12
+ {isEnded && <img src={dialButton}/>}
13
+ {text}
14
+ </a>
15
+ </div>
16
+ </div>
17
+ );
18
+
19
+ AvailableOrEnd.propTypes = {
20
+ divClass: PropTypes.string,
21
+ linkClass: PropTypes.string,
22
+ style: PropTypes.object,
23
+ text: PropTypes.string.isRequired,
24
+ isEnded: PropTypes.bool,
25
+ onClickHandler: PropTypes.func.isRequired
26
+ };
27
+
28
+ export default AvailableOrEnd;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const ConnectivityCheck = ({ divClass = '', linkClass = '', style = {}, onClickHandler }) => (
5
+ <div className={divClass}>
6
+ <a id='dialer_settings_connect_check'
7
+ className={linkClass}
8
+ style={style}
9
+ onClick={onClickHandler}
10
+ > Connectivity check </a>
11
+ </div>
12
+ );
13
+
14
+ ConnectivityCheck.propTypes = {
15
+ divClass: PropTypes.string,
16
+ linkClass: PropTypes.string,
17
+ style: PropTypes.object,
18
+ onClickHandler: PropTypes.func.isRequired
19
+ };
20
+
21
+ export default ConnectivityCheck;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import downloadIcon from '../../../res/images/fa-download.svg';
5
+
6
+ const DownloadLogs = ({ divClass = '', linkClass = '', style = {}, onClickHandler }) => (
7
+ <div className={divClass}>
8
+ <a id='dialer_settings_download_logs'
9
+ className={linkClass}
10
+ style={style}
11
+ onClick={onClickHandler}
12
+ > <img src={downloadIcon}/> Download logs </a>
13
+ </div>
14
+ );
15
+
16
+ DownloadLogs.propTypes = {
17
+ divClass: PropTypes.string,
18
+ linkClass: PropTypes.string,
19
+ style: PropTypes.object,
20
+ onClickHandler: PropTypes.func.isRequired
21
+ };
22
+
23
+ export default DownloadLogs;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import infoIcon from '../../../res/images/fa-info.svg';
5
+
6
+ const Info = ({ divClass = '', linkClass = '', style = {}, onClickHandler }) => (
7
+ <div className={divClass}>
8
+ <a className={linkClass}
9
+ style={style}
10
+ onClick={onClickHandler}
11
+ > <img src={infoIcon}/> Info </a>
12
+ </div>
13
+ );
14
+
15
+ Info.propTypes = {
16
+ divClass: PropTypes.string,
17
+ linkClass: PropTypes.string,
18
+ style: PropTypes.object,
19
+ onClickHandler: PropTypes.func.isRequired
20
+ };
21
+
22
+ export default Info;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import languageIcon from '../../../res/images/fa-language.svg';
5
+
6
+ const Language = ({ divClass = '', linkClass = '', style = {}, onClickHandler }) => (
7
+ <div className={divClass}>
8
+ <a className={linkClass}
9
+ style={style}
10
+ onClick={onClickHandler}
11
+ > <img src={languageIcon}/> English </a>
12
+ </div>
13
+ );
14
+
15
+ Language.propTypes = {
16
+ divClass: PropTypes.string,
17
+ linkClass: PropTypes.string,
18
+ style: PropTypes.object,
19
+ onClickHandler: PropTypes.func.isRequired
20
+ };
21
+
22
+ export default Language;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import acManager from '../../../api/acManager';
4
+ import { isAfterCallWork } from '../../../utils/acutils';
5
+ import sessionManage from '../../../api/sessionManager';
6
+
7
+ // take existing class and add disabled if it is not after call work
8
+ const getClass = (prvClass = '') => {
9
+ const currentState = acManager.getCurrentState();
10
+ const primaryState = sessionManage.getCurrentStateString(currentState, true);
11
+ const secondaryState = sessionManage.getCurrentStateString(currentState, false);
12
+ if (isAfterCallWork(primaryState) || isAfterCallWork(secondaryState)) {
13
+ return prvClass;
14
+ }
15
+ return `${prvClass} disabled`;
16
+ };
17
+ const ReportACall = ({ id = '', divClass = '', linkClass = '', style = {}, onClickHandler }) => (
18
+ <div className={divClass}>
19
+ <a id={id}
20
+ className={getClass(linkClass)}
21
+ style={style}
22
+ onClick={onClickHandler}
23
+ > Report a call issue </a>
24
+ </div>
25
+ );
26
+
27
+ ReportACall.propTypes = {
28
+ id: PropTypes.string,
29
+ divClass: PropTypes.string,
30
+ linkClass: PropTypes.string,
31
+ style: PropTypes.object,
32
+ onClickHandler: PropTypes.func.isRequired
33
+ };
34
+
35
+ export default ReportACall;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import versionIcon from '../../../res/images/fa-version.svg';
5
+
6
+ const Version = ({ divClass = '', linkClass = '', style = {}, onClickHandler }) => (
7
+ <div className={divClass}>
8
+ <a className={linkClass}
9
+ style={style}
10
+ onClick={onClickHandler}
11
+ > <img src={versionIcon}/> {`Dialer v${window.CS_VERSION}` }</a>
12
+ </div>
13
+ );
14
+
15
+ Version.propTypes = {
16
+ divClass: PropTypes.string,
17
+ linkClass: PropTypes.string,
18
+ style: PropTypes.object,
19
+ onClickHandler: PropTypes.func.isRequired
20
+ };
21
+
22
+ export default Version;
@@ -0,0 +1,46 @@
1
+ .acHeader {
2
+ background-color: #525252;
3
+ height: 42px;
4
+ width: 319px;
5
+ }
6
+
7
+ .disable {
8
+ opacity: 0.4;
9
+ }
10
+
11
+ .csioLogo {
12
+ width: 24px;
13
+ height: 24px;
14
+ }
15
+
16
+ .csioChangeStatus {
17
+ cursor: pointer;
18
+ }
19
+
20
+ .csioHeaderText {
21
+ font-family: AmazonEmber;
22
+ color: #ffffff;
23
+ font-size: 14px;
24
+ }
25
+
26
+ .leftBorder {
27
+ border-left: 1px solid #8a8a8a !important;
28
+ }
29
+
30
+ .acPointer {
31
+ cursor: pointer;
32
+ }
33
+
34
+ .dialerImage {
35
+ margin-top: 0.5em;
36
+ }
37
+
38
+ .disabledDiv {
39
+ pointer-events: none;
40
+ opacity: 0.4;
41
+ }
42
+
43
+ .nope {
44
+
45
+
46
+ }
@@ -0,0 +1,135 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import SVG from 'react-inlinesvg';
4
+
5
+ import statusChangeIcon from '../../res/images/change-status-icon.svg';
6
+ import dialerSettingIcon from '../../res/images/dialer-setting-icon.svg';
7
+ import csioLogo from '../../res/images/csioLogo.png';
8
+
9
+ import NetworkStrength from '../networkstrengthview/index';
10
+ import { onRequestAgentSettingsChange, onRequestAgentStateChange } from '../../reducers/acReducer';
11
+ import { connect } from 'react-redux';
12
+
13
+ import styles from './header.css';
14
+ import Quality from '../popups/quality/quality';
15
+ import networkStrengthMonitor from '../../api/networkStrengthMonitor';
16
+ import { sleep } from './../../utils/acutils';
17
+ import sessionManage from '../../api/sessionManager';
18
+
19
+ const CSIOLogo = () => (
20
+ <div className={`col-2 m-0 p-0 text-center`}>
21
+ <img src={csioLogo} className={styles.csioLogo}/>
22
+ </div>
23
+ );
24
+
25
+ const ChangeStatus = ({ onClickHandler, currentState = undefined }) => (
26
+ <div
27
+ className={`col-10 m-0 p-0 pl-1 ${styles.csioChangeStatus} ${sessionManage.isActive(currentState) && styles.disabledDiv}`}
28
+ onClick={onClickHandler}>
29
+ <span className={styles.csioHeaderText}>Change status</span>
30
+ <SVG src={statusChangeIcon}/>
31
+ </div>
32
+ );
33
+
34
+ const NetworkStrengthChange = ({ toggleShowNetworkStatus }) => (
35
+ <div className={`col-2 pl-0 ml-0 pr-0 mr-0 my-auto text-center`}>
36
+ <NetworkStrength toggleShowNetworkStatus={toggleShowNetworkStatus}/>
37
+ </div>
38
+ );
39
+ NetworkStrengthChange.propTypes = {
40
+ toggleShowNetworkStatus: PropTypes.func.isRequired
41
+ };
42
+
43
+ const DialerSettings = ({ onClickHandler }) => (
44
+ <div id="dialer_settings" className={`col-2 border-left ${styles.acPointer} ${styles.leftBorder}`}
45
+ onClick={onClickHandler}>
46
+ <img src={dialerSettingIcon} className={styles.dialerImage}/>
47
+ </div>
48
+ );
49
+
50
+ class Header extends React.Component {
51
+ constructor (props) {
52
+ super(props);
53
+ this.state = {
54
+ isOpen: false,
55
+ showNetworkStatus: false
56
+ };
57
+ this.show = false;
58
+ this.requestAgentStateChangeFunc = this.requestAgentStateChangeFunc.bind(this);
59
+ this.toggleShowNetworkStatus = this.toggleShowNetworkStatus.bind(this);
60
+ }
61
+
62
+ requestAgentStateChangeFunc () {
63
+ const { requestAgentStateChange } = this.props;
64
+ if (requestAgentStateChange === 'pending') {
65
+ this.props.requestAgentStateChangeFunc('close');
66
+ } else {
67
+ this.props.requestAgentStateChangeFunc('pending');
68
+ }
69
+ }
70
+
71
+ toggleShowNetworkStatus (show) {
72
+ this.show = show;
73
+ sleep(show ? 0 : 500).then(() => {
74
+ this.setState({
75
+ showNetworkStatus: this.show
76
+ });
77
+ });
78
+ }
79
+
80
+ render () {
81
+ const { emptyBody, currentState } = this.props;
82
+
83
+ return (
84
+ <div
85
+ className={`card-header pt-0 pb-0 mt-0 mb-0 ${styles.acHeader} ${emptyBody === true && styles.disable}`}>
86
+ <div className={`row h-100`}>
87
+ <div className={'col-8 my-auto'}>
88
+ <div className={`row`}>
89
+ <CSIOLogo/>
90
+ <ChangeStatus onClickHandler={this.requestAgentStateChangeFunc}
91
+ currentState={currentState}/>
92
+ </div>
93
+ </div>
94
+ <NetworkStrengthChange toggleShowNetworkStatus={this.toggleShowNetworkStatus}/>
95
+ <DialerSettings onClickHandler={this.props.requestAgentSettingsChange}/>
96
+ </div>
97
+ {
98
+ emptyBody !== true && this.state.showNetworkStatus &&
99
+ <div className={`row text-center justify-content-end`}
100
+ onMouseEnter={() => this.toggleShowNetworkStatus(true)}
101
+ onMouseLeave={() => this.toggleShowNetworkStatus(false)}>
102
+ <Quality qualityValue={networkStrengthMonitor.getNetworkStrength()}/>
103
+ </div>
104
+ }
105
+ </div>
106
+ );
107
+ }
108
+ }
109
+
110
+ Header.propTypes = {
111
+ emptyBody: PropTypes.bool,
112
+ currentState: PropTypes.object,
113
+ requestAgentStateChange: PropTypes.string,
114
+ requestAgentStateChangeFunc: PropTypes.func.isRequired,
115
+ requestAgentSettingsChange: PropTypes.func.isRequired
116
+ };
117
+
118
+ const mapStateToProps = state => ({
119
+ currentState: state.acReducer.currentState,
120
+ requestAgentStateChange: state.acReducer.requestAgentStateChange
121
+ });
122
+
123
+ const mapDispatchToProps = dispatch => ({
124
+ requestAgentStateChangeFunc: (value) => {
125
+ dispatch(onRequestAgentStateChange(value));
126
+ },
127
+ requestAgentSettingsChange: () => {
128
+ dispatch(onRequestAgentSettingsChange('pending'));
129
+ }
130
+ });
131
+
132
+ export default connect(
133
+ mapStateToProps,
134
+ mapDispatchToProps
135
+ )(Header);
@@ -0,0 +1,3 @@
1
+ import Header from './header';
2
+
3
+ export default Header;
@@ -0,0 +1,129 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { connect } from 'react-redux';
4
+ import StateChangeView from './statechangeview/index';
5
+ import AgentView from './agentview/index';
6
+ import SettingPageView from './settingsview/index';
7
+ import ReportCallIssueView from './reportissueview/index';
8
+ import ConnectivityCheckView from './connectivitycheckview/index';
9
+ import DialPadView from './dialerview/index';
10
+ import QuickConnectsView from './quickconnects/index';
11
+ import TransferCallView from './transfercall/index';
12
+ import Login from './login/index';
13
+ import acManager from '../api/acManager';
14
+ import AppStore from '../store';
15
+
16
+ const maybeShowThisView = (currentView, ...others) => {
17
+ // current view needs to be pending
18
+ let isPending = ['pending'].includes(currentView);
19
+ if (!isPending) {
20
+ return false;
21
+ }
22
+ isPending = others.some(viewItem => {
23
+ return ['pending'].includes(viewItem);
24
+ });
25
+ // none of other view can be in pending state
26
+ if (isPending) {
27
+ return false;
28
+ }
29
+ return true;
30
+ };
31
+
32
+ class Home extends Component {
33
+ // eslint-disable-next-line no-useless-constructor
34
+ constructor (props) {
35
+ super(props);
36
+ }
37
+
38
+ componentDidMount () {
39
+ // register ac manager
40
+ acManager.register(AppStore.dispatch);
41
+ // console.warn('-> ', this.state.isLoggedIn);
42
+ }
43
+
44
+ render () {
45
+ const initialized = this.props.initialized;
46
+ const requestAgentStateChange = this.props.requestAgentStateChange;
47
+ const requestAgentSettingsChange = this.props.requestAgentSettingsChange;
48
+ const requestReportCallIssue = this.props.requestReportCallIssue;
49
+ const requestConnectivityCheck = this.props.requestConnectivityCheck;
50
+ const requestShowDialPad = this.props.requestShowDialPad;
51
+ const requestShowQuickConnects = this.props.requestShowQuickConnects;
52
+ const requestShowTransferCall = this.props.requestShowTransferCall;
53
+
54
+ return (
55
+ !initialized
56
+ ? (<div className={`container`} style={{ width: '320px', height: '480px' }}>
57
+ <Login showLogin={acManager.getIsLoggedIn() === false}/>
58
+ </div>)
59
+ : <div className={`container`} style={{ width: '320px', height: '480px' }}>
60
+ {
61
+ maybeShowThisView('pending', requestAgentStateChange, requestAgentSettingsChange, requestReportCallIssue,
62
+ requestConnectivityCheck, requestShowDialPad, requestShowQuickConnects,
63
+ requestShowTransferCall) &&
64
+ <AgentView/>}
65
+ {
66
+ maybeShowThisView(requestAgentStateChange, requestAgentSettingsChange, requestReportCallIssue,
67
+ requestConnectivityCheck, requestShowDialPad, requestShowQuickConnects,
68
+ requestShowTransferCall) &&
69
+ <StateChangeView/>}
70
+ {
71
+ maybeShowThisView(requestAgentSettingsChange, requestAgentStateChange, requestReportCallIssue,
72
+ requestConnectivityCheck, requestShowDialPad, requestShowQuickConnects, requestShowTransferCall) &&
73
+ <SettingPageView/>}
74
+
75
+ {
76
+ maybeShowThisView(requestReportCallIssue, requestAgentStateChange, requestAgentSettingsChange,
77
+ requestConnectivityCheck, requestShowDialPad, requestShowQuickConnects, requestShowTransferCall) &&
78
+ <ReportCallIssueView/>}
79
+
80
+ {
81
+ maybeShowThisView(requestConnectivityCheck, requestAgentStateChange, requestAgentSettingsChange, requestReportCallIssue,
82
+ requestShowDialPad, requestShowQuickConnects, requestShowTransferCall) &&
83
+ <ConnectivityCheckView/>}
84
+
85
+ {
86
+ maybeShowThisView(requestShowDialPad, requestAgentStateChange, requestAgentSettingsChange, requestReportCallIssue,
87
+ requestConnectivityCheck, requestShowQuickConnects, requestShowTransferCall) &&
88
+ <DialPadView/>}
89
+
90
+ {
91
+ maybeShowThisView(requestShowQuickConnects, requestAgentStateChange, requestAgentSettingsChange, requestReportCallIssue,
92
+ requestConnectivityCheck, requestShowDialPad, requestShowTransferCall) &&
93
+ <QuickConnectsView/>}
94
+
95
+ {
96
+ maybeShowThisView(requestShowTransferCall, requestAgentStateChange, requestAgentSettingsChange, requestReportCallIssue,
97
+ requestConnectivityCheck, requestShowDialPad, requestShowQuickConnects) &&
98
+ <TransferCallView/>}
99
+ </div>
100
+ );
101
+ }
102
+ }
103
+
104
+ Home.propTypes = {
105
+ initialized: PropTypes.bool.isRequired,
106
+ requestAgentStateChange: PropTypes.string.isRequired,
107
+ requestAgentSettingsChange: PropTypes.string.isRequired,
108
+ requestReportCallIssue: PropTypes.string.isRequired,
109
+ requestConnectivityCheck: PropTypes.string.isRequired,
110
+ requestShowDialPad: PropTypes.string.isRequired,
111
+ requestShowQuickConnects: PropTypes.string.isRequired,
112
+ requestShowTransferCall: PropTypes.string.isRequired
113
+ };
114
+ const mapStateToProps = state => ({
115
+ initialized: state.acReducer.initialized,
116
+ requestAgentStateChange: state.acReducer.requestAgentStateChange || 'complete',
117
+ requestAgentSettingsChange: state.acReducer.requestAgentSettingsChange || 'complete',
118
+ requestReportCallIssue: state.acReducer.requestReportCallIssue || 'complete',
119
+ requestConnectivityCheck: state.acReducer.requestConnectivityCheck || 'complete',
120
+ requestShowDialPad: state.acReducer.requestShowDialPad || 'complete',
121
+ requestShowQuickConnects: state.acReducer.requestShowQuickConnects || 'complete',
122
+ requestShowTransferCall: state.acReducer.requestShowTransferCall || 'complete'
123
+ });
124
+ const mapDispatchToProps = dispatch => ({});
125
+
126
+ export default connect(
127
+ mapStateToProps,
128
+ mapDispatchToProps
129
+ )(Home);
@@ -0,0 +1,67 @@
1
+ import React, { Component } from 'react';
2
+ import styles from './login.css';
3
+ import databaseManager from '../../api/databaseManager';
4
+ import sessionManage from '../../api/sessionManager';
5
+
6
+ import CCPInputBox from './ccpinputbox';
7
+
8
+ const getCCPScope = () => {
9
+ const ccpScope = databaseManager.getDefaultConnectURL(CONNECT_URL || WEB_PACK_CONNECT_URL);
10
+ return ccpScope;
11
+ };
12
+
13
+ const loginURL = () => {
14
+ const connectURL = databaseManager.getDefaultConnectURL(CONNECT_URL || WEB_PACK_CONNECT_URL);
15
+ return `https://${connectURL}/connect/login?landat=%2Fconnect%2Fccp#/`;
16
+ };
17
+ class Body extends Component {
18
+ constructor (props) {
19
+ super(props);
20
+ this.state = {
21
+ ccpURL: getCCPScope()
22
+ };
23
+ this.ccpURLChange = this.ccpURLChange.bind(this);
24
+ this.trySignIn = this.trySignIn.bind(this);
25
+ }
26
+
27
+ ccpURLChange (event) {
28
+ let { value } = event.target;
29
+ this.setState({
30
+ ccpURL: value
31
+ });
32
+ }
33
+
34
+ trySignIn () {
35
+ // set the current CCP URL as current one
36
+ databaseManager.setDefaultConnectURL(this.state.ccpURL || '');
37
+
38
+ // fetch the newly set loginIN URL
39
+ let loginWindow = window.open(loginURL());
40
+ sessionManage.setLoginWindow(loginWindow);
41
+ }
42
+
43
+ render () {
44
+ return (
45
+ <div className={`card-body ${styles.cardBodyMain}`}>
46
+ <div className="row h-100">
47
+ <div className={`col-12 my-auto`}>
48
+ <div className={`row`}>
49
+ <div className="col-12">
50
+ <span className={styles.ccpInputBoxText}>Amazon Connect CCP URL</span>
51
+ </div>
52
+ <CCPInputBox ccpURL={this.state.ccpURL}
53
+ ccpURLChange={this.ccpURLChange}
54
+ />
55
+ <div className="col-12 mt-4 text-center">
56
+ <a className={`btn w-50 ${styles.loginText}`} onClick={this.trySignIn}> Sign in </a>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ );
63
+ }
64
+ }
65
+
66
+ Body.propTypes = {};
67
+ export default Body;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './login.css';
4
+
5
+ const CCPInputBox = ({ ccpURLChange, ccpURL = '' }) => (
6
+ <div className="col-12 mt-2">
7
+ <div className="input-group flex-nowrap">
8
+ <input type="text"
9
+ className={`form-control ${styles.ccpInputBox}`}
10
+ placeholder="callstatsio.awsapps.com"
11
+ aria-label="contact"
12
+ value={ccpURL}
13
+ onChange={ccpURLChange}
14
+ aria-describedby="addon-wrapping"/>
15
+ </div>
16
+ </div>
17
+ );
18
+
19
+ CCPInputBox.propTypes = {
20
+ ccpURLChange: PropTypes.func.isRequired,
21
+ ccpURL: PropTypes.string
22
+ };
23
+ export default CCPInputBox;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import styles from './login.css';
5
+
6
+ const Footer = ({ tryLogin }) => (
7
+ <div className={`card-footer m-0 p-0 ${styles.footerMain}`}>
8
+ <div className="row">
9
+ <div className="col-12">
10
+ <a className={`btn w-100 ${styles.footerLogin}`}
11
+ onClick={tryLogin}> Login </a>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ );
16
+ Footer.propTypes = {
17
+ tryLogin: PropTypes.func
18
+ };
19
+ export default Footer;
@@ -0,0 +1,2 @@
1
+ import Login from './main';
2
+ export default Login;