@tap-payments/auth-jsconnect 2.10.2-development → 2.10.3-development
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/build/assets/locales/ar.json +29 -1
- package/build/assets/locales/en.json +5 -4
- package/build/constants/app.js +12 -6
- package/build/constants/flows.d.ts +2 -1
- package/build/constants/flows.js +3 -2
- package/build/features/app/terminal/terminalStore.js +5 -2
- package/build/features/featuresScreens.js +6 -1
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +1 -1
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +1 -1
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +38 -23
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +0 -12
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +1 -44
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +41 -0
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +2 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +0 -18
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +3 -71
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/{UnlinkedTerminalInfo → shared}/TerminalList.d.ts +3 -1
- package/build/features/terminal/screens/shared/TerminalList.js +25 -0
- package/build/features/terminal/screens/shared/index.d.ts +3 -0
- package/build/features/terminal/screens/shared/index.js +3 -0
- package/build/features/terminal/screens/shared/styles.d.ts +33 -0
- package/build/features/terminal/screens/shared/styles.js +105 -0
- package/build/utils/string.js +1 -1
- package/package.json +1 -1
- package/build/features/terminal/screens/TerminalDeviceList/Header.d.ts +0 -6
- package/build/features/terminal/screens/TerminalDeviceList/Header.js +0 -23
- package/build/features/terminal/screens/UnlinkedTerminalInfo/TerminalList.js +0 -16
|
@@ -647,5 +647,33 @@
|
|
|
647
647
|
"passcode_title": "الرجاء إدخال رمز المرور الخاص بك",
|
|
648
648
|
"sign_in_with_otp": "تسجيل الدخول باستخدام رمز التحقق (OTP)",
|
|
649
649
|
"passcode_required": "الرجاء إدخال رمز المرور المطلوب",
|
|
650
|
-
"login_with_passcode": "تسجيل الدخول باستخدام رمز المرور"
|
|
650
|
+
"login_with_passcode": "تسجيل الدخول باستخدام رمز المرور",
|
|
651
|
+
"terminal_manage_terminals": "إدارة أجهزة نقاط الدفع",
|
|
652
|
+
"terminal_link_terminal": "ربط جهاز نقطة الدفع",
|
|
653
|
+
"terminal_linked": "تمَّ الربط",
|
|
654
|
+
"terminal_link": "ربط",
|
|
655
|
+
"terminal_unlinked": "غير مرتبط",
|
|
656
|
+
"terminal_paired_with": "مقترن بـ",
|
|
657
|
+
"terminal_device_id": "رقم تعريف جهاز الكاشير",
|
|
658
|
+
"terminal_serial_number": "الرقم التسلسلي",
|
|
659
|
+
"terminal_qr_code_description": "افتح تطبيق تاب على جهاز نقطة الدفع، ثم اختر جهاز نقطة الدفع المرتبط من قائمة المزيد.",
|
|
660
|
+
"terminal_or_use_code": "أو استخدم الرمز",
|
|
661
|
+
"terminal_unlink": "إلغاء الربط",
|
|
662
|
+
"terminal_linked_with": "مرتبط مع",
|
|
663
|
+
"terminal_send_link_request": "إرسال طلب الربط",
|
|
664
|
+
"terminal_request_will_send": "لتأكيد الربط سيتم إرسال طلب إلى تطبيق الـ Terminal من تاب.",
|
|
665
|
+
"terminal_new_request_will_send": "لتأكيد الربط تمَّ إرسال طلب ربط جديد إلى تطبيق الـ Terminal من تاب.",
|
|
666
|
+
"terminal_resend_request": "إعادة إرسال الطلب",
|
|
667
|
+
"terminal_with": "مع",
|
|
668
|
+
"terminal_request_denied": "The Request to link Terminal {{device}} has been denied.",
|
|
669
|
+
"terminal_go_to_board": "Go to Board",
|
|
670
|
+
"terminal_linked_success": "Your terminal {{device}} is linked successfully",
|
|
671
|
+
"terminal_unlinked_success": "Your terminal {{device}} is unlinked successfully",
|
|
672
|
+
"terminal_no_terminal_linked": "No Terminal Linked",
|
|
673
|
+
"terminal_no_terminal_linked_description": "We will list the linked terminals here when available",
|
|
674
|
+
"terminal_push_notification_link_new_terminal_failed": "Something went wrong. Please try again later",
|
|
675
|
+
"terminal_id": "Terminal ID",
|
|
676
|
+
"terminal_devices": "{{name}} Devices",
|
|
677
|
+
"terminal_flow_pending": "Terminals",
|
|
678
|
+
"terminal_select_device": "Select device"
|
|
651
679
|
}
|
|
@@ -671,6 +671,10 @@
|
|
|
671
671
|
"new_mobile_number": "New mobile number",
|
|
672
672
|
"update_mobile_number": "Update mobile number",
|
|
673
673
|
"update_later": "I'll update later",
|
|
674
|
+
"passcode_title": "Please enter your passcode",
|
|
675
|
+
"sign_in_with_otp": "Sign in with OTP",
|
|
676
|
+
"passcode_required": "Please enter the required Passcode",
|
|
677
|
+
"login_with_passcode": "Login with Passcode",
|
|
674
678
|
"terminal_manage_terminals": "Manage Terminals",
|
|
675
679
|
"terminal_link_terminal": "Link Terminal",
|
|
676
680
|
"terminal_linked": "Linked",
|
|
@@ -698,8 +702,5 @@
|
|
|
698
702
|
"terminal_id": "Terminal ID",
|
|
699
703
|
"terminal_devices": "{{name}} Devices",
|
|
700
704
|
"terminal_flow_pending": "Terminals",
|
|
701
|
-
"
|
|
702
|
-
"sign_in_with_otp": "Sign in with OTP",
|
|
703
|
-
"passcode_required": "Please enter the required Passcode",
|
|
704
|
-
"login_with_passcode": "Login with Passcode"
|
|
705
|
+
"terminal_select_device": "Select device"
|
|
705
706
|
}
|
package/build/constants/app.js
CHANGED
|
@@ -975,13 +975,13 @@ export var BRAND_SCREENS_NAVIGATION = [
|
|
|
975
975
|
export var TERMINAL_SCREENS_NAVIGATION = [
|
|
976
976
|
{
|
|
977
977
|
name: CONNECT_FLOWS.terminal.verify,
|
|
978
|
-
next: [CONNECT_FLOWS.terminal.
|
|
978
|
+
next: [CONNECT_FLOWS.terminal.terminalDeviceList, CONNECT_FLOWS.terminal.noTerminalLinked],
|
|
979
979
|
prev: CONNECT_FLOWS.terminal.board,
|
|
980
980
|
order: 1
|
|
981
981
|
},
|
|
982
982
|
{
|
|
983
983
|
name: CONNECT_FLOWS.terminal.loadingData,
|
|
984
|
-
next: CONNECT_FLOWS.terminal.
|
|
984
|
+
next: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
985
985
|
prev: '',
|
|
986
986
|
order: 1
|
|
987
987
|
},
|
|
@@ -998,11 +998,17 @@ export var TERMINAL_SCREENS_NAVIGATION = [
|
|
|
998
998
|
order: 2
|
|
999
999
|
},
|
|
1000
1000
|
{
|
|
1001
|
-
name: CONNECT_FLOWS.terminal.
|
|
1002
|
-
next: [CONNECT_FLOWS.terminal.
|
|
1001
|
+
name: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
1002
|
+
next: [CONNECT_FLOWS.terminal.terminalList, CONNECT_FLOWS.terminal.linkedTerminalInfo, CONNECT_FLOWS.terminal.unlinkedTerminalInfo],
|
|
1003
1003
|
prev: CONNECT_FLOWS.terminal.board,
|
|
1004
1004
|
order: 2
|
|
1005
1005
|
},
|
|
1006
|
+
{
|
|
1007
|
+
name: CONNECT_FLOWS.terminal.terminalList,
|
|
1008
|
+
next: CONNECT_FLOWS.terminal.terminalLinkNew,
|
|
1009
|
+
prev: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
1010
|
+
order: 3
|
|
1011
|
+
},
|
|
1006
1012
|
{
|
|
1007
1013
|
name: CONNECT_FLOWS.terminal.terminalLinkNew,
|
|
1008
1014
|
next: CONNECT_FLOWS.terminal.terminalLinkedSuccess,
|
|
@@ -1012,13 +1018,13 @@ export var TERMINAL_SCREENS_NAVIGATION = [
|
|
|
1012
1018
|
{
|
|
1013
1019
|
name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
|
|
1014
1020
|
next: CONNECT_FLOWS.terminal.terminalUnlinkedSuccess,
|
|
1015
|
-
prev: CONNECT_FLOWS.terminal.
|
|
1021
|
+
prev: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
1016
1022
|
order: 3
|
|
1017
1023
|
},
|
|
1018
1024
|
{
|
|
1019
1025
|
name: CONNECT_FLOWS.terminal.unlinkedTerminalInfo,
|
|
1020
1026
|
next: CONNECT_FLOWS.terminal.terminalLinkedSuccess,
|
|
1021
|
-
prev: CONNECT_FLOWS.terminal.
|
|
1027
|
+
prev: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
1022
1028
|
order: 3
|
|
1023
1029
|
},
|
|
1024
1030
|
{
|
|
@@ -28,7 +28,7 @@ export declare const CONNECT_FLOWS: {
|
|
|
28
28
|
operatorError: string;
|
|
29
29
|
verify: string;
|
|
30
30
|
noTerminalLinked: string;
|
|
31
|
-
|
|
31
|
+
terminalDeviceList: string;
|
|
32
32
|
terminalLinkNew: string;
|
|
33
33
|
linkedTerminalInfo: string;
|
|
34
34
|
unlinkedTerminalInfo: string;
|
|
@@ -36,5 +36,6 @@ export declare const CONNECT_FLOWS: {
|
|
|
36
36
|
terminalUnlinkedSuccess: string;
|
|
37
37
|
board: string;
|
|
38
38
|
resetPassword: string;
|
|
39
|
+
terminalList: string;
|
|
39
40
|
};
|
|
40
41
|
};
|
package/build/constants/flows.js
CHANGED
|
@@ -29,13 +29,14 @@ export var CONNECT_FLOWS = {
|
|
|
29
29
|
operatorError: 'TERMINAL_OPERATOR_ERROR_STEP',
|
|
30
30
|
verify: 'TERMINAL_VERIFY_OTP_STEP',
|
|
31
31
|
noTerminalLinked: 'TERMINAL_NO_TERMINAL_LINKED',
|
|
32
|
-
|
|
32
|
+
terminalDeviceList: 'TERMINAL_DEVICE_LIST_STEP',
|
|
33
33
|
terminalLinkNew: 'TERMINAL_LINK_NEW_STEP',
|
|
34
34
|
linkedTerminalInfo: 'TERMINAL_LINKED_INFO_STEP',
|
|
35
35
|
unlinkedTerminalInfo: 'TERMINAL_UNLINKED_INFO_STEP',
|
|
36
36
|
terminalLinkedSuccess: 'TERMINAL_LINKED_SUCCESS_STEP',
|
|
37
37
|
terminalUnlinkedSuccess: 'TERMINAL_UNLINKED_SUCCESS_STEP',
|
|
38
38
|
board: 'TERMINAL_BOARD_STEP',
|
|
39
|
-
resetPassword: 'TERMINAL_RESET_PASSWORD'
|
|
39
|
+
resetPassword: 'TERMINAL_RESET_PASSWORD',
|
|
40
|
+
terminalList: 'TERMINAL_LIST_STEP'
|
|
40
41
|
}
|
|
41
42
|
};
|
|
@@ -85,7 +85,7 @@ export var verifyToken = createAsyncThunk('terminal/verifyLeadToken', function (
|
|
|
85
85
|
return [4, API.terminalService.retrieveTerminalDeviceList([merchant_id])];
|
|
86
86
|
case 2:
|
|
87
87
|
terminalData = _d.sent();
|
|
88
|
-
nextScreen = ((_c = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _c === void 0 ? void 0 : _c.length) ? CONNECT_FLOWS.terminal.
|
|
88
|
+
nextScreen = ((_c = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _c === void 0 ? void 0 : _c.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
89
89
|
return [2, {
|
|
90
90
|
data: data,
|
|
91
91
|
token: token,
|
|
@@ -141,7 +141,7 @@ export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (par
|
|
|
141
141
|
return [4, API.terminalService.retrieveTerminalDeviceList([merchant_id])];
|
|
142
142
|
case 2:
|
|
143
143
|
terminalData = _h.sent();
|
|
144
|
-
nextScreen = ((_e = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _e === void 0 ? void 0 : _e.length) ? CONNECT_FLOWS.terminal.
|
|
144
|
+
nextScreen = ((_e = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _e === void 0 ? void 0 : _e.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
145
145
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, { otp: params.otp });
|
|
146
146
|
return [2, { data: data, terminalData: terminalData, formData: params, nextScreen: nextScreen }];
|
|
147
147
|
}
|
|
@@ -513,14 +513,17 @@ export var terminalSlice = createSlice({
|
|
|
513
513
|
state.error = action.error.message;
|
|
514
514
|
})
|
|
515
515
|
.addCase(linkNewTerminal.pending, function (state) {
|
|
516
|
+
state.loading = true;
|
|
516
517
|
state.error = null;
|
|
517
518
|
})
|
|
518
519
|
.addCase(linkNewTerminal.fulfilled, function (state, action) {
|
|
520
|
+
state.loading = false;
|
|
519
521
|
state.error = null;
|
|
520
522
|
var data = action.payload.data;
|
|
521
523
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { linkNewTerminalData: data });
|
|
522
524
|
})
|
|
523
525
|
.addCase(linkNewTerminal.rejected, function (state, action) {
|
|
526
|
+
state.loading = false;
|
|
524
527
|
state.error = action.error.message;
|
|
525
528
|
})
|
|
526
529
|
.addCase(retrieveTerminalList.fulfilled, function (state, action) {
|
|
@@ -146,6 +146,7 @@ import TerminalOperatorErrorPage from './terminal/screens/OperatorError';
|
|
|
146
146
|
import TerminalVerifyPage from './terminal/screens/Verify';
|
|
147
147
|
import NoTerminalDeviceLinkedPage from './terminal/screens/NoTerminalDeviceLinked';
|
|
148
148
|
import TerminalDeviceListPage from './terminal/screens/TerminalDeviceList';
|
|
149
|
+
import TerminalListPage from './terminal/screens/TerminalListPage';
|
|
149
150
|
import LinkNewTerminalPage from './terminal/screens/LinkNewTerminal';
|
|
150
151
|
import LinkedTerminalInfoPage from './terminal/screens/LinkedTerminalInfo';
|
|
151
152
|
import UnlinkedTerminalInfoPage from './terminal/screens/UnlinkedTerminalInfo';
|
|
@@ -735,13 +736,17 @@ export var terminalFeatureScreens = [
|
|
|
735
736
|
element: NoTerminalDeviceLinkedPage
|
|
736
737
|
},
|
|
737
738
|
{
|
|
738
|
-
name: CONNECT_FLOWS.terminal.
|
|
739
|
+
name: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
739
740
|
element: TerminalDeviceListPage
|
|
740
741
|
},
|
|
741
742
|
{
|
|
742
743
|
name: CONNECT_FLOWS.terminal.terminalLinkNew,
|
|
743
744
|
element: LinkNewTerminalPage
|
|
744
745
|
},
|
|
746
|
+
{
|
|
747
|
+
name: CONNECT_FLOWS.terminal.terminalList,
|
|
748
|
+
element: TerminalListPage
|
|
749
|
+
},
|
|
745
750
|
{
|
|
746
751
|
name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
|
|
747
752
|
element: LinkedTerminalInfoPage
|
|
@@ -31,7 +31,7 @@ var LinkNewTerminal = function () {
|
|
|
31
31
|
var _f = React.useState(false), success = _f[0], setSuccess = _f[1];
|
|
32
32
|
var _g = React.useState(false), failed = _g[0], setFailed = _g[1];
|
|
33
33
|
var terminalInfo = data.terminalInfo, responseData = data.responseData;
|
|
34
|
-
var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData;
|
|
34
|
+
var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData, terminalList = _h.terminalList;
|
|
35
35
|
var terminal_devices = (terminalData || {}).terminal_devices;
|
|
36
36
|
var qrCode = (_a = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.authentication) === null || _a === void 0 ? void 0 : _a.qr;
|
|
37
37
|
var code = (_b = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.authentication) === null || _b === void 0 ? void 0 : _b.code;
|
|
@@ -43,7 +43,7 @@ var LinkedTerminalInfo = function () {
|
|
|
43
43
|
.catch(function () { });
|
|
44
44
|
};
|
|
45
45
|
var handleOnBack = function () {
|
|
46
|
-
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.
|
|
46
|
+
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
|
|
47
47
|
};
|
|
48
48
|
return (_jsxs(ScreenContainer, __assign({ minHeight: 224, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(DeviceCard, { badge: true, image: image_url, name: display_name, deviceId: getId(selectedTerminalDevice), deviceIdLabel: getIdLabel(selectedTerminalDevice), pairedWith: getPairedWith(selectedTerminalDevice), isLinked: linked }), _jsx(LinkWithText, { children: t('terminal_linked_with') }), _jsx(DeviceCard, { sx: { minHeight: spacing(10), borderRadius: spacing(1), background: palette.components.deviceCard.deviceInfoBackground }, image: deviceImage || '', name: deviceName || '', deviceId: deviceId !== null && deviceId !== void 0 ? deviceId : '', isLinked: linked })] }), _jsx(Button, __assign({ sx: { ml: 0, mr: 0 }, loading: loading, onBackClicked: handleOnBack, onClick: handleOnNext, isAr: isAr }, { children: t('terminal_unlink') }))] })));
|
|
49
49
|
};
|
|
@@ -54,40 +54,39 @@ import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/sett
|
|
|
54
54
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
55
55
|
import Button from '../../../../components/Button';
|
|
56
56
|
import Loader from '../../../../components/Loader';
|
|
57
|
-
import {
|
|
58
|
-
import Header from '
|
|
57
|
+
import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalList, storeSelectedTerminalDevice, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
58
|
+
import { Header, Container, TextTypography } from '../shared';
|
|
59
59
|
import DeviceList from './DeviceList';
|
|
60
|
-
import { Container, TextTypography } from '../shared';
|
|
61
60
|
var TerminalDeviceList = function () {
|
|
62
61
|
var t = useTranslation().t;
|
|
63
62
|
var dispatch = useAppDispatch();
|
|
64
63
|
var _a = useAppSelector(terminalSelector), data = _a.data, loading = _a.loading, terminalListLoading = _a.terminalListLoading;
|
|
65
|
-
var _b =
|
|
64
|
+
var _b = React.useState(false), newLinkClicked = _b[0], setNewLinkClicked = _b[1];
|
|
65
|
+
var _c = data.responseData || {}, boardFlows = _c.boardFlows, authData = _c.authData, boardData = _c.boardData, terminalData = _c.terminalData, terminalList = _c.terminalList;
|
|
66
66
|
var terminal_devices = (terminalData || {}).terminal_devices;
|
|
67
|
-
var
|
|
67
|
+
var _d = React.useMemo(function () {
|
|
68
68
|
var linked = terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.filter(function (d) { return d.linked; });
|
|
69
69
|
var unLinked = terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.filter(function (d) { return !d.linked; });
|
|
70
70
|
return { linkedDevices: linked, unLinkedDevices: unLinked };
|
|
71
|
-
}, [terminal_devices]), linkedDevices =
|
|
72
|
-
var handleOnClickNewTerminalLink = function () {
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
var
|
|
71
|
+
}, [terminal_devices]), linkedDevices = _d.linkedDevices, unLinkedDevices = _d.unLinkedDevices;
|
|
72
|
+
var handleOnClickNewTerminalLink = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
setNewLinkClicked(true);
|
|
77
|
+
return [4, retrieveTerminalListAsync()];
|
|
78
|
+
case 1:
|
|
79
|
+
_a.sent();
|
|
80
|
+
dispatch(handleNextScreenStep(CONNECT_FLOWS.terminal.terminalList));
|
|
81
|
+
return [2];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}); };
|
|
85
|
+
var retrieveTerminalListAsync = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
86
|
var err_1;
|
|
87
87
|
return __generator(this, function (_a) {
|
|
88
88
|
switch (_a.label) {
|
|
89
89
|
case 0:
|
|
90
|
-
dispatch(storeSelectedTerminalDevice(terminal));
|
|
91
90
|
if (!!(terminalList === null || terminalList === void 0 ? void 0 : terminalList.length)) return [3, 4];
|
|
92
91
|
_a.label = 1;
|
|
93
92
|
case 1:
|
|
@@ -100,7 +99,23 @@ var TerminalDeviceList = function () {
|
|
|
100
99
|
err_1 = _a.sent();
|
|
101
100
|
console.log('Error while retrieving terminal list error', err_1);
|
|
102
101
|
return [3, 4];
|
|
103
|
-
case 4:
|
|
102
|
+
case 4: return [2];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); };
|
|
106
|
+
var handleOnClickLinkedTerminal = function (terminal) {
|
|
107
|
+
dispatch(storeSelectedTerminalDevice(terminal));
|
|
108
|
+
dispatch(handleNextScreenStep(CONNECT_FLOWS.terminal.linkedTerminalInfo));
|
|
109
|
+
};
|
|
110
|
+
var handleOnClickUnlinkedTerminal = function (terminal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
setNewLinkClicked(false);
|
|
115
|
+
dispatch(storeSelectedTerminalDevice(terminal));
|
|
116
|
+
return [4, retrieveTerminalListAsync()];
|
|
117
|
+
case 1:
|
|
118
|
+
_a.sent();
|
|
104
119
|
dispatch(handleNextScreenStep(CONNECT_FLOWS.terminal.unlinkedTerminalInfo));
|
|
105
120
|
return [2];
|
|
106
121
|
}
|
|
@@ -124,6 +139,6 @@ var TerminalDeviceList = function () {
|
|
|
124
139
|
})
|
|
125
140
|
.catch(function () { });
|
|
126
141
|
};
|
|
127
|
-
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(Header, { onLinkClick: handleOnClickNewTerminalLink }), _jsx(DeviceList, { devices: linkedDevices, onClick: handleOnClickLinkedTerminal }), !!(unLinkedDevices === null || unLinkedDevices === void 0 ? void 0 : unLinkedDevices.length) && _jsx(TextTypography, __assign({ sx: { pt: 1, pb: 1 } }, { children: t('terminal_unlinked') })), _jsx(DeviceList, { loading: terminalListLoading, devices: unLinkedDevices, onClick: handleOnClickUnlinkedTerminal })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: loading ? _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 15, toggleAnimation: !!loading }) : t('back') }))] })));
|
|
142
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(Header, { onLinkClick: handleOnClickNewTerminalLink, loading: terminalListLoading && newLinkClicked }), _jsx(DeviceList, { devices: linkedDevices, onClick: handleOnClickLinkedTerminal }), !!(unLinkedDevices === null || unLinkedDevices === void 0 ? void 0 : unLinkedDevices.length) && _jsx(TextTypography, __assign({ sx: { pt: 1, pb: 1 } }, { children: t('terminal_unlinked') })), _jsx(DeviceList, { loading: terminalListLoading && !newLinkClicked, devices: unLinkedDevices, onClick: handleOnClickUnlinkedTerminal })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: loading ? _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 15, toggleAnimation: !!loading }) : t('back') }))] })));
|
|
128
143
|
};
|
|
129
144
|
export default React.memo(TerminalDeviceList);
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
-
export declare const LinkButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
7
|
-
}, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "action" | "size" | "disabled" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
-
export declare const AddIconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
10
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
11
|
-
export declare const LinkText: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
12
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
13
|
-
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
14
2
|
export declare const DeviceListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
3
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
4
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import Button from '@mui/material/Button';
|
|
13
1
|
import Box from '@mui/material/Box';
|
|
14
|
-
import {
|
|
15
|
-
import Typography from '@mui/material/Typography';
|
|
16
|
-
export var Container = styled(Box)(function (_a) {
|
|
17
|
-
var spacing = _a.theme.spacing;
|
|
18
|
-
return ({
|
|
19
|
-
display: 'flex',
|
|
20
|
-
justifyContent: 'space-between',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
width: '100%',
|
|
23
|
-
paddingBottom: spacing(2)
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
export var LinkButton = styled(Button)(function (_a) {
|
|
27
|
-
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
|
|
28
|
-
return (__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, textTransform: 'none', color: palette.primary.main, display: 'flex', alignItems: 'center', gap: spacing(0.5) }));
|
|
29
|
-
});
|
|
30
|
-
export var AddIconContainer = styled(Box)(function (_a) {
|
|
31
|
-
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette;
|
|
32
|
-
return ({
|
|
33
|
-
background: alpha(palette.primary.main, 0.1),
|
|
34
|
-
height: spacing(2.25),
|
|
35
|
-
width: spacing(2.25),
|
|
36
|
-
display: 'flex',
|
|
37
|
-
justifyContent: 'center',
|
|
38
|
-
borderRadius: spacing(11.25),
|
|
39
|
-
alignItems: 'center'
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
export var LinkText = styled(Typography)(function (_a) {
|
|
43
|
-
var typography = _a.theme.typography;
|
|
44
|
-
return (__assign({}, typography.button_small));
|
|
45
|
-
});
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
46
3
|
export var DeviceListContainer = styled(Box)(function (_a) {
|
|
47
4
|
var spacing = _a.theme.spacing;
|
|
48
5
|
return ({
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
17
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import Button from '../../../../components/Button';
|
|
19
|
+
import { linkNewTerminal, storeSelectedTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
20
|
+
import { Header, Container, TerminalList } from '../shared';
|
|
21
|
+
var TerminalListPage = function () {
|
|
22
|
+
var t = useTranslation().t;
|
|
23
|
+
var dispatch = useAppDispatch();
|
|
24
|
+
var _a = useAppSelector(terminalSelector), _b = _a.data, selectedTerminal = _b.terminalInfo.selectedTerminal, responseData = _b.responseData, loading = _a.loading;
|
|
25
|
+
var terminalList = (responseData || {}).terminalList;
|
|
26
|
+
var handleOnSelectTerminal = function (terminal) {
|
|
27
|
+
dispatch(storeSelectedTerminal(terminal));
|
|
28
|
+
dispatch(linkNewTerminal())
|
|
29
|
+
.unwrap()
|
|
30
|
+
.then(function (_a) {
|
|
31
|
+
var nextScreen = _a.nextScreen;
|
|
32
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
33
|
+
})
|
|
34
|
+
.catch(function () { });
|
|
35
|
+
};
|
|
36
|
+
var handleOnBack = function () {
|
|
37
|
+
dispatch(handlePrevScreenStep());
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(Header, { title: 'terminal_select_device', sx: { pb: 0 } }), _jsx(TerminalList, { select: false, loading: loading, selectedTerminal: selectedTerminal, list: terminalList, onClick: handleOnSelectTerminal })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: t('back') }))] })));
|
|
40
|
+
};
|
|
41
|
+
export default React.memo(TerminalListPage);
|
|
@@ -26,7 +26,7 @@ import PushNotification from '../../../shared/PushNotification';
|
|
|
26
26
|
import Button from '../../../shared/Button';
|
|
27
27
|
import { Container, getId, getIdLabel, LinkWithText } from '../shared';
|
|
28
28
|
import { SendRequestContainer } from './styles';
|
|
29
|
-
import TerminalList from '
|
|
29
|
+
import { TerminalList } from '../shared';
|
|
30
30
|
var UnlinkedTerminalInfo = function () {
|
|
31
31
|
var t = useTranslation().t;
|
|
32
32
|
var typography = useTheme().typography;
|
|
@@ -78,7 +78,7 @@ var UnlinkedTerminalInfo = function () {
|
|
|
78
78
|
var handleOnBack = function () {
|
|
79
79
|
if (error)
|
|
80
80
|
dispatch(clearError());
|
|
81
|
-
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.
|
|
81
|
+
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
|
|
82
82
|
};
|
|
83
83
|
var handleOnSelectTerminal = function (terminal) {
|
|
84
84
|
if (error)
|
|
@@ -8,22 +8,4 @@ interface SendRequestContainerProps {
|
|
|
8
8
|
export declare const SendRequestContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
9
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
10
10
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & SendRequestContainerProps, {}, {}>;
|
|
11
|
-
export declare const ScrollContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
14
|
-
export declare const TerminalListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
17
|
-
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
19
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
20
|
-
export declare const TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
22
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
23
|
-
export declare const Image: import("@emotion/styled").StyledComponent<import("../../../../components/Icon").IconProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
24
|
-
export declare const Title: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
25
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
26
|
-
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
27
|
-
export declare const ListItem: import("@emotion/styled").StyledComponent<import("../../../../components/DeviceCard").DeviceCardProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
28
|
-
export declare const StyledRadio: import("@emotion/styled").StyledComponent<import("@mui/material/Radio").RadioProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
29
11
|
export {};
|
|
@@ -12,19 +12,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { alpha, styled } from '@mui/material/styles';
|
|
13
13
|
import Typography from '@mui/material/Typography';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
|
-
import Icon from '../../../../components/Icon';
|
|
16
|
-
import DeviceCard from '../../../../components/DeviceCard';
|
|
17
|
-
import { QRCodeDescription } from '../shared';
|
|
18
|
-
import Radio from '@mui/material/Radio';
|
|
19
15
|
export var ResendText = styled(Typography)(function (_a) {
|
|
20
16
|
var _b = _a.theme, palette = _b.palette, typography = _b.typography, spacing = _b.spacing;
|
|
21
17
|
return (__assign(__assign({ cursor: 'pointer', color: palette.primary.main }, typography.caption), { fontWeight: typography.fontWeightRegular, textAlign: 'end', marginTop: spacing(0.75) }));
|
|
22
18
|
});
|
|
23
|
-
export var SendRequestContainer = styled(
|
|
19
|
+
export var SendRequestContainer = styled(Box, {
|
|
24
20
|
shouldForwardProp: function (prop) { return !['hasError'].includes(prop.toString()); }
|
|
25
21
|
})(function (_a) {
|
|
26
|
-
var _b = _a.theme, typography = _b.typography, palette = _b.palette, hasError = _a.hasError;
|
|
27
|
-
return (__assign(__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, mt: 2 }), (hasError && {
|
|
22
|
+
var _b = _a.theme, typography = _b.typography, palette = _b.palette, spacing = _b.spacing, hasError = _a.hasError;
|
|
23
|
+
return (__assign(__assign(__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, mt: 2, backgroundColor: palette.common.white, borderWidth: spacing(0.125, 0, 0.125, 0), borderStyle: 'solid', borderColor: palette.divider, padding: spacing(1.5, 2.5, 1.5, 2.5), marginTop: spacing(1), color: palette.text.primary }), typography.body1), (hasError && {
|
|
28
24
|
background: alpha(palette.error.dark, 0.3),
|
|
29
25
|
borderWidth: '1px, 0px, 1px, 0px',
|
|
30
26
|
borderStyle: 'solid',
|
|
@@ -32,67 +28,3 @@ export var SendRequestContainer = styled(QRCodeDescription, {
|
|
|
32
28
|
color: alpha(palette.error.main, 0.7)
|
|
33
29
|
})));
|
|
34
30
|
});
|
|
35
|
-
export var ScrollContainer = styled(Box)(function (_a) {
|
|
36
|
-
var spacing = _a.theme.spacing;
|
|
37
|
-
return ({
|
|
38
|
-
maxHeight: spacing(20.625),
|
|
39
|
-
overflow: 'scroll'
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
export var TerminalListContainer = styled(Box)(function (_a) {
|
|
43
|
-
var spacing = _a.theme.spacing;
|
|
44
|
-
return ({
|
|
45
|
-
display: 'flex',
|
|
46
|
-
justifyContent: 'space-between',
|
|
47
|
-
flexDirection: 'column',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
width: '100%',
|
|
50
|
-
gap: spacing(0.75)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
export var Container = styled(Box)(function (_a) {
|
|
54
|
-
var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, common = _c.common, toastDeviceSelectorDropdown = _c.components.toastDeviceSelectorDropdown;
|
|
55
|
-
return ({
|
|
56
|
-
marginTop: spacing(1),
|
|
57
|
-
border: "1px solid ".concat(toastDeviceSelectorDropdown.border),
|
|
58
|
-
backgroundColor: common.white,
|
|
59
|
-
borderRadius: spacing(1)
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
export var TitleContainer = styled(Box)(function (_a) {
|
|
63
|
-
var _b = _a.theme, spacing = _b.spacing, toastDeviceSelectorDropdown = _b.palette.components.toastDeviceSelectorDropdown;
|
|
64
|
-
return ({
|
|
65
|
-
padding: spacing(1.5, 2, 1.5, 2),
|
|
66
|
-
display: 'flex',
|
|
67
|
-
flexDirection: 'row',
|
|
68
|
-
gap: spacing(0.75),
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
borderBottom: "1px solid ".concat(toastDeviceSelectorDropdown.border)
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
export var Image = styled(Icon)(function (_a) {
|
|
74
|
-
var spacing = _a.theme.spacing;
|
|
75
|
-
return ({
|
|
76
|
-
width: spacing(3),
|
|
77
|
-
height: spacing(3)
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
export var Title = styled(Typography)(function (_a) {
|
|
81
|
-
var _b = _a.theme, typography = _b.typography, palette = _b.palette;
|
|
82
|
-
return (__assign(__assign({}, typography.body2), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
|
|
83
|
-
});
|
|
84
|
-
export var ListItem = styled(DeviceCard)(function (_a) {
|
|
85
|
-
var spacing = _a.theme.spacing;
|
|
86
|
-
return ({
|
|
87
|
-
paddingTop: spacing(1),
|
|
88
|
-
paddingBottom: spacing(1)
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
export var StyledRadio = styled(Radio)(function (_a) {
|
|
92
|
-
var theme = _a.theme;
|
|
93
|
-
return ({
|
|
94
|
-
'&.Mui-checked': {
|
|
95
|
-
color: theme.palette.primary.main
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
interface HeaderProps {
|
|
4
|
+
onLinkClick?: () => void;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
sx?: SxProps<Theme>;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ onLinkClick, loading, title, sx }: HeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
16
|
+
import Loader from '../../../../components/Loader';
|
|
17
|
+
import { AddIconContainer, HeadContainer, LinkButton, LinkText, TextTypography } from './styles';
|
|
18
|
+
var Header = function (_a) {
|
|
19
|
+
var onLinkClick = _a.onLinkClick, loading = _a.loading, title = _a.title, sx = _a.sx;
|
|
20
|
+
var t = useTranslation().t;
|
|
21
|
+
var getLink = function () {
|
|
22
|
+
if (!onLinkClick)
|
|
23
|
+
return;
|
|
24
|
+
if (loading)
|
|
25
|
+
return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 14, style: { height: 28, width: 28, margin: 0 }, toggleAnimation: !!loading });
|
|
26
|
+
return (_jsxs(LinkButton, __assign({ onClick: onLinkClick }, { children: [_jsx(AddIconContainer, { children: _jsx(AddIcon, { fontSize: 'small' }) }), _jsx(LinkText, { children: t('terminal_link_terminal') })] })));
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs(HeadContainer, __assign({ sx: sx }, { children: [_jsx(TextTypography, { children: t(title !== null && title !== void 0 ? title : 'terminal_manage_terminals') }), getLink()] })));
|
|
29
|
+
};
|
|
30
|
+
export default memo(Header);
|
|
@@ -3,7 +3,9 @@ import { TerminalInfo } from '../../../../@types';
|
|
|
3
3
|
interface TerminalListProps {
|
|
4
4
|
selectedTerminal: TerminalInfo;
|
|
5
5
|
list: TerminalInfo[];
|
|
6
|
+
select?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
6
8
|
onClick: (device: TerminalInfo) => void;
|
|
7
9
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ list, onClick, selectedTerminal }: TerminalListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ list, onClick, selectedTerminal, select, loading }: TerminalListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
11
|
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
5
|
+
import Icon from '../../../../components/Icon';
|
|
6
|
+
import Loader from '../../../../components/Loader';
|
|
7
|
+
import { getTerminalId, getTerminalIdLabel, getTerminalName } from './utils';
|
|
8
|
+
import { ListContainer, TerminalListContainer, TitleContainer, Image, Title, ScrollContainer, ListItem, StyledRadio, ArrowIcon } from './styles';
|
|
9
|
+
var TerminalList = function (_a) {
|
|
10
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
11
|
+
var list = _a.list, onClick = _a.onClick, selectedTerminal = _a.selectedTerminal, _k = _a.select, select = _k === void 0 ? true : _k, loading = _a.loading;
|
|
12
|
+
var t = useTranslation().t;
|
|
13
|
+
var platformImage = ((_d = (_c = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.platform) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.logo) || ICONS_NAMES.platform_image;
|
|
14
|
+
var platformName = (_j = (_h = (_g = (_f = (_e = list[0]) === null || _e === void 0 ? void 0 : _e.platform) === null || _f === void 0 ? void 0 : _f.brand) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.text;
|
|
15
|
+
var getEndComponent = function (terminal) {
|
|
16
|
+
if (loading)
|
|
17
|
+
return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 10, style: { height: 24, width: 24 }, toggleAnimation: !!loading });
|
|
18
|
+
if (select)
|
|
19
|
+
return (_jsx(StyledRadio, { sx: { paddingInlineEnd: 0 }, disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, onChange: function () { return onClick(terminal); }, checkedIcon: _jsx(Icon, { src: ICONS_NAMES.radio_checked }), checked: (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === terminal.id }));
|
|
20
|
+
if (!select)
|
|
21
|
+
return _jsx(ArrowIcon, {});
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs(ListContainer, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(TerminalListContainer, { children: list.map(function (terminal, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, onClick: function () { return onClick(terminal); }, name: getTerminalName(terminal), deviceId: getTerminalId(terminal), deviceIdLabel: getTerminalIdLabel(terminal), endAdornment: getEndComponent(terminal) }, index)); }) }) })] }));
|
|
24
|
+
};
|
|
25
|
+
export default memo(TerminalList);
|
|
@@ -20,3 +20,36 @@ export declare const QRCodeDescription: import("@emotion/styled").StyledComponen
|
|
|
20
20
|
export declare const SuccessContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
21
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
22
22
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
23
|
+
export declare const ScrollContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
25
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
26
|
+
export declare const TerminalListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
27
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
28
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
29
|
+
export declare const ListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
30
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
31
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
32
|
+
export declare const TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
33
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
34
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
35
|
+
export declare const Image: import("@emotion/styled").StyledComponent<import("../../../../components/Icon").IconProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
36
|
+
export declare const Title: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
37
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
38
|
+
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
39
|
+
export declare const ListItem: import("@emotion/styled").StyledComponent<import("../../../../components/DeviceCard").DeviceCardProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
40
|
+
export declare const StyledRadio: import("@emotion/styled").StyledComponent<import("@mui/material/Radio").RadioProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
41
|
+
export declare const ArrowIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
|
|
42
|
+
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
43
|
+
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
44
|
+
export declare const HeadContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
45
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
46
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
47
|
+
export declare const LinkButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
48
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
49
|
+
}, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "action" | "size" | "disabled" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
50
|
+
export declare const AddIconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
51
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
52
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
53
|
+
export declare const LinkText: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
54
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
55
|
+
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -10,8 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import Box from '@mui/material/Box';
|
|
13
|
+
import Button from '@mui/material/Button';
|
|
13
14
|
import { alpha, styled } from '@mui/material/styles';
|
|
15
|
+
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
|
14
16
|
import Typography from '@mui/material/Typography';
|
|
17
|
+
import Radio from '@mui/material/Radio';
|
|
18
|
+
import Icon from '../../../../components/Icon';
|
|
19
|
+
import DeviceCard from '../../../../components/DeviceCard';
|
|
15
20
|
export var Container = styled(Box)(function () { return ({
|
|
16
21
|
display: 'flex',
|
|
17
22
|
flexDirection: 'column',
|
|
@@ -48,3 +53,103 @@ export var SuccessContainerStyled = styled(Container)(function () { return ({
|
|
|
48
53
|
alignItems: 'center',
|
|
49
54
|
pointerEvents: 'auto'
|
|
50
55
|
}); });
|
|
56
|
+
export var ScrollContainer = styled(Box)(function (_a) {
|
|
57
|
+
var spacing = _a.theme.spacing;
|
|
58
|
+
return ({
|
|
59
|
+
maxHeight: spacing(20.625),
|
|
60
|
+
overflow: 'scroll'
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export var TerminalListContainer = styled(Box)(function (_a) {
|
|
64
|
+
var spacing = _a.theme.spacing;
|
|
65
|
+
return ({
|
|
66
|
+
display: 'flex',
|
|
67
|
+
justifyContent: 'space-between',
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
width: '100%',
|
|
71
|
+
gap: spacing(0.75)
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
export var ListContainer = styled(Box)(function (_a) {
|
|
75
|
+
var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, common = _c.common, toastDeviceSelectorDropdown = _c.components.toastDeviceSelectorDropdown;
|
|
76
|
+
return ({
|
|
77
|
+
marginTop: spacing(1),
|
|
78
|
+
border: "1px solid ".concat(toastDeviceSelectorDropdown.border),
|
|
79
|
+
backgroundColor: common.white,
|
|
80
|
+
borderRadius: spacing(1)
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
export var TitleContainer = styled(Box)(function (_a) {
|
|
84
|
+
var _b = _a.theme, spacing = _b.spacing, toastDeviceSelectorDropdown = _b.palette.components.toastDeviceSelectorDropdown;
|
|
85
|
+
return ({
|
|
86
|
+
padding: spacing(1.5, 2, 1.5, 2),
|
|
87
|
+
display: 'flex',
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
gap: spacing(0.75),
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
borderBottom: "1px solid ".concat(toastDeviceSelectorDropdown.border)
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
export var Image = styled(Icon)(function (_a) {
|
|
95
|
+
var spacing = _a.theme.spacing;
|
|
96
|
+
return ({
|
|
97
|
+
width: spacing(3),
|
|
98
|
+
height: spacing(3)
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
export var Title = styled(Typography)(function (_a) {
|
|
102
|
+
var _b = _a.theme, typography = _b.typography, palette = _b.palette;
|
|
103
|
+
return (__assign(__assign({}, typography.body2), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
|
|
104
|
+
});
|
|
105
|
+
export var ListItem = styled(DeviceCard)(function (_a) {
|
|
106
|
+
var spacing = _a.theme.spacing;
|
|
107
|
+
return ({
|
|
108
|
+
paddingTop: spacing(1),
|
|
109
|
+
paddingBottom: spacing(1)
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
export var StyledRadio = styled(Radio)(function (_a) {
|
|
113
|
+
var theme = _a.theme;
|
|
114
|
+
return ({
|
|
115
|
+
'&.Mui-checked': {
|
|
116
|
+
color: theme.palette.primary.main
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
export var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
|
|
121
|
+
var _b = _a.theme, palette = _b.palette, direction = _b.direction;
|
|
122
|
+
return (__assign({ color: palette.components.deviceCard.title, fontSize: '16px' }, (direction === 'rtl' && {
|
|
123
|
+
transform: 'rotate(180deg)'
|
|
124
|
+
})));
|
|
125
|
+
});
|
|
126
|
+
export var HeadContainer = styled(Box)(function (_a) {
|
|
127
|
+
var spacing = _a.theme.spacing;
|
|
128
|
+
return ({
|
|
129
|
+
display: 'flex',
|
|
130
|
+
justifyContent: 'space-between',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
width: '100%',
|
|
133
|
+
paddingBottom: spacing(2)
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
export var LinkButton = styled(Button)(function (_a) {
|
|
137
|
+
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
|
|
138
|
+
return (__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, textTransform: 'none', color: palette.primary.main, display: 'flex', alignItems: 'center', gap: spacing(0.5) }));
|
|
139
|
+
});
|
|
140
|
+
export var AddIconContainer = styled(Box)(function (_a) {
|
|
141
|
+
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette;
|
|
142
|
+
return ({
|
|
143
|
+
background: alpha(palette.primary.main, 0.1),
|
|
144
|
+
height: spacing(2.25),
|
|
145
|
+
width: spacing(2.25),
|
|
146
|
+
display: 'flex',
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
borderRadius: spacing(11.25),
|
|
149
|
+
alignItems: 'center'
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
export var LinkText = styled(Typography)(function (_a) {
|
|
153
|
+
var typography = _a.theme.typography;
|
|
154
|
+
return (__assign({}, typography.button_small));
|
|
155
|
+
});
|
package/build/utils/string.js
CHANGED
|
@@ -205,7 +205,7 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
|
|
|
205
205
|
return 'PASSWORD_CREATE_PASSWORD_STEP';
|
|
206
206
|
}
|
|
207
207
|
if (flow === FlowsTypes.TERMINAL) {
|
|
208
|
-
return CONNECT_FLOWS.terminal.
|
|
208
|
+
return CONNECT_FLOWS.terminal.terminalDeviceList;
|
|
209
209
|
}
|
|
210
210
|
return '';
|
|
211
211
|
};
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
16
|
-
import { AddIconContainer, Container, LinkButton, LinkText } from './styles';
|
|
17
|
-
import { TextTypography } from '../shared';
|
|
18
|
-
var Header = function (_a) {
|
|
19
|
-
var onLinkClick = _a.onLinkClick;
|
|
20
|
-
var t = useTranslation().t;
|
|
21
|
-
return (_jsxs(Container, { children: [_jsx(TextTypography, { children: t('terminal_manage_terminals') }), _jsxs(LinkButton, __assign({ onClick: onLinkClick }, { children: [_jsx(AddIconContainer, { children: _jsx(AddIcon, { fontSize: 'small' }) }), _jsx(LinkText, { children: t('terminal_link_terminal') })] }))] }));
|
|
22
|
-
};
|
|
23
|
-
export default memo(Header);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
5
|
-
import { Container, TerminalListContainer, TitleContainer, Image, Title, ScrollContainer, ListItem, StyledRadio } from './styles';
|
|
6
|
-
import { getTerminalId, getTerminalIdLabel, getTerminalName } from '../shared';
|
|
7
|
-
import Icon from '../../../../components/Icon';
|
|
8
|
-
var TerminalList = function (_a) {
|
|
9
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
10
|
-
var list = _a.list, onClick = _a.onClick, selectedTerminal = _a.selectedTerminal;
|
|
11
|
-
var t = useTranslation().t;
|
|
12
|
-
var platformImage = ((_d = (_c = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.platform) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.logo) || ICONS_NAMES.platform_image;
|
|
13
|
-
var platformName = (_j = (_h = (_g = (_f = (_e = list[0]) === null || _e === void 0 ? void 0 : _e.platform) === null || _f === void 0 ? void 0 : _f.brand) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.text;
|
|
14
|
-
return (_jsxs(Container, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(TerminalListContainer, { children: list.map(function (terminal, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, onClick: function () { return onClick(terminal); }, name: getTerminalName(terminal), deviceId: getTerminalId(terminal), deviceIdLabel: getTerminalIdLabel(terminal), endAdornment: _jsx(StyledRadio, { sx: { paddingInlineEnd: 0 }, disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, onChange: function () { return onClick(terminal); }, checkedIcon: _jsx(Icon, { src: ICONS_NAMES.radio_checked }), checked: (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === terminal.id }) }, index)); }) }) })] }));
|
|
15
|
-
};
|
|
16
|
-
export default memo(TerminalList);
|