@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
|
@@ -29,6 +29,7 @@ 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';
|
|
32
33
|
var ListType;
|
|
33
34
|
(function (ListType) {
|
|
34
35
|
ListType["BrandList"] = "BrandList";
|
|
@@ -64,7 +65,8 @@ var AuthenticationList = function (_a) {
|
|
|
64
65
|
var dispatch = useAppDispatch();
|
|
65
66
|
var onSubmit = function (formData) {
|
|
66
67
|
if (isAddEntity) {
|
|
67
|
-
var
|
|
68
|
+
var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
|
|
69
|
+
var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
|
|
68
70
|
dispatch(createEntity(deepCopy(data_1)));
|
|
69
71
|
return;
|
|
70
72
|
}
|
|
@@ -76,6 +78,7 @@ var AuthenticationList = function (_a) {
|
|
|
76
78
|
setIsAddEntity(false);
|
|
77
79
|
methods.setValue('licenseNumber', '');
|
|
78
80
|
methods.setValue('legalName', '');
|
|
81
|
+
methods.setValue('licenseType', '');
|
|
79
82
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
@@ -96,6 +99,6 @@ var AuthenticationList = function (_a) {
|
|
|
96
99
|
};
|
|
97
100
|
var isBrandList = listActive === ListType.BrandList;
|
|
98
101
|
var isEntityList = listActive === ListType.EntityList;
|
|
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') })) }))] })) })) }));
|
|
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(LicenseType, {}), _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') })) }))] })) })) }));
|
|
100
103
|
};
|
|
101
104
|
export default React.memo(AuthenticationList);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
4
|
+
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
+
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
6
|
+
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
7
|
+
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
+
declare const Type: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Type;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
15
|
+
import InfoIcon from '@mui/icons-material/Info';
|
|
16
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
19
|
+
import Text from '../../../../components/Text';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import Mandatory from '../../../shared/Mandatory';
|
|
22
|
+
import RadioLabel from '../../../../components/RadioLabel';
|
|
23
|
+
import { LicenseType } from '../../../../@types';
|
|
24
|
+
import RadioGroup from '../../../../components/RadioGroup';
|
|
25
|
+
import Tooltip from '../../../../components/Tooltip';
|
|
26
|
+
import Radio from '../../../../components/Radio';
|
|
27
|
+
import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
|
|
28
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
29
|
+
var LabelTextStyled = styled(Text)(function (_a) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
32
|
+
});
|
|
33
|
+
var RadioGroupStyled = styled(RadioGroup)(function (_a) {
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return ({
|
|
36
|
+
marginInlineStart: theme.spacing(0.25)
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var RadioStyled = styled(Radio)(function (_a) {
|
|
40
|
+
var theme = _a.theme;
|
|
41
|
+
return ({
|
|
42
|
+
'& .MuiSvgIcon-root': {
|
|
43
|
+
fontSize: theme.spacing(2.25),
|
|
44
|
+
width: theme.spacing(2.25),
|
|
45
|
+
height: theme.spacing(2.25)
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
var LabelStyled = styled('span')(function () { return ({
|
|
50
|
+
display: 'inline-flex',
|
|
51
|
+
alignItems: 'center'
|
|
52
|
+
}); });
|
|
53
|
+
export var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
54
|
+
var theme = _a.theme;
|
|
55
|
+
return ({
|
|
56
|
+
width: theme.spacing(2.75),
|
|
57
|
+
height: theme.spacing(2.125),
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
color: alpha(theme.palette.text.primary, 0.4),
|
|
60
|
+
display: 'inline-flex'
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
64
|
+
var theme = _a.theme;
|
|
65
|
+
return ({
|
|
66
|
+
width: theme.spacing(2.75),
|
|
67
|
+
height: theme.spacing(2.125),
|
|
68
|
+
cursor: 'pointer',
|
|
69
|
+
color: alpha(theme.palette.text.primary, 0.4),
|
|
70
|
+
display: 'inline-flex'
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
var Type = function () {
|
|
74
|
+
var t = useTranslation().t;
|
|
75
|
+
var control = useFormContext().control;
|
|
76
|
+
var error = useAppSelector(connectExpressSelector).error;
|
|
77
|
+
var _a = React.useState(false), isCRHovered = _a[0], setIsCRHovered = _a[1];
|
|
78
|
+
var _b = React.useState(false), isFLHovered = _b[0], setIsFLHovered = _b[1];
|
|
79
|
+
var typeControl = useController({ control: control, name: 'licenseType' });
|
|
80
|
+
var dispatch = useAppDispatch();
|
|
81
|
+
var handleOnChange = function (_a) {
|
|
82
|
+
var target = _a.target;
|
|
83
|
+
if (error)
|
|
84
|
+
dispatch(clearError());
|
|
85
|
+
typeControl.field.onChange(target.value);
|
|
86
|
+
};
|
|
87
|
+
var typeValue = typeControl.field.value;
|
|
88
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })));
|
|
89
|
+
};
|
|
90
|
+
export default Type;
|
|
@@ -81,6 +81,7 @@ var EntityList = function (_a) {
|
|
|
81
81
|
if (filteredEntityList.length) {
|
|
82
82
|
setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
|
|
83
83
|
setValue('licenseNumber', '');
|
|
84
|
+
setValue('licenseType', '');
|
|
84
85
|
setValue('legalName', '');
|
|
85
86
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
86
87
|
}
|
|
@@ -121,8 +122,12 @@ var EntityList = function (_a) {
|
|
|
121
122
|
selectedEntityControl.field.onChange(entity);
|
|
122
123
|
if (entity.id === ADD_ENTITY)
|
|
123
124
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
124
|
-
else
|
|
125
|
+
else {
|
|
126
|
+
setValue('licenseNumber', '');
|
|
127
|
+
setValue('legalName', '');
|
|
128
|
+
setValue('licenseType', '');
|
|
125
129
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
130
|
+
}
|
|
126
131
|
onCloseEntityList();
|
|
127
132
|
};
|
|
128
133
|
var selectedEntity = selectedEntityControl.field.value;
|
|
@@ -3,15 +3,18 @@ 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>;
|
|
6
7
|
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
8
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
9
|
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>>;
|
|
9
10
|
entityInfo: any;
|
|
10
11
|
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>;
|
|
11
13
|
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
14
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
15
|
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>>;
|
|
14
16
|
entityInfo: any;
|
|
15
17
|
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>;
|
|
16
19
|
legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
17
20
|
}>>>;
|
|
@@ -34,6 +34,16 @@ export var AuthenticationListValidationSchema = yup.object().shape({
|
|
|
34
34
|
.required('');
|
|
35
35
|
})
|
|
36
36
|
.required(''),
|
|
37
|
+
licenseType: yup
|
|
38
|
+
.string()
|
|
39
|
+
.when('entityInfo', function (entityInfo) {
|
|
40
|
+
var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
|
|
41
|
+
if (!isAddEntity) {
|
|
42
|
+
return yup.string().optional();
|
|
43
|
+
}
|
|
44
|
+
return yup.string().required('choose_license_type');
|
|
45
|
+
})
|
|
46
|
+
.required(''),
|
|
37
47
|
legalName: yup
|
|
38
48
|
.string()
|
|
39
49
|
.when('entityInfo', function (entityInfo) {
|
|
@@ -53,7 +53,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
53
53
|
import BusinessCountry from '../../../shared/BusinessCountry';
|
|
54
54
|
import Button from '../../../shared/Button';
|
|
55
55
|
import Collapse from '../../../../components/Collapse';
|
|
56
|
-
import { findCountryByIso2, isKW, isOtherThanKWOrSA } from '../../../../utils';
|
|
56
|
+
import { findCountryByIso2, isKW, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
|
|
57
57
|
import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
|
|
58
58
|
import { clearError, connectExpressSelector, setDefaultCountryCode, storeIsStartFromBusinessCountry, updateBusinessCountryAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
59
59
|
var BusinessCountryScreen = function (_a) {
|
|
@@ -81,6 +81,12 @@ var BusinessCountryScreen = function (_a) {
|
|
|
81
81
|
return [2];
|
|
82
82
|
countryCode = findCountryByIso2(settingsData.countries, iso2);
|
|
83
83
|
dispatch(handleSetCountryByIso2(iso2));
|
|
84
|
+
sendCustomEventToGTM({
|
|
85
|
+
event: 'Send Event',
|
|
86
|
+
event_category: 'User Registration Flow',
|
|
87
|
+
event_action: 'Country selection page view',
|
|
88
|
+
event_label: iso2
|
|
89
|
+
});
|
|
84
90
|
if (!data.leadId) return [3, 2];
|
|
85
91
|
return [4, dispatch(updateBusinessCountryAsync(iso2))];
|
|
86
92
|
case 1:
|
|
@@ -89,7 +89,7 @@ var CivilID = function (_a) {
|
|
|
89
89
|
var onBackToCountryList = function () {
|
|
90
90
|
dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
|
|
91
91
|
};
|
|
92
|
-
var disabled = !methods.formState.isValid
|
|
92
|
+
var disabled = !methods.formState.isValid;
|
|
93
93
|
var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
|
|
94
94
|
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, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: isLeadIdPassed ? !isLeadIdentityIdAvailable && !methods.formState.isValid : !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 }, { children: t('mobile_button_label') }))] }))] })) })) }));
|
|
95
95
|
};
|
|
@@ -48,7 +48,7 @@ var CivilID = function (_a) {
|
|
|
48
48
|
var onBack = function () {
|
|
49
49
|
dispatch(handlePrevScreenStep());
|
|
50
50
|
};
|
|
51
|
-
var disabled = !methods.formState.isValid
|
|
51
|
+
var disabled = !methods.formState.isValid;
|
|
52
52
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: 5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
53
53
|
};
|
|
54
54
|
export default React.memo(CivilID);
|
|
@@ -87,7 +87,7 @@ var CollectBusinessInfo = function (_a) {
|
|
|
87
87
|
var onBack = function () {
|
|
88
88
|
dispatch(handlePrevScreenStep());
|
|
89
89
|
};
|
|
90
|
-
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName
|
|
90
|
+
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName;
|
|
91
91
|
var disabled = brandErrChecks || brandNameChecking || isBrandNameAvailable == false;
|
|
92
92
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'], show: true, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(LicenseList, { readOnly: readOnly['selectedLicense'], onListOpen: function () {
|
|
93
93
|
setListActive(true);
|
package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js
CHANGED
|
@@ -96,7 +96,7 @@ var CollectIndividualInfo = function (_a) {
|
|
|
96
96
|
}, [responseData]);
|
|
97
97
|
var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
|
|
98
98
|
var isEmailValid = typeof isEmailAvailable === 'undefined' ? isLeadEmailAvailable : isEmailAvailable;
|
|
99
|
-
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email
|
|
99
|
+
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email;
|
|
100
100
|
var disabled = emailErrChecks || emailChecking || !isEmailValid;
|
|
101
101
|
var emailReadOnly = readOnly['email'] && !((_b = methods.getFieldState('email').error) === null || _b === void 0 ? void 0 : _b.message) && !methods.getFieldState('email').isDirty;
|
|
102
102
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { readOnly: readOnly['name'], show: !listActive }), _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: settingsData.countries }), _jsx(Email, { readOnly: emailReadOnly, 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') })) }))] })) })) }));
|
|
@@ -53,6 +53,7 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
53
53
|
import axios from 'axios';
|
|
54
54
|
import { styled } from '@mui/material/styles';
|
|
55
55
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
56
|
+
import { removeAllOtherThanCharsNumbersAtAndDot } from '../../../../utils';
|
|
56
57
|
import Collapse from '../../../../components/Collapse';
|
|
57
58
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
58
59
|
import Input from '../../../shared/Input';
|
|
@@ -88,7 +89,8 @@ var Email = function (_a) {
|
|
|
88
89
|
});
|
|
89
90
|
}); }, 500);
|
|
90
91
|
var handleEmailChange = function (event) {
|
|
91
|
-
|
|
92
|
+
var value = removeAllOtherThanCharsNumbersAtAndDot(event.target.value);
|
|
93
|
+
emailControl.field.onChange(value);
|
|
92
94
|
};
|
|
93
95
|
React.useEffect(function () {
|
|
94
96
|
var isValid = emailValue && !error && emailValue.length > 3;
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import * as React from 'react';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
3
|
+
import { isNetworkError, sleep } from '../../../../utils';
|
|
4
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
5
|
import { connectExpressSelector, createAccountAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
18
6
|
import CreateAccountLoading from '../../../shared/CreateAccountLoading';
|
|
19
|
-
import Button from '../../../shared/Button';
|
|
20
7
|
var CreateAccountLoader = function (_a) {
|
|
21
8
|
var dispatch = useAppDispatch();
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
9
|
+
var error = useAppSelector(connectExpressSelector).error;
|
|
10
|
+
var _b = React.useState(0), isRetryCount = _b[0], setIsRetryCount = _b[1];
|
|
11
|
+
var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
|
|
25
12
|
React.useEffect(function () {
|
|
26
|
-
dispatch(createAccountAsync());
|
|
13
|
+
dispatch(createAccountAsync({ isRetry: false }));
|
|
27
14
|
}, []);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
React.useEffect(function () {
|
|
16
|
+
if (isNE && isRetryCount <= 3) {
|
|
17
|
+
sleep(2000);
|
|
18
|
+
setIsRetryCount(isRetryCount + 1);
|
|
19
|
+
dispatch(createAccountAsync({ isRetry: true }));
|
|
20
|
+
}
|
|
21
|
+
}, [isNE]);
|
|
22
|
+
return _jsx(CreateAccountLoading, { error: isNE && isRetryCount <= 3 ? '' : error });
|
|
33
23
|
};
|
|
34
24
|
export default React.memo(CreateAccountLoader);
|
|
@@ -30,7 +30,7 @@ import MobileNumber from './MobileNumber';
|
|
|
30
30
|
import { PhoneValidationSchema } from './validation';
|
|
31
31
|
import { ICONS_NAMES } from '../../../../constants';
|
|
32
32
|
import TAC from './TAC';
|
|
33
|
-
import { deepCopy } from '../../../../utils';
|
|
33
|
+
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
34
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
35
35
|
display: 'flex',
|
|
36
36
|
flexDirection: 'column'
|
|
@@ -96,6 +96,13 @@ var Mobile = function (_a) {
|
|
|
96
96
|
};
|
|
97
97
|
var onBack = function () {
|
|
98
98
|
var screen = isKuwait ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
|
|
99
|
+
var eventAction = isKuwait ? 'PACI Click' : 'Abser Click';
|
|
100
|
+
sendCustomEventToGTM({
|
|
101
|
+
event: 'Send Event',
|
|
102
|
+
event_category: 'User Registration Flow',
|
|
103
|
+
event_action: eventAction,
|
|
104
|
+
event_label: settingData.businessCountry.iso2
|
|
105
|
+
});
|
|
99
106
|
dispatch(handlePrevScreenStep(screen));
|
|
100
107
|
};
|
|
101
108
|
var onBackToCountryList = function () {
|
|
@@ -109,7 +116,7 @@ var Mobile = function (_a) {
|
|
|
109
116
|
};
|
|
110
117
|
var originalReadOnly = useFormReadOnly(methods);
|
|
111
118
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
112
|
-
var disabled = !methods.formState.isValid
|
|
119
|
+
var disabled = !methods.formState.isValid;
|
|
113
120
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, countries: settingData.countries, onListOpen: handleCountryOpen, onListClose: handleCountryClose }) }), _jsxs(Collapse, __assign({ in: !anchor }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: (isLeadIdPassed ? !isLeadIdentityIdAvailable : !methods.formState.isValid) && !isOther }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKuwait ? (_jsx(MobileButton, __assign({ disabled: loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) })) }));
|
|
114
121
|
};
|
|
115
122
|
export default React.memo(Mobile);
|
|
@@ -96,7 +96,7 @@ var NID = function (_a) {
|
|
|
96
96
|
};
|
|
97
97
|
var originalReadOnly = useFormReadOnly(methods);
|
|
98
98
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
99
|
-
var disabled = !methods.formState.isValid
|
|
99
|
+
var disabled = !methods.formState.isValid;
|
|
100
100
|
var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
|
|
101
101
|
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, readOnly: readOnly['nid'] }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose, readOnly: readOnly['dob'] }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: isLeadIdPassed ? !isLeadIdentityIdAvailable && !methods.formState.isValid : !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 }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
|
|
102
102
|
};
|
|
@@ -56,7 +56,7 @@ var NID = function (_a) {
|
|
|
56
56
|
var onBack = function () {
|
|
57
57
|
dispatch(handlePrevScreenStep());
|
|
58
58
|
};
|
|
59
|
-
var disabled = !methods.formState.isValid
|
|
59
|
+
var disabled = !methods.formState.isValid;
|
|
60
60
|
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 }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
61
61
|
};
|
|
62
62
|
export default React.memo(NID);
|
|
@@ -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,34 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { isNetworkError } from '../../../../utils';
|
|
16
|
+
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
17
|
+
import DataLoading from '../../../shared/DataLoading';
|
|
18
|
+
import Button from '../../../shared/Button';
|
|
19
|
+
import { connectExpressSelector, retrieveDetailsAfterCreateAccountAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
20
|
+
var PrepareDataLoading = function (_a) {
|
|
21
|
+
var dispatch = useAppDispatch();
|
|
22
|
+
var isAr = useLanguage().isAr;
|
|
23
|
+
var t = useTranslation().t;
|
|
24
|
+
var _b = useAppSelector(connectExpressSelector), error = _b.error, loading = _b.loading;
|
|
25
|
+
React.useEffect(function () {
|
|
26
|
+
dispatch(retrieveDetailsAfterCreateAccountAsync());
|
|
27
|
+
}, []);
|
|
28
|
+
var onReTry = function () {
|
|
29
|
+
dispatch(retrieveDetailsAfterCreateAccountAsync());
|
|
30
|
+
};
|
|
31
|
+
var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
|
|
32
|
+
return (_jsx(DataLoading, __assign({ error: error }, { children: isNE && (_jsx(Button, __assign({ onClick: onReTry, disableBack: true, isAr: isAr, loading: loading }, { children: t('try_again') }))) })));
|
|
33
|
+
};
|
|
34
|
+
export default React.memo(PrepareDataLoading);
|
package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js
CHANGED
|
@@ -28,7 +28,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
28
28
|
var _b = data.responseData || {}, boardData = _b.boardData, leadData = _b.leadData, boardInfo = _b.boardInfo;
|
|
29
29
|
var name = (leadData || {}).name;
|
|
30
30
|
var _c = boardData || {}, business = _c.business, merchant = _c.merchant, bank = _c.bank_account, user = _c.user, individuals = _c.individuals, entity = _c.entity, brand = _c.brand;
|
|
31
|
-
var
|
|
31
|
+
var _d = boardInfo || {}, flows = _d.info, recipient = _d.recipient;
|
|
32
32
|
var boardInfoId = boardInfo === null || boardInfo === void 0 ? void 0 : boardInfo.id;
|
|
33
33
|
var boardId = boardData === null || boardData === void 0 ? void 0 : boardData.id;
|
|
34
34
|
var individualsInfo = __assign(__assign({}, individuals), (!(user === null || user === void 0 ? void 0 : user.is_authorized) && { data_state: user === null || user === void 0 ? void 0 : user.data_state }));
|
|
@@ -36,6 +36,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
36
36
|
var name = _a.name;
|
|
37
37
|
return name !== FlowsTypes.PASSWORD;
|
|
38
38
|
}); }, [flows]);
|
|
39
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, loading: loading, boardId: boardId, boardInfoId: boardInfoId, brand: brand, business: business, entity: entity, flows: filteredFlows || [], merchant: merchant, individuals: individualsInfo, user: __assign({ names: { en: name } }, user), onClose: isScopeAuthentication ? onClose : undefined }));
|
|
39
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, loading: loading, boardId: boardId, boardInfoId: boardInfoId, brand: brand, business: business, entity: entity, flows: filteredFlows || [], merchant: merchant, individuals: individualsInfo, user: __assign({ names: { en: name } }, user), onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient }));
|
|
40
40
|
};
|
|
41
41
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -2,6 +2,7 @@ import { LibConfig } from '../../@types';
|
|
|
2
2
|
export interface EntityLibProps extends LibConfig {
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
configToken?: string;
|
|
5
|
+
loaderColor?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare function EntityElement(props: EntityLibProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare function renderEntityLib(config: EntityLibProps, elementId: string): {
|
|
@@ -36,7 +36,7 @@ import { entityFeatureScreens } from '../featuresScreens';
|
|
|
36
36
|
import { entitySelector, verifyLeadToken } from '../app/entity/entityStore';
|
|
37
37
|
import Background from '../shared/Background';
|
|
38
38
|
var Entity = memo(function (_a) {
|
|
39
|
-
var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
|
|
39
|
+
var configToken = _a.configToken, verifyToken = _a.verifyToken, loaderColor = _a.loaderColor, props = __rest(_a, ["configToken", "verifyToken", "loaderColor"]);
|
|
40
40
|
var theme = useAppTheme().theme;
|
|
41
41
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
42
42
|
var _c = useAppSelector(entitySelector), customLoading = _c.customLoading, entityError = _c.error, loading = _c.loading;
|
|
@@ -49,8 +49,11 @@ var Entity = memo(function (_a) {
|
|
|
49
49
|
loadingScreenName: 'ENTITY_LOADING_DATA_STEP',
|
|
50
50
|
navigation: featureScreensNavigation,
|
|
51
51
|
open: open,
|
|
52
|
+
mode: props.mode,
|
|
52
53
|
internalToken: verifyToken,
|
|
53
|
-
settingLoading: settingLoading
|
|
54
|
+
settingLoading: settingLoading,
|
|
55
|
+
operatorErrorScreenName: 'ENTITY_OPERATOR_ERROR_STEP',
|
|
56
|
+
isValidOperator: data.isValidOperator
|
|
54
57
|
});
|
|
55
58
|
React.useEffect(function () {
|
|
56
59
|
initializeGTM();
|
|
@@ -58,8 +61,8 @@ var Entity = memo(function (_a) {
|
|
|
58
61
|
title: 'Entity'
|
|
59
62
|
});
|
|
60
63
|
}, []);
|
|
61
|
-
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
62
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: entityFeatureScreens.map(function (_a, index) {
|
|
64
|
+
var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
|
|
65
|
+
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, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', 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: entityFeatureScreens.map(function (_a, index) {
|
|
63
66
|
var Element = _a.element, name = _a.name;
|
|
64
67
|
var isActive = activeScreen.name === name;
|
|
65
68
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -14,16 +14,17 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
|
-
import {
|
|
17
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
18
|
+
import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
19
20
|
import Input from '../../../shared/Input';
|
|
20
|
-
import { clearError
|
|
21
|
+
import { clearError } from '../../../app/entity/entityStore';
|
|
21
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
22
23
|
var CapitalPaid = function (_a) {
|
|
23
24
|
var _b;
|
|
24
25
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
25
26
|
var t = useTranslation().t;
|
|
26
|
-
var
|
|
27
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
27
28
|
var control = useFormContext().control;
|
|
28
29
|
var dispatch = useAppDispatch();
|
|
29
30
|
var handleChange = function (_a) {
|
|
@@ -33,11 +34,14 @@ var CapitalPaid = function (_a) {
|
|
|
33
34
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
34
35
|
capitalPaidControl.field.onChange(value);
|
|
35
36
|
};
|
|
37
|
+
var getCurrency = React.useMemo(function () {
|
|
38
|
+
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
+
}, [settingsData.businessCountry.iso2]);
|
|
36
40
|
var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
|
|
37
41
|
var capitalPaidValue = capitalPaidControl.field.value;
|
|
38
42
|
var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
39
43
|
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
|
|
40
|
-
currency:
|
|
44
|
+
currency: getCurrency
|
|
41
45
|
}), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
|
|
42
46
|
};
|
|
43
47
|
export default React.memo(CapitalPaid);
|
|
@@ -13,17 +13,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
16
|
+
import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
17
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
18
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
19
20
|
import Input from '../../../shared/Input';
|
|
20
|
-
import { clearError
|
|
21
|
+
import { clearError } from '../../../app/entity/entityStore';
|
|
21
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
22
23
|
var CapitalShareValue = function (_a) {
|
|
23
24
|
var _b;
|
|
24
25
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
25
26
|
var t = useTranslation().t;
|
|
26
|
-
var
|
|
27
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
27
28
|
var control = useFormContext().control;
|
|
28
29
|
var dispatch = useAppDispatch();
|
|
29
30
|
var handleChange = function (_a) {
|
|
@@ -33,11 +34,14 @@ var CapitalShareValue = function (_a) {
|
|
|
33
34
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
34
35
|
capitalShareValueControl.field.onChange(value);
|
|
35
36
|
};
|
|
37
|
+
var getCurrency = React.useMemo(function () {
|
|
38
|
+
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
+
}, [settingsData.businessCountry.iso2]);
|
|
36
40
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
37
41
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
38
42
|
var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
39
43
|
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
|
|
40
|
-
currency:
|
|
44
|
+
currency: getCurrency
|
|
41
45
|
}), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
42
46
|
};
|
|
43
47
|
export default React.memo(CapitalShareValue);
|