@tap-payments/auth-jsconnect 2.6.94-test → 2.6.95-test
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/features/app/individual/individualStore.d.ts +2 -0
- package/build/features/app/individual/individualStore.js +98 -66
- package/build/features/individual/screens/IndividualList/UserList.js +7 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -2
- package/build/features/shared/Button/FlowsButtons.js +3 -2
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +2 -2
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ export declare const verifyToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
24
24
|
flows: any;
|
|
25
25
|
};
|
|
26
26
|
token: string;
|
|
27
|
+
userList: User[];
|
|
27
28
|
}, VerifyLeadTokenProps, {
|
|
28
29
|
state?: unknown;
|
|
29
30
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -191,6 +192,7 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
191
192
|
formData: {
|
|
192
193
|
otp: string;
|
|
193
194
|
};
|
|
195
|
+
userList: User[] | undefined;
|
|
194
196
|
}, OTPFormValues, {
|
|
195
197
|
state?: unknown;
|
|
196
198
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -75,10 +75,10 @@ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountry
|
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
76
76
|
var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
|
|
77
77
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
-
var payload, settings, data,
|
|
79
|
-
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
78
|
+
var payload, settings, data, individualData, boardData, countryCode, boardInfoData, userList, boardInfoStatus, countries, publicKey, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry, individuals, _c, is_authorized, data_state;
|
|
79
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
80
|
+
return __generator(this, function (_p) {
|
|
81
|
+
switch (_p.label) {
|
|
82
82
|
case 0:
|
|
83
83
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
84
84
|
notification: {
|
|
@@ -88,7 +88,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
88
88
|
settings = thunkApi.getState().settings;
|
|
89
89
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
90
90
|
case 1:
|
|
91
|
-
data = (
|
|
91
|
+
data = (_p.sent()).data;
|
|
92
|
+
individualData = undefined;
|
|
92
93
|
boardInfoStatus = undefined;
|
|
93
94
|
countries = settings.data.countries;
|
|
94
95
|
if (((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
@@ -105,63 +106,77 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
105
106
|
}
|
|
106
107
|
if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
|
|
107
108
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
|
|
108
|
-
return [3,
|
|
109
|
+
return [3, 20];
|
|
109
110
|
case 2:
|
|
110
|
-
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3,
|
|
111
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 19];
|
|
111
112
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
112
113
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
113
114
|
if (!(board_id && board_info_id)) return [3, 5];
|
|
114
115
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
115
116
|
case 3:
|
|
116
|
-
boardInfoData =
|
|
117
|
+
boardInfoData = _p.sent();
|
|
117
118
|
notification = (boardInfoData || {}).notification;
|
|
118
119
|
_b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
|
|
119
120
|
if (!(id && type)) return [3, 5];
|
|
120
121
|
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
121
122
|
case 4:
|
|
122
|
-
data_1 = (
|
|
123
|
+
data_1 = (_p.sent()).data;
|
|
123
124
|
individualData = data_1 || {};
|
|
124
|
-
|
|
125
|
+
_p.label = 5;
|
|
125
126
|
case 5:
|
|
126
127
|
if (!board_id) return [3, 7];
|
|
127
128
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
128
129
|
case 6:
|
|
129
|
-
boardData =
|
|
130
|
-
|
|
130
|
+
boardData = _p.sent();
|
|
131
|
+
_p.label = 7;
|
|
131
132
|
case 7:
|
|
132
133
|
if (!countryCode) {
|
|
133
134
|
countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
|
|
134
135
|
if (countryCode)
|
|
135
136
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
136
137
|
}
|
|
137
|
-
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
|
|
138
|
+
if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 11];
|
|
138
139
|
if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 9];
|
|
139
|
-
return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
|
|
140
|
+
return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)).unwrap()];
|
|
140
141
|
case 8:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
case 9:
|
|
142
|
+
userList = _p.sent();
|
|
143
|
+
_p.label = 9;
|
|
144
|
+
case 9:
|
|
145
|
+
userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id); });
|
|
146
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
144
147
|
case 10:
|
|
145
|
-
boardInfoStatus =
|
|
148
|
+
boardInfoStatus = _p.sent();
|
|
146
149
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
147
|
-
return [3,
|
|
150
|
+
return [3, 18];
|
|
148
151
|
case 11:
|
|
149
|
-
|
|
150
|
-
if (!
|
|
151
|
-
return [4, thunkApi.dispatch(
|
|
152
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 15];
|
|
153
|
+
if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 13];
|
|
154
|
+
return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id)).unwrap()];
|
|
152
155
|
case 12:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
case 13:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
userList = _p.sent();
|
|
157
|
+
_p.label = 13;
|
|
158
|
+
case 13: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
159
|
+
case 14:
|
|
160
|
+
boardInfoStatus = _p.sent();
|
|
161
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
162
|
+
return [3, 18];
|
|
159
163
|
case 15:
|
|
164
|
+
birthCountry = ((_l = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _l === void 0 ? void 0 : _l.country) || countryCode;
|
|
165
|
+
if (!birthCountry) return [3, 17];
|
|
166
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
167
|
+
case 16:
|
|
168
|
+
_p.sent();
|
|
169
|
+
_p.label = 17;
|
|
170
|
+
case 17:
|
|
171
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
172
|
+
_p.label = 18;
|
|
173
|
+
case 18: return [3, 20];
|
|
174
|
+
case 19:
|
|
160
175
|
if (isUpdatePhoneInfo) {
|
|
161
176
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
|
|
162
177
|
}
|
|
163
|
-
|
|
164
|
-
case
|
|
178
|
+
_p.label = 20;
|
|
179
|
+
case 20:
|
|
165
180
|
individuals = (boardData || {}).individuals;
|
|
166
181
|
_c = individualData || {}, is_authorized = _c.is_authorized, data_state = _c.data_state;
|
|
167
182
|
return [2, {
|
|
@@ -172,8 +187,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
172
187
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
173
188
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
174
189
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
175
|
-
name: (
|
|
176
|
-
contact: (
|
|
190
|
+
name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
|
|
191
|
+
contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
|
|
177
192
|
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
178
193
|
countries: countries,
|
|
179
194
|
countryCode: countryCode,
|
|
@@ -181,7 +196,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
181
196
|
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
182
197
|
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
183
198
|
},
|
|
184
|
-
token: token
|
|
199
|
+
token: token,
|
|
200
|
+
userList: userList || []
|
|
185
201
|
}];
|
|
186
202
|
}
|
|
187
203
|
});
|
|
@@ -424,10 +440,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
424
440
|
});
|
|
425
441
|
}); });
|
|
426
442
|
export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
427
|
-
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData,
|
|
428
|
-
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
429
|
-
return __generator(this, function (
|
|
430
|
-
switch (
|
|
443
|
+
var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, individualData, boardInfoData, userList, boardData, boardInfoStatus, publicKey, countryCode, notification, _c, id, type, data_3, birthCountry, individuals, _d, is_authorized, data_state;
|
|
444
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
445
|
+
return __generator(this, function (_t) {
|
|
446
|
+
switch (_t.label) {
|
|
431
447
|
case 0:
|
|
432
448
|
_a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
|
|
433
449
|
responseBody = individual.data.verify.responseBody;
|
|
@@ -442,7 +458,8 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
442
458
|
};
|
|
443
459
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
444
460
|
case 1:
|
|
445
|
-
data = (
|
|
461
|
+
data = (_t.sent()).data;
|
|
462
|
+
individualData = undefined;
|
|
446
463
|
boardInfoStatus = undefined;
|
|
447
464
|
if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
|
|
448
465
|
throw new Error(data.errors[0].description);
|
|
@@ -453,48 +470,62 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
453
470
|
if (!board_id) return [3, 3];
|
|
454
471
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
455
472
|
case 2:
|
|
456
|
-
boardData =
|
|
457
|
-
|
|
473
|
+
boardData = _t.sent();
|
|
474
|
+
_t.label = 3;
|
|
458
475
|
case 3:
|
|
459
476
|
countryCode = (_h = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _h === void 0 ? void 0 : _h.country;
|
|
460
477
|
if (!(board_id && board_info_id)) return [3, 6];
|
|
461
478
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
462
479
|
case 4:
|
|
463
|
-
boardInfoData =
|
|
480
|
+
boardInfoData = _t.sent();
|
|
464
481
|
notification = (boardInfoData || {}).notification;
|
|
465
482
|
_c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
|
|
466
483
|
if (!(id && type)) return [3, 6];
|
|
467
484
|
return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
|
|
468
485
|
case 5:
|
|
469
|
-
data_3 = (
|
|
486
|
+
data_3 = (_t.sent()).data;
|
|
470
487
|
individualData = data_3 || {};
|
|
471
|
-
|
|
488
|
+
_t.label = 6;
|
|
472
489
|
case 6:
|
|
473
490
|
if (countryCode)
|
|
474
491
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
475
|
-
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
|
|
492
|
+
if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 10];
|
|
476
493
|
if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 8];
|
|
477
|
-
return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id))];
|
|
494
|
+
return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id)).unwrap()];
|
|
478
495
|
case 7:
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
case 8:
|
|
496
|
+
userList = _t.sent();
|
|
497
|
+
_t.label = 8;
|
|
498
|
+
case 8:
|
|
499
|
+
userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id); });
|
|
500
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
482
501
|
case 9:
|
|
483
|
-
boardInfoStatus =
|
|
502
|
+
boardInfoStatus = _t.sent();
|
|
484
503
|
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
485
|
-
return [3,
|
|
504
|
+
return [3, 17];
|
|
486
505
|
case 10:
|
|
487
|
-
|
|
488
|
-
if (!
|
|
489
|
-
return [4, thunkApi.dispatch(
|
|
506
|
+
if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 14];
|
|
507
|
+
if (!((_l = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _l === void 0 ? void 0 : _l.id)) return [3, 12];
|
|
508
|
+
return [4, thunkApi.dispatch(getIndividualList((_m = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _m === void 0 ? void 0 : _m.id))];
|
|
490
509
|
case 11:
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
case 12:
|
|
494
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
495
|
-
_r.label = 13;
|
|
510
|
+
_t.sent();
|
|
511
|
+
_t.label = 12;
|
|
512
|
+
case 12: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
496
513
|
case 13:
|
|
497
|
-
|
|
514
|
+
boardInfoStatus = _t.sent();
|
|
515
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
|
|
516
|
+
return [3, 17];
|
|
517
|
+
case 14:
|
|
518
|
+
birthCountry = ((_o = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _o === void 0 ? void 0 : _o.country) || countryCode;
|
|
519
|
+
if (!birthCountry) return [3, 16];
|
|
520
|
+
return [4, thunkApi.dispatch(getCityList(birthCountry))];
|
|
521
|
+
case 15:
|
|
522
|
+
_t.sent();
|
|
523
|
+
_t.label = 16;
|
|
524
|
+
case 16:
|
|
525
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
|
|
526
|
+
_t.label = 17;
|
|
527
|
+
case 17:
|
|
528
|
+
(_q = (_p = settings.data.appConfig).onStepCompleted) === null || _q === void 0 ? void 0 : _q.call(_p, settings.data.activeScreen.name, { otp: params.otp });
|
|
498
529
|
individuals = (boardData || {}).individuals;
|
|
499
530
|
_d = individualData || {}, is_authorized = _d.is_authorized, data_state = _d.data_state;
|
|
500
531
|
return [2, {
|
|
@@ -505,8 +536,8 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
505
536
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
506
537
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
507
538
|
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
508
|
-
name: (
|
|
509
|
-
contact: (
|
|
539
|
+
name: (_r = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _r === void 0 ? void 0 : _r.names,
|
|
540
|
+
contact: (_s = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _s === void 0 ? void 0 : _s.contact,
|
|
510
541
|
individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
|
|
511
542
|
countries: countries,
|
|
512
543
|
countryCode: countryCode,
|
|
@@ -514,7 +545,8 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
514
545
|
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
515
546
|
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
516
547
|
},
|
|
517
|
-
formData: __assign({}, params)
|
|
548
|
+
formData: __assign({}, params),
|
|
549
|
+
userList: userList
|
|
518
550
|
}];
|
|
519
551
|
}
|
|
520
552
|
});
|
|
@@ -934,8 +966,8 @@ export var individualSlice = createSlice({
|
|
|
934
966
|
})
|
|
935
967
|
.addCase(verifyToken.fulfilled, function (state, action) {
|
|
936
968
|
state.error = null;
|
|
937
|
-
var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse;
|
|
938
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
|
|
969
|
+
var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse, userList = _a.userList;
|
|
970
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, userList: userList });
|
|
939
971
|
state.data.verify.token = token;
|
|
940
972
|
})
|
|
941
973
|
.addCase(verifyToken.rejected, function (state, action) {
|
|
@@ -978,7 +1010,7 @@ export var individualSlice = createSlice({
|
|
|
978
1010
|
var _a;
|
|
979
1011
|
state.loading = false;
|
|
980
1012
|
state.error = null;
|
|
981
|
-
var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse;
|
|
1013
|
+
var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse, userList = _b.userList;
|
|
982
1014
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
983
1015
|
if (description) {
|
|
984
1016
|
state.error = description;
|
|
@@ -986,7 +1018,7 @@ export var individualSlice = createSlice({
|
|
|
986
1018
|
}
|
|
987
1019
|
state.data.otpData = formData;
|
|
988
1020
|
state.data.otpData.responseBody = data;
|
|
989
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
|
|
1021
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { userList: userList });
|
|
990
1022
|
})
|
|
991
1023
|
.addCase(verifyLeadOTP.rejected, function (state, action) {
|
|
992
1024
|
state.loading = false;
|
|
@@ -25,7 +25,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
25
25
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
26
26
|
import { alpha, styled, useTheme } from '@mui/material/styles';
|
|
27
27
|
import Box from '@mui/material/Box';
|
|
28
|
-
import { getUserName, isValidEmail } from '../../../../utils';
|
|
28
|
+
import { getUserName, isKWOrSA, isValidEmail } from '../../../../utils';
|
|
29
29
|
import { useLanguage, useAppSelector, useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
|
|
30
30
|
import { IndividualType } from '../../../../@types';
|
|
31
31
|
import Collapse from '../../../../components/Collapse';
|
|
@@ -35,9 +35,10 @@ import Text from '../../../../components/Text';
|
|
|
35
35
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
36
36
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
37
37
|
import { addDetailsAsync, individualSelector, requestDetailsByEmail, resetIndividualData } from '../../../app/individual/individualStore';
|
|
38
|
-
import IndividualActionButtons from '
|
|
38
|
+
import IndividualActionButtons from '../../../shared/Button/IndividualActionButtons';
|
|
39
39
|
import { IndividualCollectInfoValidationSchema } from './validation';
|
|
40
40
|
import CollectPhoneEmail from './CollectPhoneEmail';
|
|
41
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
41
42
|
var ScreenContainerStyled = styled(ScreenContainer)(function (_a) {
|
|
42
43
|
var theme = _a.theme;
|
|
43
44
|
return ({
|
|
@@ -85,10 +86,11 @@ var UserList = function (_a) {
|
|
|
85
86
|
var _j = React.useState(false), emailChecking = _j[0], setEmailChecking = _j[1];
|
|
86
87
|
var theme = useTheme();
|
|
87
88
|
var _k = useAppSelector(individualSelector), data = _k.data, loading = _k.loading, error = _k.error;
|
|
89
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
88
90
|
var _l = data.individualCollectData, email = _l.email, mobile = _l.mobile, responseBody = _l.responseBody;
|
|
89
91
|
var is_available = (responseBody || {}).is_available;
|
|
90
92
|
var verify = data.verify;
|
|
91
|
-
var _m = verify.responseBody || {}, userList = _m.userList, notification = _m.notification;
|
|
93
|
+
var _m = verify.responseBody || {}, userList = _m.userList, notification = _m.notification, userRes = _m.user;
|
|
92
94
|
var methods = useForm({
|
|
93
95
|
resolver: yupResolver(IndividualCollectInfoValidationSchema(activeUser)),
|
|
94
96
|
defaultValues: {
|
|
@@ -158,6 +160,8 @@ var UserList = function (_a) {
|
|
|
158
160
|
};
|
|
159
161
|
var isSameUserRequestedBefore = function (user) {
|
|
160
162
|
var _a, _b;
|
|
163
|
+
if (!(userRes === null || userRes === void 0 ? void 0 : userRes.is_authorized) && !isKWOrSA(settingsData.businessCountry.iso2))
|
|
164
|
+
return false;
|
|
161
165
|
return (_a = user === null || user === void 0 ? void 0 : user.ids) === null || _a === void 0 ? void 0 : _a.includes((_b = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _b === void 0 ? void 0 : _b.id);
|
|
162
166
|
};
|
|
163
167
|
var getUserStatus = function (user) {
|
|
@@ -18,7 +18,7 @@ import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } fro
|
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { alpha, styled } from '@mui/material/styles';
|
|
20
20
|
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
21
|
-
import { convertToEnglishDateFormat, deepCopy, getUserName, isOtherThanKWOrSA } from '../../../../utils';
|
|
21
|
+
import { convertToEnglishDateFormat, deepCopy, getUserName, isKWOrSA, isOtherThanKWOrSA } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Collapse from '../../../../components/Collapse';
|
|
24
24
|
import Text from '../../../../components/Text';
|
|
@@ -144,9 +144,10 @@ var IndividualPersonalInfo = function (_a) {
|
|
|
144
144
|
dispatch(clearError());
|
|
145
145
|
}, [methods.formState.isValid]);
|
|
146
146
|
var onBack = function () {
|
|
147
|
+
var isKWOrSaCountry = isKWOrSA(settingsData.businessCountry.iso2);
|
|
147
148
|
if (error)
|
|
148
149
|
dispatch(clearError());
|
|
149
|
-
if (is_authorized) {
|
|
150
|
+
if (is_authorized || !isKWOrSaCountry) {
|
|
150
151
|
dispatch(handleCurrentActiveScreen('INDIVIDUAL_LIST_STEP'));
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
@@ -57,7 +57,7 @@ import { ICONS_NAMES } from '../../../constants';
|
|
|
57
57
|
import CheckIcon from '@mui/icons-material/Check';
|
|
58
58
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../hooks';
|
|
59
59
|
import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../app/settings';
|
|
60
|
-
import { dangerousMessage, getScreenNameBasedOnFlow } from '../../../utils';
|
|
60
|
+
import { dangerousMessage, getScreenNameBasedOnFlow, isKWOrSA } from '../../../utils';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import Text from '../../../components/Text';
|
|
63
63
|
import Dot from '../Dot';
|
|
@@ -161,7 +161,8 @@ export default function FlowsButtons(_a) {
|
|
|
161
161
|
if (!item.href)
|
|
162
162
|
return;
|
|
163
163
|
if (flowName === item.name && item.name !== 'password') {
|
|
164
|
-
|
|
164
|
+
var isOtherThanSAOrKWCountry = !isKWOrSA(settingsData.businessCountry.iso2);
|
|
165
|
+
dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser, isOtherThanSAOrKWCountry)));
|
|
165
166
|
return;
|
|
166
167
|
}
|
|
167
168
|
if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
|
package/build/utils/string.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
|
42
42
|
};
|
|
43
43
|
export declare const removeRequestHeaders: () => void;
|
|
44
44
|
export declare const getBaseUrl: () => string;
|
|
45
|
-
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
45
|
+
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean, isOtherThanSAOrKWCountry?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
46
46
|
export declare const getEighteenYearsAgo: () => string;
|
|
47
47
|
export declare const isKW: (flag: string) => boolean;
|
|
48
48
|
export declare const isSA: (flag: string) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -172,7 +172,7 @@ export var getBaseUrl = function () {
|
|
|
172
172
|
}
|
|
173
173
|
return ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
174
174
|
};
|
|
175
|
-
export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser) {
|
|
175
|
+
export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherThanSAOrKWCountry) {
|
|
176
176
|
if (flow === FlowsTypes.BANK) {
|
|
177
177
|
return 'BANK_BANK_DETAILS_STEP';
|
|
178
178
|
}
|
|
@@ -180,7 +180,7 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser) {
|
|
|
180
180
|
return 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
181
181
|
}
|
|
182
182
|
if (flow === FlowsTypes.INDIVIDUAL) {
|
|
183
|
-
return isAuthorizedUser ? 'INDIVIDUAL_LIST_STEP' : 'INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP';
|
|
183
|
+
return isAuthorizedUser || isOtherThanSAOrKWCountry ? 'INDIVIDUAL_LIST_STEP' : 'INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP';
|
|
184
184
|
}
|
|
185
185
|
if (flow === FlowsTypes.CONNECT) {
|
|
186
186
|
return 'CONNECT_NID_STEP';
|