@webex/cc-station-login 1.28.0-ccwidgets.13 → 1.28.0-ccwidgets.15
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.
package/dist/index.js
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
/******/ "use strict";
|
|
11
11
|
/******/ var __webpack_modules__ = ({
|
|
12
12
|
|
|
13
|
+
/***/ "../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./src/station-login/alert-modal.scss":
|
|
14
|
+
/*!***************************************************************************************************************************************!*\
|
|
15
|
+
!*** ../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./src/station-login/alert-modal.scss ***!
|
|
16
|
+
\***************************************************************************************************************************************/
|
|
17
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
18
|
+
|
|
19
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ \"../../../node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.modal {\n width: 400px;\n border: none;\n border-radius: 10px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n padding: 20px;\n text-align: center;\n}\n\n.modal-content {\n display: flex;\n justify-content: flex-end;\n}\n\n.modal::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\nh2 {\n margin-top: 0;\n}\n\n#ContinueButton {\n background-color: #0078d4;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n cursor: pointer;\n font-size: 16px;\n cursor: pointer;\n}\n\n#ContinueButton:hover {\n background-color: #005a9e;\n}`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/alert-modal.scss?../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js");
|
|
20
|
+
|
|
21
|
+
/***/ }),
|
|
22
|
+
|
|
13
23
|
/***/ "../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./src/station-login/station-login.style.scss":
|
|
14
24
|
/*!***********************************************************************************************************************************************!*\
|
|
15
25
|
!*** ../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./src/station-login/station-login.style.scss ***!
|
|
@@ -200,6 +210,16 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
200
210
|
|
|
201
211
|
/***/ }),
|
|
202
212
|
|
|
213
|
+
/***/ "./src/station-login/alert-modal.scss":
|
|
214
|
+
/*!********************************************!*\
|
|
215
|
+
!*** ./src/station-login/alert-modal.scss ***!
|
|
216
|
+
\********************************************/
|
|
217
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
218
|
+
|
|
219
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ \"../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ \"../../../node_modules/style-loader/dist/runtime/insertBySelector.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ \"../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ \"../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ \"../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_alert_modal_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js!../../../../../node_modules/sass-loader/dist/cjs.js!./alert-modal.scss */ \"../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./src/station-login/alert-modal.scss\");\n\n \n \n \n \n \n \n \n \n \n\nvar options = {};\n\noptions.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());\noptions.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());\noptions.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, \"head\");\noptions.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());\noptions.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_alert_modal_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"], options);\n\n\n\n\n /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_alert_modal_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_alert_modal_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals ? _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_alert_modal_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals : undefined);\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/alert-modal.scss?");
|
|
220
|
+
|
|
221
|
+
/***/ }),
|
|
222
|
+
|
|
203
223
|
/***/ "./src/station-login/station-login.style.scss":
|
|
204
224
|
/*!****************************************************!*\
|
|
205
225
|
!*** ./src/station-login/station-login.style.scss ***!
|
|
@@ -296,7 +316,7 @@ eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ../cj
|
|
|
296
316
|
\***********************/
|
|
297
317
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
298
318
|
|
|
299
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.useStationLogin = void 0;\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\")); // we need to import as we are losing the context of this in store\nconst useStationLogin = (props) => {\n const cc = props.cc;\n const loginCb = props.onLogin;\n const logoutCb = props.onLogout;\n const logger = props.logger;\n const [isAgentLoggedIn, setIsAgentLoggedIn] = (0, react_1.useState)(props.isAgentLoggedIn);\n const [dialNumber, setDialNumber] = (0, react_1.useState)('');\n const [deviceType, setDeviceType] = (0, react_1.useState)('');\n const [team, setTeam] = (0, react_1.useState)('');\n const [loginSuccess, setLoginSuccess] = (0, react_1.useState)();\n const [loginFailure, setLoginFailure] = (0, react_1.useState)();\n const [logoutSuccess, setLogoutSuccess] = (0, react_1.useState)();\n (0, react_1.useEffect)(() => {\n setIsAgentLoggedIn(props.isAgentLoggedIn);\n }, [props.isAgentLoggedIn]);\n const login = () => {\n cc.stationLogin({ teamId: team, loginOption: deviceType, dialNumber: dialNumber })\n .then((res) => {\n setLoginSuccess(res);\n setIsAgentLoggedIn(true);\n cc_store_1.default.setSelectedLoginOption(deviceType);\n if (loginCb) {\n loginCb();\n }\n }).catch((error) => {\n logger.error(`Error logging in: ${error}`, {\n module: 'widget-station-login#helper.ts',\n method: 'login',\n });\n setLoginFailure(error);\n });\n };\n const logout = () => {\n cc.stationLogout({ logoutReason: 'User requested logout' })\n .then((res) => {\n setLogoutSuccess(res);\n setIsAgentLoggedIn(false);\n if (logoutCb) {\n logoutCb();\n }\n }).catch((error) => {\n logger.error(`Error logging out: ${error}`, {\n module: 'widget-station-login#helper.ts',\n method: 'logout',\n });\n });\n };\n function relogin() {\n cc_store_1.default.setSelectedLoginOption(deviceType);\n if (loginCb) {\n loginCb();\n }\n }\n return {\n name: 'StationLogin',\n setDeviceType,\n setDialNumber,\n setTeam,\n login,\n logout,\n relogin,\n loginSuccess,\n loginFailure,\n logoutSuccess,\n isAgentLoggedIn,\n };\n};\nexports.useStationLogin = useStationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/helper.ts?");
|
|
319
|
+
eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.useStationLogin = void 0;\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\")); // we need to import as we are losing the context of this in store\nconst constants_1 = __webpack_require__(/*! ./station-login/constants */ \"./src/station-login/constants.ts\");\nconst useStationLogin = (props) => {\n const cc = props.cc;\n const loginCb = props.onLogin;\n const logoutCb = props.onLogout;\n const logger = props.logger;\n const [isAgentLoggedIn, setIsAgentLoggedIn] = (0, react_1.useState)(props.isAgentLoggedIn);\n const [dialNumber, setDialNumber] = (0, react_1.useState)('');\n const [deviceType, setDeviceType] = (0, react_1.useState)('');\n const [team, setTeam] = (0, react_1.useState)('');\n const [loginSuccess, setLoginSuccess] = (0, react_1.useState)();\n const [loginFailure, setLoginFailure] = (0, react_1.useState)();\n const [logoutSuccess, setLogoutSuccess] = (0, react_1.useState)();\n const [showMultipleLoginAlert, setShowMultipleLoginAlert] = (0, react_1.useState)(false);\n (0, react_1.useEffect)(() => {\n const handleMultiLoginCloseSession = (data) => {\n if (data && typeof data === 'object' && data.type === 'AgentMultiLoginCloseSession') {\n setShowMultipleLoginAlert(true);\n }\n };\n cc.on(constants_1.AGENT_MULTI_LOGIN, handleMultiLoginCloseSession);\n return () => {\n cc.off(constants_1.AGENT_MULTI_LOGIN, handleMultiLoginCloseSession);\n };\n }, [cc]);\n (0, react_1.useEffect)(() => {\n setIsAgentLoggedIn(props.isAgentLoggedIn);\n }, [props.isAgentLoggedIn]);\n const handleContinue = () => __awaiter(void 0, void 0, void 0, function* () {\n try {\n setShowMultipleLoginAlert(false);\n const profile = yield cc.register();\n if (profile.isAgentLoggedIn) {\n logger.log(`Agent Relogin Success`, {\n module: 'widget-station-login#station-login/helper.ts',\n method: 'handleContinue',\n });\n }\n else {\n logger.error(`Agent Relogin Failed`, {\n module: 'widget-station-login#station-login/helper.ts',\n method: 'handleContinue',\n });\n }\n }\n catch (error) {\n logger.error(`Error handling agent multi login continue: ${error}`, {\n module: 'widget-station-login#station-login/index.tsx',\n method: 'handleContinue',\n });\n }\n });\n const login = () => {\n cc.stationLogin({ teamId: team, loginOption: deviceType, dialNumber: dialNumber })\n .then((res) => {\n setLoginSuccess(res);\n setIsAgentLoggedIn(true);\n cc_store_1.default.setSelectedLoginOption(deviceType);\n if (res.data.auxCodeId) {\n cc_store_1.default.setCurrentState(res.data.auxCodeId);\n }\n if (res.data.lastStateChangeTimestamp) {\n cc_store_1.default.setLastStateChangeTimestamp(new Date(res.data.lastStateChangeTimestamp));\n }\n if (loginCb) {\n loginCb();\n }\n })\n .catch((error) => {\n logger.error(`Error logging in: ${error}`, {\n module: 'widget-station-login#helper.ts',\n method: 'login',\n });\n setLoginFailure(error);\n });\n };\n const logout = () => {\n cc.stationLogout({ logoutReason: 'User requested logout' })\n .then((res) => {\n setLogoutSuccess(res);\n setIsAgentLoggedIn(false);\n if (logoutCb) {\n logoutCb();\n }\n })\n .catch((error) => {\n logger.error(`Error logging out: ${error}`, {\n module: 'widget-station-login#helper.ts',\n method: 'logout',\n });\n });\n };\n function relogin() {\n cc_store_1.default.setSelectedLoginOption(deviceType);\n if (loginCb) {\n loginCb();\n }\n }\n return {\n name: 'StationLogin',\n setDeviceType,\n setDialNumber,\n setTeam,\n login,\n logout,\n relogin,\n loginSuccess,\n loginFailure,\n logoutSuccess,\n showMultipleLoginAlert,\n isAgentLoggedIn,\n handleContinue,\n };\n};\nexports.useStationLogin = useStationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/helper.ts?");
|
|
300
320
|
|
|
301
321
|
/***/ }),
|
|
302
322
|
|
|
@@ -310,13 +330,23 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
310
330
|
|
|
311
331
|
/***/ }),
|
|
312
332
|
|
|
333
|
+
/***/ "./src/station-login/constants.ts":
|
|
334
|
+
/*!****************************************!*\
|
|
335
|
+
!*** ./src/station-login/constants.ts ***!
|
|
336
|
+
\****************************************/
|
|
337
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
338
|
+
|
|
339
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AGENT_MULTI_LOGIN = exports.MULTIPLE_SIGN_IN_ALERT_TITLE = exports.MULTIPLE_SIGN_IN_ALERT_MESSAGE = void 0;\nexports.MULTIPLE_SIGN_IN_ALERT_MESSAGE = 'You are signed in to the Desktop in multiple application instances. Click Continue to proceed with the Desktop in this application instance. Else, close this window.';\nexports.MULTIPLE_SIGN_IN_ALERT_TITLE = 'Multiple Sign In Alert';\nexports.AGENT_MULTI_LOGIN = 'agent:multiLogin';\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/constants.ts?");
|
|
340
|
+
|
|
341
|
+
/***/ }),
|
|
342
|
+
|
|
313
343
|
/***/ "./src/station-login/index.tsx":
|
|
314
344
|
/*!*************************************!*\
|
|
315
345
|
!*** ./src/station-login/index.tsx ***!
|
|
316
346
|
\*************************************/
|
|
317
347
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
318
348
|
|
|
319
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StationLogin = void 0;\nconst react_1 = __importDefault(__webpack_require__(/*! react */ \"react\"));\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\"));\nconst mobx_react_lite_1 = __webpack_require__(/*! mobx-react-lite */ \"../../../node_modules/mobx-react-lite/es/index.js\");\nconst station_login_presentational_1 = __importDefault(__webpack_require__(/*! ./station-login.presentational */ \"./src/station-login/station-login.presentational.tsx\"));\nconst helper_1 = __webpack_require__(/*! ../helper */ \"./src/helper.ts\");\nconst StationLoginComponent = ({ onLogin, onLogout }) => {\n const { cc, teams, loginOptions, logger, deviceType, isAgentLoggedIn } = cc_store_1.default;\n const result = (0, helper_1.useStationLogin)({
|
|
349
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StationLogin = void 0;\nconst react_1 = __importDefault(__webpack_require__(/*! react */ \"react\"));\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\"));\nconst mobx_react_lite_1 = __webpack_require__(/*! mobx-react-lite */ \"../../../node_modules/mobx-react-lite/es/index.js\");\nconst station_login_presentational_1 = __importDefault(__webpack_require__(/*! ./station-login.presentational */ \"./src/station-login/station-login.presentational.tsx\"));\nconst helper_1 = __webpack_require__(/*! ../helper */ \"./src/helper.ts\");\nconst StationLoginComponent = ({ onLogin, onLogout }) => {\n const { cc, teams, loginOptions, logger, deviceType, isAgentLoggedIn, handleContinue, showMultipleLoginAlert } = cc_store_1.default;\n const result = (0, helper_1.useStationLogin)({\n cc,\n onLogin,\n onLogout,\n logger,\n isAgentLoggedIn,\n handleContinue,\n showMultipleLoginAlert,\n });\n const props = Object.assign(Object.assign({}, result), { teams,\n loginOptions,\n deviceType });\n return react_1.default.createElement(station_login_presentational_1.default, Object.assign({}, props));\n};\nconst StationLogin = (0, mobx_react_lite_1.observer)(StationLoginComponent);\nexports.StationLogin = StationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/index.tsx?");
|
|
320
350
|
|
|
321
351
|
/***/ }),
|
|
322
352
|
|
|
@@ -326,7 +356,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
326
356
|
\************************************************************/
|
|
327
357
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
328
358
|
|
|
329
|
-
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst react_1 = __importStar(__webpack_require__(/*! react */ \"react\"));\n__webpack_require__(/*! ./station-login.style.scss */ \"./src/station-login/station-login.style.scss\");\nconst StationLoginPresentational = (props) => {\n const { name, teams, loginOptions, login, logout, relogin, setDeviceType, setDialNumber, setTeam, isAgentLoggedIn, deviceType } = props; // TODO: Use the
|
|
359
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst react_1 = __importStar(__webpack_require__(/*! react */ \"react\"));\n__webpack_require__(/*! ./station-login.style.scss */ \"./src/station-login/station-login.style.scss\");\nconst constants_1 = __webpack_require__(/*! ./constants */ \"./src/station-login/constants.ts\");\n__webpack_require__(/*! ./alert-modal.scss */ \"./src/station-login/alert-modal.scss\");\nconst StationLoginPresentational = (props) => {\n const { name, teams, loginOptions, login, logout, relogin, setDeviceType, setDialNumber, setTeam, isAgentLoggedIn, deviceType, showMultipleLoginAlert, handleContinue } = props; // TODO: Use the loginSuccess, loginFailure, logoutSuccess props returned fromthe API response via helper file to reflect UI changes\n const modalRef = (0, react_1.useRef)(null);\n (0, react_1.useEffect)(() => {\n const teamsDropdown = document.getElementById('teamsDropdown');\n const agentLogin = document.querySelector('#LoginOption');\n const dialNumber = document.querySelector('#dialNumber');\n if (teamsDropdown) {\n teamsDropdown.innerHTML = '';\n if (teams) {\n teams.forEach((team) => {\n const option = document.createElement('option');\n option.value = team.id;\n option.text = team.name;\n teamsDropdown.add(option);\n });\n setTeam(teamsDropdown.value);\n dialNumber.value = '';\n dialNumber.disabled = true;\n }\n }\n if (loginOptions.length > 0) {\n loginOptions.forEach((options) => {\n const option = document.createElement('option');\n option.text = options;\n option.value = options;\n agentLogin.add(option);\n });\n }\n }, [teams, loginOptions]);\n (0, react_1.useEffect)(() => {\n const modal = modalRef.current;\n if (showMultipleLoginAlert && modal) {\n modal.showModal();\n }\n }, [showMultipleLoginAlert, modalRef]);\n (0, react_1.useEffect)(() => {\n if (!isAgentLoggedIn)\n return;\n const agentLogin = document.querySelector('#LoginOption');\n if (agentLogin && !agentLogin.value) {\n setDeviceType(deviceType);\n agentLogin.value = deviceType;\n relogin();\n }\n }, [isAgentLoggedIn]);\n const selectLoginOption = (event) => {\n const dialNumber = document.querySelector('#dialNumber');\n const deviceType = event.target.value;\n setDeviceType(deviceType);\n if (deviceType === 'AGENT_DN' || deviceType === 'EXTENSION') {\n dialNumber.disabled = false;\n }\n else {\n dialNumber.disabled = true;\n }\n };\n const continueClicked = () => {\n const modal = modalRef.current;\n if (modal) {\n modal.close();\n handleContinue();\n }\n };\n function updateDN() {\n const dialNumber = document.querySelector('#dialNumber');\n setDialNumber(dialNumber.value);\n }\n return (react_1.default.createElement(\"div\", null,\n showMultipleLoginAlert && (react_1.default.createElement(\"dialog\", { ref: modalRef, className: \"modal\" },\n react_1.default.createElement(\"h2\", null, constants_1.MULTIPLE_SIGN_IN_ALERT_TITLE),\n react_1.default.createElement(\"p\", null, constants_1.MULTIPLE_SIGN_IN_ALERT_MESSAGE),\n react_1.default.createElement(\"div\", { className: 'modal-content' },\n react_1.default.createElement(\"button\", { id: \"ContinueButton\", \"data-testid\": \"ContinueButton\", onClick: continueClicked }, \"Continue\")))),\n react_1.default.createElement(\"h1\", { \"data-testid\": \"station-login-heading\" }, name),\n react_1.default.createElement(\"div\", { className: \"box\" },\n react_1.default.createElement(\"section\", { className: \"section-box\" },\n react_1.default.createElement(\"fieldset\", { className: \"fieldset\" },\n react_1.default.createElement(\"legend\", { className: \"legend-box\" }, \"Agent\"),\n react_1.default.createElement(\"div\", { style: { display: 'flex', flexDirection: 'column', flexGrow: 1 } },\n react_1.default.createElement(\"div\", { style: { display: 'flex', gap: '1rem' } },\n react_1.default.createElement(\"fieldset\", { style: {\n border: '1px solid #ccc',\n borderRadius: '5px',\n padding: '10px',\n marginBottom: '20px',\n flex: 0.69,\n } },\n react_1.default.createElement(\"legend\", { className: \"legend-box\" }, \"Select Team\"),\n react_1.default.createElement(\"select\", { id: \"teamsDropdown\", className: \"select\" }, \"Teams\")),\n react_1.default.createElement(\"fieldset\", { className: \"fieldset\" },\n react_1.default.createElement(\"legend\", { className: \"legend-box\" }, \"Agent Login\"),\n react_1.default.createElement(\"select\", { name: \"LoginOption\", id: \"LoginOption\", className: \"select\", onChange: selectLoginOption },\n react_1.default.createElement(\"option\", { value: \"\", hidden: true }, \"Choose Agent Login Option...\")),\n react_1.default.createElement(\"input\", { className: \"input\", id: \"dialNumber\", name: \"dialNumber\", placeholder: \"Extension/Dial Number\", type: \"text\", onInput: updateDN }),\n react_1.default.createElement(\"button\", { id: \"AgentLogin\", className: \"btn\", onClick: login }, \"Login\"),\n react_1.default.createElement(\"button\", { id: \"logoutAgent\", className: \"btn\", onClick: logout }, \"Logout\")))))))));\n};\nexports[\"default\"] = StationLoginPresentational;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/station-login.presentational.tsx?");
|
|
330
360
|
|
|
331
361
|
/***/ }),
|
|
332
362
|
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -10,5 +10,7 @@ export declare const useStationLogin: (props: UseStationLoginProps) => {
|
|
|
10
10
|
loginSuccess: StationLoginSuccess;
|
|
11
11
|
loginFailure: Error;
|
|
12
12
|
logoutSuccess: StationLogoutSuccess;
|
|
13
|
+
showMultipleLoginAlert: boolean;
|
|
13
14
|
isAgentLoggedIn: boolean;
|
|
15
|
+
handleContinue: () => Promise<void>;
|
|
14
16
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const MULTIPLE_SIGN_IN_ALERT_MESSAGE = "You are signed in to the Desktop in multiple application instances. Click Continue to proceed with the Desktop in this application instance. Else, close this window.";
|
|
2
|
+
export declare const MULTIPLE_SIGN_IN_ALERT_TITLE = "Multiple Sign In Alert";
|
|
3
|
+
export declare const AGENT_MULTI_LOGIN = "agent:multiLogin";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StationLoginPresentationalProps } from './station-login.types';
|
|
3
3
|
import './station-login.style.scss';
|
|
4
|
+
import './alert-modal.scss';
|
|
4
5
|
declare const StationLoginPresentational: React.FunctionComponent<StationLoginPresentationalProps>;
|
|
5
6
|
export default StationLoginPresentational;
|
|
@@ -76,7 +76,17 @@ export interface IStationLoginProps {
|
|
|
76
76
|
* Handler to relogin the agent
|
|
77
77
|
*/
|
|
78
78
|
relogin: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Handler to relogin the agent when the agent is already logged in
|
|
81
|
+
*/
|
|
82
|
+
handleContinue: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Flag to indicate if the alert should be shown
|
|
85
|
+
*/
|
|
86
|
+
showMultipleLoginAlert: boolean;
|
|
79
87
|
}
|
|
80
|
-
export type StationLoginPresentationalProps = Pick<IStationLoginProps, 'name' | 'teams' | 'loginOptions' | 'login' | 'logout' | 'relogin' | 'loginSuccess' | 'loginFailure' | 'logoutSuccess' | 'setDeviceType' | 'setDialNumber' | 'setTeam' | 'isAgentLoggedIn' | 'deviceType'
|
|
81
|
-
|
|
88
|
+
export type StationLoginPresentationalProps = Pick<IStationLoginProps, 'name' | 'teams' | 'loginOptions' | 'login' | 'logout' | 'relogin' | 'loginSuccess' | 'loginFailure' | 'logoutSuccess' | 'setDeviceType' | 'setDialNumber' | 'setTeam' | 'isAgentLoggedIn' | 'handleContinue' | 'deviceType'> & {
|
|
89
|
+
showMultipleLoginAlert: boolean;
|
|
90
|
+
};
|
|
91
|
+
export type UseStationLoginProps = Pick<IStationLoginProps, 'cc' | 'onLogin' | 'onLogout' | 'logger' | 'isAgentLoggedIn' | 'handleContinue' | 'showMultipleLoginAlert'>;
|
|
82
92
|
export type StationLoginProps = Pick<IStationLoginProps, 'onLogin' | 'onLogout'>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/cc-station-login",
|
|
3
3
|
"description": "Webex Contact Center Widgets: Station Login",
|
|
4
|
-
"version": "1.28.0-ccwidgets.
|
|
4
|
+
"version": "1.28.0-ccwidgets.15",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test:unit": "jest"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@webex/cc-store": "1.28.0-ccwidgets.
|
|
22
|
+
"@webex/cc-store": "1.28.0-ccwidgets.15",
|
|
23
23
|
"mobx-react-lite": "^4.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"^.+\\.(css|less|scss)$": "babel-jest"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
"stableVersion": "1.28.0-ccwidgets.
|
|
61
|
+
"stableVersion": "1.28.0-ccwidgets.14"
|
|
62
62
|
}
|