@tap-payments/auth-jsconnect 2.8.57-development → 2.8.59-beta
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 +0 -1
- package/build/@types/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +165 -184
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +242 -239
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +88 -77
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
- package/build/features/app/connectExpress/connectExpressStore.js +52 -110
- package/build/features/app/entity/entityStore.d.ts +36 -20
- package/build/features/app/entity/entityStore.js +246 -196
- package/build/features/app/individual/individualStore.d.ts +38 -22
- package/build/features/app/individual/individualStore.js +266 -263
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
- 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 +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- 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 +5 -23
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
- 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 +4 -9
- package/build/features/business/screens/Activities/Activities.js +3 -12
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +3 -12
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -14
- package/build/features/business/screens/Verify/Verify.js +3 -13
- package/build/features/connect/Connect.js +2 -3
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +1 -3
- 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 +8 -11
- 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 +1 -2
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
- 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 +1 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
- 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/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
- package/build/features/entity/screens/EntityName/EntityName.js +15 -32
- 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 +7 -67
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- 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 +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- 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 +3 -13
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +11 -14
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -31
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -36
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -18,9 +18,9 @@ import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues, u
|
|
|
18
18
|
import Form from '../../../../components/Form';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
|
-
import { handlePrevScreenStep
|
|
21
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
|
-
import { deepCopy
|
|
23
|
+
import { deepCopy } from '../../../../utils';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
25
|
import Collapse from '../../../../components/Collapse';
|
|
26
26
|
import OperationStartDate from './OperationStartDate';
|
|
@@ -36,7 +36,6 @@ var Activities = function () {
|
|
|
36
36
|
var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
37
37
|
var _c = React.useState(false), collapse = _c[0], setCollapse = _c[1];
|
|
38
38
|
var dispatch = useAppDispatch();
|
|
39
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
40
39
|
var isAr = useLanguage().isAr;
|
|
41
40
|
var t = useTranslation().t;
|
|
42
41
|
var _d = useAppSelector(businessSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
@@ -65,14 +64,6 @@ var Activities = function () {
|
|
|
65
64
|
var onBack = function () {
|
|
66
65
|
dispatch(handlePrevScreenStep());
|
|
67
66
|
};
|
|
68
|
-
React.useEffect(function () {
|
|
69
|
-
sendCustomEventToGTM({
|
|
70
|
-
event: 'Send Event',
|
|
71
|
-
event_category: 'Account Creation Flow',
|
|
72
|
-
event_action: 'Brand Activities Details Page',
|
|
73
|
-
event_label: settingsData.businessCountry.iso2
|
|
74
|
-
});
|
|
75
|
-
}, []);
|
|
76
67
|
React.useEffect(function () {
|
|
77
68
|
if (error)
|
|
78
69
|
dispatch(clearError());
|
|
@@ -81,7 +72,7 @@ var Activities = function () {
|
|
|
81
72
|
anchorEl ? setAnchorEl(false) : setAnchorEl(true);
|
|
82
73
|
};
|
|
83
74
|
var isOperationStartDateVerified = dataVerified['operations.business_start_date'] && (operations === null || operations === void 0 ? void 0 : operations.business_start_date) === methods.watch('operationStartDate');
|
|
84
|
-
var disabled = !methods.formState.isValid;
|
|
75
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
85
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(LicenseName, {}) })), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ActivitiesList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleMenuClick(); }, onListClose: function () { return handleMenuClick(); } }) })), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(OperationStartDate, { isVerified: isOperationStartDateVerified, readOnly: readOnly['operationStartDate'] || noneEditable['operations.business_start_date'], onDateClicked: handleCollapseOpenClose }) })), _jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
86
77
|
};
|
|
87
78
|
export default Activities;
|
|
@@ -23,7 +23,7 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
23
23
|
import { businessSelector, clearError, updateLeadBusinessType } from '../../../app/business/businessStore';
|
|
24
24
|
import { BusinessType as Type } from '../../../../@types';
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
26
|
-
import { deepCopy, isKW, isOtherLicense, isOtherThanKWOrSA, isSA
|
|
26
|
+
import { deepCopy, isKW, isOtherLicense, isOtherThanKWOrSA, isSA } from '../../../../utils';
|
|
27
27
|
import { KWLicenseValidationSchema, LicenseValidationSchema, OtherCountryLicenseValidationSchema } from './validation';
|
|
28
28
|
import LicenseList from './LicenseList';
|
|
29
29
|
import LicenseCertificate from './LicenseCertificate';
|
|
@@ -46,14 +46,6 @@ var BusinessType = function (_a) {
|
|
|
46
46
|
var isAr = useLanguage().isAr;
|
|
47
47
|
var dispatch = useAppDispatch();
|
|
48
48
|
var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
|
|
49
|
-
React.useEffect(function () {
|
|
50
|
-
sendCustomEventToGTM({
|
|
51
|
-
event: 'Send Event',
|
|
52
|
-
event_category: 'Account Creation Flow',
|
|
53
|
-
event_action: 'CR Page',
|
|
54
|
-
event_label: settingsData.businessCountry.iso2
|
|
55
|
-
});
|
|
56
|
-
}, []);
|
|
57
49
|
var handleMenuClick = function (flag) {
|
|
58
50
|
setListActive(flag);
|
|
59
51
|
};
|
|
@@ -107,7 +99,7 @@ var BusinessType = function (_a) {
|
|
|
107
99
|
var hasEntityList = !!(entityLicenseList === null || entityLicenseList === void 0 ? void 0 : entityLicenseList.length);
|
|
108
100
|
var showLicenseList = hasEntityList ? (isSACountry || isOtherCountry) && isOtherLicense(selectedLicenseEntity) : isSACountry || isOtherCountry;
|
|
109
101
|
var showEntityList = isKWCountry ? hasEntityList && !isLicenseListActive && isCR : hasEntityList && !isLicenseListActive;
|
|
110
|
-
var disabled = !methods.formState.isValid || uploading || uploadingArticle;
|
|
102
|
+
var disabled = !methods.formState.isValid || !!error || uploading || uploadingArticle;
|
|
111
103
|
var disableBack = !data.otpData.isNID;
|
|
112
104
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(LicenseType, { show: !listActive && isKWCountry }), _jsx(EntityLicenseList, { show: showEntityList, onListOpen: function () { return handleMenuClick(ListType.EntityLicenseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(LicenseList, { show: showLicenseList && !isEntityLicenseListActive, onListOpen: function () { return handleMenuClick(ListType.LicenseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityName, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(LicenseNumber, { show: isKWCountry ? !isAnyListActive && isCR : !isAnyListActive }), _jsx(LicenseCertificate, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(Article, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(Collapse, __assign({ in: !isAnyListActive, timeout: 500 }, { children: _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
113
105
|
};
|
|
@@ -62,7 +62,7 @@ var CivilID = function (_a) {
|
|
|
62
62
|
if (error)
|
|
63
63
|
dispatch(clearError());
|
|
64
64
|
};
|
|
65
|
-
var disabled = !methods.formState.isValid;
|
|
65
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
66
66
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: 7.5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
67
67
|
};
|
|
68
68
|
export default React.memo(CivilID);
|
|
@@ -17,7 +17,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
17
17
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
18
18
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
19
|
import { useAppDispatch, useAppSelector, useDataNoneEditable, useDataVerified, useExcludeReadOnlyFelids, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
|
|
20
|
-
import { handlePrevScreenStep
|
|
20
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
21
|
import { CustomerInfoValidation } from './validation';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Button from '../../../shared/Button';
|
|
@@ -30,7 +30,7 @@ import TransactionPolicy from './TransactionPolicy';
|
|
|
30
30
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
31
31
|
import Collapse from '../../../../components/Collapse';
|
|
32
32
|
import { businessSelector, clearError, updateCustomersInfo } from '../../../app/business/businessStore';
|
|
33
|
-
import { deepCopy
|
|
33
|
+
import { deepCopy } from '../../../../utils';
|
|
34
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
35
35
|
display: 'flex',
|
|
36
36
|
flexDirection: 'column'
|
|
@@ -45,7 +45,6 @@ var Customers = function (_a) {
|
|
|
45
45
|
var _b, _c, _d, _e, _f;
|
|
46
46
|
var _g = React.useState(), listActive = _g[0], setListActive = _g[1];
|
|
47
47
|
var dispatch = useAppDispatch();
|
|
48
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
49
48
|
var _h = useAppSelector(businessSelector), data = _h.data, loading = _h.loading, error = _h.error;
|
|
50
49
|
var _j = data.customersData, customerLocations = _j.customerLocations, expectedCustomer = _j.expectedCustomer, expectedSale = _j.expectedSale, refundPolicy = _j.refundPolicy, transactionPolicy = _j.transactionPolicy;
|
|
51
50
|
var _k = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, data_status = _k.data_status, data_verification = _k.data_verification, operations = _k.operations, terms = _k.terms;
|
|
@@ -76,14 +75,6 @@ var Customers = function (_a) {
|
|
|
76
75
|
'operations.sales_range'
|
|
77
76
|
]);
|
|
78
77
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
79
|
-
React.useEffect(function () {
|
|
80
|
-
sendCustomEventToGTM({
|
|
81
|
-
event: 'Send Event',
|
|
82
|
-
event_category: 'Account Creation Flow',
|
|
83
|
-
event_action: 'Business Market and Size Details Page',
|
|
84
|
-
event_label: settingsData.businessCountry.iso2
|
|
85
|
-
});
|
|
86
|
-
}, []);
|
|
87
78
|
React.useEffect(function () {
|
|
88
79
|
var _a, _b;
|
|
89
80
|
var isTermsAgreed = !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
@@ -136,7 +127,7 @@ var Customers = function (_a) {
|
|
|
136
127
|
var whenNotSelectExpectedCustomers = !isCustomerLocationsListActive && !isExpectedSalesListActive;
|
|
137
128
|
var whenNotSelectExpectedSales = !isCustomerLocationsListActive && !isExpectedCustomersListActive;
|
|
138
129
|
var isAnyListSelected = !isExpectedCustomersListActive && !isCustomerLocationsListActive && !isExpectedSalesListActive;
|
|
139
|
-
var disabled = !methods.formState.isValid;
|
|
130
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
140
131
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(CustomerLocations, { readOnly: readOnly['customerLocations'] || noneEditable['operations.customer_base_location'], show: whenNotSelectCustomersLocation, onListOpen: function () { return handleMenuClick(ListType.CustomerLocationsList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isCustomerLocationsVerified }), _jsx(ExpectedCustomers, { readOnly: readOnly['expectedCustomer'] || noneEditable['operations.customer_base'], show: whenNotSelectExpectedCustomers, onListOpen: function () { return handleMenuClick(ListType.ExpectedCustomersList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isExpectedCustomersVerified }), _jsx(ExpectedSales, { readOnly: readOnly['expectedSale'] || noneEditable['operations.sales_range'], show: whenNotSelectExpectedSales, onListOpen: function () { return handleMenuClick(ListType.ExpectedSalesList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isExpectedSalesRangeVerified }), _jsxs(Collapse, __assign({ in: isAnyListSelected }, { children: [_jsx(RefundPolicy, { readOnly: readOnly['refundPolicy'] || noneEditable['terms'] }), _jsx(TransactionPolicy, { readOnly: readOnly['transactionPolicy'] || noneEditable['terms'] }), _jsx(Box, __assign({ sx: { mt: 2 } }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] }))] })) })) }));
|
|
141
132
|
};
|
|
142
133
|
export default React.memo(Customers);
|
|
@@ -22,7 +22,7 @@ import Collapse from '../../../../components/Collapse';
|
|
|
22
22
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
23
23
|
import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
24
24
|
import { businessSelector, clearError } from '../../../app/business/businessStore';
|
|
25
|
-
import {
|
|
25
|
+
import { isExist } from '../../../../utils';
|
|
26
26
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
27
27
|
import Search from '../../../shared/Search';
|
|
28
28
|
import InputSelect from '../../../shared/InputSelect';
|
|
@@ -66,7 +66,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
66
66
|
var expectedSaleControl = useController({ name: 'expectedSale', control: control });
|
|
67
67
|
var _e = useAppSelector(businessSelector), data = _e.data, error = _e.error;
|
|
68
68
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
69
|
-
var activitiesData = data.activitiesData;
|
|
69
|
+
var activitiesData = data.activitiesData, currency = data.currency;
|
|
70
70
|
var expectedSales = (activitiesData.responseBody || {}).expectedSales;
|
|
71
71
|
var expectedSalesRangeValue = expectedSaleControl.field.value;
|
|
72
72
|
var countryCode = settingsData.businessCountry;
|
|
@@ -121,11 +121,8 @@ var ExpectedSalesRange = function (_a) {
|
|
|
121
121
|
if (item)
|
|
122
122
|
setSubIndex(item.id);
|
|
123
123
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
124
|
-
var getCurrency = React.useMemo(function () {
|
|
125
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
126
|
-
}, [countryCode.iso2]);
|
|
127
124
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
|
|
128
|
-
currency:
|
|
125
|
+
currency: t(currency)
|
|
129
126
|
}) }), _jsx(InputStyled, { readOnly: readOnly, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
130
127
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
131
128
|
if (isOnlyOneItem)
|
|
@@ -22,7 +22,7 @@ import Button from '../../../shared/Button';
|
|
|
22
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
23
|
import { businessSelector, clearError, updateLeadIdentity } from '../../../app/business/businessStore';
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
|
-
import { deepCopy, isOtherThanKWOrSA
|
|
25
|
+
import { deepCopy, isOtherThanKWOrSA } from '../../../../utils';
|
|
26
26
|
import { NIDOtherCountryValidationSchema, NIDValidationSchema } from './validation';
|
|
27
27
|
import ID from './ID';
|
|
28
28
|
import DOB from './DOB';
|
|
@@ -44,14 +44,6 @@ var IDBOD = function (_a) {
|
|
|
44
44
|
mode: 'onChange'
|
|
45
45
|
});
|
|
46
46
|
useSetFromDefaultValues(methods, data.nidData);
|
|
47
|
-
React.useEffect(function () {
|
|
48
|
-
sendCustomEventToGTM({
|
|
49
|
-
event: 'Send Event',
|
|
50
|
-
event_category: 'Account Creation Flow',
|
|
51
|
-
event_action: 'ID Details Step',
|
|
52
|
-
event_label: settingsData.businessCountry.iso2
|
|
53
|
-
});
|
|
54
|
-
}, []);
|
|
55
47
|
React.useEffect(function () {
|
|
56
48
|
if (error)
|
|
57
49
|
dispatch(clearError());
|
|
@@ -62,7 +54,7 @@ var IDBOD = function (_a) {
|
|
|
62
54
|
var handleCollapseOpenClose = function (flag) {
|
|
63
55
|
setCollapse(flag);
|
|
64
56
|
};
|
|
65
|
-
var disabled = !methods.formState.isValid;
|
|
57
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
66
58
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ID, {}) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, disableBack: true, isAr: isAr, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
67
59
|
};
|
|
68
60
|
export default React.memo(IDBOD);
|
|
@@ -82,7 +82,7 @@ var OTP = function (_a) {
|
|
|
82
82
|
var onBack = function () {
|
|
83
83
|
dispatch(handlePrevScreenStep());
|
|
84
84
|
};
|
|
85
|
-
var disabled = !methods.formState.isValid;
|
|
85
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
86
86
|
var idNumber = data.nidData.nid;
|
|
87
87
|
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('opt_nid_sent_title', { provider: 'ABSHER' }), ' ', !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
88
88
|
};
|
|
@@ -10,24 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo } from 'react';
|
|
14
14
|
import { useAppSelector } from '../../../../hooks';
|
|
15
15
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
16
16
|
import SuccessFlowButtons from '../../../shared/SuccessFlowButtons';
|
|
17
|
-
import { sendCustomEventToGTM } from '../../../../utils';
|
|
18
|
-
import { settingsSelector } from '../../../../app/settings';
|
|
19
17
|
var SuccessWithFlowButtons = function () {
|
|
20
18
|
var data = useAppSelector(businessSelector).data;
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
React.useEffect(function () {
|
|
24
|
-
sendCustomEventToGTM({
|
|
25
|
-
event: 'Send Event',
|
|
26
|
-
event_category: 'Account Creation Flow',
|
|
27
|
-
event_action: 'Board Page View',
|
|
28
|
-
event_label: settingsData.businessCountry.iso2
|
|
29
|
-
});
|
|
30
|
-
}, []);
|
|
31
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, individuals: individuals, boardInfoId: board_info_id, flows: flows || [], recipient: recipient }));
|
|
19
|
+
var _a = data.verify.responseBody || {}, flows = _a.flows, entity = _a.entity, brand = _a.brand, bank = _a.bank_account, merchant = _a.merchant, user = _a.user, business = _a.business, board_id = _a.board_id, board_info_id = _a.board_info_id, name = _a.name, individuals = _a.individuals, recipient = _a.recipient, board_status = _a.board_status;
|
|
20
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, individuals: individuals, boardInfoId: board_info_id, flows: flows || [], status: board_status }));
|
|
32
21
|
};
|
|
33
22
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -17,9 +17,9 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
|
-
import { handlePrevScreenStep
|
|
20
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
21
|
import { useLanguage } from '../../../../hooks';
|
|
22
|
-
import { deepCopy, maskPhone
|
|
22
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
23
23
|
import Form from '../../../../components/Form';
|
|
24
24
|
import Text from '../../../../components/Text';
|
|
25
25
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -49,7 +49,6 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
49
49
|
var VerifyNumber = function (_a) {
|
|
50
50
|
var _b, _c;
|
|
51
51
|
var dispatch = useAppDispatch();
|
|
52
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
53
52
|
var _d = useAppSelector(businessSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
54
53
|
var methods = useForm({
|
|
55
54
|
resolver: yupResolver(OTPValidation),
|
|
@@ -60,15 +59,6 @@ var VerifyNumber = function (_a) {
|
|
|
60
59
|
var isAr = useLanguage().isAr;
|
|
61
60
|
var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
|
|
62
61
|
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;
|
|
63
|
-
React.useEffect(function () {
|
|
64
|
-
var _a;
|
|
65
|
-
sendCustomEventToGTM({
|
|
66
|
-
event: 'Send Event',
|
|
67
|
-
event_category: 'Account Creation Flow',
|
|
68
|
-
event_action: 'Business OTP Step',
|
|
69
|
-
event_label: (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
|
|
70
|
-
});
|
|
71
|
-
}, []);
|
|
72
62
|
React.useEffect(function () {
|
|
73
63
|
if (error && methods.formState.isValid && phone)
|
|
74
64
|
dispatch(clearError());
|
|
@@ -82,7 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
82
72
|
var onBack = function () {
|
|
83
73
|
dispatch(handlePrevScreenStep());
|
|
84
74
|
};
|
|
85
|
-
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
75
|
+
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
86
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, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
87
77
|
};
|
|
88
78
|
export default React.memo(VerifyNumber);
|
|
@@ -89,8 +89,7 @@ var Connect = memo(function (props) {
|
|
|
89
89
|
React.useEffect(function () {
|
|
90
90
|
initializeGTM();
|
|
91
91
|
sendPageView({
|
|
92
|
-
title: 'Connect'
|
|
93
|
-
connect_flow: 'Normal'
|
|
92
|
+
title: 'Connect'
|
|
94
93
|
});
|
|
95
94
|
if (props.leadId) {
|
|
96
95
|
dispatch(storeLeadId(props.leadId));
|
|
@@ -125,7 +124,7 @@ var Connect = memo(function (props) {
|
|
|
125
124
|
event: 'Send Event',
|
|
126
125
|
event_category: 'User Registration Flow',
|
|
127
126
|
event_action: 'Registration Landing Page Viewed',
|
|
128
|
-
|
|
127
|
+
event_value: (_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2
|
|
129
128
|
});
|
|
130
129
|
sendCustomDimension({
|
|
131
130
|
event: 'PageView',
|
|
@@ -56,7 +56,7 @@ var BrandSegment = function (_a) {
|
|
|
56
56
|
if (error)
|
|
57
57
|
dispatch(clearError());
|
|
58
58
|
}, [methods.formState.isValid]);
|
|
59
|
-
var disabled = !methods.formState.isValid;
|
|
59
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
60
60
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TeamSize, { show: true, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
61
61
|
};
|
|
62
62
|
export default React.memo(BrandSegment);
|
|
@@ -52,7 +52,7 @@ import { useAppSelector, useAppDispatch, useLanguage } from '../../../../hooks';
|
|
|
52
52
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
53
53
|
import BusinessCountry from '../../../shared/BusinessCountry';
|
|
54
54
|
import Button from '../../../shared/Button';
|
|
55
|
-
import { findCountryByIso2, isKW, isOtherThanKWOrSA,
|
|
55
|
+
import { findCountryByIso2, isKW, isOtherThanKWOrSA, updateLocationUrlWithCountry } from '../../../../utils';
|
|
56
56
|
import Collapse from '../../../../components/Collapse';
|
|
57
57
|
import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
|
|
58
58
|
import { connectSelector, setDefaultCountryCode, updateBusinessCountry, storeIsStartFromBusinessCountry, clearError } from '../../../app/connect/connectStore';
|
|
@@ -81,14 +81,7 @@ var BusinessCountryScreen = function (_a) {
|
|
|
81
81
|
return [2];
|
|
82
82
|
countryCode = findCountryByIso2(settingsData.countries, iso2);
|
|
83
83
|
dispatch(handleSetCountryByIso2(iso2));
|
|
84
|
-
|
|
85
|
-
event: 'Send Event',
|
|
86
|
-
event_category: 'User Registration Flow',
|
|
87
|
-
event_action: 'Country selection page view',
|
|
88
|
-
event_label: iso2
|
|
89
|
-
});
|
|
90
|
-
if (settingsData.appConfig.mode !== 'popup')
|
|
91
|
-
updateLocationUrlWithCountry(iso2);
|
|
84
|
+
updateLocationUrlWithCountry(iso2);
|
|
92
85
|
if (!data.leadId) return [3, 2];
|
|
93
86
|
return [4, dispatch(updateBusinessCountry(iso2))];
|
|
94
87
|
case 1:
|
|
@@ -97,7 +97,7 @@ var CivilID = function (_a) {
|
|
|
97
97
|
React.useEffect(function () {
|
|
98
98
|
dispatch(resetStore());
|
|
99
99
|
}, []);
|
|
100
|
-
var disabled = !methods.formState.isValid;
|
|
100
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
101
101
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
|
|
102
102
|
};
|
|
103
103
|
export default React.memo(CivilID);
|
|
@@ -53,7 +53,6 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
53
53
|
import { useTranslation } from 'react-i18next';
|
|
54
54
|
import { styled } from '@mui/material/styles';
|
|
55
55
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
56
|
-
import { removeAllOtherThanCharsNumbersAtAndDot } from '../../../../utils';
|
|
57
56
|
import Collapse from '../../../../components/Collapse';
|
|
58
57
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
59
58
|
import Input from '../../../shared/Input';
|
|
@@ -90,8 +89,7 @@ var Email = function (_a) {
|
|
|
90
89
|
});
|
|
91
90
|
}); }, 500);
|
|
92
91
|
var handleEmailChange = function (event) {
|
|
93
|
-
|
|
94
|
-
emailControl.field.onChange(value);
|
|
92
|
+
emailControl.field.onChange(event.target.value);
|
|
95
93
|
};
|
|
96
94
|
React.useEffect(function () {
|
|
97
95
|
var isValid = emailValue && !error && emailValue.length > 3;
|
|
@@ -100,7 +100,7 @@ var Individual = function (_a) {
|
|
|
100
100
|
}, [responseBody]);
|
|
101
101
|
var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
|
|
102
102
|
var isEmailValid = typeof is_available === 'undefined' ? isLeadEmailAvailable : is_available;
|
|
103
|
-
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email;
|
|
103
|
+
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
|
|
104
104
|
var disabled = emailErrChecks || emailChecking || !isEmailValid;
|
|
105
105
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { show: !listActive }), _jsx(MobileNumber, { show: !isMobile, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: settingsData.countries }), _jsx(Email, { show: !listActive, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
106
106
|
};
|
|
@@ -60,9 +60,9 @@ var BrandList = function (_a) {
|
|
|
60
60
|
setAnchorEl(null);
|
|
61
61
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
62
62
|
};
|
|
63
|
-
var getBrandName = function (
|
|
64
|
-
var _a
|
|
65
|
-
return (isAr ?
|
|
63
|
+
var getBrandName = function (_a) {
|
|
64
|
+
var name = _a.name;
|
|
65
|
+
return (isAr ? name === null || name === void 0 ? void 0 : name.ar : name === null || name === void 0 ? void 0 : name.en) || '';
|
|
66
66
|
};
|
|
67
67
|
var getBrandId = function (item) {
|
|
68
68
|
return item.id || '';
|
|
@@ -84,7 +84,7 @@ var Merchant = function (_a) {
|
|
|
84
84
|
if (termAndConditionChecked === true)
|
|
85
85
|
methods.setValue('termAndConditionChecked', termAndConditionChecked);
|
|
86
86
|
}, [termAndConditionChecked]);
|
|
87
|
-
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName;
|
|
87
|
+
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
88
88
|
var disabled = brandErrChecks || brandNameChecking || ((_c = data.brandData.responseBody) === null || _c === void 0 ? void 0 : _c.response_code) === '5';
|
|
89
89
|
var hasBrandList = (brandList === null || brandList === void 0 ? void 0 : brandList.length) > 0;
|
|
90
90
|
var isOtherBrand = (brandListItem === null || brandListItem === void 0 ? void 0 : brandListItem.id) === 'other' && hasBrandList;
|
|
@@ -15,7 +15,7 @@ var SalesChannels = function (_a) {
|
|
|
15
15
|
var channelList = (responseBody || {}).channel_list;
|
|
16
16
|
var selectedBrandControl = getValues('selectedBrandItem');
|
|
17
17
|
React.useEffect(function () {
|
|
18
|
-
if (selectedBrandItem
|
|
18
|
+
if (selectedBrandItem.id) {
|
|
19
19
|
setValue('selectedBrandItem', selectedBrandItem);
|
|
20
20
|
var sales = mapSalesChannel(selectedBrandItem.channel_services || []);
|
|
21
21
|
field.onChange(sales);
|
|
@@ -74,12 +74,12 @@ var ListType;
|
|
|
74
74
|
ListType["CountryCodeList"] = "CountryCodeList";
|
|
75
75
|
})(ListType || (ListType = {}));
|
|
76
76
|
var Mobile = function (_a) {
|
|
77
|
-
var _b;
|
|
77
|
+
var _b, _c;
|
|
78
78
|
var settingsStore = useAppSelector(settingsSelector);
|
|
79
|
-
var
|
|
80
|
-
var
|
|
79
|
+
var _d = useAppSelector(connectSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
80
|
+
var _e = React.useState(), listType = _e[0], setListType = _e[1];
|
|
81
81
|
var dispatch = useAppDispatch();
|
|
82
|
-
var
|
|
82
|
+
var _f = data.mobileData, mobile = _f.mobile, countryCode = _f.countryCode, termAndConditionChecked = _f.termAndConditionChecked;
|
|
83
83
|
var methods = useForm({
|
|
84
84
|
resolver: yupResolver(PhoneValidationSchema),
|
|
85
85
|
defaultValues: {
|
|
@@ -92,7 +92,6 @@ var Mobile = function (_a) {
|
|
|
92
92
|
useSetFromDefaultValues(methods, data.mobileData);
|
|
93
93
|
var t = useTranslation().t;
|
|
94
94
|
var isAr = useLanguage().isAr;
|
|
95
|
-
var country = (_b = settingsStore.data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2;
|
|
96
95
|
var handleMenuListClick = function (flag) {
|
|
97
96
|
setListType(flag);
|
|
98
97
|
};
|
|
@@ -108,15 +107,13 @@ var Mobile = function (_a) {
|
|
|
108
107
|
dispatch(resetNIDScreen());
|
|
109
108
|
dispatch(resetCivilScreen());
|
|
110
109
|
};
|
|
111
|
-
var isKWCountry = React.useMemo(function () { return isKW(
|
|
112
|
-
var isOtherThanKWOrSACountry = React.useMemo(function () { return isOtherThanKWOrSA(
|
|
110
|
+
var isKWCountry = React.useMemo(function () { var _a; return isKW((_a = settingsStore.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2); }, [(_b = settingsStore.data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2]);
|
|
111
|
+
var isOtherThanKWOrSACountry = React.useMemo(function () { var _a; return isOtherThanKWOrSA((_a = settingsStore.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2); }, [(_c = settingsStore.data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2]);
|
|
113
112
|
var onBack = function () {
|
|
114
|
-
var eventAction = isKWCountry ? 'PACI Click' : 'Abser Click';
|
|
115
113
|
sendCustomEventToGTM({
|
|
116
114
|
event: 'Send Event',
|
|
117
115
|
event_category: 'User Registration Flow',
|
|
118
|
-
event_action:
|
|
119
|
-
event_label: country
|
|
116
|
+
event_action: 'Switch to ID Login Clicked'
|
|
120
117
|
});
|
|
121
118
|
dispatch(handlePrevScreenStep(isKWCountry ? 'CONNECT_CIVIL_ID_STEP' : 'CONNECT_NID_STEP'));
|
|
122
119
|
};
|
|
@@ -129,7 +126,7 @@ var Mobile = function (_a) {
|
|
|
129
126
|
var isBusinessListActive = listType === ListType.BusinessList;
|
|
130
127
|
var isCountryListActive = listType === ListType.CountryCodeList;
|
|
131
128
|
var listActive = isBusinessListActive || isCountryListActive;
|
|
132
|
-
var disabled = !methods.formState.isValid;
|
|
129
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
133
130
|
var title = t('join_our_community');
|
|
134
131
|
var subTitle = t('ide_terms_and_conditions_description');
|
|
135
132
|
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid && !isOtherThanKWOrSACountry }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKWCountry ? (_jsx(MobileButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) }))] }));
|
|
@@ -101,7 +101,7 @@ var NID = function (_a) {
|
|
|
101
101
|
React.useEffect(function () {
|
|
102
102
|
dispatch(resetStore());
|
|
103
103
|
}, []);
|
|
104
|
-
var disabled = !methods.formState.isValid;
|
|
104
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
105
105
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
|
|
106
106
|
};
|
|
107
107
|
export default React.memo(NID);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '
|
|
4
|
+
import GenericError from '../../../../features/shared/GenericError';
|
|
5
5
|
var OperatorError = function (_a) {
|
|
6
6
|
var t = useTranslation().t;
|
|
7
7
|
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
@@ -100,8 +100,7 @@ var ConnectExpress = memo(function (_a) {
|
|
|
100
100
|
React.useEffect(function () {
|
|
101
101
|
initializeGTM();
|
|
102
102
|
sendPageView({
|
|
103
|
-
title: 'Connect Express'
|
|
104
|
-
connect_flow: 'Express'
|
|
103
|
+
title: 'Connect Express'
|
|
105
104
|
});
|
|
106
105
|
}, []);
|
|
107
106
|
React.useEffect(function () {
|
|
@@ -29,7 +29,6 @@ import BrandList from './BrandList';
|
|
|
29
29
|
import EntityList from './EntityList';
|
|
30
30
|
import LicenseNumber from './LicenseNumber';
|
|
31
31
|
import EntityLegalName from './EntityLegalName';
|
|
32
|
-
import LicenseType from './EntityLicenseType';
|
|
33
32
|
var ListType;
|
|
34
33
|
(function (ListType) {
|
|
35
34
|
ListType["BrandList"] = "BrandList";
|
|
@@ -65,8 +64,7 @@ var AuthenticationList = function (_a) {
|
|
|
65
64
|
var dispatch = useAppDispatch();
|
|
66
65
|
var onSubmit = function (formData) {
|
|
67
66
|
if (isAddEntity) {
|
|
68
|
-
var
|
|
69
|
-
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
|
|
67
|
+
var data_1 = { licenseNumber: formData.licenseNumber, legalName: formData.legalName, brandInfo: formData.brandInfo };
|
|
70
68
|
dispatch(createEntity(deepCopy(data_1)));
|
|
71
69
|
return;
|
|
72
70
|
}
|
|
@@ -78,7 +76,6 @@ var AuthenticationList = function (_a) {
|
|
|
78
76
|
setIsAddEntity(false);
|
|
79
77
|
methods.setValue('licenseNumber', '');
|
|
80
78
|
methods.setValue('legalName', '');
|
|
81
|
-
methods.setValue('licenseType', '');
|
|
82
79
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
83
80
|
return;
|
|
84
81
|
}
|
|
@@ -99,6 +96,6 @@ var AuthenticationList = function (_a) {
|
|
|
99
96
|
};
|
|
100
97
|
var isBrandList = listActive === ListType.BrandList;
|
|
101
98
|
var isEntityList = listActive === ListType.EntityList;
|
|
102
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(
|
|
99
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
|
|
103
100
|
};
|
|
104
101
|
export default React.memo(AuthenticationList);
|
|
@@ -81,7 +81,6 @@ var EntityList = function (_a) {
|
|
|
81
81
|
if (filteredEntityList.length) {
|
|
82
82
|
setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
|
|
83
83
|
setValue('licenseNumber', '');
|
|
84
|
-
setValue('licenseType', '');
|
|
85
84
|
setValue('legalName', '');
|
|
86
85
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
87
86
|
}
|
|
@@ -122,12 +121,8 @@ var EntityList = function (_a) {
|
|
|
122
121
|
selectedEntityControl.field.onChange(entity);
|
|
123
122
|
if (entity.id === ADD_ENTITY)
|
|
124
123
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
125
|
-
else
|
|
126
|
-
setValue('licenseNumber', '');
|
|
127
|
-
setValue('legalName', '');
|
|
128
|
-
setValue('licenseType', '');
|
|
124
|
+
else
|
|
129
125
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
130
|
-
}
|
|
131
126
|
onCloseEntityList();
|
|
132
127
|
};
|
|
133
128
|
var selectedEntity = selectedEntityControl.field.value;
|
|
@@ -3,18 +3,15 @@ export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import
|
|
|
3
3
|
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
4
|
entityInfo: any;
|
|
5
5
|
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
6
|
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
7
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
8
|
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
10
9
|
entityInfo: any;
|
|
11
10
|
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
13
11
|
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
12
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
13
|
brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
16
14
|
entityInfo: any;
|
|
17
15
|
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
|
-
licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
19
16
|
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
20
17
|
}>>>;
|