@webex/cc-station-login 1.28.0-ccwidgets.7 → 1.28.0-ccwidgets.71
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 +3892 -6
- package/dist/index.js.LICENSE.txt +11 -0
- package/dist/types/helper.d.ts +7 -2
- package/dist/types/station-login/station-login.types.d.ts +3 -65
- package/package.json +27 -16
- package/dist/helper.js +0 -58
- package/dist/helper.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/station-login/index.js +0 -20
- package/dist/station-login/index.js.map +0 -1
- package/dist/station-login/station-login.presentational.js +0 -142
- package/dist/station-login/station-login.presentational.js.map +0 -1
- package/dist/station-login/station-login.types.js +0 -3
- package/dist/station-login/station-login.types.js.map +0 -1
- package/dist/types/station-login/station-login.presentational.d.ts +0 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* use-sync-external-store-shim.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { UseStationLoginProps } from './station-login/station-login.types';
|
|
2
2
|
export declare const useStationLogin: (props: UseStationLoginProps) => {
|
|
3
3
|
name: string;
|
|
4
|
-
setDeviceType: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
5
|
-
setDialNumber: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
6
4
|
setTeam: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
7
5
|
login: () => void;
|
|
8
6
|
logout: () => void;
|
|
9
7
|
loginSuccess: StationLoginSuccess;
|
|
10
8
|
loginFailure: Error;
|
|
11
9
|
logoutSuccess: StationLogoutSuccess;
|
|
10
|
+
handleContinue: () => Promise<void>;
|
|
11
|
+
originalLoginOptions: LoginOptionsState;
|
|
12
|
+
currentLoginOptions: LoginOptionsState;
|
|
13
|
+
setCurrentLoginOptions: import("react").Dispatch<any>;
|
|
14
|
+
isLoginOptionsChanged: boolean;
|
|
15
|
+
saveLoginOptions: () => void;
|
|
16
|
+
saveError: string;
|
|
12
17
|
};
|
|
@@ -1,65 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export interface IStationLoginProps {
|
|
6
|
-
/**
|
|
7
|
-
* The name of the station.
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* Webex instance.
|
|
12
|
-
*/
|
|
13
|
-
cc: IContactCenter;
|
|
14
|
-
/**
|
|
15
|
-
* Array of the team IDs that agent belongs to
|
|
16
|
-
*/
|
|
17
|
-
teams: Team[];
|
|
18
|
-
/**
|
|
19
|
-
* Station login options available for the agent
|
|
20
|
-
*/
|
|
21
|
-
loginOptions: string[];
|
|
22
|
-
/**
|
|
23
|
-
* Handler to initiate the agent login
|
|
24
|
-
*/
|
|
25
|
-
login: () => void;
|
|
26
|
-
/**
|
|
27
|
-
* Handler for agent logout
|
|
28
|
-
*/
|
|
29
|
-
logout: () => void;
|
|
30
|
-
/**
|
|
31
|
-
* Response data received on agent login success
|
|
32
|
-
*/
|
|
33
|
-
loginSuccess?: StationLoginSuccess;
|
|
34
|
-
/**
|
|
35
|
-
* Error received on agent login failure
|
|
36
|
-
*/
|
|
37
|
-
loginFailure?: Error;
|
|
38
|
-
/**
|
|
39
|
-
* Response data received on agent login success
|
|
40
|
-
*/
|
|
41
|
-
logoutSuccess?: StationLogoutSuccess;
|
|
42
|
-
/**
|
|
43
|
-
* Callback function to be invoked once the agent login is successful
|
|
44
|
-
*/
|
|
45
|
-
onLogin?: () => void;
|
|
46
|
-
/**
|
|
47
|
-
* Callback function to be invoked once the agent login is successful
|
|
48
|
-
*/
|
|
49
|
-
onLogout?: () => void;
|
|
50
|
-
/**
|
|
51
|
-
* Handler to set device type
|
|
52
|
-
*/
|
|
53
|
-
setDeviceType: (deviceType: string) => void;
|
|
54
|
-
/**
|
|
55
|
-
* Handler to set the entered dial number
|
|
56
|
-
*/
|
|
57
|
-
setDialNumber: (dn: string) => void;
|
|
58
|
-
/**
|
|
59
|
-
* Handler to set the selected agent team
|
|
60
|
-
*/
|
|
61
|
-
setTeam: (team: string) => void;
|
|
62
|
-
}
|
|
63
|
-
export type StationLoginPresentationalProps = Pick<IStationLoginProps, 'name' | 'teams' | 'loginOptions' | 'login' | 'logout' | 'loginSuccess' | 'loginFailure' | 'logoutSuccess' | 'setDeviceType' | 'setDialNumber' | 'setTeam'>;
|
|
64
|
-
export type UseStationLoginProps = Pick<IStationLoginProps, 'cc' | 'onLogin' | 'onLogout'>;
|
|
65
|
-
export type StationLoginProps = Pick<IStationLoginProps, 'onLogin' | 'onLogout'>;
|
|
1
|
+
import { IStationLoginProps } from '@webex/cc-components';
|
|
2
|
+
export type UseStationLoginProps = Pick<IStationLoginProps, 'cc' | 'onLogin' | 'onLogout' | 'logger' | 'deviceType' | 'dialNumber' | 'onSaveStart' | 'onSaveEnd' | 'teamId'>;
|
|
3
|
+
export type StationLoginProps = Pick<IStationLoginProps, 'onLogin' | 'onLogout' | 'onCCSignOut' | 'profileMode' | 'onSaveStart' | 'onSaveEnd'>;
|
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.71",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -11,45 +11,56 @@
|
|
|
11
11
|
"package.json"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
+
"clean": "rm -rf dist && rm -rf node_modules",
|
|
15
|
+
"clean:dist": "rm -rf dist",
|
|
14
16
|
"build": "yarn run -T tsc",
|
|
15
|
-
"build:src": "
|
|
17
|
+
"build:src": "yarn run clean:dist && webpack",
|
|
16
18
|
"build:watch": "webpack --watch",
|
|
17
|
-
"test:unit": "jest"
|
|
19
|
+
"test:unit": "jest --coverage",
|
|
20
|
+
"test:styles": "eslint"
|
|
18
21
|
},
|
|
19
22
|
"dependencies": {
|
|
20
|
-
"@webex/cc-
|
|
21
|
-
"
|
|
22
|
-
"react": "
|
|
23
|
-
"react-dom": "18.3.1"
|
|
23
|
+
"@webex/cc-components": "1.28.0-ccwidgets.71",
|
|
24
|
+
"@webex/cc-store": "1.28.0-ccwidgets.71",
|
|
25
|
+
"mobx-react-lite": "^4.1.0"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
28
|
"@babel/core": "7.25.2",
|
|
27
29
|
"@babel/preset-env": "7.25.4",
|
|
28
30
|
"@babel/preset-react": "7.24.7",
|
|
29
31
|
"@babel/preset-typescript": "7.25.9",
|
|
32
|
+
"@eslint/js": "^9.20.0",
|
|
30
33
|
"@testing-library/dom": "10.4.0",
|
|
31
34
|
"@testing-library/jest-dom": "6.6.2",
|
|
32
35
|
"@testing-library/react": "16.0.1",
|
|
33
36
|
"@types/jest": "29.5.14",
|
|
37
|
+
"@types/node": "^22.13.13",
|
|
34
38
|
"@types/react-test-renderer": "18",
|
|
35
39
|
"babel-jest": "29.7.0",
|
|
36
40
|
"babel-loader": "9.2.1",
|
|
41
|
+
"eslint": "^9.20.1",
|
|
42
|
+
"eslint-config-prettier": "^10.0.1",
|
|
43
|
+
"eslint-config-standard": "^17.1.0",
|
|
44
|
+
"eslint-plugin-import": "^2.25.2",
|
|
45
|
+
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
|
|
46
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
47
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
48
|
+
"eslint-plugin-react": "^7.37.4",
|
|
37
49
|
"file-loader": "6.2.0",
|
|
50
|
+
"globals": "^16.0.0",
|
|
38
51
|
"jest": "29.7.0",
|
|
39
52
|
"jest-environment-jsdom": "29.7.0",
|
|
53
|
+
"prettier": "^3.5.1",
|
|
40
54
|
"ts-loader": "9.5.1",
|
|
41
55
|
"typescript": "5.6.3",
|
|
56
|
+
"typescript-eslint": "^8.24.1",
|
|
42
57
|
"webpack": "5.94.0",
|
|
43
58
|
"webpack-cli": "5.1.4",
|
|
44
59
|
"webpack-merge": "6.0.1"
|
|
45
60
|
},
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
],
|
|
52
|
-
"verbose": true
|
|
53
|
-
},
|
|
54
|
-
"stableVersion": "1.28.0-ccwidgets.6"
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"@momentum-ui/react-collaboration": ">=26.201.9",
|
|
63
|
+
"react": ">=18.3.1",
|
|
64
|
+
"react-dom": ">=18.3.1"
|
|
65
|
+
}
|
|
55
66
|
}
|
package/dist/helper.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useStationLogin = void 0;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const cc_store_1 = __importDefault(require("@webex/cc-store")); // we need to import as we are losing the context of this in store
|
|
9
|
-
const useStationLogin = (props) => {
|
|
10
|
-
const cc = props.cc;
|
|
11
|
-
const loginCb = props.onLogin;
|
|
12
|
-
const logoutCb = props.onLogout;
|
|
13
|
-
const [dialNumber, setDialNumber] = (0, react_1.useState)('');
|
|
14
|
-
const [deviceType, setDeviceType] = (0, react_1.useState)('');
|
|
15
|
-
const [team, setTeam] = (0, react_1.useState)('');
|
|
16
|
-
const [loginSuccess, setLoginSuccess] = (0, react_1.useState)();
|
|
17
|
-
const [loginFailure, setLoginFailure] = (0, react_1.useState)();
|
|
18
|
-
const [logoutSuccess, setLogoutSuccess] = (0, react_1.useState)();
|
|
19
|
-
const login = () => {
|
|
20
|
-
cc.stationLogin({ teamId: team, loginOption: deviceType, dialNumber: dialNumber })
|
|
21
|
-
.then((res) => {
|
|
22
|
-
setLoginSuccess(res);
|
|
23
|
-
cc_store_1.default.setSelectedLoginOption(deviceType);
|
|
24
|
-
if (loginCb) {
|
|
25
|
-
loginCb();
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
.catch((error) => {
|
|
29
|
-
console.error(error);
|
|
30
|
-
setLoginFailure(error);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
const logout = () => {
|
|
34
|
-
cc.stationLogout({ logoutReason: 'User requested logout' })
|
|
35
|
-
.then((res) => {
|
|
36
|
-
setLogoutSuccess(res);
|
|
37
|
-
if (logoutCb) {
|
|
38
|
-
logoutCb();
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
.catch((error) => {
|
|
42
|
-
console.error(error);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
return {
|
|
46
|
-
name: 'StationLogin',
|
|
47
|
-
setDeviceType,
|
|
48
|
-
setDialNumber,
|
|
49
|
-
setTeam,
|
|
50
|
-
login,
|
|
51
|
-
logout,
|
|
52
|
-
loginSuccess,
|
|
53
|
-
loginFailure,
|
|
54
|
-
logoutSuccess,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
exports.useStationLogin = useStationLogin;
|
|
58
|
-
//# sourceMappingURL=helper.js.map
|
package/dist/helper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mapp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AAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,EAAE,CAAC,aAAa,CAAC,EAAC,YAAY,EAAE,uBAAuB,EAAC,CAAC;aACtD,IAAI,CAAC,CAAC,GAAyB,EAAE,EAAE;YAClC,gBAAgB,CAAC,GAAG,CAAC,CAAC;YACtB,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,EAAE,CAAC;YACb,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,aAAa;QACb,aAAa;QACb,OAAO;QACP,KAAK;QACL,MAAM;QACN,YAAY;QACZ,YAAY;QACZ,aAAa;KACd,CAAC;AACJ,CAAC,CAAC;AAlDW,QAAA,eAAe,mBAkD1B"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAErC,6FAFA,4BAAY,OAEA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StationLogin = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const cc_store_1 = __importDefault(require("@webex/cc-store"));
|
|
9
|
-
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const station_login_presentational_1 = __importDefault(require("./station-login.presentational"));
|
|
11
|
-
const helper_1 = require("../helper");
|
|
12
|
-
const StationLogin = (0, mobx_react_1.observer)(({ onLogin, onLogout }) => {
|
|
13
|
-
const { cc, teams, loginOptions } = cc_store_1.default;
|
|
14
|
-
const result = (0, helper_1.useStationLogin)({ cc, onLogin, onLogout });
|
|
15
|
-
const props = Object.assign(Object.assign({}, result), { teams,
|
|
16
|
-
loginOptions });
|
|
17
|
-
return react_1.default.createElement(station_login_presentational_1.default, Object.assign({}, props));
|
|
18
|
-
});
|
|
19
|
-
exports.StationLogin = StationLogin;
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/station-login/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+DAAoC;AACpC,2CAAoC;AAEpC,kGAAwE;AACxE,sCAA0C;AAG1C,MAAM,YAAY,GAA+C,IAAA,qBAAQ,EAAC,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;IAChG,MAAM,EAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAC,GAAG,kBAAK,CAAC;IACxC,MAAM,MAAM,GAAG,IAAA,wBAAe,EAAC,EAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAC,CAAC,CAAC;IAExD,MAAM,KAAK,mCACN,MAAM,KACT,KAAK;QACL,YAAY,GACb,CAAC;IACF,OAAO,8BAAC,sCAA0B,oBAAK,KAAK,EAAI,CAAC;AACnD,CAAC,CAAC,CAAC;AAEK,oCAAY"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const react_1 = __importStar(require("react"));
|
|
27
|
-
const StationLoginPresentational = (props) => {
|
|
28
|
-
const { name, teams, loginOptions, login, logout, setDeviceType, setDialNumber, setTeam } = props; // TODO: Use the loginSuccess, loginFailure, logoutSuccess props returned fromthe API response via helper file to reflect UI changes
|
|
29
|
-
(0, react_1.useEffect)(() => {
|
|
30
|
-
const teamsDropdown = document.getElementById('teamsDropdown');
|
|
31
|
-
const agentLogin = document.querySelector('#LoginOption');
|
|
32
|
-
const dialNumber = document.querySelector('#dialNumber');
|
|
33
|
-
if (teamsDropdown) {
|
|
34
|
-
teamsDropdown.innerHTML = '';
|
|
35
|
-
if (teams) {
|
|
36
|
-
teams.forEach((team) => {
|
|
37
|
-
const option = document.createElement('option');
|
|
38
|
-
option.value = team.id;
|
|
39
|
-
option.text = team.name;
|
|
40
|
-
teamsDropdown.add(option);
|
|
41
|
-
});
|
|
42
|
-
setTeam(teamsDropdown.value);
|
|
43
|
-
dialNumber.value = '';
|
|
44
|
-
dialNumber.disabled = true;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (loginOptions.length > 0) {
|
|
48
|
-
loginOptions.forEach((options) => {
|
|
49
|
-
const option = document.createElement('option');
|
|
50
|
-
option.text = options;
|
|
51
|
-
option.value = options;
|
|
52
|
-
agentLogin.add(option);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}, [teams, loginOptions]);
|
|
56
|
-
const selectLoginOption = (event) => {
|
|
57
|
-
const dialNumber = document.querySelector('#dialNumber');
|
|
58
|
-
const deviceType = event.target.value;
|
|
59
|
-
setDeviceType(deviceType);
|
|
60
|
-
if (deviceType === 'AGENT_DN' || deviceType === 'EXTENSION') {
|
|
61
|
-
dialNumber.disabled = false;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
dialNumber.disabled = true;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
function updateDN() {
|
|
68
|
-
const dialNumber = document.querySelector('#dialNumber');
|
|
69
|
-
setDialNumber(dialNumber.value);
|
|
70
|
-
}
|
|
71
|
-
const styles = {
|
|
72
|
-
box: {
|
|
73
|
-
backgroundColor: '#ffffff',
|
|
74
|
-
borderRadius: '8px',
|
|
75
|
-
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
|
|
76
|
-
padding: '20px',
|
|
77
|
-
maxWidth: '800px',
|
|
78
|
-
margin: '0 auto'
|
|
79
|
-
},
|
|
80
|
-
sectionBox: {
|
|
81
|
-
padding: '10px',
|
|
82
|
-
border: '1px solid #ddd',
|
|
83
|
-
borderRadius: '8px'
|
|
84
|
-
},
|
|
85
|
-
fieldset: {
|
|
86
|
-
border: '1px solid #ccc',
|
|
87
|
-
borderRadius: '5px',
|
|
88
|
-
padding: '10px',
|
|
89
|
-
marginBottom: '20px'
|
|
90
|
-
},
|
|
91
|
-
legendBox: {
|
|
92
|
-
fontWeight: 'bold',
|
|
93
|
-
color: '#0052bf'
|
|
94
|
-
},
|
|
95
|
-
btn: {
|
|
96
|
-
padding: '10px 20px',
|
|
97
|
-
backgroundColor: '#0052bf',
|
|
98
|
-
color: 'white',
|
|
99
|
-
border: 'none',
|
|
100
|
-
borderRadius: '4px',
|
|
101
|
-
cursor: 'pointer',
|
|
102
|
-
transition: 'background-color 0.3s',
|
|
103
|
-
marginRight: '8px'
|
|
104
|
-
},
|
|
105
|
-
select: {
|
|
106
|
-
width: '100%',
|
|
107
|
-
padding: '8px',
|
|
108
|
-
marginTop: '8px',
|
|
109
|
-
marginBottom: '12px',
|
|
110
|
-
border: '1px solid #ccc',
|
|
111
|
-
borderRadius: '4px'
|
|
112
|
-
},
|
|
113
|
-
input: {
|
|
114
|
-
width: '97%',
|
|
115
|
-
padding: '8px',
|
|
116
|
-
marginTop: '8px',
|
|
117
|
-
marginBottom: '12px',
|
|
118
|
-
border: '1px solid #ccc',
|
|
119
|
-
borderRadius: '4px'
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
123
|
-
react_1.default.createElement("h1", { "data-testid": "station-login-heading" }, name),
|
|
124
|
-
react_1.default.createElement("div", { style: styles.box },
|
|
125
|
-
react_1.default.createElement("section", { style: styles.sectionBox },
|
|
126
|
-
react_1.default.createElement("fieldset", { style: styles.fieldset },
|
|
127
|
-
react_1.default.createElement("legend", { style: styles.legendBox }, "Agent"),
|
|
128
|
-
react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column', flexGrow: 1 } },
|
|
129
|
-
react_1.default.createElement("div", { style: { display: 'flex', gap: '1rem' } },
|
|
130
|
-
react_1.default.createElement("fieldset", { style: { border: '1px solid #ccc', borderRadius: '5px', padding: '10px', marginBottom: '20px', flex: 0.69 } },
|
|
131
|
-
react_1.default.createElement("legend", { style: styles.legendBox }, "Select Team"),
|
|
132
|
-
react_1.default.createElement("select", { id: "teamsDropdown", style: styles.select }, "Teams")),
|
|
133
|
-
react_1.default.createElement("fieldset", { style: styles.fieldset },
|
|
134
|
-
react_1.default.createElement("legend", { style: styles.legendBox }, "Agent Login"),
|
|
135
|
-
react_1.default.createElement("select", { name: "LoginOption", id: "LoginOption", style: styles.select, onChange: selectLoginOption },
|
|
136
|
-
react_1.default.createElement("option", { value: "", selected: true, hidden: true }, "Choose Agent Login Option...")),
|
|
137
|
-
react_1.default.createElement("input", { style: styles.input, id: "dialNumber", name: "dialNumber", placeholder: "Extension/Dial Number", type: "text", onInput: updateDN }),
|
|
138
|
-
react_1.default.createElement("button", { id: "AgentLogin", style: styles.btn, onClick: login }, "Login"),
|
|
139
|
-
react_1.default.createElement("button", { id: "logoutAgent", style: styles.btn, onClick: logout }, "Logout")))))))));
|
|
140
|
-
};
|
|
141
|
-
exports.default = StationLoginPresentational;
|
|
142
|
-
//# sourceMappingURL=station-login.presentational.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"station-login.presentational.js","sourceRoot":"","sources":["../../src/station-login/station-login.presentational.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuC;AAGvC,MAAM,0BAA0B,GAA6D,CAAC,KAAK,EAAE,EAAE;IACrG,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC,CAAC,qIAAqI;IAEtO,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAsB,CAAC;QACpF,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAsB,CAAC;QAC/E,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAqB,CAAC;QAC7E,IAAI,aAAa,EAAE,CAAC;YAClB,aAAa,CAAC,SAAS,GAAG,EAAE,CAAC;YAC7B,IAAI,KAAK,EAAE,CAAC;gBACV,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrB,MAAM,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