@tap-payments/auth-jsconnect 2.8.55-beta → 2.8.55-development
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 +1 -0
- package/build/@types/form.d.ts +1 -0
- package/build/@types/redux.d.ts +1 -0
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +12 -4
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +0 -2
- package/build/constants/app.js +0 -2
- package/build/features/app/bank/bankStore.d.ts +13 -18
- package/build/features/app/bank/bankStore.js +184 -165
- package/build/features/app/board/boardStore.js +52 -30
- package/build/features/app/brand/brandStore.d.ts +16 -33
- package/build/features/app/brand/brandStore.js +239 -242
- package/build/features/app/business/businessStore.d.ts +0 -5
- package/build/features/app/business/businessStore.js +76 -87
- package/build/features/app/connectExpress/connectExpressStore.d.ts +15 -6
- package/build/features/app/connectExpress/connectExpressStore.js +110 -52
- package/build/features/app/entity/entityStore.d.ts +20 -36
- package/build/features/app/entity/entityStore.js +196 -246
- package/build/features/app/individual/individualStore.d.ts +22 -38
- package/build/features/app/individual/individualStore.js +263 -266
- package/build/features/app/password/passwordStore.d.ts +40 -23
- package/build/features/app/password/passwordStore.js +226 -233
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +168 -147
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +13 -1
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/bank/Bank.d.ts +1 -0
- package/build/features/bank/Bank.js +7 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
- package/build/features/bank/screens/OperatorError/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +8 -4
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/board/screens/OperatorError/index.d.ts +3 -0
- package/build/features/board/screens/OperatorError/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -4
- package/build/features/brand/Brand.d.ts +1 -0
- package/build/features/brand/Brand.js +7 -4
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +49 -12
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +23 -5
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +23 -7
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
- package/build/features/brand/screens/OperatorError/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +9 -4
- package/build/features/business/screens/Activities/Activities.js +12 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +10 -2
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +12 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -3
- package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/business/screens/OperatorError/index.d.ts +3 -0
- package/build/features/business/screens/OperatorError/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
- package/build/features/business/screens/Verify/Verify.js +13 -3
- package/build/features/connect/Connect.js +3 -2
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +9 -2
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +3 -1
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +11 -8
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +2 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +9 -0
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +90 -0
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +6 -1
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +3 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +10 -0
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -1
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
- package/build/features/connectExpress/screens/Mobile/Mobile.js +9 -2
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +1 -0
- package/build/features/entity/Entity.js +7 -4
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +34 -10
- package/build/features/entity/screens/EntityName/EntityName.js +32 -15
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
- package/build/features/entity/screens/OperatorError/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +67 -7
- package/build/features/individual/Individual.d.ts +1 -0
- package/build/features/individual/Individual.js +7 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +14 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +76 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +3 -2
- package/build/features/individual/screens/IndividualList/Email.js +3 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
- package/build/features/individual/screens/IndividualList/UserList.js +13 -9
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
- package/build/features/individual/screens/OperatorError/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +1 -0
- package/build/features/password/Password.js +75 -28
- package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/password/screens/OperatorError/index.d.ts +3 -0
- package/build/features/password/screens/OperatorError/index.js +2 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Button/FlowsButtons.js +13 -3
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -0
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +5 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/signIn/SignIn.js +12 -3
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
- package/build/features/signIn/screens/OperatorError/index.js +2 -0
- package/build/features/tax/Tax.d.ts +1 -0
- package/build/features/tax/Tax.js +7 -4
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
- package/build/features/tax/screens/OperatorError/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/hooks/useVerifyToken.d.ts +5 -2
- package/build/hooks/useVerifyToken.js +10 -5
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +2 -1
- package/build/utils/string.d.ts +5 -2
- package/build/utils/string.js +34 -5
- package/package.json +2 -2
|
@@ -17,8 +17,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
17
17
|
import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { alpha, styled } from '@mui/material/styles';
|
|
20
|
-
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
21
|
-
import { convertToEnglishDateFormat, deepCopy, getUserName, isOtherThanKWOrSA } from '../../../../utils';
|
|
20
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified, useFormDirtyCheck } from '../../../../hooks';
|
|
21
|
+
import { convertToEnglishDateFormat, deepCopy, findCountryByIddPrefix, findCountryByIso2, getUserName, isKWOrSA, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Collapse from '../../../../components/Collapse';
|
|
24
24
|
import Text from '../../../../components/Text';
|
|
@@ -50,17 +50,17 @@ var ListType;
|
|
|
50
50
|
ListType["NationalityList"] = "NationalityList";
|
|
51
51
|
})(ListType || (ListType = {}));
|
|
52
52
|
var IndividualPersonalInfo = function (_a) {
|
|
53
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
53
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
54
54
|
var t = useTranslation().t;
|
|
55
55
|
var isAr = useLanguage().isAr;
|
|
56
56
|
var dispatch = useAppDispatch();
|
|
57
|
-
var
|
|
57
|
+
var _p = useAppSelector(individualSelector), data = _p.data, loading = _p.loading, error = _p.error, cityLoading = _p.cityLoading;
|
|
58
58
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
59
59
|
var countries = settingsData.countries;
|
|
60
60
|
var verify = data.verify, individualPersonalData = data.individualPersonalData;
|
|
61
|
-
var
|
|
61
|
+
var _q = verify.responseBody || {}, user = _q.user, flows = _q.flows;
|
|
62
62
|
var name = individualPersonalData.name, email = individualPersonalData.email, mobile = individualPersonalData.mobile, countryCode = individualPersonalData.countryCode, gender = individualPersonalData.gender, nid = individualPersonalData.nid, issuedCountry = individualPersonalData.issuedCountry, expiryDate = individualPersonalData.expiryDate, dob = individualPersonalData.dob, placeOfBirthCountry = individualPersonalData.placeOfBirthCountry, placeOfBirthCity = individualPersonalData.placeOfBirthCity, nationality = individualPersonalData.nationality;
|
|
63
|
-
var
|
|
63
|
+
var _r = user || {}, data_status = _r.data_status, is_authorized = _r.is_authorized, data_verification = _r.data_verification, contact = _r.contact, genderRes = _r.gender, identification = _r.identification, birth = _r.birth, nationalityRes = _r.nationality;
|
|
64
64
|
var isOtherCountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
65
65
|
var methods = useForm({
|
|
66
66
|
resolver: yupResolver(IndividualInfoValidationSchema(isOtherCountry)),
|
|
@@ -82,9 +82,51 @@ var IndividualPersonalInfo = function (_a) {
|
|
|
82
82
|
});
|
|
83
83
|
var watch = methods.watch;
|
|
84
84
|
useSetFromDefaultValues(methods, data.individualPersonalData);
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
85
|
+
var _s = React.useState(), listActive = _s[0], setListActive = _s[1];
|
|
86
|
+
var _t = React.useState(false), dobActive = _t[0], setDobActive = _t[1];
|
|
87
|
+
var _u = React.useState(false), expiryDateActive = _u[0], setExpiryDateActive = _u[1];
|
|
88
|
+
var expDateRes = (identification === null || identification === void 0 ? void 0 : identification.expiry) && convertToEnglishDateFormat(new Date(identification === null || identification === void 0 ? void 0 : identification.expiry));
|
|
89
|
+
var dobDateRes = (birth === null || birth === void 0 ? void 0 : birth.date) && convertToEnglishDateFormat(new Date(birth === null || birth === void 0 ? void 0 : birth.date));
|
|
90
|
+
var resCountryCode = React.useMemo(function () {
|
|
91
|
+
var _a;
|
|
92
|
+
if (!((_a = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _a === void 0 ? void 0 : _a.country_code))
|
|
93
|
+
return {};
|
|
94
|
+
return findCountryByIddPrefix(countries, contact.phone.country_code) || {};
|
|
95
|
+
}, [(_b = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _b === void 0 ? void 0 : _b.country_code]);
|
|
96
|
+
var resIssuedCountry = React.useMemo(function () {
|
|
97
|
+
if (!(identification === null || identification === void 0 ? void 0 : identification.issued_country_code))
|
|
98
|
+
return;
|
|
99
|
+
return findCountryByIso2(countries, identification.issued_country_code);
|
|
100
|
+
}, [identification === null || identification === void 0 ? void 0 : identification.issued_country_code]);
|
|
101
|
+
var resPlaceOfBirthCountry = React.useMemo(function () {
|
|
102
|
+
if (!(birth === null || birth === void 0 ? void 0 : birth.country))
|
|
103
|
+
return;
|
|
104
|
+
return findCountryByIso2(countries, birth.country);
|
|
105
|
+
}, [birth === null || birth === void 0 ? void 0 : birth.country]);
|
|
106
|
+
var resNationality = React.useMemo(function () {
|
|
107
|
+
if (!nationalityRes)
|
|
108
|
+
return;
|
|
109
|
+
return findCountryByIso2(countries, nationalityRes);
|
|
110
|
+
}, [nationalityRes]);
|
|
111
|
+
var isDirty = useFormDirtyCheck(methods, {
|
|
112
|
+
name: getUserName(user, false),
|
|
113
|
+
email: contact === null || contact === void 0 ? void 0 : contact.email,
|
|
114
|
+
mobile: (_c = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _c === void 0 ? void 0 : _c.number,
|
|
115
|
+
countryCode: resCountryCode,
|
|
116
|
+
gender: genderRes === null || genderRes === void 0 ? void 0 : genderRes.toLowerCase(),
|
|
117
|
+
nid: identification === null || identification === void 0 ? void 0 : identification.id,
|
|
118
|
+
issuedCountry: resIssuedCountry,
|
|
119
|
+
expiryDate: expDateRes,
|
|
120
|
+
dob: dobDateRes,
|
|
121
|
+
placeOfBirthCountry: resPlaceOfBirthCountry,
|
|
122
|
+
placeOfBirthCity: ((_d = birth === null || birth === void 0 ? void 0 : birth.city) === null || _d === void 0 ? void 0 : _d.cityId) && { id: birth.city.cityId },
|
|
123
|
+
nationality: resNationality
|
|
124
|
+
}, [
|
|
125
|
+
{
|
|
126
|
+
name: 'placeOfBirthCity',
|
|
127
|
+
keys: ['id']
|
|
128
|
+
}
|
|
129
|
+
]).isDirty;
|
|
88
130
|
var originalReadOnly = useFormReadOnly(methods);
|
|
89
131
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
90
132
|
'name.en',
|
|
@@ -120,36 +162,50 @@ var IndividualPersonalInfo = function (_a) {
|
|
|
120
162
|
'nationality',
|
|
121
163
|
'gender'
|
|
122
164
|
]);
|
|
123
|
-
var expDateRes = (identification === null || identification === void 0 ? void 0 : identification.expiry) && convertToEnglishDateFormat(new Date(identification === null || identification === void 0 ? void 0 : identification.expiry));
|
|
124
|
-
var dobDateRes = (birth === null || birth === void 0 ? void 0 : birth.date) && convertToEnglishDateFormat(new Date(birth === null || birth === void 0 ? void 0 : birth.date));
|
|
125
165
|
var isNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && getUserName(user, isAr) === watch('name');
|
|
126
166
|
var isPhoneNumberVerified = dataVerified['contact.phone.number'] &&
|
|
127
167
|
dataVerified['contact.phone.country_code'] &&
|
|
128
|
-
((
|
|
129
|
-
((
|
|
168
|
+
((_e = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _e === void 0 ? void 0 : _e.number) === watch('mobile') &&
|
|
169
|
+
((_f = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _f === void 0 ? void 0 : _f.country_code) === ((_h = (_g = watch('countryCode')) === null || _g === void 0 ? void 0 : _g.idd_prefix) === null || _h === void 0 ? void 0 : _h.toString());
|
|
130
170
|
var isEmailVerified = dataVerified['contact.email'] && (contact === null || contact === void 0 ? void 0 : contact.email) === watch('email');
|
|
131
171
|
var isGenderVerified = dataVerified['gender'] && genderRes === watch('gender');
|
|
132
172
|
var isIDVerified = dataVerified['identification.id'] && (identification === null || identification === void 0 ? void 0 : identification.id) === watch('nid');
|
|
133
|
-
var isIssuedCountryVerified = dataVerified['identification.issuer_country'] && (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) === ((
|
|
173
|
+
var isIssuedCountryVerified = dataVerified['identification.issuer_country'] && (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) === ((_j = watch('issuedCountry')) === null || _j === void 0 ? void 0 : _j.iso2);
|
|
134
174
|
var isExpiryDateVerified = dataVerified['identification.expiry'] && expDateRes === watch('expiryDate');
|
|
135
175
|
var isDOBVerified = dataVerified['birth.date'] && dobDateRes === watch('dob');
|
|
136
|
-
var isBirthCountryVerified = dataVerified['birth.country'] && (birth === null || birth === void 0 ? void 0 : birth.country) === ((
|
|
137
|
-
var isBirthCityVerified = dataVerified['birth.city'] && ((
|
|
138
|
-
var isNationalityVerified = dataVerified['nationality'] && nationalityRes === ((
|
|
176
|
+
var isBirthCountryVerified = dataVerified['birth.country'] && (birth === null || birth === void 0 ? void 0 : birth.country) === ((_k = watch('placeOfBirthCountry')) === null || _k === void 0 ? void 0 : _k.iso2);
|
|
177
|
+
var isBirthCityVerified = dataVerified['birth.city'] && ((_l = birth === null || birth === void 0 ? void 0 : birth.city) === null || _l === void 0 ? void 0 : _l.cityId) === ((_m = watch('placeOfBirthCity')) === null || _m === void 0 ? void 0 : _m.id);
|
|
178
|
+
var isNationalityVerified = dataVerified['nationality'] && nationalityRes === ((_o = watch('nationality')) === null || _o === void 0 ? void 0 : _o.iso2);
|
|
179
|
+
var isKWOrSaCountry = React.useMemo(function () { return isKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
139
180
|
var onSubmit = function (data) {
|
|
140
|
-
|
|
181
|
+
var formData = __assign(__assign({}, deepCopy(getFelids(data))), { isDirty: isDirty });
|
|
182
|
+
dispatch(updateIndividualPersonalInfo(formData));
|
|
141
183
|
};
|
|
142
184
|
React.useEffect(function () {
|
|
143
185
|
if (error)
|
|
144
186
|
dispatch(clearError());
|
|
145
187
|
}, [methods.formState.isValid]);
|
|
188
|
+
React.useEffect(function () {
|
|
189
|
+
sendCustomEventToGTM({
|
|
190
|
+
event: 'Send Event',
|
|
191
|
+
event_category: 'Board Flows - Individual',
|
|
192
|
+
event_action: 'Update Personal Data Page',
|
|
193
|
+
event_label: settingsData.businessCountry.iso2
|
|
194
|
+
});
|
|
195
|
+
}, []);
|
|
146
196
|
var onBack = function () {
|
|
147
197
|
if (error)
|
|
148
198
|
dispatch(clearError());
|
|
149
|
-
if (is_authorized) {
|
|
199
|
+
if (is_authorized || !isKWOrSaCountry) {
|
|
150
200
|
dispatch(handleCurrentActiveScreen('INDIVIDUAL_LIST_STEP'));
|
|
151
201
|
return;
|
|
152
202
|
}
|
|
203
|
+
sendCustomEventToGTM({
|
|
204
|
+
event: 'Send Event',
|
|
205
|
+
event_category: 'Board Flows - Individual',
|
|
206
|
+
event_action: 'Individual Details Back Button',
|
|
207
|
+
event_label: settingsData.businessCountry.iso2
|
|
208
|
+
});
|
|
153
209
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
154
210
|
dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
155
211
|
return;
|
|
@@ -173,7 +229,7 @@ var IndividualPersonalInfo = function (_a) {
|
|
|
173
229
|
var isBirthCountryListActive = listActive === ListType.BirthCountryList;
|
|
174
230
|
var isBirthCityListActive = listActive === ListType.BirthCityList;
|
|
175
231
|
var isNationalityListActive = listActive === ListType.NationalityList;
|
|
176
|
-
var disableBack = settingsData.appConfig.mode === 'content' && !is_authorized;
|
|
232
|
+
var disableBack = settingsData.appConfig.mode === 'content' && !(is_authorized || !isKWOrSaCountry);
|
|
177
233
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Name, { show: showField, readOnly: readOnly['name'] || (noneEditable['name.en'] && noneEditable['name.ar']), isVerified: isNameVerified }), _jsx(MobileNumber, { readOnly: readOnly['mobile'] || noneEditable['contact.phone.number'] || noneEditable['contact.phone.country_code'], show: !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive && !isIssuedCountryListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.MobileCountryList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isPhoneNumberVerified }), _jsx(Email, { show: showField, readOnly: readOnly['email'] || noneEditable['contact.email'], isVerified: isEmailVerified }), _jsx(Gender, { show: showField, readOnly: readOnly['gender'] || noneEditable['gender'], isVerified: isGenderVerified }), _jsx(ID, { show: showField, readOnly: readOnly['nid'] || noneEditable['identification.id'], isVerified: isIDVerified }), _jsx(IssuedCountry, { readOnly: readOnly['issuedCountry'] || noneEditable['identification.issuer_country'], show: !isMobileCountryListActive && !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.IssuedCountryList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isIssuedCountryVerified }), _jsx(ExpiryDate, { show: !listActive && !dobActive, onDateClicked: handleExpiryDateActive, readOnly: readOnly['expiryDate'] || noneEditable['identification.expiry'], isVerified: isExpiryDateVerified }), _jsx(DOB, { show: !listActive && !expiryDateActive, onDateClicked: handleDobActive, readOnly: readOnly['dob'] || noneEditable['birth.date'], isVerified: isDOBVerified }), _jsx(BirthCountry, { readOnly: readOnly['placeOfBirthCountry'] || noneEditable['birth.country'], show: !isMobileCountryListActive && !isDateFieldActive && !isIssuedCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.BirthCountryList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isBirthCountryVerified }), _jsx(BirthCity, { readOnly: readOnly['placeOfBirthCity'] || noneEditable['birth.city'], show: !isMobileCountryListActive &&
|
|
178
234
|
!isDateFieldActive &&
|
|
179
235
|
!isIssuedCountryListActive &&
|
|
@@ -58,7 +58,7 @@ var PhoneInfo = function (_a) {
|
|
|
58
58
|
if (error && methods.formState.isValid)
|
|
59
59
|
dispatch(clearError());
|
|
60
60
|
}, [methods.formState.isValid]);
|
|
61
|
-
var disabled = !methods.formState.isValid
|
|
61
|
+
var disabled = !methods.formState.isValid;
|
|
62
62
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, sx: { mb: 7.5 }, countries: countries, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
63
63
|
};
|
|
64
64
|
export default React.memo(PhoneInfo);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import GenericError from '../../../shared/GenericError';
|
|
5
|
+
var OperatorError = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(OperatorError);
|
|
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
21
21
|
var _a = useAppSelector(individualSelector), data = _a.data, loading = _a.loading;
|
|
22
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient;
|
|
25
25
|
var onClose = function () {
|
|
26
26
|
dispatch(onCloseCompleteIndividual());
|
|
27
27
|
};
|
|
28
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined }));
|
|
28
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient }));
|
|
29
29
|
};
|
|
30
30
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -72,7 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
73
|
dispatch(verifyLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
|
-
var disabled = !methods.formState.isValid ||
|
|
75
|
+
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
76
76
|
var dataLoading = loading || cityLoading;
|
|
77
77
|
var showMobileNumber = !loading && !cityLoading && phone;
|
|
78
78
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [dataLoading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), showMobileNumber && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
@@ -2,6 +2,7 @@ import { LibConfig } from '../../@types';
|
|
|
2
2
|
export interface PasswordLibProps extends LibConfig {
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
configToken?: string;
|
|
5
|
+
loaderColor?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare function PasswordElement(props: PasswordLibProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare function renderPasswordLib(config: PasswordLibProps, elementId: string): {
|
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
49
|
var t = {};
|
|
14
50
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -21,10 +57,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
57
|
return t;
|
|
22
58
|
};
|
|
23
59
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { memo
|
|
60
|
+
import { memo } from 'react';
|
|
25
61
|
import { createRoot } from 'react-dom/client';
|
|
26
|
-
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
27
|
-
import {
|
|
62
|
+
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useVerifyToken } from '../../hooks';
|
|
63
|
+
import { settingsSelector } from '../../app/settings';
|
|
28
64
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
29
65
|
import { store } from '../../app/store';
|
|
30
66
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
@@ -36,7 +72,7 @@ import { passwordFeatureScreens } from '../featuresScreens';
|
|
|
36
72
|
import { passwordSelector, verifyLeadToken, verifyOperationToken } from '../app/password/passwordStore';
|
|
37
73
|
import Background from '../shared/Background';
|
|
38
74
|
var Password = memo(function (_a) {
|
|
39
|
-
var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
|
|
75
|
+
var configToken = _a.configToken, loaderColor = _a.loaderColor, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "loaderColor", "verifyToken"]);
|
|
40
76
|
var theme = useAppTheme().theme;
|
|
41
77
|
var dispatch = useAppDispatch();
|
|
42
78
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
@@ -45,31 +81,42 @@ var Password = memo(function (_a) {
|
|
|
45
81
|
useErrorListener(passwordError || error);
|
|
46
82
|
useStepStartedListener();
|
|
47
83
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress, featureScreensNavigation = data.featureScreensNavigation, appConfig = data.appConfig;
|
|
48
|
-
var handleVerifyToken = function () {
|
|
49
|
-
var token =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
var handleVerifyToken = function (_a) {
|
|
85
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
86
|
+
return function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
|
+
var operationType, boardId, boardInfoId, userId, userType;
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
operationType = getParameterByName('operation_type');
|
|
90
|
+
boardId = getParameterByName('board_id') || '';
|
|
91
|
+
boardInfoId = getParameterByName('board_info_id') || '';
|
|
92
|
+
userId = getParameterByName('user_id') || '';
|
|
93
|
+
userType = getParameterByName('user_type') || '';
|
|
94
|
+
initializeGTM();
|
|
95
|
+
sendPageView({
|
|
96
|
+
title: 'Password'
|
|
97
|
+
});
|
|
98
|
+
if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
|
|
99
|
+
dispatch(verifyOperationToken({ token: token, boardId: boardId, boardInfoId: boardInfoId, userId: userId, userType: userType }));
|
|
100
|
+
return [2];
|
|
101
|
+
}
|
|
102
|
+
dispatch(verifyLeadToken({ token: token, isInternally: isInternally }));
|
|
103
|
+
return [2];
|
|
104
|
+
});
|
|
105
|
+
}); };
|
|
67
106
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
107
|
+
useVerifyToken({
|
|
108
|
+
verify: handleVerifyToken,
|
|
109
|
+
loadingScreenName: 'PASSWORD_LOADING_DATA_STEP',
|
|
110
|
+
navigation: featureScreensNavigation,
|
|
111
|
+
open: open,
|
|
112
|
+
mode: props.mode,
|
|
113
|
+
internalToken: verifyToken,
|
|
114
|
+
settingLoading: settingLoading,
|
|
115
|
+
isValidOperator: data.isValidOperator,
|
|
116
|
+
operatorErrorScreenName: 'PASSWORD_OPERATOR_ERROR_STEP'
|
|
117
|
+
});
|
|
118
|
+
var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
|
|
119
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', loaderColor: loaderColor, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
73
120
|
var Element = _a.element, name = _a.name;
|
|
74
121
|
var isActive = activeScreen.name === name;
|
|
75
122
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -17,7 +17,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
17
17
|
import Box from '@mui/material/Box';
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
19
|
import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
|
|
20
|
-
import {
|
|
20
|
+
import { handleNextScreenStep, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import { useLanguage } from '../../../../hooks';
|
|
23
23
|
import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
@@ -25,7 +25,7 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
26
26
|
import { PasswordValidation } from './validation';
|
|
27
27
|
import Password from './Password';
|
|
28
|
-
import { createPassword, passwordSelector, storePasswordScreen } from '../../../app/password/passwordStore';
|
|
28
|
+
import { createPassword, passwordSelector, retrieveBoardStatus, storePasswordScreen } from '../../../app/password/passwordStore';
|
|
29
29
|
import { useSelector } from 'react-redux';
|
|
30
30
|
import { deepCopy } from '../../../../utils';
|
|
31
31
|
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
@@ -61,9 +61,13 @@ var CreatePassword = function (_a) {
|
|
|
61
61
|
dispatch(createPassword(deepCopy(data)));
|
|
62
62
|
};
|
|
63
63
|
var onBack = function () {
|
|
64
|
-
|
|
64
|
+
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
65
|
+
dispatch(handlePrevScreenStep());
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
dispatch(retrieveBoardStatus());
|
|
65
69
|
};
|
|
66
|
-
var disableBack = settingsData.appConfig.mode === 'content'
|
|
70
|
+
var disableBack = settingsData.appConfig.mode === 'content';
|
|
67
71
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
68
72
|
};
|
|
69
73
|
export default React.memo(CreatePassword);
|
|
@@ -83,7 +83,7 @@ var OTP = function (_a) {
|
|
|
83
83
|
var onBack = function () {
|
|
84
84
|
dispatch(handlePrevScreenStep());
|
|
85
85
|
};
|
|
86
|
-
var disabled = !methods.formState.isValid
|
|
86
|
+
var disabled = !methods.formState.isValid;
|
|
87
87
|
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.auth_info) === null || _c === void 0 ? void 0 : _c.phone;
|
|
88
88
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
89
89
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import GenericError from '../../../shared/GenericError';
|
|
5
|
+
var OperatorError = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(OperatorError);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { useAppSelector } from '../../../../hooks';
|
|
4
|
+
import DataLoading from '../../../shared/DataLoading';
|
|
5
|
+
import { individualSelector } from '../../../app/individual/individualStore';
|
|
6
|
+
export var PrepareDataLoading = function () {
|
|
7
|
+
var error = useAppSelector(individualSelector).error;
|
|
8
|
+
return _jsx(DataLoading, { error: error });
|
|
9
|
+
};
|
|
10
|
+
export default memo(PrepareDataLoading);
|
|
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
21
21
|
var _a = useAppSelector(passwordSelector), data = _a.data, loading = _a.loading;
|
|
22
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient;
|
|
25
25
|
var onClose = function () {
|
|
26
26
|
dispatch(onCloseCompletePassword());
|
|
27
27
|
};
|
|
28
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined }));
|
|
28
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient }));
|
|
29
29
|
};
|
|
30
30
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -46,9 +46,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
46
46
|
flexDirection: 'column'
|
|
47
47
|
}); });
|
|
48
48
|
var VerifyNumber = function (_a) {
|
|
49
|
-
var _b, _c
|
|
49
|
+
var _b, _c;
|
|
50
50
|
var dispatch = useAppDispatch();
|
|
51
|
-
var
|
|
51
|
+
var _d = useAppSelector(passwordSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
52
52
|
var otp = data.otpData.otp;
|
|
53
53
|
var methods = useForm({
|
|
54
54
|
resolver: yupResolver(OTPValidation),
|
|
@@ -60,8 +60,8 @@ var VerifyNumber = function (_a) {
|
|
|
60
60
|
useSetFromDefaultValues(methods, data.otpData);
|
|
61
61
|
var t = useTranslation().t;
|
|
62
62
|
var isAr = useLanguage().isAr;
|
|
63
|
-
var
|
|
64
|
-
var phone = (
|
|
63
|
+
var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
|
|
64
|
+
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
|
|
65
65
|
React.useEffect(function () {
|
|
66
66
|
if (error && methods.formState.isValid && phone)
|
|
67
67
|
dispatch(clearError());
|
|
@@ -72,7 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
73
|
dispatch(verifyPasswordLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
|
-
var disabled = !methods.formState.isValid ||
|
|
75
|
+
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
76
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
77
|
};
|
|
78
78
|
export default React.memo(VerifyNumber);
|
|
@@ -48,6 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
49
|
import { useState } from 'react';
|
|
50
50
|
import { useTranslation } from 'react-i18next';
|
|
51
|
+
import { capitalize } from 'lodash-es';
|
|
51
52
|
import Button from '../../../components/Button';
|
|
52
53
|
import { Button as SharedButton } from '../../shared/Button';
|
|
53
54
|
import { alpha, styled } from '@mui/material/styles';
|
|
@@ -57,7 +58,8 @@ import { ICONS_NAMES } from '../../../constants';
|
|
|
57
58
|
import CheckIcon from '@mui/icons-material/Check';
|
|
58
59
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../hooks';
|
|
59
60
|
import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../app/settings';
|
|
60
|
-
import {
|
|
61
|
+
import { FlowsTypes } from '../../../@types';
|
|
62
|
+
import { dangerousMessage, getScreenNameBasedOnFlow, isKWOrSA, sendCustomEventToGTM } from '../../../utils';
|
|
61
63
|
import API from '../../../api';
|
|
62
64
|
import Text from '../../../components/Text';
|
|
63
65
|
import Dot from '../Dot';
|
|
@@ -160,8 +162,16 @@ export default function FlowsButtons(_a) {
|
|
|
160
162
|
var onRedirect = function (item) {
|
|
161
163
|
if (!item.href)
|
|
162
164
|
return;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
var name = flowName === FlowsTypes.BANK ? 'Wallet' : capitalize(flowName);
|
|
166
|
+
sendCustomEventToGTM({
|
|
167
|
+
event: 'Send Event',
|
|
168
|
+
event_category: "Board Flows - ".concat(name),
|
|
169
|
+
event_action: "".concat(name, " Kit Click"),
|
|
170
|
+
event_label: settingsData.businessCountry.iso2
|
|
171
|
+
});
|
|
172
|
+
if (flowName === item.name && !isResetPassword(item.name, item.status)) {
|
|
173
|
+
var isOtherThanSAOrKWCountry = !isKWOrSA(settingsData.businessCountry.iso2);
|
|
174
|
+
dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser, isOtherThanSAOrKWCountry)));
|
|
165
175
|
return;
|
|
166
176
|
}
|
|
167
177
|
if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
3
|
interface FeatureContainerProps extends BoxProps {
|
|
4
4
|
isMaturityExpress?: boolean;
|
|
5
|
+
mode?: 'popup' | 'page' | 'content';
|
|
5
6
|
}
|
|
6
7
|
declare const FeatureContainer: React.ForwardRefExoticComponent<Omit<FeatureContainerProps, "ref"> & React.RefAttributes<unknown>>;
|
|
7
8
|
export default FeatureContainer;
|
|
@@ -13,9 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { styled } from '@mui/material/styles';
|
|
15
15
|
import Box from '@mui/material/Box';
|
|
16
|
-
var Container = styled(Box, { shouldForwardProp: function (prop) { return
|
|
16
|
+
var Container = styled(Box, { shouldForwardProp: function (prop) { return !['isMaturityExpress', 'mode'].includes(prop); } })(function (_a) {
|
|
17
17
|
var _b;
|
|
18
|
-
var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress;
|
|
18
|
+
var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress, mode = _a.mode;
|
|
19
19
|
return (_b = {
|
|
20
20
|
width: '100%',
|
|
21
21
|
minHeight: theme.spacing(30),
|
|
@@ -27,7 +27,7 @@ var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !
|
|
|
27
27
|
property: 'all'
|
|
28
28
|
},
|
|
29
29
|
_b[theme.breakpoints.down('sm')] = {
|
|
30
|
-
paddingTop: isMaturityExpress ? theme.spacing(
|
|
30
|
+
paddingTop: isMaturityExpress || mode === 'content' ? theme.spacing(0.625) : theme.spacing(6)
|
|
31
31
|
},
|
|
32
32
|
_b);
|
|
33
33
|
});
|
|
@@ -12,8 +12,12 @@ interface SuccessFlowButtonsProps {
|
|
|
12
12
|
boardInfoId: string;
|
|
13
13
|
boardId: string;
|
|
14
14
|
flowName: FlowsTypes;
|
|
15
|
+
recipient: {
|
|
16
|
+
id: string;
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
15
19
|
onClose?: () => void;
|
|
16
20
|
loading?: boolean;
|
|
17
21
|
}
|
|
18
|
-
declare const _default: React.MemoExoticComponent<({ brand, entity, business, merchant, bank, user, flows, boardInfoId, boardId, flowName, individuals, onClose, loading }: SuccessFlowButtonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
22
|
+
declare const _default: React.MemoExoticComponent<({ brand, entity, business, merchant, bank, user, flows, boardInfoId, boardId, flowName, individuals, recipient, onClose, loading }: SuccessFlowButtonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
23
|
export default _default;
|