@tap-payments/auth-jsconnect 2.4.61-test → 2.4.63-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.
|
@@ -56,25 +56,28 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
56
56
|
};
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
|
-
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen } from '../../../app/settings';
|
|
59
|
+
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2 } from '../../../app/settings';
|
|
60
60
|
import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@types';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
64
|
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA } from '../../../utils';
|
|
65
65
|
export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
-
var _a, settings, connectExpress, countryCode, showBoard, data, phone, status, board_id, board_info_id, isRegistered,
|
|
67
|
-
var
|
|
68
|
-
return __generator(this, function (
|
|
69
|
-
switch (
|
|
66
|
+
var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, _c, boardInfo, boardData, error_1;
|
|
67
|
+
var _d, _e;
|
|
68
|
+
return __generator(this, function (_f) {
|
|
69
|
+
switch (_f.label) {
|
|
70
70
|
case 0:
|
|
71
71
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
72
72
|
countryCode = settings.data.businessCountry;
|
|
73
73
|
showBoard = connectExpress.data.showBoard;
|
|
74
74
|
return [4, API.leadService.retrieveLeadIdentity(leadId)];
|
|
75
75
|
case 1:
|
|
76
|
-
data =
|
|
77
|
-
|
|
76
|
+
data = _f.sent();
|
|
77
|
+
_b = data || {}, country_code = _b.country_code, contact = _b.contact;
|
|
78
|
+
if (country_code)
|
|
79
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
80
|
+
phone = (contact || {}).phone;
|
|
78
81
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
79
82
|
countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
|
|
80
83
|
status = data.status, board_id = data.board_id, board_info_id = data.board_info_id;
|
|
@@ -84,7 +87,7 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
84
87
|
return [2, { data: data, countryCode: countryCode }];
|
|
85
88
|
}
|
|
86
89
|
if (isRegistered && !showBoard) {
|
|
87
|
-
(
|
|
90
|
+
(_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, data);
|
|
88
91
|
thunkApi.dispatch(handleOpen(false));
|
|
89
92
|
return [2, { data: data, countryCode: countryCode }];
|
|
90
93
|
}
|
|
@@ -93,19 +96,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
93
96
|
return [2, { data: data, countryCode: countryCode }];
|
|
94
97
|
}
|
|
95
98
|
if (!(isRegistered && board_id && board_info_id)) return [3, 5];
|
|
96
|
-
|
|
99
|
+
_f.label = 2;
|
|
97
100
|
case 2:
|
|
98
|
-
|
|
101
|
+
_f.trys.push([2, 4, , 5]);
|
|
99
102
|
return [4, Promise.all([
|
|
100
103
|
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
101
104
|
API.boardService.retrieveBoardDetails(board_id)
|
|
102
105
|
])];
|
|
103
106
|
case 3:
|
|
104
|
-
|
|
107
|
+
_c = _f.sent(), boardInfo = _c[0], boardData = _c[1];
|
|
105
108
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
|
|
106
109
|
return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
|
|
107
110
|
case 4:
|
|
108
|
-
error_1 =
|
|
111
|
+
error_1 = _f.sent();
|
|
109
112
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
110
113
|
return [2, { data: data, countryCode: countryCode }];
|
|
111
114
|
case 5: return [2, { data: data, countryCode: countryCode }];
|
|
@@ -68,6 +68,8 @@ var BrandInfo = function (_a) {
|
|
|
68
68
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
69
69
|
var dataVerified = useDataVerified(data_verification, ['logo', 'name.en', 'name.ar', 'segment.teams', 'segment.type']);
|
|
70
70
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
71
|
+
console.log('brand kit noneEditable', noneEditable);
|
|
72
|
+
console.log('brand kit readOnly', readOnly);
|
|
71
73
|
var isBrandNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && ((name === null || name === void 0 ? void 0 : name.en) === watch('brandName') || (name === null || name === void 0 ? void 0 : name.ar) === watch('brandName'));
|
|
72
74
|
var isSegmentVerified = dataVerified['segment.type'] && ((_b = resSegment === null || resSegment === void 0 ? void 0 : resSegment.type) === null || _b === void 0 ? void 0 : _b.id) === ((_c = watch('segment')) === null || _c === void 0 ? void 0 : _c.id);
|
|
73
75
|
var isTeamSizeVerified = dataVerified['segment.teams'] && ((_d = resSegment === null || resSegment === void 0 ? void 0 : resSegment.team) === null || _d === void 0 ? void 0 : _d.id) === ((_e = watch('teamSize')) === null || _e === void 0 ? void 0 : _e.id);
|
|
@@ -48,8 +48,10 @@ var Segments = function (_a) {
|
|
|
48
48
|
}
|
|
49
49
|
}, [segmentsList]);
|
|
50
50
|
var onOpenList = function (event) {
|
|
51
|
+
console.log('readOnly', readOnly);
|
|
51
52
|
if (readOnly)
|
|
52
53
|
return;
|
|
54
|
+
console.log('onOpenList segments');
|
|
53
55
|
setAnchorEl(event.currentTarget);
|
|
54
56
|
onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
|
|
55
57
|
};
|
|
@@ -58,6 +60,7 @@ var Segments = function (_a) {
|
|
|
58
60
|
onListClose === null || onListClose === void 0 ? void 0 : onListClose();
|
|
59
61
|
};
|
|
60
62
|
var onSelectItem = function (segment) {
|
|
63
|
+
console.log('onSelectItem segments', segment);
|
|
61
64
|
onCloseList();
|
|
62
65
|
segmentControl.field.onChange(segment);
|
|
63
66
|
};
|
|
@@ -48,8 +48,10 @@ var TeamSize = function (_a) {
|
|
|
48
48
|
}
|
|
49
49
|
}, [teamSizesList]);
|
|
50
50
|
var onOpenList = function (event) {
|
|
51
|
+
console.log('readOnly', readOnly);
|
|
51
52
|
if (readOnly)
|
|
52
53
|
return;
|
|
54
|
+
console.log('onOpenList teamSize');
|
|
53
55
|
setAnchorEl(event.currentTarget);
|
|
54
56
|
onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
|
|
55
57
|
};
|
|
@@ -58,6 +60,7 @@ var TeamSize = function (_a) {
|
|
|
58
60
|
onListClose === null || onListClose === void 0 ? void 0 : onListClose();
|
|
59
61
|
};
|
|
60
62
|
var onSelectItem = function (teamSize) {
|
|
63
|
+
console.log('onSelectItem teamSize', teamSize);
|
|
61
64
|
onCloseList();
|
|
62
65
|
teamSizeControl.field.onChange(teamSize);
|
|
63
66
|
};
|