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,25 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import DialNumber from './dialnumber';
5
+ import MuteUnmute from './togglemute';
6
+ import HoldAll from './holdall';
7
+
8
+ const BothJoined = ({ muted = false, dialNumber, holdAll, toggleMuteUnmute }) => (
9
+ <div className={`row mt-3`}>
10
+ <DialNumber dialNumber={dialNumber}/>
11
+ <HoldAll holdAll={holdAll}/>
12
+ <MuteUnmute muted={muted}
13
+ toggleMuteUnmute={toggleMuteUnmute}
14
+ marginTop={'mt-1'}/>
15
+ </div>
16
+ );
17
+
18
+ BothJoined.propTypes = {
19
+ muted: PropTypes.bool,
20
+ dialNumber: PropTypes.func,
21
+ toggleMuteUnmute: PropTypes.func,
22
+ holdAll: PropTypes.func
23
+ };
24
+
25
+ export default BothJoined;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './../agentview.css';
4
+
5
+ import dialNumberIcon from '../../../../res/images/fa-dial-number.svg';
6
+
7
+ const DialNumber = ({ dialNumber, marginTop = '' }) => (
8
+ <div className={`col-6 ${marginTop}`}>
9
+ <a className={`btn ${styles.buttonCommon}`}
10
+ onClick={dialNumber}
11
+ >
12
+ <img src={dialNumberIcon}/> &nbsp; Dial number
13
+ </a>
14
+ </div>
15
+ );
16
+ DialNumber.propTypes = {
17
+ dialNumber: PropTypes.func,
18
+ marginTop: PropTypes.string
19
+ };
20
+
21
+ export default DialNumber;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './../agentview.css';
4
+ import holdIcon from '../../../../res/images/fa-hold.svg';
5
+
6
+ const HoldAll = ({ holdAll, marginTop = '' }) => (
7
+ <div className={`col-6 ${marginTop}`}>
8
+ <a className={`btn ${styles.buttonCommon}`}
9
+ onClick={holdAll}
10
+ >
11
+ <img src={holdIcon}/> &nbsp; Hold all
12
+ </a>
13
+ </div>
14
+ );
15
+ HoldAll.propTypes = {
16
+ holdAll: PropTypes.func,
17
+ marginTop: PropTypes.string
18
+ };
19
+
20
+ export default HoldAll;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './../agentview.css';
4
+
5
+ import joinIcon from '../../../../res/images/fa-ico-join.svg';
6
+
7
+ const Join = ({ joinConnection, marginTop = '' }) => (
8
+ <div className={`col-6 ${marginTop}`}>
9
+ <a className={`btn ${styles.buttonCommon}`}
10
+ onClick={joinConnection}
11
+ >
12
+ <img src={joinIcon}/> &nbsp; Join
13
+ </a>
14
+ </div>
15
+ );
16
+ Join.propTypes = {
17
+ joinConnection: PropTypes.func,
18
+ marginTop: PropTypes.string
19
+ };
20
+
21
+ export default Join;
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ import Join from './join';
5
+ import Swap from './swap';
6
+ import HoldAll from './holdall';
7
+ import DialNumber from './dialnumber';
8
+ import MuteUnmute from './togglemute';
9
+
10
+ // join
11
+ // swap
12
+ // dial
13
+ // hold all
14
+ // mute
15
+
16
+ const OneHoldOtherConnected = ({ muted = false, joinConnection, swapConnection, holdAll, dialNumber, toggleMuteUnmute }) => (
17
+ <div className={`row mt-3`}>
18
+ <Join joinConnection={joinConnection}/>
19
+ <Swap swapConnection={swapConnection}/>
20
+
21
+ <HoldAll holdAll={holdAll} marginTop={'mt-1'}/>
22
+ <DialNumber dialNumber={dialNumber} marginTop={'mt-1'}/>
23
+
24
+ <MuteUnmute muted={muted} toggleMuteUnmute={toggleMuteUnmute} marginTop={'mt-1'}/>
25
+ </div>
26
+ );
27
+
28
+ OneHoldOtherConnected.propTypes = {
29
+ muted: PropTypes.bool,
30
+ joinConnection: PropTypes.func,
31
+ swapConnection: PropTypes.func,
32
+ holdAll: PropTypes.func,
33
+ dialNumber: PropTypes.func,
34
+ toggleMuteUnmute: PropTypes.func
35
+ };
36
+
37
+ export default OneHoldOtherConnected;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './../agentview.css';
4
+
5
+ import resumeIcon from '../../../../res/images/fa-resume.svg';
6
+
7
+ const ResumeAll = ({ resumeAll, marginTop = '' }) => (
8
+ <div className={`col-6 ${marginTop}`}>
9
+ <a className={`btn ${styles.buttonCommon}`}
10
+ onClick={resumeAll}
11
+ >
12
+ <img src={resumeIcon}/> &nbsp; Resume all
13
+ </a>
14
+ </div>
15
+ );
16
+ ResumeAll.propTypes = {
17
+ resumeAll: PropTypes.func,
18
+ marginTop: PropTypes.string
19
+ };
20
+
21
+ export default ResumeAll;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './../agentview.css';
4
+
5
+ import swapIcon from '../../../../res/images/fa-ico-swap.svg';
6
+
7
+ const Swap = ({ swapConnection, marginTop = '' }) => (
8
+ <div className={`col-6 ${marginTop}`}>
9
+ <a className={`btn ${styles.buttonCommon}`}
10
+ onClick={swapConnection}
11
+ >
12
+ <img src={swapIcon}/> &nbsp; Swap
13
+ </a>
14
+ </div>
15
+ );
16
+ Swap.propTypes = {
17
+ swapConnection: PropTypes.func,
18
+ marginTop: PropTypes.string
19
+ };
20
+
21
+ export default Swap;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styles from './../agentview.css';
4
+
5
+ import muteIcon from './../../../../res/images/fa-mute.svg';
6
+ import unMuteIcon from './../../../../res/images/fa-mic.svg';
7
+
8
+ const MuteUnmute = ({ toggleMuteUnmute, muted = false, marginTop = '' }) => (
9
+ <div className={`col-6 ${marginTop}`}>
10
+ <a className={`btn ${styles.buttonCommon}`}
11
+ onClick={toggleMuteUnmute}>
12
+ {muted ? <img src={unMuteIcon}/> : <img src={muteIcon}/>}
13
+ {muted ? ' Unmute' : ' Mute'}
14
+ </a>
15
+ </div>
16
+ );
17
+ MuteUnmute.propTypes = {
18
+ muted: PropTypes.bool,
19
+ toggleMuteUnmute: PropTypes.func,
20
+ marginTop: PropTypes.string
21
+ };
22
+
23
+ export default MuteUnmute;
@@ -0,0 +1,3 @@
1
+ import ConferenceConnection from './main';
2
+
3
+ export default ConferenceConnection;
@@ -0,0 +1,154 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { connect } from 'react-redux';
4
+ import QuickFeedback from './quickFeedback';
5
+ import lo from 'lodash';
6
+
7
+ import sessionManager from '../../../api/sessionManager';
8
+
9
+ import BothHoldView from './components/bothhold';
10
+ import BothJoined from './components/bothjoined';
11
+ import OneHoldOtherConnected from './components/oneHoldOtherConnected';
12
+
13
+ import { onRequestShowDialPad } from '../../../reducers/acReducer';
14
+
15
+ import {
16
+ isHold,
17
+ isConferenceConnected,
18
+ isAfterCallWork
19
+ } from './../../../utils/acutils';
20
+
21
+ // two participant in the conference are both in hold state
22
+ const isBothHold = (currentState = undefined) => {
23
+ if (!currentState) {
24
+ return false;
25
+ }
26
+ const state1 = lo.get(currentState, 'primaryConnectionState.state', 'none');
27
+ const state2 = lo.get(currentState, 'thirdPartyConnectionState.state', 'none');
28
+ return state1 === state2 && isHold(state1);
29
+ };
30
+
31
+ // both are joined state
32
+ const isBothJoined = (currentState = undefined) => {
33
+ if (!currentState) {
34
+ return false;
35
+ }
36
+ const primaryConnectionState = lo.get(currentState, 'primaryConnectionState.state', 'none');
37
+ const thirdPartyConnectionState = lo.get(currentState, 'thirdPartyConnectionState.state', 'none');
38
+ return primaryConnectionState === thirdPartyConnectionState && isConferenceConnected(primaryConnectionState);
39
+ };
40
+
41
+ // one is connected, and another one is on hold
42
+ // or some other scenario where both have different connection state
43
+ const isOneHoldOtherConnected = (currentState = undefined) => {
44
+ if (!currentState) {
45
+ return false;
46
+ }
47
+ const primaryConnectionState = lo.get(currentState, 'primaryConnectionState.state', 'none');
48
+ const thirdPartyConnectionState = lo.get(currentState, 'thirdPartyConnectionState.state', 'none');
49
+ return primaryConnectionState !== thirdPartyConnectionState;
50
+ };
51
+
52
+ class LowerBody extends Component {
53
+ constructor (props) {
54
+ super(props);
55
+ this.toggleMuteUnmute = this.toggleMuteUnmute.bind(this);
56
+ this.resumeAll = this.resumeAll.bind(this);
57
+ this.holdAll = this.holdAll.bind(this);
58
+ this.dialNumber = this.dialNumber.bind(this);
59
+ this.joinConnection = this.joinConnection.bind(this);
60
+ this.swapConnection = this.swapConnection.bind(this);
61
+ }
62
+
63
+ toggleMuteUnmute () {
64
+ this.props.muted ? sessionManager.unmute() : sessionManager.mute();
65
+ }
66
+
67
+ resumeAll () {
68
+ sessionManager.resumeAll().then(s => {
69
+ }, e => console.error(e));
70
+ }
71
+
72
+ holdAll () {
73
+ sessionManager.holdAll().then(s => {
74
+ }, e => console.error(e));
75
+ }
76
+
77
+ dialNumber () {
78
+ this.props.requestDialPad();
79
+ }
80
+
81
+ joinConnection () {
82
+ // join call, and resume all actually same.
83
+ // so just calling the same function
84
+ sessionManager.resumeAll().then(s => {
85
+ }, e => console.error(e));
86
+ }
87
+
88
+ isBothAfterCallWork (currentState = undefined) {
89
+ const primaryState = sessionManager.getCurrentStateString(currentState, true);
90
+ const thirdPartyState = sessionManager.getCurrentStateString(currentState, false);
91
+
92
+ return isAfterCallWork(primaryState) && isAfterCallWork(thirdPartyState);
93
+ }
94
+
95
+ swapConnection () {
96
+ sessionManager.swapCall().then(s => {
97
+ }, e => console.error(e));
98
+ }
99
+
100
+ render () {
101
+ const currentState = this.props.currentState;
102
+ const muted = this.props.muted;
103
+ return (
104
+ <div className="row">
105
+ <div className="col-12">
106
+ {
107
+ isBothHold(currentState) && <BothHoldView muted={muted}
108
+ toggleMuteUnmute={this.toggleMuteUnmute}
109
+ resumeAll={this.resumeAll}/>
110
+ }
111
+ {
112
+ isBothJoined(currentState) && <BothJoined muted={muted}
113
+ dialNumber={this.dialNumber}
114
+ toggleMuteUnmute={this.toggleMuteUnmute}
115
+ holdAll={this.holdAll}/>
116
+ }
117
+ {
118
+ isOneHoldOtherConnected(currentState) &&
119
+ <OneHoldOtherConnected joinConnection={this.joinConnection}
120
+ swapConnection={this.swapConnection}
121
+ holdAll={this.holdAll}
122
+ dialNumber={this.dialNumber}
123
+ toggleMuteUnmute={this.toggleMuteUnmute}
124
+ muted={muted}/>
125
+ }
126
+ {
127
+ this.isBothAfterCallWork(currentState) && <QuickFeedback/>
128
+ }
129
+
130
+ </div>
131
+ </div>
132
+ );
133
+ }
134
+ }
135
+
136
+ LowerBody.propTypes = {
137
+ currentState: PropTypes.object,
138
+ muted: PropTypes.bool,
139
+ requestDialPad: PropTypes.func.isRequired
140
+ };
141
+ const mapStateToProps = state => ({
142
+ currentState: state.acReducer.currentState,
143
+ muted: state.acReducer.muted || false
144
+ });
145
+ const mapDispatchToProps = dispatch => ({
146
+ requestDialPad: () => {
147
+ dispatch(onRequestShowDialPad('pending'));
148
+ }
149
+ });
150
+
151
+ export default connect(
152
+ mapStateToProps,
153
+ mapDispatchToProps
154
+ )(LowerBody);
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { connect } from 'react-redux';
3
+
4
+ import UpperBody from './upperBody';
5
+ import LowerBody from './lowerBody';
6
+
7
+ const ConferenceConnection = () => (
8
+ <div className={`card-body`}
9
+ style={{ paddingLeft: '0.95em', paddingRight: '0.9em', paddingTop: '0' }}>
10
+ <UpperBody/>
11
+ <LowerBody/>
12
+ </div>
13
+ );
14
+
15
+ ConferenceConnection.propTypes = {};
16
+ const mapStateToProps = state => ({});
17
+ const mapDispatchToProps = dispatch => ({});
18
+
19
+ export default connect(
20
+ mapStateToProps,
21
+ mapDispatchToProps
22
+ )(ConferenceConnection);
@@ -0,0 +1,109 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import lo from 'lodash';
4
+ import sessionManager from '../../../api/sessionManager';
5
+ import styles from './agentview.css';
6
+
7
+ import endIcon from '../../../res/images/fa-mini-endcall.svg';
8
+ import holdIcon from '../../../res/images/fa-mini-hold.svg';
9
+ import resumeIcon from '../../../res/images/fa-mini-resume.svg';
10
+
11
+ import { getColorSchema } from '../../../utils/agetStateMap';
12
+
13
+ import {
14
+ isJoined
15
+ } from './../../../utils/acutils';
16
+
17
+ const isBothHold = (currentState) => {
18
+ const state1 = lo.get(currentState, 'primaryConnectionState.state', 'none');
19
+ const state2 = lo.get(currentState, 'thirdPartyConnectionState.state', 'none');
20
+ return state1 === state2 && ['Hold', 'hold', 'On hold'].includes(state1);
21
+ };
22
+
23
+ const DURATION_MS = 1 * 1000;
24
+
25
+ class PrimaryConnection extends Component {
26
+ constructor (props) {
27
+ super(props);
28
+ this.intervalId = undefined;
29
+ this.state = {
30
+ duration: '00:00:00'
31
+ };
32
+ this.endConnection = this.endConnection.bind(this);
33
+ this.holdConnection = this.holdConnection.bind(this);
34
+ this.resumeConnection = this.resumeConnection.bind(this);
35
+ }
36
+
37
+ _dispose () {
38
+ if (this.intervalId) {
39
+ clearInterval(this.intervalId);
40
+ }
41
+ }
42
+
43
+ componentDidMount () {
44
+ this._dispose();
45
+ this.intervalId = setInterval(() => {
46
+ let duration = sessionManager.getPrimaryConnectionDuration();
47
+ this.setState({
48
+ duration: duration
49
+ });
50
+ }, DURATION_MS);
51
+ }
52
+
53
+ componentWillUnmount () {
54
+ this._dispose();
55
+ }
56
+
57
+ endConnection () {
58
+ let connection = sessionManager.getPrimaryConnection();
59
+ sessionManager.endConnection(connection).then(success => _, err => console.error(err));
60
+ }
61
+
62
+ holdConnection () {
63
+ let connection = sessionManager.getPrimaryConnection();
64
+ sessionManager.holdConnection(connection).then(success => _, err => console.error(err));
65
+ }
66
+
67
+ resumeConnection () {
68
+ let connection = sessionManager.getPrimaryConnection();
69
+ sessionManager.resumeConnection(connection).then(success => _, err => console.error(err));
70
+ }
71
+
72
+ render () {
73
+ const { currentState } = this.props;
74
+ const stateString = sessionManager.getCurrentStateString(currentState, true);
75
+ return (
76
+ <div className="col-12 h-50"
77
+ style={{
78
+ borderBottom: `1px solid rgba(255,255,255,0.50)`,
79
+ backgroundColor: getColorSchema(stateString)
80
+ }}>
81
+ <div className="row">
82
+ <div className={`col-8 mt-2 ${styles.agentStateMini}`}>
83
+ <span> {stateString} </span>
84
+ </div>
85
+ <div className="col-4 mt-2 text-right">
86
+ {isJoined(stateString) &&
87
+ <img className={styles.miniHoldResume} onClick={this.holdConnection} src={holdIcon}/>}
88
+ {isBothHold(currentState) &&
89
+ <img className={styles.miniHoldResume} onClick={this.resumeConnection} src={resumeIcon}/>}
90
+ <img className={styles.miniEnd}
91
+ onClick={this.endConnection}
92
+ src={endIcon}/>
93
+ </div>
94
+ <div className={`col-8 mt-1 ${styles.phoneAndDurationMini}`}>
95
+ <span>{sessionManager.getPrimaryConnectionPhone()}</span></div>
96
+ <div className={`col-4 mt-1 text-right ${styles.phoneAndDurationMini}`}>
97
+ <span>{this.state.duration}</span>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ );
102
+ }
103
+ }
104
+
105
+ PrimaryConnection.propTypes = {
106
+ currentState: PropTypes.object
107
+ };
108
+
109
+ export default PrimaryConnection;
@@ -0,0 +1,118 @@
1
+ import React, { Component } from 'react';
2
+ import { connect } from 'react-redux';
3
+ import lo from 'lodash';
4
+
5
+ import starYellowIcon from '../../../res/images/star-yellow.svg';
6
+ import starWhiteIcon from '../../../res/images/star-white.svg';
7
+ import PropTypes from 'prop-types';
8
+ import ConfirmReport from './../../popups/confirmreport/confirmreport';
9
+ import feedbackHandler from './../../../api/feedbackHandler';
10
+
11
+ import {
12
+ onRequestReportCallIssue
13
+ } from '../../../reducers/acReducer';
14
+
15
+ import {
16
+ feedbackRatings,
17
+ feedbackRatingsText
18
+ } from '../../../utils/feedback';
19
+ import sessionManager from '../../../api/sessionManager';
20
+
21
+ class QuickFeedback extends Component {
22
+ constructor (props) {
23
+ super(props);
24
+ this.state = {
25
+ feedback: feedbackHandler.getFeedbackRatings()
26
+ };
27
+ this.requestReportACallIssue = this.requestReportACallIssue.bind(this);
28
+ this.closeReport = this.closeReport.bind(this);
29
+ this.skipReport = this.skipReport.bind(this);
30
+ }
31
+
32
+ closeReport () {
33
+ jQuery('#confirmReportIssue').modal('hide');
34
+ }
35
+
36
+ skipReport () {
37
+ this.closeReport();
38
+ feedbackHandler.updateFeedback(0);
39
+ sessionManager.setAgentAvailable();
40
+ }
41
+
42
+ requestReportACallIssue () {
43
+ this.closeReport();
44
+ feedbackHandler.updateFeedback(0);
45
+ this.props.requestReportACallIssue();
46
+ }
47
+
48
+ feedbackChange (currentFeedback) {
49
+ const feedback = feedbackHandler.updateFeedback(currentFeedback);
50
+ this.setState({
51
+ feedback: feedback
52
+ });
53
+ }
54
+
55
+ render () {
56
+ return (
57
+ <div className="row mt-3">
58
+ <ConfirmReport requestReportACallIssue={this.requestReportACallIssue}
59
+ closeReport={this.closeReport}
60
+ skipReport={this.skipReport}/>
61
+
62
+ <div className="col-7 pr-0 mr-0">
63
+ <a className="text-left"
64
+ style={{
65
+ cursor: 'pointer',
66
+ opacity: '0.6',
67
+ fontFamily: 'AmazonEmber',
68
+ fontSize: '14px',
69
+ color: '#000000'
70
+ }}>How was
71
+ the call quality?
72
+ </a></div>
73
+ <div className="col-5 pl-0 ml-0">
74
+ <a className="text-left"
75
+ style={{ fontFamily: 'AmazonEmber', fontSize: '14px', color: '#3885de', cursor: 'pointer' }}
76
+ onClick={this.props.requestReportACallIssue}
77
+ >Report a call issue</a>
78
+ </div>
79
+ <div className="col-12 mt-1">
80
+ {
81
+ feedbackRatings.map((currentFeedback) => (
82
+ <a key={`feedback-rating-${currentFeedback}`}
83
+ style={{ cursor: 'pointer', paddingRight: '2%' }}
84
+ onClick={() => this.feedbackChange(currentFeedback)}>
85
+ <img src={currentFeedback <= this.state.feedback ? starYellowIcon : starWhiteIcon}/>
86
+ </a>
87
+ ))
88
+ }
89
+ </div>
90
+ <div className="col-12 mt-1" style={{
91
+ opacity: '0.6',
92
+ fontFamily: 'AmazonEmber',
93
+ fontSize: '12px',
94
+ letterSpacing: 'normal',
95
+ color: '#000000'
96
+ }}>&nbsp;{lo.get(feedbackRatingsText, this.state.feedback - 1)}
97
+ </div>
98
+ </div>
99
+ );
100
+ }
101
+ }
102
+
103
+ QuickFeedback.propTypes = {
104
+ feedback: PropTypes.number,
105
+ requestReportACallIssue: PropTypes.func.isRequired
106
+ };
107
+ const mapStateToProps = state => ({});
108
+
109
+ const mapDispatchToProps = dispatch => ({
110
+ requestReportACallIssue: () => {
111
+ dispatch(onRequestReportCallIssue('pending'));
112
+ }
113
+ });
114
+
115
+ export default connect(
116
+ mapStateToProps,
117
+ mapDispatchToProps
118
+ )(QuickFeedback);