@tap-payments/auth-jsconnect 2.12.9-development → 2.12.9-sandbox
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/app.d.ts +2 -0
- package/build/@types/app.js +1 -0
- package/build/@types/form.d.ts +1 -0
- package/build/api/document.d.ts +1 -1
- package/build/api/file.d.ts +1 -0
- package/build/api/file.js +9 -1
- package/build/api/index.d.ts +1 -0
- package/build/assets/locales/ar.json +13 -10
- package/build/assets/locales/en.json +8 -6
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/app.d.ts +3 -0
- package/build/constants/app.js +15 -6
- package/build/features/app/connectExpress/connectExpressStore.d.ts +11 -1
- package/build/features/app/connectExpress/connectExpressStore.js +199 -18
- package/build/features/app/entity/entityStore.js +56 -35
- package/build/features/app/individual/individualStore.js +1 -0
- package/build/features/app/terminal/terminalStore.d.ts +3 -0
- package/build/features/app/terminal/terminalStore.js +34 -1
- package/build/features/bank/screens/BankDetails/BankDetails.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +6 -3
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +10 -5
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +3 -2
- package/build/features/connectExpress/screens/Email/Email.d.ts +5 -0
- package/build/features/connectExpress/screens/Email/Email.js +57 -0
- package/build/features/connectExpress/screens/Email/EmailField.d.ts +8 -0
- package/build/features/connectExpress/screens/Email/EmailField.js +52 -0
- package/build/features/connectExpress/screens/Email/index.d.ts +3 -0
- package/build/features/connectExpress/screens/Email/index.js +2 -0
- package/build/features/connectExpress/screens/Email/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/Email/validation.js +4 -0
- package/build/features/connectExpress/screens/NIDMissed/NID.js +4 -2
- package/build/features/connectExpress/screens/OTP/OTP.js +15 -9
- package/build/features/connectExpress/screens/OTP/OTPInput.js +10 -4
- package/build/features/entity/screens/EntityName/EntityDocumentUpload.d.ts +12 -0
- package/build/features/entity/screens/EntityName/{LicenseCertificate.js → EntityDocumentUpload.js} +10 -15
- package/build/features/entity/screens/EntityName/EntityName.js +10 -4
- package/build/features/entity/screens/EntityName/validation.d.ts +9 -0
- package/build/features/entity/screens/EntityName/validation.js +3 -0
- package/build/features/featuresScreens.js +5 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +2 -1
- package/build/features/terminal/screens/shared/POSDeviceList.js +5 -5
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.js +1 -1
- package/build/hooks/useCountry.d.ts +1 -0
- package/build/hooks/useCountry.js +3 -2
- package/build/hooks/useIsEmailAuth.d.ts +1 -0
- package/build/hooks/useIsEmailAuth.js +11 -0
- package/build/utils/array.d.ts +1 -1
- package/build/utils/array.js +3 -2
- package/build/utils/common.js +3 -3
- package/build/utils/file.d.ts +1 -0
- package/build/utils/file.js +6 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/string.d.ts +2 -0
- package/build/utils/string.js +8 -0
- package/package.json +2 -2
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +0 -9
|
@@ -61,7 +61,7 @@ import { FlowsTypes, AuthForType, BusinessType, LicenseType, AuthForScreen } fro
|
|
|
61
61
|
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
62
62
|
import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH, SCOPE_MERCHANT } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
|
-
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError, isTimeoutError, isInternalServerError, isAuthenticationVerificationFailed } from '../../../utils';
|
|
64
|
+
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isEmailAuthEnabled, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError, isTimeoutError, isInternalServerError, isAuthenticationVerificationFailed } from '../../../utils';
|
|
65
65
|
export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateBusinessCountryAsync', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
66
|
var connectExpress, payload, data;
|
|
67
67
|
return __generator(this, function (_a) {
|
|
@@ -81,17 +81,17 @@ export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateB
|
|
|
81
81
|
});
|
|
82
82
|
}); });
|
|
83
83
|
export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var settings, countryCode, showBoard, data, _a, country_code, contact, phone, status, board_id, board_info_id, isRegistered, screen_1, _b, boardInfo, boardData, error_1;
|
|
85
|
-
var _c, _d, _e, _f, _g;
|
|
86
|
-
return __generator(this, function (
|
|
87
|
-
switch (
|
|
84
|
+
var settings, countryCode, showBoard, data, _a, country_code, contact, phone, status, board_id, board_info_id, emailAuth, isRegistered, screen_1, screen_2, _b, boardInfo, boardData, error_1;
|
|
85
|
+
var _c, _d, _e, _f, _g, _h, _j;
|
|
86
|
+
return __generator(this, function (_k) {
|
|
87
|
+
switch (_k.label) {
|
|
88
88
|
case 0:
|
|
89
89
|
settings = thunkApi.getState().settings;
|
|
90
90
|
countryCode = settings.data.businessCountry;
|
|
91
91
|
showBoard = settings.data.appConfig.showBoard;
|
|
92
92
|
return [4, API.leadService.retrieveLeadIdentity(leadId)];
|
|
93
93
|
case 1:
|
|
94
|
-
data =
|
|
94
|
+
data = _k.sent();
|
|
95
95
|
_a = data || {}, country_code = _a.country_code, contact = _a.contact;
|
|
96
96
|
if (country_code)
|
|
97
97
|
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
@@ -103,16 +103,24 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
103
103
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
|
|
104
104
|
return [2, { data: data, countryCode: countryCode }];
|
|
105
105
|
}
|
|
106
|
+
emailAuth = (_d = settings.data.appConfig.features) === null || _d === void 0 ? void 0 : _d.emailAuth;
|
|
106
107
|
isRegistered = (status === null || status === void 0 ? void 0 : status.toLowerCase()) === 'registered';
|
|
107
108
|
if (!isRegistered && !(data === null || data === void 0 ? void 0 : data.identification) && phone) {
|
|
108
|
-
|
|
109
|
+
screen_1 = isEmailAuthEnabled(emailAuth, country_code || ((_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2))
|
|
110
|
+
? 'CONNECT_EXPRESS_EMAIL_STEP'
|
|
111
|
+
: 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
112
|
+
thunkApi.dispatch(handleCurrentActiveScreen(screen_1));
|
|
109
113
|
return [2, { data: data, countryCode: countryCode }];
|
|
110
114
|
}
|
|
111
115
|
if (!isRegistered && country_code) {
|
|
112
|
-
|
|
116
|
+
screen_2 = 'CONNECT_EXPRESS_NID_STEP';
|
|
113
117
|
if (!isSA(data.country_code))
|
|
114
|
-
|
|
115
|
-
thunkApi.dispatch(handleCurrentActiveScreen(
|
|
118
|
+
screen_2 = isEmailAuthEnabled(emailAuth, data.country_code) ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
119
|
+
thunkApi.dispatch(handleCurrentActiveScreen(screen_2));
|
|
120
|
+
return [2, { data: data, countryCode: countryCode }];
|
|
121
|
+
}
|
|
122
|
+
if (!isRegistered && isEmailAuthEnabled(emailAuth, settings.data.businessCountry.iso2)) {
|
|
123
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_EMAIL_STEP'));
|
|
116
124
|
return [2, { data: data, countryCode: countryCode }];
|
|
117
125
|
}
|
|
118
126
|
if (!isRegistered && !isSA(settings.data.businessCountry.iso2)) {
|
|
@@ -123,11 +131,11 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
123
131
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_NID_STEP'));
|
|
124
132
|
return [2, { data: data, countryCode: countryCode }];
|
|
125
133
|
}
|
|
126
|
-
if ((
|
|
127
|
-
thunkApi.dispatch(storeAuthId((
|
|
134
|
+
if ((_f = data === null || data === void 0 ? void 0 : data.identification) === null || _f === void 0 ? void 0 : _f.authentication_id) {
|
|
135
|
+
thunkApi.dispatch(storeAuthId((_g = data === null || data === void 0 ? void 0 : data.identification) === null || _g === void 0 ? void 0 : _g.authentication_id));
|
|
128
136
|
}
|
|
129
137
|
if (isRegistered && !showBoard) {
|
|
130
|
-
(
|
|
138
|
+
(_j = (_h = settings.data.appConfig).onFlowCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, data);
|
|
131
139
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
132
140
|
return [2, { data: data, countryCode: countryCode }];
|
|
133
141
|
}
|
|
@@ -136,19 +144,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
136
144
|
return [2, { data: data, countryCode: countryCode }];
|
|
137
145
|
}
|
|
138
146
|
if (!(isRegistered && board_id && board_info_id)) return [3, 5];
|
|
139
|
-
|
|
147
|
+
_k.label = 2;
|
|
140
148
|
case 2:
|
|
141
|
-
|
|
149
|
+
_k.trys.push([2, 4, , 5]);
|
|
142
150
|
return [4, Promise.all([
|
|
143
151
|
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
144
152
|
API.boardService.retrieveBoardDetails(board_id)
|
|
145
153
|
])];
|
|
146
154
|
case 3:
|
|
147
|
-
_b =
|
|
155
|
+
_b = _k.sent(), boardInfo = _b[0], boardData = _b[1];
|
|
148
156
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
|
|
149
157
|
return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
|
|
150
158
|
case 4:
|
|
151
|
-
error_1 =
|
|
159
|
+
error_1 = _k.sent();
|
|
152
160
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
153
161
|
return [2, { data: data, countryCode: countryCode }];
|
|
154
162
|
case 5: return [2, { data: data, countryCode: countryCode }];
|
|
@@ -309,6 +317,61 @@ export var resendMobileAuthOTP = createAsyncThunk('connectExpress/resendMobileAu
|
|
|
309
317
|
}
|
|
310
318
|
});
|
|
311
319
|
}); });
|
|
320
|
+
export var createEmailAuthAsync = createAsyncThunk('connectExpress/createEmailAuthAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
321
|
+
var _a, settings, connectExpress, requestBody, data;
|
|
322
|
+
var _b, _c;
|
|
323
|
+
return __generator(this, function (_d) {
|
|
324
|
+
switch (_d.label) {
|
|
325
|
+
case 0:
|
|
326
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
327
|
+
requestBody = {
|
|
328
|
+
country: settings.data.businessCountry.iso2,
|
|
329
|
+
scope: settings.data.appConfig.scope,
|
|
330
|
+
lang: settings.data.language,
|
|
331
|
+
lead_id: connectExpress.data.leadId,
|
|
332
|
+
user_credentail: {
|
|
333
|
+
email: params.email || ''
|
|
334
|
+
},
|
|
335
|
+
sign_in: false,
|
|
336
|
+
is_lead: true,
|
|
337
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.CREATE_AUTH_EMAIL,
|
|
338
|
+
encryption_contract: ['user_credentail.email']
|
|
339
|
+
};
|
|
340
|
+
return [4, API.authService.createExpressAuth(requestBody)];
|
|
341
|
+
case 1:
|
|
342
|
+
data = _d.sent();
|
|
343
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
344
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
345
|
+
return [2, { response: data, formData: params }];
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}); });
|
|
349
|
+
export var resendEmailAuthOTP = createAsyncThunk('connectExpress/resendEmailAuthOTPExpress', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
350
|
+
var _a, settings, connectExpress, requestBody, data;
|
|
351
|
+
return __generator(this, function (_b) {
|
|
352
|
+
switch (_b.label) {
|
|
353
|
+
case 0:
|
|
354
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
355
|
+
requestBody = {
|
|
356
|
+
country: settings.data.businessCountry.iso2,
|
|
357
|
+
scope: settings.data.appConfig.scope,
|
|
358
|
+
lang: settings.data.language,
|
|
359
|
+
lead_id: connectExpress.data.leadId,
|
|
360
|
+
user_credentail: {
|
|
361
|
+
email: params.email || ''
|
|
362
|
+
},
|
|
363
|
+
sign_in: false,
|
|
364
|
+
is_lead: true,
|
|
365
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.CREATE_AUTH_EMAIL,
|
|
366
|
+
encryption_contract: ['user_credentail.email']
|
|
367
|
+
};
|
|
368
|
+
return [4, API.authService.createExpressAuth(requestBody)];
|
|
369
|
+
case 1:
|
|
370
|
+
data = _b.sent();
|
|
371
|
+
return [2, { response: data, formData: params }];
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}); });
|
|
312
375
|
export var createAuthSessionExpiredAsync = createAsyncThunk('connectExpress/createAuthSessionExpiredAsync', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
376
|
var settings, requestBody, data;
|
|
314
377
|
return __generator(this, function (_a) {
|
|
@@ -614,6 +677,78 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
614
677
|
}
|
|
615
678
|
});
|
|
616
679
|
}); });
|
|
680
|
+
export var verifyEmailOtpAsync = createAsyncThunk('connectExpress/verifyEmailOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
681
|
+
var _a, settings, connectExpress, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, payload, data, authId, urlQueryStart, _e, brandList, entityList;
|
|
682
|
+
var _f, _g;
|
|
683
|
+
return __generator(this, function (_h) {
|
|
684
|
+
switch (_h.label) {
|
|
685
|
+
case 0:
|
|
686
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
687
|
+
_b = connectExpress.data || {}, responseData = _b.responseData, leadId = _b.leadId;
|
|
688
|
+
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.authData))
|
|
689
|
+
throw new Error('Auth data is missing');
|
|
690
|
+
_c = responseData.authData, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type;
|
|
691
|
+
_d = settings.data.appConfig, scope = _d.scope, redirectUrl = _d.redirectUrl, authData = _d.data;
|
|
692
|
+
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
693
|
+
bi = settings.data.deviceInfo.browser.browser_id;
|
|
694
|
+
isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
|
|
695
|
+
authDataHasValue = authData === null || authData === void 0 ? void 0 : authData.length;
|
|
696
|
+
payload = {
|
|
697
|
+
auth_token: auth_token,
|
|
698
|
+
lead_id: leadId,
|
|
699
|
+
data: params.otp,
|
|
700
|
+
auth_type: auth_type,
|
|
701
|
+
device_token: device_token,
|
|
702
|
+
service_name: service_name,
|
|
703
|
+
sign_in: false,
|
|
704
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_EMAIL,
|
|
705
|
+
encryption_contract: ['data']
|
|
706
|
+
};
|
|
707
|
+
return [4, API.authService.verifyExpressAuth(payload).catch(function (err) {
|
|
708
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
709
|
+
thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
710
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
711
|
+
})];
|
|
712
|
+
case 1:
|
|
713
|
+
data = _h.sent();
|
|
714
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
715
|
+
sendCustomEventToGTM({
|
|
716
|
+
event: 'Send Event',
|
|
717
|
+
event_category: 'User Registration Flow',
|
|
718
|
+
event_action: 'First OTP Success'
|
|
719
|
+
});
|
|
720
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
721
|
+
authId = data.auth.id;
|
|
722
|
+
thunkApi.dispatch(storeAuthId(authId));
|
|
723
|
+
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
724
|
+
if (settings.data.appConfig.mode === 'popup') {
|
|
725
|
+
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
726
|
+
thunkApi.dispatch(handleOpen(false));
|
|
727
|
+
return [2, data];
|
|
728
|
+
}
|
|
729
|
+
if (redirectUrl) {
|
|
730
|
+
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
731
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
732
|
+
return [2, data];
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 3];
|
|
736
|
+
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
737
|
+
case 2:
|
|
738
|
+
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
739
|
+
if (brandList.length && entityList.length) {
|
|
740
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
741
|
+
return [2, data];
|
|
742
|
+
}
|
|
743
|
+
_h.label = 3;
|
|
744
|
+
case 3: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead_id)).unwrap()];
|
|
745
|
+
case 4:
|
|
746
|
+
_h.sent();
|
|
747
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_NID_MISSED_STEP')); });
|
|
748
|
+
return [2, data];
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}); });
|
|
617
752
|
export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
618
753
|
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, error_3, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
619
754
|
var _d, _e, _f;
|
|
@@ -1543,6 +1678,9 @@ var initialState = {
|
|
|
1543
1678
|
mobile: '',
|
|
1544
1679
|
termAndConditionChecked: false
|
|
1545
1680
|
},
|
|
1681
|
+
emailData: {
|
|
1682
|
+
email: ''
|
|
1683
|
+
},
|
|
1546
1684
|
nidData: {
|
|
1547
1685
|
nid: '',
|
|
1548
1686
|
termAndConditionChecked: false
|
|
@@ -1647,11 +1785,14 @@ export var connectSlice = createSlice({
|
|
|
1647
1785
|
var _b = data || {}, identification = _b.identification, contact = _b.contact, terms_conditions_accepted = _b.terms_conditions_accepted;
|
|
1648
1786
|
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
1649
1787
|
state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
1650
|
-
var
|
|
1788
|
+
var _c = contact || {}, phone = _c.phone, email = _c.email;
|
|
1651
1789
|
if (phone) {
|
|
1652
1790
|
state.data.mobileData.mobile = phone === null || phone === void 0 ? void 0 : phone.number;
|
|
1653
1791
|
state.data.mobileData.countryCode = countryCode;
|
|
1654
1792
|
}
|
|
1793
|
+
if (email) {
|
|
1794
|
+
state.data.emailData.email = email;
|
|
1795
|
+
}
|
|
1655
1796
|
if (terms_conditions_accepted !== undefined && state.data.isLeadIdPassed) {
|
|
1656
1797
|
state.data.mobileData.termAndConditionChecked = terms_conditions_accepted;
|
|
1657
1798
|
state.data.nidData.termAndConditionChecked = terms_conditions_accepted;
|
|
@@ -1718,6 +1859,31 @@ export var connectSlice = createSlice({
|
|
|
1718
1859
|
})
|
|
1719
1860
|
.addCase(resendMobileAuthOTP.rejected, function (state, action) {
|
|
1720
1861
|
state.error = action.error.message;
|
|
1862
|
+
})
|
|
1863
|
+
.addCase(createEmailAuthAsync.pending, function (state) {
|
|
1864
|
+
state.loading = true;
|
|
1865
|
+
state.error = null;
|
|
1866
|
+
})
|
|
1867
|
+
.addCase(createEmailAuthAsync.fulfilled, function (state, action) {
|
|
1868
|
+
state.loading = false;
|
|
1869
|
+
state.data.emailData = action.payload.formData;
|
|
1870
|
+
state.data.otpData.authFor = AuthForType.EMAIL;
|
|
1871
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: action.payload.response });
|
|
1872
|
+
})
|
|
1873
|
+
.addCase(createEmailAuthAsync.rejected, function (state, action) {
|
|
1874
|
+
state.loading = false;
|
|
1875
|
+
state.error = action.error.message;
|
|
1876
|
+
})
|
|
1877
|
+
.addCase(resendEmailAuthOTP.pending, function (state) {
|
|
1878
|
+
state.error = null;
|
|
1879
|
+
})
|
|
1880
|
+
.addCase(resendEmailAuthOTP.fulfilled, function (state, action) {
|
|
1881
|
+
state.data.emailData = action.payload.formData;
|
|
1882
|
+
state.data.otpData.authFor = AuthForType.EMAIL;
|
|
1883
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: action.payload.response });
|
|
1884
|
+
})
|
|
1885
|
+
.addCase(resendEmailAuthOTP.rejected, function (state, action) {
|
|
1886
|
+
state.error = action.error.message;
|
|
1721
1887
|
})
|
|
1722
1888
|
.addCase(createAuthSessionExpiredAsync.pending, function (state) {
|
|
1723
1889
|
state.loading = true;
|
|
@@ -1822,6 +1988,21 @@ export var connectSlice = createSlice({
|
|
|
1822
1988
|
state.loading = false;
|
|
1823
1989
|
if (!isAuthenticationVerificationFailed(message))
|
|
1824
1990
|
state.error = message;
|
|
1991
|
+
})
|
|
1992
|
+
.addCase(verifyEmailOtpAsync.pending, function (state) {
|
|
1993
|
+
state.loading = true;
|
|
1994
|
+
state.error = null;
|
|
1995
|
+
})
|
|
1996
|
+
.addCase(verifyEmailOtpAsync.fulfilled, function (state, action) {
|
|
1997
|
+
var _a;
|
|
1998
|
+
state.loading = false;
|
|
1999
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authData), action.payload) });
|
|
2000
|
+
})
|
|
2001
|
+
.addCase(verifyEmailOtpAsync.rejected, function (state, _a) {
|
|
2002
|
+
var message = _a.error.message;
|
|
2003
|
+
state.loading = false;
|
|
2004
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
2005
|
+
state.error = message;
|
|
1825
2006
|
})
|
|
1826
2007
|
.addCase(verifyNafathAsync.pending, function (state) {
|
|
1827
2008
|
state.loading = true;
|
|
@@ -304,18 +304,43 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
|
|
|
304
304
|
});
|
|
305
305
|
});
|
|
306
306
|
});
|
|
307
|
+
var uploadEntityDocumentByPurpose = function (documents, entityId, purpose, imageIds) { return __awaiter(void 0, void 0, void 0, function () {
|
|
308
|
+
var existingDocument, documentBody_1, documentBody;
|
|
309
|
+
return __generator(this, function (_a) {
|
|
310
|
+
if ((imageIds || []).length === 0)
|
|
311
|
+
return [2, undefined];
|
|
312
|
+
existingDocument = getRecentDocumentBasedOnPurpose(documents, purpose);
|
|
313
|
+
if (existingDocument === null || existingDocument === void 0 ? void 0 : existingDocument.id) {
|
|
314
|
+
documentBody_1 = {
|
|
315
|
+
id: existingDocument.id,
|
|
316
|
+
images: imageIds
|
|
317
|
+
};
|
|
318
|
+
return [2, API.documentService.addFilesToExistingDocument(documentBody_1)];
|
|
319
|
+
}
|
|
320
|
+
documentBody = {
|
|
321
|
+
entity_id: entityId,
|
|
322
|
+
documents: [
|
|
323
|
+
{
|
|
324
|
+
type: purpose,
|
|
325
|
+
images: imageIds
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
};
|
|
329
|
+
return [2, API.documentService.updateDocumentInfo(documentBody)];
|
|
330
|
+
});
|
|
331
|
+
}); };
|
|
307
332
|
export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
|
|
308
333
|
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
309
334
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
310
|
-
var _b, settings, entity, entityRes, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, entityData, documentData, activityList, entity_1, documentResponse,
|
|
311
|
-
var
|
|
312
|
-
return __generator(this, function (
|
|
313
|
-
switch (
|
|
335
|
+
var _b, settings, entity, entityRes, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, commercialRegistrationExtractId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, entityData, documentData, activityList, entity_1, documentResponse, documentUploads, _i, documentUploads_1, _d, purpose, imageIds, response, entity_2, list;
|
|
336
|
+
var _e, _f;
|
|
337
|
+
return __generator(this, function (_g) {
|
|
338
|
+
switch (_g.label) {
|
|
314
339
|
case 0:
|
|
315
340
|
_b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
|
|
316
341
|
entityRes = (entity.data.verify.responseBody || {}).entity;
|
|
317
342
|
_c = entityRes || {}, id = _c.id, data_status = _c.data_status, data_verification = _c.data_verification, documents = _c.documents;
|
|
318
|
-
issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, entityType = formData.entityType;
|
|
343
|
+
issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, commercialRegistrationExtractId = formData.commercialRegistrationExtractId, entityType = formData.entityType;
|
|
319
344
|
issueDate = issuingDate && new Date(issuingDate).getTime();
|
|
320
345
|
expDate = expiryDate && new Date(expiryDate).getTime();
|
|
321
346
|
isFL = licenseType === BusinessType.FL;
|
|
@@ -358,48 +383,44 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
|
|
|
358
383
|
if (!isDirty) return [3, 2];
|
|
359
384
|
return [4, API.entityService.updateEntity(payload)];
|
|
360
385
|
case 1:
|
|
361
|
-
entity_1 = (
|
|
386
|
+
entity_1 = (_g.sent()).entity;
|
|
362
387
|
entityData = entity_1;
|
|
363
|
-
|
|
388
|
+
_g.label = 2;
|
|
364
389
|
case 2:
|
|
365
390
|
documentResponse = undefined;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
391
|
+
if (!!isDocumentsNonEditable) return [3, 6];
|
|
392
|
+
documentUploads = [
|
|
393
|
+
{ purpose: DocumentPurpose.CR, imageIds: certificateId },
|
|
394
|
+
{ purpose: DocumentPurpose.COMMERCIAL_REGISTRATION_EXTRACT, imageIds: commercialRegistrationExtractId }
|
|
395
|
+
];
|
|
396
|
+
_i = 0, documentUploads_1 = documentUploads;
|
|
397
|
+
_g.label = 3;
|
|
374
398
|
case 3:
|
|
375
|
-
|
|
376
|
-
|
|
399
|
+
if (!(_i < documentUploads_1.length)) return [3, 6];
|
|
400
|
+
_d = documentUploads_1[_i], purpose = _d.purpose, imageIds = _d.imageIds;
|
|
401
|
+
return [4, uploadEntityDocumentByPurpose(documents, id || '', purpose, imageIds)];
|
|
377
402
|
case 4:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
type: DocumentPurpose.CR,
|
|
383
|
-
images: certificateId
|
|
384
|
-
}
|
|
385
|
-
]
|
|
386
|
-
};
|
|
387
|
-
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
403
|
+
response = _g.sent();
|
|
404
|
+
if (response)
|
|
405
|
+
documentResponse = response;
|
|
406
|
+
_g.label = 5;
|
|
388
407
|
case 5:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
case 6:
|
|
408
|
+
_i++;
|
|
409
|
+
return [3, 3];
|
|
410
|
+
case 6:
|
|
411
|
+
if (!documentResponse) return [3, 8];
|
|
412
|
+
return [4, API.entityService.retrieveEntity(id)];
|
|
392
413
|
case 7:
|
|
393
|
-
entity_2 = (
|
|
414
|
+
entity_2 = (_g.sent()).entity;
|
|
394
415
|
entityData = entity_2;
|
|
395
416
|
documentData = documentResponse;
|
|
396
|
-
|
|
417
|
+
_g.label = 8;
|
|
397
418
|
case 8: return [4, API.dataService.getActivitiesIsIc()];
|
|
398
419
|
case 9:
|
|
399
|
-
list = (
|
|
420
|
+
list = (_g.sent()).list;
|
|
400
421
|
activityList = list;
|
|
401
422
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
402
|
-
(
|
|
423
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
|
|
403
424
|
return [2, { data: { entity: entityData, documentData: documentData, activityList: activityList }, formData: originalFormData }];
|
|
404
425
|
}
|
|
405
426
|
});
|
|
@@ -754,7 +775,7 @@ export var entitySlice = createSlice({
|
|
|
754
775
|
state.error = null;
|
|
755
776
|
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
756
777
|
var _b = data || {}, entity = _b.entity, activityList = _b.activityList, rest = __rest(_b, ["entity", "activityList"]);
|
|
757
|
-
state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined });
|
|
778
|
+
state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined, commercialRegistrationExtractId: undefined });
|
|
758
779
|
state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
|
|
759
780
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity, activityList: activityList });
|
|
760
781
|
if (entity === null || entity === void 0 ? void 0 : entity.activities)
|
|
@@ -1274,6 +1274,7 @@ export var individualSlice = createSlice({
|
|
|
1274
1274
|
state.data.individualData.isAuthorized = is_authorized;
|
|
1275
1275
|
})
|
|
1276
1276
|
.addCase(retrieveIndividualInfo.rejected, function (state, action) {
|
|
1277
|
+
state.addOrRequestDetailLoading = false;
|
|
1277
1278
|
state.error = action.error.message;
|
|
1278
1279
|
})
|
|
1279
1280
|
.addCase(getIndividualList.pending, function (state) {
|
|
@@ -40,6 +40,9 @@ export declare const linkNewTerminal: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
40
40
|
export declare const retrievePOSDevices: import("@reduxjs/toolkit").AsyncThunk<{
|
|
41
41
|
data: any;
|
|
42
42
|
}, void, {}>;
|
|
43
|
+
export declare const retrieveTerminalPlatformBrandLogo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
44
|
+
logo: string;
|
|
45
|
+
}, void, {}>;
|
|
43
46
|
interface pushNotificationLinkNewTerminalParams {
|
|
44
47
|
newTerminal: boolean;
|
|
45
48
|
onSuccess: () => void;
|
|
@@ -51,7 +51,7 @@ import { handleCurrentActiveScreen, handlePublicKey, handleSetCountryByIso2, onC
|
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
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, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
54
|
-
import { isAuthenticationVerificationFailed, isNetworkError, isNoDataFoundError, isTimeoutError, retrieveIndividualData, sleep } from '../../../utils';
|
|
54
|
+
import { createImageObjectURL, 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 () {
|
|
@@ -262,6 +262,25 @@ export var retrievePOSDevices = createAsyncThunk('terminal/retrievePOSDevices',
|
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
}); });
|
|
265
|
+
export var retrieveTerminalPlatformBrandLogo = createAsyncThunk('terminal/retrieveTerminalPlatformBrandLogo', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
266
|
+
var terminal, list, logoFileId, data, logo;
|
|
267
|
+
var _a, _b, _c, _d, _e, _f;
|
|
268
|
+
return __generator(this, function (_g) {
|
|
269
|
+
switch (_g.label) {
|
|
270
|
+
case 0:
|
|
271
|
+
terminal = thunkApi.getState().terminal;
|
|
272
|
+
list = (_c = (_b = (_a = terminal.data.responseData) === null || _a === void 0 ? void 0 : _a.terminalData) === null || _b === void 0 ? void 0 : _b.list) !== null && _c !== void 0 ? _c : [];
|
|
273
|
+
logoFileId = (_f = (_e = (_d = list === null || list === void 0 ? void 0 : list[0]) === null || _d === void 0 ? void 0 : _d.platform) === null || _e === void 0 ? void 0 : _e.brand) === null || _f === void 0 ? void 0 : _f.logo;
|
|
274
|
+
if (!logoFileId)
|
|
275
|
+
return [2, { logo: '' }];
|
|
276
|
+
return [4, API.fileService.retrieveFileInfo(logoFileId)];
|
|
277
|
+
case 1:
|
|
278
|
+
data = _g.sent();
|
|
279
|
+
logo = createImageObjectURL(data);
|
|
280
|
+
return [2, { logo: logo }];
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}); });
|
|
265
284
|
export var pushNotificationLinkNewTerminal = createAsyncThunk('terminal/pushNotificationLinkNewTerminal', function (_a, thunkApi) {
|
|
266
285
|
var newTerminal = _a.newTerminal, onSuccess = _a.onSuccess, onFailure = _a.onFailure;
|
|
267
286
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -655,6 +674,20 @@ export var terminalSlice = createSlice({
|
|
|
655
674
|
.addCase(retrievePOSDevices.pending, function (state) {
|
|
656
675
|
state.posDevicesLoading = true;
|
|
657
676
|
state.error = null;
|
|
677
|
+
})
|
|
678
|
+
.addCase(retrieveTerminalPlatformBrandLogo.pending, function (state) {
|
|
679
|
+
state.error = null;
|
|
680
|
+
})
|
|
681
|
+
.addCase(retrieveTerminalPlatformBrandLogo.fulfilled, function (state, action) {
|
|
682
|
+
var _a;
|
|
683
|
+
state.error = null;
|
|
684
|
+
var prevLogo = (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.terminalPlatformBrandLogo;
|
|
685
|
+
if (prevLogo)
|
|
686
|
+
URL.revokeObjectURL(prevLogo);
|
|
687
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { terminalPlatformBrandLogo: action.payload.logo });
|
|
688
|
+
})
|
|
689
|
+
.addCase(retrieveTerminalPlatformBrandLogo.rejected, function (state) {
|
|
690
|
+
state.error = null;
|
|
658
691
|
})
|
|
659
692
|
.addCase(retrieveTerminalList.pending, function (state) {
|
|
660
693
|
state.error = null;
|
|
@@ -91,7 +91,7 @@ var BankDetails = function () {
|
|
|
91
91
|
var defaultBankFiles = React.useMemo(function () {
|
|
92
92
|
if (!document)
|
|
93
93
|
return [];
|
|
94
|
-
return getFileDetailsFromDocument([document],
|
|
94
|
+
return getFileDetailsFromDocument([document], [DocumentPurpose.BANK_STATEMENT, DocumentPurpose.BANK_CERTIFICATE]);
|
|
95
95
|
}, [document]);
|
|
96
96
|
var originalReadOnly = useFormReadOnly(methods, { bankStatementId: defaultBankFiles });
|
|
97
97
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
@@ -67,7 +67,7 @@ import { store } from '../../app/store';
|
|
|
67
67
|
import { connectExpressSelector, setIsLeadIdPassed, setLeadId, retrieveLeadIdentityByIdAsync, setDefaultCountryCode, clearError, createAuthSessionExpiredAsync } from '../app/connectExpress/connectExpressStore';
|
|
68
68
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
69
69
|
import Collapse from '../../components/Collapse';
|
|
70
|
-
import { isKW, findOrCreateElementAndInject, sendPageView, isOtherThanKWOrSA, initializeGTM, sendCustomEventToGTM, sendCustomDimension } from '../../utils';
|
|
70
|
+
import { isKW, isEmailAuthEnabled, findOrCreateElementAndInject, sendPageView, isOtherThanKWOrSA, initializeGTM, sendCustomEventToGTM, sendCustomDimension } from '../../utils';
|
|
71
71
|
import { CONNECT_EXPRESS_SCREENS_NAVIGATION } from '../../constants';
|
|
72
72
|
import { connectExpressFeatureScreens } from '../featuresScreens';
|
|
73
73
|
import Background from '../shared/Background';
|
|
@@ -123,7 +123,7 @@ var ConnectExpress = memo(function (_a) {
|
|
|
123
123
|
}
|
|
124
124
|
}, [data.businessCountry]);
|
|
125
125
|
React.useEffect(function () {
|
|
126
|
-
var _a, _b;
|
|
126
|
+
var _a, _b, _c, _d;
|
|
127
127
|
if (settingLoading || !props.open)
|
|
128
128
|
return;
|
|
129
129
|
if (!data.isValidOperator) {
|
|
@@ -146,7 +146,10 @@ var ConnectExpress = memo(function (_a) {
|
|
|
146
146
|
dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && (
|
|
149
|
+
if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && isEmailAuthEnabled((_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.emailAuth, data.businessCountry.iso2)) {
|
|
150
|
+
dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_EMAIL_STEP'));
|
|
151
|
+
}
|
|
152
|
+
else if (((_d = data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
|
|
150
153
|
dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
151
154
|
}
|
|
152
155
|
}, [data.isValidOperator, settingLoading]);
|
|
@@ -15,7 +15,7 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useIsEmailAuth } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import { deepCopy, isKW, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
21
21
|
import { AuthForType } from '../../../../@types';
|
|
@@ -45,6 +45,7 @@ var AuthenticationList = function (_a) {
|
|
|
45
45
|
var _g = React.useState(false), isAddEntity = _g[0], setIsAddEntity = _g[1];
|
|
46
46
|
var otpData = data.otpData;
|
|
47
47
|
var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
|
|
48
|
+
var startWithEmail = useIsEmailAuth();
|
|
48
49
|
React.useEffect(function () {
|
|
49
50
|
sendCustomEventToGTM({
|
|
50
51
|
event: 'Send Event',
|
|
@@ -83,7 +84,9 @@ var AuthenticationList = function (_a) {
|
|
|
83
84
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
86
|
-
var screen =
|
|
87
|
+
var screen = startWithEmail ? 'CONNECT_EXPRESS_EMAIL_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
88
|
+
if (startWithNID)
|
|
89
|
+
screen = isKW(code) ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
|
|
87
90
|
dispatch(resetAuthenticationScreen());
|
|
88
91
|
dispatch(handlePrevScreenStep(screen));
|
|
89
92
|
};
|
|
@@ -53,7 +53,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
53
53
|
import BusinessCountry from '../../../shared/BusinessCountry';
|
|
54
54
|
import Button from '../../../shared/Button';
|
|
55
55
|
import Collapse from '../../../../components/Collapse';
|
|
56
|
-
import { findCountryByIso2, isKW, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
|
|
56
|
+
import { findCountryByIso2, isKW, isEmailAuthEnabled, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
|
|
57
57
|
import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
|
|
58
58
|
import { clearError, connectExpressSelector, setDefaultCountryCode, storeIsStartFromBusinessCountry, updateBusinessCountryAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
59
59
|
var BusinessCountryScreen = function (_a) {
|
|
@@ -74,8 +74,9 @@ var BusinessCountryScreen = function (_a) {
|
|
|
74
74
|
}, [settingsData.businessCountry, settingsData.ipCountry]);
|
|
75
75
|
var onSelectCountry = function (iso2) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
76
|
var countryCode;
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
var _a;
|
|
78
|
+
return __generator(this, function (_b) {
|
|
79
|
+
switch (_b.label) {
|
|
79
80
|
case 0:
|
|
80
81
|
if (!iso2)
|
|
81
82
|
return [2];
|
|
@@ -90,11 +91,15 @@ var BusinessCountryScreen = function (_a) {
|
|
|
90
91
|
if (!data.leadId) return [3, 2];
|
|
91
92
|
return [4, dispatch(updateBusinessCountryAsync(iso2))];
|
|
92
93
|
case 1:
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
_b.sent();
|
|
95
|
+
_b.label = 2;
|
|
95
96
|
case 2:
|
|
96
97
|
if (countryCode)
|
|
97
98
|
dispatch(setDefaultCountryCode(countryCode));
|
|
99
|
+
if (isEmailAuthEnabled((_a = settingsData.appConfig.features) === null || _a === void 0 ? void 0 : _a.emailAuth, iso2)) {
|
|
100
|
+
dispatch(handleNextScreenStep('CONNECT_EXPRESS_EMAIL_STEP'));
|
|
101
|
+
return [2];
|
|
102
|
+
}
|
|
98
103
|
if (isOtherThanKWOrSA(iso2) || isKW(iso2)) {
|
|
99
104
|
dispatch(handleNextScreenStep('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
100
105
|
return [2];
|