@tap-payments/auth-jsconnect 2.11.0-development → 2.11.0
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/@types/form.d.ts +2 -2
- package/build/@types/terminal.d.ts +32 -44
- package/build/api/account.d.ts +2 -2
- package/build/api/account.js +7 -4
- package/build/api/auth.d.ts +8 -2
- package/build/api/auth.js +7 -3
- package/build/api/axios.d.ts +1 -1
- package/build/api/headers.d.ts +5 -0
- package/build/api/headers.js +3 -0
- package/build/api/index.d.ts +6 -6
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +5 -2
- package/build/api/terminal.d.ts +3 -6
- package/build/api/terminal.js +22 -12
- package/build/assets/currencies/AEDSymbol.js +1 -1
- package/build/assets/currencies/SARSymbol.js +1 -1
- package/build/assets/locales/ar.json +5 -0
- package/build/assets/locales/en.json +8 -2
- package/build/components/DeviceCard/DeviceCard.d.ts +3 -2
- package/build/components/DeviceCard/DeviceCard.js +9 -10
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
- package/build/components/TruncatedTooltipText/index.d.ts +2 -0
- package/build/components/TruncatedTooltipText/index.js +2 -0
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/app.d.ts +4 -2
- package/build/constants/app.js +137 -38
- package/build/constants/flows.d.ts +2 -1
- package/build/constants/flows.js +2 -1
- package/build/features/app/auth/authStore.js +64 -54
- package/build/features/app/bank/bankStore.js +24 -20
- package/build/features/app/board/boardStore.js +11 -7
- package/build/features/app/brand/brandStore.js +22 -18
- package/build/features/app/business/businessStore.js +30 -26
- package/build/features/app/connect/connectStore.d.ts +6 -5
- package/build/features/app/connect/connectStore.js +48 -31
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -5
- package/build/features/app/connectExpress/connectExpressStore.js +42 -16
- package/build/features/app/entity/entityStore.js +21 -17
- package/build/features/app/individual/individualStore.js +34 -28
- package/build/features/app/password/passwordStore.js +44 -46
- package/build/features/app/signIn/signInStore.js +12 -16
- package/build/features/app/tax/taxStore.js +20 -16
- package/build/features/app/terminal/terminalStore.d.ts +7 -7
- package/build/features/app/terminal/terminalStore.js +89 -62
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/auth/screens/AuthenticationList/EntityList.js +9 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +5 -5
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +9 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -11
- package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
- package/build/features/entity/screens/EntityName/EntityName.js +14 -14
- package/build/features/entity/screens/EntityName/validation.d.ts +47 -45
- package/build/features/entity/screens/EntityName/validation.js +99 -95
- package/build/features/featuresScreens.js +63 -3
- package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
- package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
- package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
- package/build/features/terminal/Terminal.js +2 -2
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +8 -9
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +5 -6
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +9 -9
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +59 -14
- package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
- package/build/features/terminal/screens/{TerminalListPage/TerminalListPage.js → POSDeviceListPage/POSDeviceListPage.js} +13 -10
- package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +3 -3
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +2 -2
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +15 -15
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +5 -7
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +12 -11
- package/build/features/terminal/screens/Verify/Verify.js +6 -2
- package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
- package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
- package/build/features/terminal/screens/shared/index.d.ts +2 -2
- package/build/features/terminal/screens/shared/index.js +2 -2
- package/build/features/terminal/screens/shared/styles.d.ts +1 -1
- package/build/features/terminal/screens/shared/styles.js +1 -1
- package/build/features/terminal/screens/shared/utils.d.ts +4 -4
- package/build/features/terminal/screens/shared/utils.js +9 -9
- package/build/utils/common.js +13 -6
- package/build/utils/error.d.ts +3 -0
- package/build/utils/error.js +9 -0
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +1 -0
- package/build/utils/validation.js +1 -1
- package/package.json +3 -3
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
- package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
- package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
- package/build/features/terminal/screens/shared/TerminalList.js +0 -25
- /package/build/features/{terminal/screens/TerminalListPage/TerminalListPage.d.ts → shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts} +0 -0
|
@@ -1,78 +1,56 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { BusinessType } from '../../../../@types';
|
|
3
|
-
import { KW_MIN_LICENSE_LENGTH,
|
|
4
|
-
export var EntityNameValidationSchema = function () {
|
|
3
|
+
import { KW_MIN_LICENSE_LENGTH, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
|
|
4
|
+
export var EntityNameValidationSchema = function (noneEditable) {
|
|
5
5
|
return yup.object().shape({
|
|
6
|
-
legalName:
|
|
7
|
-
.string()
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
|
|
7
|
+
? yup.string().optional()
|
|
8
|
+
: yup
|
|
9
|
+
.string()
|
|
10
|
+
.required('')
|
|
11
|
+
.test({
|
|
12
|
+
test: function (value) {
|
|
13
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
14
|
+
if (length === 0)
|
|
15
|
+
return true;
|
|
16
|
+
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
17
19
|
licenseType: yup.string().optional(),
|
|
18
|
-
entityType: yup.string().required('entity_type_required'),
|
|
19
|
-
licenseNumber: yup
|
|
20
|
-
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (length === 0)
|
|
27
|
-
return true;
|
|
28
|
-
if (isCR) {
|
|
29
|
-
return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
|
|
20
|
+
entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
|
|
21
|
+
licenseNumber: yup.string().optional(),
|
|
22
|
+
unifiedNumber: noneEditable['license.additional_info']
|
|
23
|
+
? yup.string().optional()
|
|
24
|
+
: yup.string().when('licenseType', function (licenseType) {
|
|
25
|
+
var isCR = licenseType === BusinessType.CR;
|
|
26
|
+
if (!isCR) {
|
|
27
|
+
return yup.string().optional();
|
|
30
28
|
}
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
issuingDate: yup.string().required('choose_any_issuing_date'),
|
|
29
|
+
return yup
|
|
30
|
+
.string()
|
|
31
|
+
.required('')
|
|
32
|
+
.test({
|
|
33
|
+
test: function (value) {
|
|
34
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
35
|
+
if (length >= UNIFIED_NUMBER_MIN_LENGTH)
|
|
36
|
+
return true;
|
|
37
|
+
if (length === 0)
|
|
38
|
+
return this.createError({ message: '' });
|
|
39
|
+
return this.createError({ message: 'unified_number_required' });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
|
|
48
44
|
expiryDate: yup.string().optional(),
|
|
49
45
|
certificateId: yup.array().optional(),
|
|
50
46
|
articleId: yup.string().optional()
|
|
51
47
|
});
|
|
52
48
|
};
|
|
53
|
-
export var EntityNameKWValidationSchema = function () {
|
|
49
|
+
export var EntityNameKWValidationSchema = function (noneEditable) {
|
|
54
50
|
return yup.object().shape({
|
|
55
|
-
legalName:
|
|
56
|
-
.string()
|
|
57
|
-
|
|
58
|
-
.test({
|
|
59
|
-
test: function (value) {
|
|
60
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
61
|
-
if (length === 0)
|
|
62
|
-
return true;
|
|
63
|
-
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
64
|
-
}
|
|
65
|
-
}),
|
|
66
|
-
licenseType: yup.string().optional(),
|
|
67
|
-
entityType: yup.string().required('entity_type_required'),
|
|
68
|
-
licenseNumber: yup
|
|
69
|
-
.string()
|
|
70
|
-
.when('licenseType', function (licenseType) {
|
|
71
|
-
var isCR = licenseType === BusinessType.CR;
|
|
72
|
-
if (!isCR) {
|
|
73
|
-
return yup.string().optional();
|
|
74
|
-
}
|
|
75
|
-
return yup
|
|
51
|
+
legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
|
|
52
|
+
? yup.string().optional()
|
|
53
|
+
: yup
|
|
76
54
|
.string()
|
|
77
55
|
.required('')
|
|
78
56
|
.test({
|
|
@@ -80,37 +58,44 @@ export var EntityNameKWValidationSchema = function () {
|
|
|
80
58
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
81
59
|
if (length === 0)
|
|
82
60
|
return true;
|
|
83
|
-
return length >=
|
|
61
|
+
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
licenseType: yup.string().optional(),
|
|
65
|
+
entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
|
|
66
|
+
licenseNumber: noneEditable['license.number']
|
|
67
|
+
? yup.string().optional()
|
|
68
|
+
: yup
|
|
69
|
+
.string()
|
|
70
|
+
.when('licenseType', function (licenseType) {
|
|
71
|
+
var isCR = licenseType === BusinessType.CR;
|
|
72
|
+
if (!isCR) {
|
|
73
|
+
return yup.string().optional();
|
|
84
74
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
return yup
|
|
76
|
+
.string()
|
|
77
|
+
.required('')
|
|
78
|
+
.test({
|
|
79
|
+
test: function (value) {
|
|
80
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
81
|
+
if (length === 0)
|
|
82
|
+
return true;
|
|
83
|
+
return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
})
|
|
87
|
+
.required(''),
|
|
88
|
+
issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
|
|
89
|
+
expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
|
|
90
90
|
certificateId: yup.array().optional(),
|
|
91
91
|
articleId: yup.string().optional()
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
|
-
export var EntityNameOtherCountryValidationSchema = function () {
|
|
94
|
+
export var EntityNameOtherCountryValidationSchema = function (noneEditable) {
|
|
95
95
|
return yup.object().shape({
|
|
96
|
-
legalName:
|
|
97
|
-
.string()
|
|
98
|
-
|
|
99
|
-
.test({
|
|
100
|
-
test: function (value) {
|
|
101
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
102
|
-
if (length === 0)
|
|
103
|
-
return true;
|
|
104
|
-
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
105
|
-
}
|
|
106
|
-
}),
|
|
107
|
-
licenseType: yup.string().optional(),
|
|
108
|
-
entityType: yup.string().required('entity_type_required'),
|
|
109
|
-
licenseNumber: yup
|
|
110
|
-
.string()
|
|
111
|
-
.when('licenseType', function (licenseType) {
|
|
112
|
-
var isCR = licenseType === BusinessType.CR;
|
|
113
|
-
return yup
|
|
96
|
+
legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
|
|
97
|
+
? yup.string().optional()
|
|
98
|
+
: yup
|
|
114
99
|
.string()
|
|
115
100
|
.required('')
|
|
116
101
|
.test({
|
|
@@ -118,13 +103,32 @@ export var EntityNameOtherCountryValidationSchema = function () {
|
|
|
118
103
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
119
104
|
if (length === 0)
|
|
120
105
|
return true;
|
|
121
|
-
return length >=
|
|
106
|
+
return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
|
|
122
107
|
}
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
108
|
+
}),
|
|
109
|
+
licenseType: yup.string().optional(),
|
|
110
|
+
entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
|
|
111
|
+
licenseNumber: noneEditable['license.number']
|
|
112
|
+
? yup.string().optional()
|
|
113
|
+
: yup
|
|
114
|
+
.string()
|
|
115
|
+
.when('licenseType', function (licenseType) {
|
|
116
|
+
var isCR = licenseType === BusinessType.CR;
|
|
117
|
+
return yup
|
|
118
|
+
.string()
|
|
119
|
+
.required('')
|
|
120
|
+
.test({
|
|
121
|
+
test: function (value) {
|
|
122
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
123
|
+
if (length === 0)
|
|
124
|
+
return true;
|
|
125
|
+
return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: isCR ? 'cr_kw_max_length' : 'fl_max_length' });
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
})
|
|
129
|
+
.required(''),
|
|
130
|
+
issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
|
|
131
|
+
expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
|
|
128
132
|
certificateId: yup.array().optional(),
|
|
129
133
|
articleId: yup.string().optional()
|
|
130
134
|
});
|
|
@@ -13,6 +13,7 @@ import ConnectOTPScreen from './connect/screens/OTP';
|
|
|
13
13
|
import ThankYouScreen from './connect/screens/ThankYou';
|
|
14
14
|
import OperatorError from './connect/screens/OperatorError';
|
|
15
15
|
import CollectMobileOwnership from './connect/screens/MobileOwnership';
|
|
16
|
+
import OTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
16
17
|
import ConnectExpressBusinessCountry from './connectExpress/screens/BusinessCountry/BusinessCountry';
|
|
17
18
|
import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
|
|
18
19
|
import ConnectExpressNIDScreen from './connectExpress/screens/NID';
|
|
@@ -37,6 +38,7 @@ import ConnectExpressAuthMerchantScreen from './connectExpress/screens/AuthMerch
|
|
|
37
38
|
import ConnectExpressAuthAccountCreatedLoaderScreen from './connectExpress/screens/AccountCreatedLoader';
|
|
38
39
|
import ConnectExpressOperatorError from './connectExpress/screens/OperatorError';
|
|
39
40
|
import ConnectExpressCollectMobileOwnership from './connectExpress/screens/MobileOwnership';
|
|
41
|
+
import ConnectExpressOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
40
42
|
import AuthBusinessCountry from './auth/screens/BusinessCountry/BusinessCountry';
|
|
41
43
|
import AuthSwitchScreen from './auth/screens/AuthSwitch';
|
|
42
44
|
import AuthMobileScreen from './auth/screens/Mobile';
|
|
@@ -58,6 +60,7 @@ import AuthEmailSentScreen from './auth/screens/EmailSent';
|
|
|
58
60
|
import AuthMigratingDataScreen from './auth/screens/MigratingData';
|
|
59
61
|
import AuthOperatorError from './auth/screens/OperatorError';
|
|
60
62
|
import AuthPasscodeScreen from './auth/screens/Passcode';
|
|
63
|
+
import AuthOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
61
64
|
import CustomersPage from './business/screens/Customers';
|
|
62
65
|
import IDBODPage from './business/screens/IDBOD';
|
|
63
66
|
import BusinessVerifyPage from './business/screens/Verify';
|
|
@@ -73,6 +76,7 @@ import BusVerifyPACIScreen from './business/screens/VerifyPACI';
|
|
|
73
76
|
import BrandVerifyScreen from './business/screens/BrandDetails';
|
|
74
77
|
import BusinessOperatorError from './business/screens/OperatorError';
|
|
75
78
|
import BusinessCollectMobileOwnership from './business/screens/MobileOwnership';
|
|
79
|
+
import BusinessOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
76
80
|
import PasswordVerifyPage from './password/screens/Verify';
|
|
77
81
|
import CreatePasswordPage from './password/screens/CreatePassword';
|
|
78
82
|
import PasswordDataLoadingPage from './password/screens/PrepareDataLoading';
|
|
@@ -81,6 +85,7 @@ import SuccessPasswordPage from './password/screens/Success';
|
|
|
81
85
|
import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
|
|
82
86
|
import PasswordResetPasswordSuccessPage from './password/screens/ResetPasswordSuccess';
|
|
83
87
|
import PasswordOperatorError from './password/screens/OperatorError';
|
|
88
|
+
import PasswordOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
84
89
|
import IndividualVerifyPage from './individual/screens/Verify';
|
|
85
90
|
import IndividualPhoneInfoPage from './individual/screens/IndividualPhoneInfo';
|
|
86
91
|
import IndividualListPage from './individual/screens/IndividualList';
|
|
@@ -91,6 +96,7 @@ import IndividualSuccessWithFlowPage from './individual/screens/SuccessWithFlowB
|
|
|
91
96
|
import IndividualResetPasswordSuccessPage from './individual/screens/ResetPasswordSuccess';
|
|
92
97
|
import IndividualDataLoadingPage from './individual/screens/PrepareDataLoading';
|
|
93
98
|
import IndividualOperatorError from './individual/screens/OperatorError';
|
|
99
|
+
import IndividualOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
94
100
|
import BankVerifyPage from './bank/screens/Verify';
|
|
95
101
|
import BankDetailsPage from './bank/screens/BankDetails';
|
|
96
102
|
import BankSuccessPage from './bank/screens/Success';
|
|
@@ -98,6 +104,7 @@ import BankSuccessWithFlowPage from './bank/screens/SuccessWithFlowButtons';
|
|
|
98
104
|
import BankResetPasswordSuccessPage from './bank/screens/ResetPasswordSuccess';
|
|
99
105
|
import BankDataLoadingPage from './bank/screens/PrepareDataLoading';
|
|
100
106
|
import BankOperatorError from './bank/screens/OperatorError';
|
|
107
|
+
import BankOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
101
108
|
import TaxVerifyPage from './tax/screens/Verify';
|
|
102
109
|
import TaxDetailsPage from './tax/screens/TaxDetails';
|
|
103
110
|
import TaxSuccessPage from './tax/screens/Success';
|
|
@@ -105,6 +112,7 @@ import TaxSuccessWithFlowPage from './tax/screens/SuccessWithFlowButtons';
|
|
|
105
112
|
import TaxResetPasswordSuccessPage from './tax/screens/ResetPasswordSuccess';
|
|
106
113
|
import TaxDataLoadingPage from './tax/screens/PrepareDataLoading';
|
|
107
114
|
import TaxOperatorError from './tax/screens/OperatorError';
|
|
115
|
+
import TaxOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
108
116
|
import SignInMobilePage from './signIn/screens/Mobile';
|
|
109
117
|
import SignInEmailPage from './signIn/screens/Email';
|
|
110
118
|
import SignInOTPPage from './signIn/screens/OTP';
|
|
@@ -118,6 +126,7 @@ import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
|
|
|
118
126
|
import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
|
|
119
127
|
import EntityDataLoadingPage from './entity/screens/PrepareDataLoading';
|
|
120
128
|
import EntityOperatorError from './entity/screens/OperatorError';
|
|
129
|
+
import EntityOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
121
130
|
import BrandVerifyPage from './brand/screens/Verify';
|
|
122
131
|
import BrandInfoPage from './brand/screens/BrandInfo';
|
|
123
132
|
import BrandSegmentPage from './brand/screens/BrandSegmentInfo';
|
|
@@ -127,11 +136,13 @@ import BrandSuccessWithFlowPage from './brand/screens/SuccessWithFlowButtons';
|
|
|
127
136
|
import BrandResetPasswordSuccessPage from './brand/screens/ResetPasswordSuccess';
|
|
128
137
|
import BrandDataLoadingPage from './brand/screens/PrepareDataLoading';
|
|
129
138
|
import BrandOperatorError from './brand/screens/OperatorError';
|
|
139
|
+
import BrandOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
130
140
|
import BoardVerifyPage from './board/screens/Verify';
|
|
131
141
|
import BoardSuccessWithFlowPage from './board/screens/SuccessWithFlowButtons';
|
|
132
142
|
import BoardResetPasswordSuccessPage from './board/screens/ResetPasswordSuccess';
|
|
133
143
|
import BoardDataLoadingPage from './board/screens/PrepareDataLoading';
|
|
134
144
|
import BoardOperatorError from './board/screens/OperatorError';
|
|
145
|
+
import BoardOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
135
146
|
import KycLoadingPage from './kyc/screens/Loading';
|
|
136
147
|
import KycTokenErrorPage from './kyc/screens/TokenError';
|
|
137
148
|
import KycAlreadySubmittedPage from './kyc/screens/AlreadySubmitted';
|
|
@@ -146,7 +157,7 @@ import TerminalOperatorErrorPage from './terminal/screens/OperatorError';
|
|
|
146
157
|
import TerminalVerifyPage from './terminal/screens/Verify';
|
|
147
158
|
import NoTerminalDeviceLinkedPage from './terminal/screens/NoTerminalDeviceLinked';
|
|
148
159
|
import TerminalDeviceListPage from './terminal/screens/TerminalDeviceList';
|
|
149
|
-
import
|
|
160
|
+
import POSDeviceListPage from '../features/terminal/screens/POSDeviceListPage';
|
|
150
161
|
import LinkNewTerminalPage from './terminal/screens/LinkNewTerminal';
|
|
151
162
|
import LinkedTerminalInfoPage from './terminal/screens/LinkedTerminalInfo';
|
|
152
163
|
import UnlinkedTerminalInfoPage from './terminal/screens/UnlinkedTerminalInfo';
|
|
@@ -154,6 +165,7 @@ import LinkedSuccessPage from './terminal/screens/LinkedSuccess';
|
|
|
154
165
|
import UnlinkedSuccessPage from './terminal/screens/UnlinkedSuccess';
|
|
155
166
|
import TerminalBoardPage from './terminal/screens/SuccessWithFlowButtons';
|
|
156
167
|
import TerminalResetPasswordSuccessPage from './terminal/screens/ResetPasswordSuccess';
|
|
168
|
+
import TerminalOTPVerifySecurityError from './shared/OTPVerifySecurityError';
|
|
157
169
|
export var connectFeatureScreens = [
|
|
158
170
|
{
|
|
159
171
|
name: 'CONNECT_BUSINESS_COUNTRY_STEP',
|
|
@@ -210,6 +222,10 @@ export var connectFeatureScreens = [
|
|
|
210
222
|
{
|
|
211
223
|
name: 'CONNECT_MOBILE_OWNERSHIP',
|
|
212
224
|
element: CollectMobileOwnership
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
228
|
+
element: OTPVerifySecurityError
|
|
213
229
|
}
|
|
214
230
|
];
|
|
215
231
|
export var connectExpressFeatureScreens = [
|
|
@@ -308,6 +324,10 @@ export var connectExpressFeatureScreens = [
|
|
|
308
324
|
{
|
|
309
325
|
name: 'COLLECT_MOBILE_OWNERSHIP',
|
|
310
326
|
element: ConnectExpressCollectMobileOwnership
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: 'CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
330
|
+
element: ConnectExpressOTPVerifySecurityError
|
|
311
331
|
}
|
|
312
332
|
];
|
|
313
333
|
export var authFeatureScreens = [
|
|
@@ -394,6 +414,10 @@ export var authFeatureScreens = [
|
|
|
394
414
|
{
|
|
395
415
|
name: 'AUTH_OPERATOR_ERROR_STEP',
|
|
396
416
|
element: AuthOperatorError
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'AUTH_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
420
|
+
element: AuthOTPVerifySecurityError
|
|
397
421
|
}
|
|
398
422
|
];
|
|
399
423
|
export var businessFeatureScreens = [
|
|
@@ -444,6 +468,10 @@ export var businessFeatureScreens = [
|
|
|
444
468
|
{
|
|
445
469
|
name: 'BUSINESS_MOBILE_OWNERSHIP',
|
|
446
470
|
element: BusinessCollectMobileOwnership
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: 'BUSINESS_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
474
|
+
element: BusinessOTPVerifySecurityError
|
|
447
475
|
}
|
|
448
476
|
];
|
|
449
477
|
export var passwordFeatureScreens = [
|
|
@@ -475,6 +503,10 @@ export var passwordFeatureScreens = [
|
|
|
475
503
|
{
|
|
476
504
|
name: 'PASSWORD_OPERATOR_ERROR_STEP',
|
|
477
505
|
element: PasswordOperatorError
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: 'PASSWORD_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
509
|
+
element: PasswordOTPVerifySecurityError
|
|
478
510
|
}
|
|
479
511
|
];
|
|
480
512
|
export var individualFeatureScreens = [
|
|
@@ -514,6 +546,10 @@ export var individualFeatureScreens = [
|
|
|
514
546
|
{
|
|
515
547
|
name: 'INDIVIDUAL_OPERATOR_ERROR_STEP',
|
|
516
548
|
element: IndividualOperatorError
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: 'INDIVIDUAL_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
552
|
+
element: IndividualOTPVerifySecurityError
|
|
517
553
|
}
|
|
518
554
|
];
|
|
519
555
|
export var bankFeatureScreens = [
|
|
@@ -541,6 +577,10 @@ export var bankFeatureScreens = [
|
|
|
541
577
|
{
|
|
542
578
|
name: 'BANK_OPERATOR_ERROR_STEP',
|
|
543
579
|
element: BankOperatorError
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: 'BANK_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
583
|
+
element: BankOTPVerifySecurityError
|
|
544
584
|
}
|
|
545
585
|
];
|
|
546
586
|
export var taxFeatureScreens = [
|
|
@@ -568,6 +608,10 @@ export var taxFeatureScreens = [
|
|
|
568
608
|
{
|
|
569
609
|
name: 'TAX_OPERATOR_ERROR_STEP',
|
|
570
610
|
element: TaxOperatorError
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: 'TAX_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
614
|
+
element: TaxOTPVerifySecurityError
|
|
571
615
|
}
|
|
572
616
|
];
|
|
573
617
|
export var signInFeatureScreens = [
|
|
@@ -621,6 +665,10 @@ export var entityFeatureScreens = [
|
|
|
621
665
|
{
|
|
622
666
|
name: 'ENTITY_OPERATOR_ERROR_STEP',
|
|
623
667
|
element: EntityOperatorError
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: 'ENTITY_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
671
|
+
element: EntityOTPVerifySecurityError
|
|
624
672
|
}
|
|
625
673
|
];
|
|
626
674
|
export var brandFeatureScreens = [
|
|
@@ -656,6 +704,10 @@ export var brandFeatureScreens = [
|
|
|
656
704
|
{
|
|
657
705
|
name: 'BRAND_OPERATOR_ERROR_STEP',
|
|
658
706
|
element: BrandOperatorError
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
name: 'BRAND_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
710
|
+
element: BrandOTPVerifySecurityError
|
|
659
711
|
}
|
|
660
712
|
];
|
|
661
713
|
export var boardFeatureScreens = [
|
|
@@ -678,6 +730,10 @@ export var boardFeatureScreens = [
|
|
|
678
730
|
{
|
|
679
731
|
name: 'BOARD_OPERATOR_ERROR_STEP',
|
|
680
732
|
element: BoardOperatorError
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: 'BOARD_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
736
|
+
element: BoardOTPVerifySecurityError
|
|
681
737
|
}
|
|
682
738
|
];
|
|
683
739
|
export var kycFeatureScreens = [
|
|
@@ -744,8 +800,8 @@ export var terminalFeatureScreens = [
|
|
|
744
800
|
element: LinkNewTerminalPage
|
|
745
801
|
},
|
|
746
802
|
{
|
|
747
|
-
name: CONNECT_FLOWS.terminal.
|
|
748
|
-
element:
|
|
803
|
+
name: CONNECT_FLOWS.terminal.posDeviceList,
|
|
804
|
+
element: POSDeviceListPage
|
|
749
805
|
},
|
|
750
806
|
{
|
|
751
807
|
name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
|
|
@@ -770,5 +826,9 @@ export var terminalFeatureScreens = [
|
|
|
770
826
|
{
|
|
771
827
|
name: CONNECT_FLOWS.terminal.resetPassword,
|
|
772
828
|
element: TerminalResetPasswordSuccessPage
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
name: CONNECT_FLOWS.terminal.otpVerifySecurityError,
|
|
832
|
+
element: TerminalOTPVerifySecurityError
|
|
773
833
|
}
|
|
774
834
|
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import GenericError from '../../shared/GenericError';
|
|
5
|
+
var OTPVerifySecurityError = function () {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return _jsx(GenericError, { error: t('something_went_wrong'), errorTitle: t('oops') });
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(OTPVerifySecurityError);
|
|
@@ -41,7 +41,7 @@ var Terminal = memo(function (_a) {
|
|
|
41
41
|
var theme = useAppTheme().theme;
|
|
42
42
|
var dispatch = useAppDispatch();
|
|
43
43
|
var _d = useAppSelector(settingsSelector), data = _d.data, error = _d.error, settingLoading = _d.loading;
|
|
44
|
-
var _e = useAppSelector(terminalSelector), customLoading = _e.customLoading, terminalError = _e.error, loading = _e.loading,
|
|
44
|
+
var _e = useAppSelector(terminalSelector), customLoading = _e.customLoading, terminalError = _e.error, loading = _e.loading, posDevicesLoading = _e.posDevicesLoading;
|
|
45
45
|
useAppConfig(__assign(__assign({ navigation: TERMINAL_SCREENS_NAVIGATION }, props), { disableSettingFetching: props.mode === 'content' ? false : !!verifyToken || !!configToken }));
|
|
46
46
|
useErrorListener(terminalError || error);
|
|
47
47
|
useStepStartedListener();
|
|
@@ -77,7 +77,7 @@ var Terminal = memo(function (_a) {
|
|
|
77
77
|
});
|
|
78
78
|
}, []);
|
|
79
79
|
var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
|
|
80
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ||
|
|
80
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading || posDevicesLoading ? 'none' : 'auto', isTapOrigin: isTapOrigin, animationDirection: animationDirection, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: terminalFeatureScreens.map(function (_a, index) {
|
|
81
81
|
var Element = _a.element, name = _a.name;
|
|
82
82
|
var isActive = activeScreen.name === name;
|
|
83
83
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -27,17 +27,15 @@ var LinkNewTerminal = function () {
|
|
|
27
27
|
var _a, _b, _c, _d;
|
|
28
28
|
var t = useTranslation().t;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData;
|
|
36
|
-
var terminal_devices = (terminalData || {}).terminal_devices;
|
|
30
|
+
var _e = useAppSelector(terminalSelector).data, terminal_device = _e.terminalInfo.selectedTerminal.terminal_device, responseData = _e.responseData;
|
|
31
|
+
var _f = React.useState(false), isReady = _f[0], setIsReady = _f[1];
|
|
32
|
+
var _g = React.useState(false), success = _g[0], setSuccess = _g[1];
|
|
33
|
+
var _h = React.useState(false), failed = _h[0], setFailed = _h[1];
|
|
34
|
+
var _j = responseData || {}, terminalData = _j.terminalData, linkNewTerminalData = _j.linkNewTerminalData;
|
|
37
35
|
var qrCode = "data:image/png;base64,".concat((_a = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _a === void 0 ? void 0 : _a.qr);
|
|
38
36
|
var code = (_b = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _b === void 0 ? void 0 : _b.code;
|
|
39
37
|
var expiry = TERMINAL_PUSH_NOTIFICATION_DURATION;
|
|
40
|
-
var deviceName = ((_d = (_c =
|
|
38
|
+
var deviceName = ((_d = (_c = terminal_device === null || terminal_device === void 0 ? void 0 : terminal_device.model) === null || _c === void 0 ? void 0 : _c.name[0]) === null || _d === void 0 ? void 0 : _d.text) || '';
|
|
41
39
|
var newTerminal = true;
|
|
42
40
|
React.useEffect(function () {
|
|
43
41
|
if (linkNewTerminalData && !isReady) {
|
|
@@ -61,7 +59,8 @@ var LinkNewTerminal = function () {
|
|
|
61
59
|
};
|
|
62
60
|
}, [isReady]);
|
|
63
61
|
var handleOnBack = function () {
|
|
64
|
-
var
|
|
62
|
+
var _a;
|
|
63
|
+
var previousScreen = ((_a = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _a === void 0 ? void 0 : _a.length) ? CONNECT_FLOWS.terminal.posDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
65
64
|
dispatch(handlePrevScreenStep(previousScreen));
|
|
66
65
|
};
|
|
67
66
|
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, justifyContent: 'space-between' }, { children: [_jsx(PushNotification, __assign({ error: t('terminal_request_denied', { device: deviceName }), failed: failed, success: success, expiryInSeconds: expiry }, { children: _jsxs(LinkNewTerminalContainer, { children: [_jsx(LinkTerminalText, { children: t('terminal_link_terminal') }), _jsx(QRCodeDescription, { children: t('terminal_qr_code_description') }), _jsx(QRCodeImage, { src: qrCode }), code && (_jsxs(_Fragment, { children: [_jsx(LinkTerminalText, { children: t('terminal_or_use_code') }), _jsx(CodeDescription, { children: formatCode(code) })] }))] }) })), _jsx(Box, __assign({ sx: { ml: 2.5, mr: 2.5 } }, { children: _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: handleOnBack, variant: 'text' }, { children: t('back') })) }))] })));
|
|
@@ -15,22 +15,21 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import Box from '@mui/material/Box';
|
|
16
16
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
17
17
|
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
18
|
-
import { retrieveBoardDetails, retrieveBoardStatus,
|
|
18
|
+
import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalList, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
19
19
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
20
20
|
import Button from '../../../shared/Button';
|
|
21
|
-
import {
|
|
21
|
+
import { SuccessContainerStyled } from '../shared';
|
|
22
22
|
import { CONNECT_FLOWS } from '../../../../constants';
|
|
23
23
|
var LinkedSuccess = function () {
|
|
24
24
|
var t = useTranslation().t;
|
|
25
25
|
var isAr = useLanguage().isAr;
|
|
26
26
|
var dispatch = useAppDispatch();
|
|
27
|
-
var _a = useAppSelector(terminalSelector), error = _a.error, loading = _a.loading, _b = _a.data,
|
|
27
|
+
var _a = useAppSelector(terminalSelector), error = _a.error, loading = _a.loading, _b = _a.data, selectedPOS = _b.terminalInfo.selectedPOS, responseData = _b.responseData;
|
|
28
28
|
var _c = responseData || {}, boardData = _c.boardData, authData = _c.authData;
|
|
29
|
-
var deviceName = getTerminalName(selectedTerminal);
|
|
30
29
|
var handleGoToBoard = function () {
|
|
31
30
|
var board_id = (boardData || {}).id;
|
|
32
31
|
var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
|
|
33
|
-
dispatch(
|
|
32
|
+
dispatch(retrieveTerminalList());
|
|
34
33
|
dispatch(retrieveBoardStatus({ boardId: board_id }))
|
|
35
34
|
.unwrap()
|
|
36
35
|
.then(function () {
|
|
@@ -46,6 +45,6 @@ var LinkedSuccess = function () {
|
|
|
46
45
|
var handleOnBack = function () {
|
|
47
46
|
dispatch(handlePrevScreenStep());
|
|
48
47
|
};
|
|
49
|
-
return (_jsxs(SuccessContainerStyled, { children: [_jsx(SuccessScreen, { sx: { minHeight: 'unset', ml: 2.5, mr: 2.5 }, title: t('terminal_linked_success', { device:
|
|
48
|
+
return (_jsxs(SuccessContainerStyled, { children: [_jsx(SuccessScreen, { sx: { minHeight: 'unset', ml: 2.5, mr: 2.5 }, title: t('terminal_linked_success', { device: selectedPOS === null || selectedPOS === void 0 ? void 0 : selectedPOS.display_name }), successTitle: t('terminal_go_to_board'), loading: loading, error: error || '' }), _jsx(Box, __assign({ sx: { width: '100%' } }, { children: _jsx(Button, __assign({ loading: loading, disableBack: true, onBackClicked: handleOnBack, onClick: handleGoToBoard, isAr: isAr }, { children: t('terminal_go_to_board') })) }))] }));
|
|
50
49
|
};
|
|
51
50
|
export default React.memo(LinkedSuccess);
|
|
@@ -23,17 +23,17 @@ import Button from '../../../shared/Button';
|
|
|
23
23
|
import { clearError, terminalSelector, unlinkTerminalDevice } from '../../../app/terminal/terminalStore';
|
|
24
24
|
import { Container, getId, getIdLabel, getPairedWith, LinkWithText } from '../shared';
|
|
25
25
|
var LinkedTerminalInfo = function () {
|
|
26
|
-
var _a
|
|
26
|
+
var _a;
|
|
27
27
|
var t = useTranslation().t;
|
|
28
|
-
var
|
|
28
|
+
var _b = useTheme(), spacing = _b.spacing, palette = _b.palette;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var isAr = useLanguage().isAr;
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var deviceName = (
|
|
35
|
-
var deviceImage = (
|
|
36
|
-
var deviceId = (
|
|
31
|
+
var _c = useAppSelector(terminalSelector), error = _c.error, selectedTerminal = _c.data.terminalInfo.selectedTerminal, loading = _c.loading;
|
|
32
|
+
var terminal_device = selectedTerminal.terminal_device, linked = selectedTerminal.linked, device = selectedTerminal.device;
|
|
33
|
+
var _d = ((terminal_device === null || terminal_device === void 0 ? void 0 : terminal_device.model) || {}).image_url, image_url = _d === void 0 ? ICONS_NAMES.device_image : _d;
|
|
34
|
+
var deviceName = (device === null || device === void 0 ? void 0 : device.display_name) || '';
|
|
35
|
+
var deviceImage = (device === null || device === void 0 ? void 0 : device.logo) || ICONS_NAMES.platform_image;
|
|
36
|
+
var deviceId = (device === null || device === void 0 ? void 0 : device.reference) || (device === null || device === void 0 ? void 0 : device.id) || '';
|
|
37
37
|
React.useEffect(function () {
|
|
38
38
|
if (error)
|
|
39
39
|
dispatch(clearError());
|
|
@@ -50,6 +50,6 @@ var LinkedTerminalInfo = function () {
|
|
|
50
50
|
var handleOnBack = function () {
|
|
51
51
|
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
|
|
52
52
|
};
|
|
53
|
-
return (_jsxs(ScreenContainer, __assign({ minHeight: 224, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(DeviceCard, { badge: true, image: image_url, name: display_name, deviceId: getId(
|
|
53
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 224, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(DeviceCard, { badge: true, image: image_url, name: ((_a = selectedTerminal.terminal_device) === null || _a === void 0 ? void 0 : _a.display_name) || '', deviceId: getId(selectedTerminal), deviceIdLabel: getIdLabel(selectedTerminal), pairedWith: getPairedWith(selectedTerminal), 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, isLinked: linked })] })), error && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) })), _jsx(Button, __assign({ loading: loading, onBackClicked: handleOnBack, onClick: handleOnNext, isAr: isAr }, { children: t('terminal_unlink') }))] })));
|
|
54
54
|
};
|
|
55
55
|
export default React.memo(LinkedTerminalInfo);
|