@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
|
@@ -49,13 +49,13 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import { handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { CONNECT_FLOWS, NAFATH_PACI_TIMEOUT_DURATION,
|
|
52
|
+
import { CONNECT_FLOWS, NAFATH_PACI_TIMEOUT_DURATION, SELECTED_POS_DEFAULT_INFO, SELECTED_TERMINAL_DEFAULT_INFO, TERMINAL_PUSH_NOTIFICATION_DURATION, TERMINAL_PUSH_NOTIFICATION_FAILED, TERMINAL_STEP_NAMES } from '../../../constants';
|
|
53
53
|
import API from '../../../api';
|
|
54
|
-
import { isNetworkError, isTimeoutError, retrieveIndividualData, sleep } from '../../../utils';
|
|
54
|
+
import { isAuthenticationVerificationFailed, isNetworkError, isNoDataFoundError, isTimeoutError, retrieveIndividualData, sleep } from '../../../utils';
|
|
55
55
|
export var verifyToken = createAsyncThunk('terminal/verifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data, _b, step_name, merchant_id, config, country_code, publicKey, terminalData,
|
|
58
|
+
var payload, data, _b, step_name, merchant_id, config, country_code, publicKey, nextScreen, terminalData, err_1;
|
|
59
59
|
var _c;
|
|
60
60
|
return __generator(this, function (_d) {
|
|
61
61
|
switch (_d.label) {
|
|
@@ -79,16 +79,28 @@ export var verifyToken = createAsyncThunk('terminal/verifyLeadToken', function (
|
|
|
79
79
|
if (step_name === TERMINAL_STEP_NAMES.PHONE_AUTH) {
|
|
80
80
|
return [2, { data: data, token: token, nextScreen: CONNECT_FLOWS.terminal.verify }];
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
nextScreen = CONNECT_FLOWS.terminal.terminalDeviceList;
|
|
83
|
+
terminalData = undefined;
|
|
84
|
+
_d.label = 2;
|
|
83
85
|
case 2:
|
|
86
|
+
_d.trys.push([2, 4, , 5]);
|
|
87
|
+
return [4, API.terminalService.retrieveTerminalList([merchant_id])];
|
|
88
|
+
case 3:
|
|
84
89
|
terminalData = _d.sent();
|
|
85
|
-
nextScreen = ((_c = terminalData === null || terminalData === void 0 ? void 0 : terminalData.
|
|
86
|
-
return [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
nextScreen = ((_c = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _c === void 0 ? void 0 : _c.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
91
|
+
return [3, 5];
|
|
92
|
+
case 4:
|
|
93
|
+
err_1 = _d.sent();
|
|
94
|
+
if (!isNoDataFoundError(err_1 === null || err_1 === void 0 ? void 0 : err_1.message))
|
|
95
|
+
throw new Error(err_1);
|
|
96
|
+
nextScreen = CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
97
|
+
return [3, 5];
|
|
98
|
+
case 5: return [2, {
|
|
99
|
+
data: data,
|
|
100
|
+
token: token,
|
|
101
|
+
terminalData: terminalData,
|
|
102
|
+
nextScreen: nextScreen
|
|
103
|
+
}];
|
|
92
104
|
}
|
|
93
105
|
});
|
|
94
106
|
});
|
|
@@ -111,7 +123,7 @@ export var resendOTP = createAsyncThunk('terminal/resendOTP', function (params,
|
|
|
111
123
|
});
|
|
112
124
|
}); });
|
|
113
125
|
export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
-
var _a, terminal, settings, authData, payload, data, _b, config, country_code, merchant_id, publicKey, countryIso2, terminalData,
|
|
126
|
+
var _a, terminal, settings, authData, payload, data, _b, config, country_code, merchant_id, publicKey, countryIso2, nextScreen, terminalData, err_2;
|
|
115
127
|
var _c, _d, _e, _f;
|
|
116
128
|
return __generator(this, function (_g) {
|
|
117
129
|
switch (_g.label) {
|
|
@@ -135,27 +147,41 @@ export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (par
|
|
|
135
147
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
136
148
|
if (countryIso2)
|
|
137
149
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
138
|
-
|
|
150
|
+
nextScreen = CONNECT_FLOWS.terminal.terminalDeviceList;
|
|
151
|
+
terminalData = undefined;
|
|
152
|
+
_g.label = 2;
|
|
139
153
|
case 2:
|
|
154
|
+
_g.trys.push([2, 4, , 5]);
|
|
155
|
+
return [4, API.terminalService.retrieveTerminalList([merchant_id])];
|
|
156
|
+
case 3:
|
|
140
157
|
terminalData = _g.sent();
|
|
141
|
-
nextScreen = ((_d = terminalData === null || terminalData === void 0 ? void 0 : terminalData.
|
|
158
|
+
nextScreen = ((_d = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _d === void 0 ? void 0 : _d.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
159
|
+
return [3, 5];
|
|
160
|
+
case 4:
|
|
161
|
+
err_2 = _g.sent();
|
|
162
|
+
if (!isNoDataFoundError(err_2 === null || err_2 === void 0 ? void 0 : err_2.message))
|
|
163
|
+
throw new Error(err_2);
|
|
164
|
+
nextScreen = CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
165
|
+
return [3, 5];
|
|
166
|
+
case 5:
|
|
142
167
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
|
|
143
168
|
return [2, { data: data, terminalData: terminalData, formData: params, nextScreen: nextScreen }];
|
|
144
169
|
}
|
|
145
170
|
});
|
|
146
171
|
}); });
|
|
147
172
|
export var linkNewTerminal = createAsyncThunk('terminal/linkNewTerminal', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
148
|
-
var _a,
|
|
149
|
-
return __generator(this, function (
|
|
150
|
-
switch (
|
|
173
|
+
var _a, _b, selectedPOS, responseData, _c, language, businessCountry, scope, authData, payload, data;
|
|
174
|
+
return __generator(this, function (_d) {
|
|
175
|
+
switch (_d.label) {
|
|
151
176
|
case 0:
|
|
152
|
-
_a = thunkApi.getState(),
|
|
153
|
-
|
|
177
|
+
_a = thunkApi.getState(), _b = _a.terminal.data, selectedPOS = _b.terminalInfo.selectedPOS, responseData = _b.responseData, _c = _a.settings.data, language = _c.language, businessCountry = _c.businessCountry, scope = _c.appConfig.scope;
|
|
178
|
+
authData = (responseData || {}).authData;
|
|
154
179
|
payload = {
|
|
155
180
|
user_credentail: {
|
|
156
|
-
|
|
157
|
-
id:
|
|
158
|
-
}
|
|
181
|
+
merchant: {
|
|
182
|
+
id: authData === null || authData === void 0 ? void 0 : authData.merchant_id
|
|
183
|
+
},
|
|
184
|
+
device: { id: selectedPOS === null || selectedPOS === void 0 ? void 0 : selectedPOS.id }
|
|
159
185
|
},
|
|
160
186
|
country: businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2,
|
|
161
187
|
scope: scope,
|
|
@@ -167,12 +193,12 @@ export var linkNewTerminal = createAsyncThunk('terminal/linkNewTerminal', functi
|
|
|
167
193
|
};
|
|
168
194
|
return [4, API.authService.createAuth(payload)];
|
|
169
195
|
case 1:
|
|
170
|
-
data =
|
|
196
|
+
data = _d.sent();
|
|
171
197
|
return [2, { data: data, nextScreen: CONNECT_FLOWS.terminal.terminalLinkNew }];
|
|
172
198
|
}
|
|
173
199
|
});
|
|
174
200
|
}); });
|
|
175
|
-
export var
|
|
201
|
+
export var retrievePOSDevices = createAsyncThunk('terminal/retrievePOSDevices', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
202
|
var terminal, merchant_id, data;
|
|
177
203
|
var _a;
|
|
178
204
|
return __generator(this, function (_b) {
|
|
@@ -180,7 +206,7 @@ export var retrieveTerminalList = createAsyncThunk('terminal/retrieveTerminalLis
|
|
|
180
206
|
case 0:
|
|
181
207
|
terminal = thunkApi.getState().terminal;
|
|
182
208
|
merchant_id = (((_a = terminal.data.responseData) === null || _a === void 0 ? void 0 : _a.authData) || {}).merchant_id;
|
|
183
|
-
return [4, API.terminalService.
|
|
209
|
+
return [4, API.terminalService.retrievePOSDevices([merchant_id])];
|
|
184
210
|
case 1:
|
|
185
211
|
data = _b.sent();
|
|
186
212
|
return [2, { data: data }];
|
|
@@ -247,20 +273,16 @@ export var pushNotificationLinkNewTerminal = createAsyncThunk('terminal/pushNoti
|
|
|
247
273
|
});
|
|
248
274
|
});
|
|
249
275
|
export var unlinkTerminalDevice = createAsyncThunk('terminal/unlinkTerminalDevice', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
250
|
-
var
|
|
276
|
+
var _a, id, device, payload, data;
|
|
251
277
|
return __generator(this, function (_b) {
|
|
252
278
|
switch (_b.label) {
|
|
253
279
|
case 0:
|
|
254
|
-
|
|
255
|
-
_a = terminal.data.terminalInfo.selectedTerminalDevice, id = _a.id, terminalInfo = _a.terminal, merchant = _a.merchant;
|
|
280
|
+
_a = thunkApi.getState().terminal.data.terminalInfo.selectedTerminal, id = _a.id, device = _a.device;
|
|
256
281
|
payload = {
|
|
257
282
|
deviceId: id,
|
|
258
283
|
initiator: 'connect',
|
|
259
|
-
|
|
260
|
-
id: (
|
|
261
|
-
},
|
|
262
|
-
merchant: {
|
|
263
|
-
id: (merchant === null || merchant === void 0 ? void 0 : merchant.id) || ''
|
|
284
|
+
device: {
|
|
285
|
+
id: (device === null || device === void 0 ? void 0 : device.id) || ''
|
|
264
286
|
}
|
|
265
287
|
};
|
|
266
288
|
return [4, API.terminalService.unlinkTerminalDevice(payload)];
|
|
@@ -271,18 +293,21 @@ export var unlinkTerminalDevice = createAsyncThunk('terminal/unlinkTerminalDevic
|
|
|
271
293
|
});
|
|
272
294
|
}); });
|
|
273
295
|
export var linkTerminalDevice = createAsyncThunk('terminal/linkTerminalDevice', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
274
|
-
var _a, _b,
|
|
275
|
-
return __generator(this, function (
|
|
276
|
-
switch (
|
|
296
|
+
var _a, _b, posId, _c, id, terminal_device, _d, businessCountry, language, scope, payload, data;
|
|
297
|
+
return __generator(this, function (_e) {
|
|
298
|
+
switch (_e.label) {
|
|
277
299
|
case 0:
|
|
278
|
-
_a = thunkApi.getState(), _b = _a.terminal.data.terminalInfo,
|
|
300
|
+
_a = thunkApi.getState(), _b = _a.terminal.data.terminalInfo, posId = _b.selectedPOS.id, _c = _b.selectedTerminal, id = _c.id, terminal_device = _c.terminal_device, _d = _a.settings.data, businessCountry = _d.businessCountry, language = _d.language, scope = _d.appConfig.scope;
|
|
279
301
|
payload = {
|
|
280
302
|
user_credentail: {
|
|
281
303
|
terminal: {
|
|
282
|
-
id:
|
|
304
|
+
id: id,
|
|
283
305
|
terminal_device: {
|
|
284
|
-
id:
|
|
306
|
+
id: terminal_device.id
|
|
285
307
|
}
|
|
308
|
+
},
|
|
309
|
+
device: {
|
|
310
|
+
id: posId
|
|
286
311
|
}
|
|
287
312
|
},
|
|
288
313
|
country: businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2,
|
|
@@ -295,7 +320,7 @@ export var linkTerminalDevice = createAsyncThunk('terminal/linkTerminalDevice',
|
|
|
295
320
|
};
|
|
296
321
|
return [4, API.authService.createAuth(payload)];
|
|
297
322
|
case 1:
|
|
298
|
-
data =
|
|
323
|
+
data = _e.sent();
|
|
299
324
|
return [2, { data: data }];
|
|
300
325
|
}
|
|
301
326
|
});
|
|
@@ -342,7 +367,7 @@ export var retrieveBoardStatus = createAsyncThunk('terminal/retrieveBoardStatus'
|
|
|
342
367
|
});
|
|
343
368
|
});
|
|
344
369
|
});
|
|
345
|
-
export var
|
|
370
|
+
export var retrieveTerminalList = createAsyncThunk('terminal/retrieveTerminalList', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
346
371
|
var terminal, merchant_id, data;
|
|
347
372
|
var _a;
|
|
348
373
|
return __generator(this, function (_b) {
|
|
@@ -350,7 +375,7 @@ export var retrieveTerminalDeviceList = createAsyncThunk('terminal/retrieveTermi
|
|
|
350
375
|
case 0:
|
|
351
376
|
terminal = thunkApi.getState().terminal;
|
|
352
377
|
merchant_id = (((_a = terminal.data.responseData) === null || _a === void 0 ? void 0 : _a.authData) || {}).merchant_id;
|
|
353
|
-
return [4, API.terminalService.
|
|
378
|
+
return [4, API.terminalService.retrieveTerminalList([merchant_id])];
|
|
354
379
|
case 1:
|
|
355
380
|
data = _b.sent();
|
|
356
381
|
return [2, { data: data }];
|
|
@@ -434,7 +459,7 @@ var initialState = {
|
|
|
434
459
|
error: null,
|
|
435
460
|
loading: false,
|
|
436
461
|
customLoading: false,
|
|
437
|
-
|
|
462
|
+
posDevicesLoading: false,
|
|
438
463
|
data: {
|
|
439
464
|
flowName: FlowsTypes.TERMINAL,
|
|
440
465
|
verify: {
|
|
@@ -444,8 +469,8 @@ var initialState = {
|
|
|
444
469
|
otp: ''
|
|
445
470
|
},
|
|
446
471
|
terminalInfo: {
|
|
447
|
-
|
|
448
|
-
|
|
472
|
+
selectedTerminal: SELECTED_TERMINAL_DEFAULT_INFO,
|
|
473
|
+
selectedPOS: SELECTED_POS_DEFAULT_INFO
|
|
449
474
|
}
|
|
450
475
|
}
|
|
451
476
|
};
|
|
@@ -465,12 +490,12 @@ export var terminalSlice = createSlice({
|
|
|
465
490
|
resetOTPScreen: function (state) {
|
|
466
491
|
state.data.otpData.otp = '';
|
|
467
492
|
},
|
|
468
|
-
storeSelectedTerminalDevice: function (state, action) {
|
|
469
|
-
state.data.terminalInfo.selectedTerminalDevice = action.payload;
|
|
470
|
-
},
|
|
471
493
|
storeSelectedTerminal: function (state, action) {
|
|
472
494
|
state.data.terminalInfo.selectedTerminal = action.payload;
|
|
473
495
|
},
|
|
496
|
+
storeSelectedPOS: function (state, action) {
|
|
497
|
+
state.data.terminalInfo.selectedPOS = action.payload;
|
|
498
|
+
},
|
|
474
499
|
resetTerminalLinkResponse: function (state) {
|
|
475
500
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { linkTerminalDeviceData: undefined, pushNotificationLinkedNewTerminalData: undefined, linkNewTerminalData: undefined });
|
|
476
501
|
}
|
|
@@ -514,9 +539,11 @@ export var terminalSlice = createSlice({
|
|
|
514
539
|
state.data.otpData = formData;
|
|
515
540
|
state.data.responseData = { authData: data, boardData: { id: data === null || data === void 0 ? void 0 : data.id, board_info_id: data === null || data === void 0 ? void 0 : data.board_info_id }, terminalData: terminalData };
|
|
516
541
|
})
|
|
517
|
-
.addCase(verifyTokenOTP.rejected, function (state,
|
|
542
|
+
.addCase(verifyTokenOTP.rejected, function (state, _a) {
|
|
543
|
+
var message = _a.error.message;
|
|
518
544
|
state.loading = false;
|
|
519
|
-
|
|
545
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
546
|
+
state.error = message;
|
|
520
547
|
})
|
|
521
548
|
.addCase(linkNewTerminal.pending, function (state) {
|
|
522
549
|
state.loading = true;
|
|
@@ -532,32 +559,32 @@ export var terminalSlice = createSlice({
|
|
|
532
559
|
state.loading = false;
|
|
533
560
|
state.error = action.error.message;
|
|
534
561
|
})
|
|
535
|
-
.addCase(
|
|
562
|
+
.addCase(retrievePOSDevices.fulfilled, function (state, action) {
|
|
536
563
|
var _a, _b;
|
|
537
|
-
state.
|
|
564
|
+
state.posDevicesLoading = false;
|
|
538
565
|
state.error = null;
|
|
539
566
|
var data = action.payload.data;
|
|
540
567
|
if ((_a = data === null || data === void 0 ? void 0 : data.list) === null || _a === void 0 ? void 0 : _a.length)
|
|
541
|
-
state.data.terminalInfo.
|
|
542
|
-
state.data.responseData = __assign(__assign({}, state.data.responseData), {
|
|
568
|
+
state.data.terminalInfo.selectedPOS = data.list[0];
|
|
569
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { posDevices: (_b = data === null || data === void 0 ? void 0 : data.list) !== null && _b !== void 0 ? _b : [] });
|
|
543
570
|
})
|
|
544
|
-
.addCase(
|
|
545
|
-
state.
|
|
571
|
+
.addCase(retrievePOSDevices.rejected, function (state, action) {
|
|
572
|
+
state.posDevicesLoading = false;
|
|
546
573
|
state.error = action.error.message;
|
|
547
574
|
})
|
|
548
|
-
.addCase(
|
|
549
|
-
state.
|
|
575
|
+
.addCase(retrievePOSDevices.pending, function (state) {
|
|
576
|
+
state.posDevicesLoading = true;
|
|
550
577
|
state.error = null;
|
|
551
578
|
})
|
|
552
|
-
.addCase(
|
|
579
|
+
.addCase(retrieveTerminalList.pending, function (state) {
|
|
553
580
|
state.error = null;
|
|
554
581
|
})
|
|
555
|
-
.addCase(
|
|
582
|
+
.addCase(retrieveTerminalList.fulfilled, function (state, action) {
|
|
556
583
|
state.error = null;
|
|
557
584
|
var data = action.payload.data;
|
|
558
585
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { terminalData: data });
|
|
559
586
|
})
|
|
560
|
-
.addCase(
|
|
587
|
+
.addCase(retrieveTerminalList.rejected, function (state, action) {
|
|
561
588
|
state.error = action.error.message;
|
|
562
589
|
})
|
|
563
590
|
.addCase(pushNotificationLinkNewTerminal.pending, function (state) {
|
|
@@ -671,6 +698,6 @@ export var terminalSlice = createSlice({
|
|
|
671
698
|
});
|
|
672
699
|
}
|
|
673
700
|
});
|
|
674
|
-
export var clearError = (_a = terminalSlice.actions, _a.clearError), setError = _a.setError, stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen,
|
|
701
|
+
export var clearError = (_a = terminalSlice.actions, _a.clearError), setError = _a.setError, stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen, storeSelectedTerminal = _a.storeSelectedTerminal, storeSelectedPOS = _a.storeSelectedPOS, resetTerminalLinkResponse = _a.resetTerminalLinkResponse;
|
|
675
702
|
export default terminalSlice.reducer;
|
|
676
703
|
export var terminalSelector = function (state) { return state.terminal; };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LibConfig } from '../../@types';
|
|
3
|
-
export interface AuthLibProps extends Pick<LibConfig, 'open' | 'mode' | 'scope' | 'merchantDomain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'appInfo' | 'businessCountryCode' | 'language' | 'onFlowCompleted' | 'onError' | 'onStepCompleted' | 'onReady' | 'onClose' | 'onStepStarted'> {
|
|
3
|
+
export interface AuthLibProps extends Pick<LibConfig, 'open' | 'mode' | 'scope' | 'merchantDomain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'appInfo' | 'businessCountryCode' | 'language' | 'onFlowCompleted' | 'onError' | 'onStepCompleted' | 'onReady' | 'onClose' | 'onStepStarted' | 'region'> {
|
|
4
4
|
leadId?: string;
|
|
5
5
|
configToken?: string;
|
|
6
6
|
}
|
|
@@ -17,7 +17,7 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
20
|
+
import { deepCopy, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
23
|
import Button from '../../../shared/Button';
|
|
@@ -27,19 +27,22 @@ import BrandList from './BrandList';
|
|
|
27
27
|
import EntityList from './EntityList';
|
|
28
28
|
import EntityLegalName from './EntityLegalName';
|
|
29
29
|
import LicenseNumber from './LicenseNumber';
|
|
30
|
-
import
|
|
30
|
+
import EntityLicenseType from './EntityLicenseType';
|
|
31
31
|
var ListType;
|
|
32
32
|
(function (ListType) {
|
|
33
33
|
ListType["BrandList"] = "BrandList";
|
|
34
34
|
ListType["EntityList"] = "EntityList";
|
|
35
35
|
})(ListType || (ListType = {}));
|
|
36
36
|
var AuthenticationList = function (_a) {
|
|
37
|
+
var _b;
|
|
37
38
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
var _c = useAppSelector(authSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
40
|
+
var _d = data.authenticationData, brandInfo = _d.brandInfo, entityInfo = _d.entityInfo;
|
|
41
|
+
var _e = React.useState(), listActive = _e[0], setListActive = _e[1];
|
|
41
42
|
var brandList = (data.responseData || {}).brandList;
|
|
42
|
-
var
|
|
43
|
+
var _f = React.useState(false), isAddEntity = _f[0], setIsAddEntity = _f[1];
|
|
44
|
+
var code = (_b = settingsData.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2;
|
|
45
|
+
var isSACountry = React.useMemo(function () { return isSA(code); }, [code]);
|
|
43
46
|
React.useEffect(function () {
|
|
44
47
|
sendCustomEventToGTM({
|
|
45
48
|
event: 'Send Event',
|
|
@@ -91,6 +94,6 @@ var AuthenticationList = function (_a) {
|
|
|
91
94
|
};
|
|
92
95
|
var isBrandList = listActive === ListType.BrandList;
|
|
93
96
|
var isEntityList = listActive === ListType.EntityList;
|
|
94
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); }, handleAddEntity: function (flag) { return setIsAddEntity(flag); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(
|
|
97
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); }, handleAddEntity: function (flag) { return setIsAddEntity(flag); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(EntityLicenseType, { show: isSACountry }), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
|
|
95
98
|
};
|
|
96
99
|
export default React.memo(AuthenticationList);
|
|
@@ -27,5 +27,8 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
|
|
|
27
27
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
28
28
|
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
29
29
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
30
|
-
declare
|
|
30
|
+
declare type TypeProps = {
|
|
31
|
+
show: boolean;
|
|
32
|
+
};
|
|
33
|
+
declare const Type: ({ show }: TypeProps) => JSX.Element;
|
|
31
34
|
export default Type;
|
|
@@ -26,6 +26,7 @@ import Tooltip from '../../../../components/Tooltip';
|
|
|
26
26
|
import Radio from '../../../../components/Radio';
|
|
27
27
|
import { clearError, authSelector } from '../../../app/auth/authStore';
|
|
28
28
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
29
|
+
import Collapse from '../../../../components/Collapse';
|
|
29
30
|
var LabelTextStyled = styled(Text)(function (_a) {
|
|
30
31
|
var theme = _a.theme;
|
|
31
32
|
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
@@ -70,12 +71,13 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
|
70
71
|
display: 'inline-flex'
|
|
71
72
|
});
|
|
72
73
|
});
|
|
73
|
-
var Type = function () {
|
|
74
|
+
var Type = function (_a) {
|
|
75
|
+
var show = _a.show;
|
|
74
76
|
var t = useTranslation().t;
|
|
75
77
|
var control = useFormContext().control;
|
|
76
78
|
var error = useAppSelector(authSelector).error;
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
+
var _b = React.useState(false), isCRHovered = _b[0], setIsCRHovered = _b[1];
|
|
80
|
+
var _c = React.useState(false), isFLHovered = _c[0], setIsFLHovered = _c[1];
|
|
79
81
|
var typeControl = useController({ control: control, name: 'licenseType' });
|
|
80
82
|
var dispatch = useAppDispatch();
|
|
81
83
|
var handleOnChange = function (_a) {
|
|
@@ -85,6 +87,6 @@ var Type = function () {
|
|
|
85
87
|
typeControl.field.onChange(target.value);
|
|
86
88
|
};
|
|
87
89
|
var typeValue = typeControl.field.value;
|
|
88
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })));
|
|
90
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
|
|
89
91
|
};
|
|
90
92
|
export default Type;
|
|
@@ -43,9 +43,12 @@ import SimpleList from '../../../../components/SimpleList';
|
|
|
43
43
|
import Text from '../../../../components/Text';
|
|
44
44
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
45
45
|
import Collapse from '../../../../components/Collapse';
|
|
46
|
+
import { LicenseType } from '../../../../@types';
|
|
46
47
|
import Icon from '../../../../components/Icon';
|
|
47
48
|
import { authSelector } from '../../../app/auth/authStore';
|
|
48
49
|
import { ADD_ENTITY } from '../../../../constants';
|
|
50
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
51
|
+
import { isSA } from '../../../../utils';
|
|
49
52
|
var EntityContainer = styled(Box)(function () { return ({
|
|
50
53
|
display: 'flex',
|
|
51
54
|
alignItems: 'center'
|
|
@@ -74,6 +77,8 @@ var EntityList = function (_a) {
|
|
|
74
77
|
var entityList = ((_b = data.responseData) === null || _b === void 0 ? void 0 : _b.entityList) || [];
|
|
75
78
|
var selectedEntityControl = useController({ control: control, name: 'entityInfo' });
|
|
76
79
|
var selectedEntity = selectedEntityControl.field.value;
|
|
80
|
+
var businessCountry = useAppSelector(settingsSelector).data.businessCountry;
|
|
81
|
+
var isSACountry = React.useMemo(function () { return isSA(businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2); }, [businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2]);
|
|
77
82
|
React.useEffect(function () {
|
|
78
83
|
if (entityList.length > 0) {
|
|
79
84
|
var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; }) || [];
|
|
@@ -121,8 +126,11 @@ var EntityList = function (_a) {
|
|
|
121
126
|
};
|
|
122
127
|
var onSelectItem = function (entity) {
|
|
123
128
|
selectedEntityControl.field.onChange(entity);
|
|
124
|
-
if (entity.id === ADD_ENTITY)
|
|
129
|
+
if (entity.id === ADD_ENTITY) {
|
|
130
|
+
if (!isSACountry)
|
|
131
|
+
setValue('licenseType', LicenseType.CR);
|
|
125
132
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
133
|
+
}
|
|
126
134
|
else {
|
|
127
135
|
setValue('licenseNumber', '');
|
|
128
136
|
setValue('legalName', '');
|
|
@@ -35,7 +35,7 @@ export declare const LinkStyled: import("@emotion/styled").StyledComponent<Omit<
|
|
|
35
35
|
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
|
|
36
36
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>> & {
|
|
37
37
|
ref?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject<HTMLAnchorElement> | null | undefined;
|
|
38
|
-
}, "left" | "right" | "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "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" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "slot" | "title" | "children" | "sx" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "underline" | "variant" | "href" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "
|
|
38
|
+
}, "left" | "right" | "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "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" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "slot" | "title" | "children" | "sx" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "underline" | "referrerPolicy" | "variant" | "href" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "TypographyClasses"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
39
39
|
declare type RefundPolicyProps = {
|
|
40
40
|
readOnly?: boolean;
|
|
41
41
|
};
|
|
@@ -23,7 +23,7 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
23
23
|
import { businessSelector, clearError, updateLeadBusinessType } from '../../../app/business/businessStore';
|
|
24
24
|
import { BusinessType as Type } from '../../../../@types';
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
26
|
-
import { deepCopy, isKW, isOtherLicense,
|
|
26
|
+
import { deepCopy, isKW, isOtherLicense, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
27
27
|
import { KWLicenseValidationSchema, LicenseValidationSchema, OtherCountryLicenseValidationSchema } from './validation';
|
|
28
28
|
import LicenseList from './LicenseList';
|
|
29
29
|
import LicenseCertificate from './LicenseCertificate';
|
|
@@ -60,7 +60,6 @@ var BusinessType = function (_a) {
|
|
|
60
60
|
};
|
|
61
61
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
62
62
|
var isKWCountry = React.useMemo(function () { return isKW(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
63
|
-
var isOtherCountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
64
63
|
var getSchema = function () {
|
|
65
64
|
if (isSACountry)
|
|
66
65
|
return LicenseValidationSchema;
|
|
@@ -116,7 +115,7 @@ var BusinessType = function (_a) {
|
|
|
116
115
|
var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === Type.CR;
|
|
117
116
|
var isFL = (selected === null || selected === void 0 ? void 0 : selected.type) === Type.FL;
|
|
118
117
|
var hasEntityList = !!(entityLicenseList === null || entityLicenseList === void 0 ? void 0 : entityLicenseList.length);
|
|
119
|
-
var showLicenseList = hasEntityList ?
|
|
118
|
+
var showLicenseList = hasEntityList ? isSACountry && isOtherLicense(selectedLicenseEntity) : isSACountry;
|
|
120
119
|
var showEntityList = isKWCountry ? hasEntityList && !isLicenseListActive && isCR : hasEntityList && !isLicenseListActive;
|
|
121
120
|
var disabled = !methods.formState.isValid || uploading || uploadingArticle;
|
|
122
121
|
var disableBack = !data.otpData.isNID;
|
|
@@ -37,7 +37,7 @@ import Text from '../../../../components/Text';
|
|
|
37
37
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
38
38
|
import Collapse from '../../../../components/Collapse';
|
|
39
39
|
import { isKW, isOtherLicense, isSA } from '../../../../utils';
|
|
40
|
-
import { OTHER_CR_LICENSE
|
|
40
|
+
import { OTHER_CR_LICENSE } from '../../../../constants';
|
|
41
41
|
import { settingsSelector } from '../../../../app/settings';
|
|
42
42
|
var InputStyled = styled(InputSelect)(function (_a) {
|
|
43
43
|
var theme = _a.theme;
|
|
@@ -91,10 +91,10 @@ var LicenseList = function (_a) {
|
|
|
91
91
|
}, [licenseList, selectedLicense]);
|
|
92
92
|
React.useEffect(function () {
|
|
93
93
|
if (!!country_code) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
if (!isSA(country_code)) {
|
|
95
|
+
setValue('selectedLicense', OTHER_CR_LICENSE, { shouldValidate: true });
|
|
96
|
+
}
|
|
97
|
+
if (isKW(country_code)) {
|
|
98
98
|
setValue('entityLegalName', entityLegalName, { shouldValidate: true });
|
|
99
99
|
}
|
|
100
100
|
}
|