@tap-payments/auth-jsconnect 2.5.20-test → 2.5.22-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +2 -2
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +2 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +2 -2
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +2 -1
- package/build/features/brand/screens/Verify/Verify.js +2 -2
- package/build/features/business/screens/Activities/Activities.js +2 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -2
- package/build/features/business/screens/CivilID/CivilID.js +2 -1
- package/build/features/business/screens/Customers/Customers.js +2 -1
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -1
- package/build/features/business/screens/OTP/OTP.js +2 -2
- package/build/features/business/screens/Verify/Verify.js +2 -2
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +2 -2
- package/build/features/connect/screens/CivilID/CivilID.js +2 -1
- package/build/features/connect/screens/Individual/Individual.js +2 -2
- package/build/features/connect/screens/Merchant/Merchant.js +2 -2
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/NID/NID.js +2 -2
- package/build/features/connect/screens/OTP/OTP.js +2 -2
- package/build/features/connectExpress/screens/CivilID/CivilID.js +2 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +2 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +2 -2
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +3 -3
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -1
- package/build/features/connectExpress/screens/NID/NID.js +2 -1
- package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -1
- package/build/features/connectExpress/screens/OTP/OTP.js +3 -3
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +2 -2
- package/build/features/entity/screens/EntityName/EntityName.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +2 -2
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +2 -1
- package/build/features/individual/screens/Verify/Verify.js +2 -2
- package/build/features/password/screens/CreatePassword/CreatePassword.js +3 -2
- package/build/features/password/screens/OTP/OTP.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +2 -2
- package/build/features/signIn/screens/Email/Email.js +2 -1
- package/build/features/signIn/screens/Mobile/Mobile.js +2 -1
- package/build/features/signIn/screens/OTP/OTP.js +2 -2
- package/build/features/signIn/screens/Password/Password.js +2 -1
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -2
- package/build/features/tax/screens/Verify/Verify.js +2 -2
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +14 -0
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ import Form from '../../../../components/Form';
|
|
|
29
29
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
30
30
|
import ConfirmPolicy from './ConfirmPolicy';
|
|
31
31
|
import BankStatement from './BankStatement';
|
|
32
|
-
import { getFileDetailsFromDocument, isKW, isStringHasOneAsterisk } from '../../../../utils';
|
|
32
|
+
import { deepCopy, getFileDetailsFromDocument, isKW, isStringHasOneAsterisk } from '../../../../utils';
|
|
33
33
|
var FormStyled = styled(Form)(function () { return ({
|
|
34
34
|
display: 'flex',
|
|
35
35
|
flexDirection: 'column',
|
|
@@ -103,7 +103,7 @@ var BankDetails = function () {
|
|
|
103
103
|
var isBankNameVerified = dataVerified['bank_name'] && bank_name === methods.watch('bankName');
|
|
104
104
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
105
105
|
var onSubmit = function (data) {
|
|
106
|
-
dispatch(createBankAccount(
|
|
106
|
+
dispatch(createBankAccount(deepCopy(getFelids(data))));
|
|
107
107
|
};
|
|
108
108
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, { readOnly: readOnly['beneficiaryName'] || noneEditable['beneficiary_name'], isVerified: isBeneficiaryNameVerified }), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking, readOnly: readOnly['iban'] || noneEditable['iban'], isVerified: isIBANVerified }), _jsx(BankName, { readOnly: readOnly['bankName'] || noneEditable['bank_name'], isVerified: isBankNameVerified }), _jsx(BankStatement, { isVerified: dataVerified['document'], required: isKWCountry && isFL && !bankHasDocument, defaultFiles: defaultBankFiles, readOnly: readOnly['bankStatementId'] || noneEditable['bank_statement_file_id'] }), _jsx(ConfirmPolicy, { readOnly: readOnly['confirmPolicy'] || noneEditable['is_acknowledged'] }), _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
109
109
|
};
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { maskPhone } from '../../../../utils';
|
|
21
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Text from '../../../../components/Text';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -66,7 +66,7 @@ var VerifyNumber = function (_a) {
|
|
|
66
66
|
};
|
|
67
67
|
}, [methods.formState.isValid]);
|
|
68
68
|
var onSubmit = function (formData) {
|
|
69
|
-
dispatch(verifyBankLeadOTP(
|
|
69
|
+
dispatch(verifyBankLeadOTP(deepCopy(formData)));
|
|
70
70
|
};
|
|
71
71
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
72
72
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
@@ -21,6 +21,7 @@ import { BrandActivitiesValidationSchema } from './validation';
|
|
|
21
21
|
import Button from '../../../shared/Button';
|
|
22
22
|
import { brandSelector, updateBrandActivities } from '../../../app/brand/brandStore';
|
|
23
23
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
24
|
+
import { deepCopy } from '../../../../utils';
|
|
24
25
|
import { useTranslation } from 'react-i18next';
|
|
25
26
|
import ActivitiesList from './ActivitiesList';
|
|
26
27
|
import CustomerBase from './CustomerBase';
|
|
@@ -94,7 +95,7 @@ var BrandActivities = function (_a) {
|
|
|
94
95
|
var isExpectedSalesRangeVerified = dataVerified['operations.sales_range'] && ((_c = operations === null || operations === void 0 ? void 0 : operations.sales) === null || _c === void 0 ? void 0 : _c.id) === ((_d = methods.watch('expectedSale')) === null || _d === void 0 ? void 0 : _d.id);
|
|
95
96
|
var isExpectedCustomersVerified = dataVerified['operations.customer_base'] && ((_e = operations === null || operations === void 0 ? void 0 : operations.customer_base) === null || _e === void 0 ? void 0 : _e.id) === ((_f = methods.watch('expectedCustomer')) === null || _f === void 0 ? void 0 : _f.id);
|
|
96
97
|
var onSubmit = function (data) {
|
|
97
|
-
dispatch(updateBrandActivities(
|
|
98
|
+
dispatch(updateBrandActivities(deepCopy(getFelids(data))));
|
|
98
99
|
};
|
|
99
100
|
var onBack = function () {
|
|
100
101
|
dispatch(handlePrevScreenStep());
|
|
@@ -18,7 +18,7 @@ import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, u
|
|
|
18
18
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
|
-
import { mapSalesChannel } from '../../../../utils';
|
|
21
|
+
import { deepCopy, mapSalesChannel } from '../../../../utils';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
23
|
import { clearError, brandSelector, updateBrand, retrieveBoardStatus } from '../../../app/brand/brandStore';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -58,7 +58,7 @@ var BrandInfo = function (_a) {
|
|
|
58
58
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
59
59
|
var isBrandNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && ((name === null || name === void 0 ? void 0 : name.en) === watch('brandName') || (name === null || name === void 0 ? void 0 : name.ar) === watch('brandName'));
|
|
60
60
|
var onSubmit = function (data) {
|
|
61
|
-
dispatch(updateBrand(
|
|
61
|
+
dispatch(updateBrand(deepCopy(getFelids(data))));
|
|
62
62
|
};
|
|
63
63
|
var onBack = function () {
|
|
64
64
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
@@ -19,6 +19,7 @@ import { handlePrevScreenStep } from '../../../../app/settings';
|
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import Collapse from '../../../../components/Collapse';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
|
+
import { deepCopy } from '../../../../utils';
|
|
22
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
24
|
import { clearError, brandSelector, updateSegmentBrand } from '../../../app/brand/brandStore';
|
|
24
25
|
import Button from '../../../shared/Button';
|
|
@@ -80,7 +81,7 @@ var BrandInfo = function (_a) {
|
|
|
80
81
|
var isSegmentTechVerified = dataVerified['segment.tech_type'] && ((_f = resSegment === null || resSegment === void 0 ? void 0 : resSegment.tech_type) === null || _f === void 0 ? void 0 : _f.id) === ((_g = watch('segmentTech')) === null || _g === void 0 ? void 0 : _g.id);
|
|
81
82
|
var isTeamSizeVerified = dataVerified['segment.teams'] && ((_h = resSegment === null || resSegment === void 0 ? void 0 : resSegment.team) === null || _h === void 0 ? void 0 : _h.id) === ((_j = watch('teamSize')) === null || _j === void 0 ? void 0 : _j.id);
|
|
82
83
|
var onSubmit = function (data) {
|
|
83
|
-
dispatch(updateSegmentBrand(
|
|
84
|
+
dispatch(updateSegmentBrand(deepCopy(getFelids(data))));
|
|
84
85
|
};
|
|
85
86
|
var onBack = function () {
|
|
86
87
|
dispatch(handlePrevScreenStep());
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { maskPhone } from '../../../../utils';
|
|
21
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Text from '../../../../components/Text';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -70,7 +70,7 @@ var VerifyNumber = function (_a) {
|
|
|
70
70
|
};
|
|
71
71
|
}, [methods.formState.isValid]);
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
|
-
dispatch(verifyBrandLeadOTP(
|
|
73
|
+
dispatch(verifyBrandLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
@@ -20,6 +20,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
21
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
|
+
import { deepCopy } from '../../../../utils';
|
|
23
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
25
|
import Collapse from '../../../../components/Collapse';
|
|
25
26
|
import OperationStartDate from './OperationStartDate';
|
|
@@ -48,7 +49,7 @@ var Activities = function () {
|
|
|
48
49
|
});
|
|
49
50
|
useSetFromDefaultValues(methods, data.activitiesData, true);
|
|
50
51
|
var onSubmit = function (data) {
|
|
51
|
-
dispatch(updateActivitiesInfo(
|
|
52
|
+
dispatch(updateActivitiesInfo(deepCopy(data)));
|
|
52
53
|
};
|
|
53
54
|
var handleCollapseOpenClose = function (flag) {
|
|
54
55
|
setCollapse(flag);
|
|
@@ -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 { isKW, isOtherLicense, isSA } from '../../../../utils';
|
|
26
|
+
import { deepCopy, isKW, isOtherLicense, isSA } from '../../../../utils';
|
|
27
27
|
import { KWLicenseValidationSchema, LicenseValidationSchema } from './validation';
|
|
28
28
|
import LicenseList from './LicenseList';
|
|
29
29
|
import LicenseCertificate from './LicenseCertificate';
|
|
@@ -77,7 +77,7 @@ var BusinessType = function (_a) {
|
|
|
77
77
|
certificateId: data.certificateId,
|
|
78
78
|
articleId: data.articleId
|
|
79
79
|
};
|
|
80
|
-
dispatch(updateLeadBusinessType(dataValues));
|
|
80
|
+
dispatch(updateLeadBusinessType(deepCopy(dataValues)));
|
|
81
81
|
};
|
|
82
82
|
var onBack = function () {
|
|
83
83
|
dispatch(handlePrevScreenStep());
|
|
@@ -33,6 +33,7 @@ import { clearError, businessSelector, createCivilIdAuth } from '../../../app/bu
|
|
|
33
33
|
import Form from '../../../../components/Form';
|
|
34
34
|
import Button from '../../../shared/Button';
|
|
35
35
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
|
+
import { deepCopy } from '../../../../utils';
|
|
36
37
|
import IDNumber from './IDNumber';
|
|
37
38
|
var FormStyled = styled(Form)(function () { return ({
|
|
38
39
|
display: 'flex',
|
|
@@ -55,7 +56,7 @@ var CivilID = function (_a) {
|
|
|
55
56
|
handleClearError();
|
|
56
57
|
}, [methods.formState.isValid]);
|
|
57
58
|
var onSubmit = function (data) {
|
|
58
|
-
dispatch(createCivilIdAuth(
|
|
59
|
+
dispatch(createCivilIdAuth(deepCopy(data)));
|
|
59
60
|
};
|
|
60
61
|
var handleClearError = function () {
|
|
61
62
|
if (error)
|
|
@@ -30,6 +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 } from '../../../../utils';
|
|
33
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
34
35
|
display: 'flex',
|
|
35
36
|
flexDirection: 'column'
|
|
@@ -74,7 +75,7 @@ var Customers = function (_a) {
|
|
|
74
75
|
}
|
|
75
76
|
}, [terms]);
|
|
76
77
|
var onSubmit = function (data) {
|
|
77
|
-
dispatch(updateCustomersInfo(
|
|
78
|
+
dispatch(updateCustomersInfo(deepCopy(data)));
|
|
78
79
|
};
|
|
79
80
|
var onBack = function () {
|
|
80
81
|
dispatch(handlePrevScreenStep());
|
|
@@ -32,6 +32,7 @@ import Button from '../../../shared/Button';
|
|
|
32
32
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
33
33
|
import { businessSelector, clearError, updateLeadIdentity } from '../../../app/business/businessStore';
|
|
34
34
|
import Collapse from '../../../../components/Collapse';
|
|
35
|
+
import { deepCopy } from '../../../../utils';
|
|
35
36
|
import { NIDValidationSchema } from './validation';
|
|
36
37
|
import ID from './ID';
|
|
37
38
|
import DOB from './DOB';
|
|
@@ -57,7 +58,7 @@ var IDBOD = function (_a) {
|
|
|
57
58
|
dispatch(clearError());
|
|
58
59
|
}, [methods.formState.isValid]);
|
|
59
60
|
var onSubmit = function (data) {
|
|
60
|
-
dispatch(updateLeadIdentity(
|
|
61
|
+
dispatch(updateLeadIdentity(deepCopy(data)));
|
|
61
62
|
};
|
|
62
63
|
var handleCollapseOpenClose = function (flag) {
|
|
63
64
|
setCollapse(flag);
|
|
@@ -35,7 +35,7 @@ import Text from '../../../../components/Text';
|
|
|
35
35
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
36
|
import { businessSelector, clearError, resetOTPScreen, verifyLeadOTP } from '../../../app/business/businessStore';
|
|
37
37
|
import Button from '../../../shared/Button';
|
|
38
|
-
import { maskID } from '../../../../utils';
|
|
38
|
+
import { deepCopy, maskID } from '../../../../utils';
|
|
39
39
|
import { OTPValidation } from './validation';
|
|
40
40
|
import OTPInput from './OTPInput';
|
|
41
41
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -77,7 +77,7 @@ var OTP = function (_a) {
|
|
|
77
77
|
};
|
|
78
78
|
}, [methods.formState.isValid]);
|
|
79
79
|
var onSubmit = function (formData) {
|
|
80
|
-
dispatch(verifyLeadOTP(
|
|
80
|
+
dispatch(verifyLeadOTP(deepCopy(formData)));
|
|
81
81
|
};
|
|
82
82
|
var onBack = function () {
|
|
83
83
|
dispatch(handlePrevScreenStep());
|
|
@@ -19,7 +19,7 @@ import Box from '@mui/material/Box/Box';
|
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
21
|
import { useLanguage } from '../../../../hooks';
|
|
22
|
-
import { maskPhone } from '../../../../utils';
|
|
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';
|
|
@@ -67,7 +67,7 @@ var VerifyNumber = function (_a) {
|
|
|
67
67
|
};
|
|
68
68
|
}, [methods.formState.isValid]);
|
|
69
69
|
var onSubmit = function (formData) {
|
|
70
|
-
dispatch(verifyLeadOTP(
|
|
70
|
+
dispatch(verifyLeadOTP(deepCopy(formData)));
|
|
71
71
|
};
|
|
72
72
|
var onBack = function () {
|
|
73
73
|
dispatch(handlePrevScreenStep());
|
|
@@ -17,7 +17,7 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
|
-
import { sendCustomEventToGTM } from '../../../../utils';
|
|
20
|
+
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
23
|
import Button from '../../../shared/Button';
|
|
@@ -62,7 +62,7 @@ var BrandSegment = function (_a) {
|
|
|
62
62
|
var isAr = useLanguage().isAr;
|
|
63
63
|
var dispatch = useAppDispatch();
|
|
64
64
|
var onSubmit = function (formData) {
|
|
65
|
-
dispatch(updateLeadBrandSegment(
|
|
65
|
+
dispatch(updateLeadBrandSegment(deepCopy(formData)));
|
|
66
66
|
};
|
|
67
67
|
var onBack = function () {
|
|
68
68
|
dispatch(handlePrevScreenStep());
|
|
@@ -18,6 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import { civilIDValidationSchema } from './validation';
|
|
19
19
|
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
20
20
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
|
+
import { deepCopy } from '../../../../utils';
|
|
21
22
|
import { clearError, connectSelector, createCivilIdAuth, resetMobileScreen, resetStore } from '../../../app/connect/connectStore';
|
|
22
23
|
import Form from '../../../../components/Form';
|
|
23
24
|
import Button, { MobileButton } from '../../../shared/Button';
|
|
@@ -75,7 +76,7 @@ var CivilID = function (_a) {
|
|
|
75
76
|
handleClearError();
|
|
76
77
|
}, [methods.formState.isValid]);
|
|
77
78
|
var onSubmit = function (data) {
|
|
78
|
-
dispatch(createCivilIdAuth(
|
|
79
|
+
dispatch(createCivilIdAuth(deepCopy(data)));
|
|
79
80
|
dispatch(resetMobileScreen(settingsStore.data.businessCountry));
|
|
80
81
|
};
|
|
81
82
|
var handleClearError = function () {
|
|
@@ -40,7 +40,7 @@ import MobileNumber from './MobileNumber';
|
|
|
40
40
|
import { countriesCode } from '../../../../constants';
|
|
41
41
|
import { AuthForType } from '../../../../@types';
|
|
42
42
|
import Collapse from '../../../../components/Collapse';
|
|
43
|
-
import { isKW, sendCustomEventToGTM } from '../../../../utils';
|
|
43
|
+
import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
|
|
44
44
|
var FormStyled = styled(Form)(function () { return ({
|
|
45
45
|
display: 'flex',
|
|
46
46
|
flexDirection: 'column',
|
|
@@ -79,7 +79,7 @@ var Individual = function (_a) {
|
|
|
79
79
|
methods.setValue('countryCode', defaultValues.countryCode);
|
|
80
80
|
}, [defaultValues.countryCode]);
|
|
81
81
|
var onSubmit = function (formData) {
|
|
82
|
-
dispatch(updateLeadIndividual(
|
|
82
|
+
dispatch(updateLeadIndividual(deepCopy(formData)));
|
|
83
83
|
};
|
|
84
84
|
var onBack = function () {
|
|
85
85
|
var _a;
|
|
@@ -17,7 +17,7 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
|
-
import { sendCustomEventToGTM } from '../../../../utils';
|
|
20
|
+
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
23
|
import Button from '../../../shared/Button';
|
|
@@ -63,7 +63,7 @@ var Merchant = function (_a) {
|
|
|
63
63
|
var dispatch = useAppDispatch();
|
|
64
64
|
var brandListItem = methods.getValues('selectedBrandItem');
|
|
65
65
|
var onSubmit = function (formData) {
|
|
66
|
-
dispatch(updateLeadBrand(__assign(__assign({}, formData), { isNewBrand: isRequiredNewBrand })));
|
|
66
|
+
dispatch(updateLeadBrand(deepCopy(__assign(__assign({}, formData), { isNewBrand: isRequiredNewBrand }))));
|
|
67
67
|
};
|
|
68
68
|
var onBack = function () {
|
|
69
69
|
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
@@ -25,7 +25,7 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
25
25
|
import { clearError, connectSelector, createMobileAuth, resetNIDScreen, resetCivilScreen, resetOTPScreen, resetStore } from '../../../app/connect/connectStore';
|
|
26
26
|
import { useLanguage } from '../../../../hooks';
|
|
27
27
|
import Divider from '@mui/material/Divider';
|
|
28
|
-
import { isKW, sendCustomEventToGTM } from '../../../../utils';
|
|
28
|
+
import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
|
|
29
29
|
import Text from '../../../../components/Text';
|
|
30
30
|
import MIDTitle from './Title';
|
|
31
31
|
import MobileNumber from './MobileNumber';
|
|
@@ -103,7 +103,7 @@ var Mobile = function (_a) {
|
|
|
103
103
|
dispatch(clearError());
|
|
104
104
|
}, [methods.formState.isValid]);
|
|
105
105
|
var onSubmit = function (formData) {
|
|
106
|
-
dispatch(createMobileAuth(
|
|
106
|
+
dispatch(createMobileAuth(deepCopy(formData)));
|
|
107
107
|
dispatch(resetNIDScreen());
|
|
108
108
|
dispatch(resetCivilScreen());
|
|
109
109
|
};
|
|
@@ -22,7 +22,7 @@ import { clearError, connectSelector, createNIDAuth, resetMobileScreen, resetSto
|
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Button, { MobileButton } from '../../../shared/Button';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import { sendCustomEventToGTM } from '../../../../utils';
|
|
25
|
+
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
26
26
|
import Collapse from '../../../../components/Collapse';
|
|
27
27
|
import Box from '@mui/material/Box';
|
|
28
28
|
import Divider from '@mui/material/Divider';
|
|
@@ -77,7 +77,7 @@ var NID = function (_a) {
|
|
|
77
77
|
handleClearError();
|
|
78
78
|
}, [methods.formState.isValid]);
|
|
79
79
|
var onSubmit = function (data) {
|
|
80
|
-
dispatch(createNIDAuth(
|
|
80
|
+
dispatch(createNIDAuth(deepCopy(data)));
|
|
81
81
|
dispatch(resetMobileScreen(settingsStore.data.businessCountry));
|
|
82
82
|
};
|
|
83
83
|
var handleCollapseOpenClose = function (flag) {
|
|
@@ -25,7 +25,7 @@ import { AuthForType } from '../../../../@types';
|
|
|
25
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
26
26
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
27
27
|
import Form from '../../../../components/Form';
|
|
28
|
-
import { maskPhone, maskID, sendCustomEventToGTM } from '../../../../utils';
|
|
28
|
+
import { maskPhone, maskID, sendCustomEventToGTM, deepCopy } from '../../../../utils';
|
|
29
29
|
import { OTPValidation } from './validation';
|
|
30
30
|
import OTPInput from './OTPInput';
|
|
31
31
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -78,7 +78,7 @@ var OTP = function () {
|
|
|
78
78
|
};
|
|
79
79
|
}, [methods.formState.isValid]);
|
|
80
80
|
var onSubmit = function (formData) {
|
|
81
|
-
dispatch(verifyAuth(
|
|
81
|
+
dispatch(verifyAuth(deepCopy(formData)));
|
|
82
82
|
};
|
|
83
83
|
var onBack = function () {
|
|
84
84
|
dispatch(handlePrevScreenStep(startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
|
|
@@ -27,6 +27,7 @@ import Box from '@mui/material/Box';
|
|
|
27
27
|
import Divider from '@mui/material/Divider';
|
|
28
28
|
import Text from '../../../../components/Text';
|
|
29
29
|
import IDNumber from './IDNumber';
|
|
30
|
+
import { deepCopy } from '../../../../utils';
|
|
30
31
|
var FormStyled = styled(Form)(function () { return ({
|
|
31
32
|
display: 'flex',
|
|
32
33
|
flexDirection: 'column'
|
|
@@ -73,7 +74,7 @@ var CivilID = function (_a) {
|
|
|
73
74
|
dispatch(resetStore());
|
|
74
75
|
}, []);
|
|
75
76
|
var onSubmit = function (data) {
|
|
76
|
-
dispatch(createCivilIdAuthAsync(
|
|
77
|
+
dispatch(createCivilIdAuthAsync(deepCopy(data)));
|
|
77
78
|
};
|
|
78
79
|
var onBack = function () {
|
|
79
80
|
dispatch(handlePrevScreenStep());
|
|
@@ -22,6 +22,7 @@ import { clearError, connectExpressSelector, createCivilIDAuthIdentityAsync } fr
|
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Button from '../../../shared/Button';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
+
import { deepCopy } from '../../../../utils';
|
|
25
26
|
import IDNumber from './IDNumber';
|
|
26
27
|
var FormStyled = styled(Form)(function () { return ({
|
|
27
28
|
display: 'flex',
|
|
@@ -42,7 +43,7 @@ var CivilID = function (_a) {
|
|
|
42
43
|
dispatch(clearError());
|
|
43
44
|
}, [methods.formState.isValid]);
|
|
44
45
|
var onSubmit = function (data) {
|
|
45
|
-
dispatch(createCivilIDAuthIdentityAsync(
|
|
46
|
+
dispatch(createCivilIDAuthIdentityAsync(deepCopy(data)));
|
|
46
47
|
};
|
|
47
48
|
var onBack = function () {
|
|
48
49
|
dispatch(handlePrevScreenStep());
|
|
@@ -15,7 +15,7 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
17
|
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
18
|
-
import { isSA } from '../../../../utils';
|
|
18
|
+
import { deepCopy, isSA } from '../../../../utils';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
@@ -67,7 +67,7 @@ var CollectBusinessInfo = function (_a) {
|
|
|
67
67
|
licenseNumber: data.licenseNumber,
|
|
68
68
|
termAndConditionChecked: data.termAndConditionChecked
|
|
69
69
|
};
|
|
70
|
-
dispatch(updateLeadBusinessDataAsync(
|
|
70
|
+
dispatch(updateLeadBusinessDataAsync(deepCopy(getFelids(dataValues))));
|
|
71
71
|
};
|
|
72
72
|
var onBack = function () {
|
|
73
73
|
dispatch(handlePrevScreenStep());
|
package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js
CHANGED
|
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
|
|
|
18
18
|
import { useAppDispatch, useAppSelector, useExcludeReadOnlyFelids, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
|
|
19
19
|
import { AuthForType } from '../../../../@types';
|
|
20
20
|
import { useLanguage } from '../../../../hooks';
|
|
21
|
-
import { isKW } from '../../../../utils';
|
|
21
|
+
import { deepCopy, isKW } from '../../../../utils';
|
|
22
22
|
import { countriesCode } from '../../../../constants';
|
|
23
23
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
24
24
|
import Form from '../../../../components/Form';
|
|
@@ -64,7 +64,7 @@ var CollectIndividualInfo = function (_a) {
|
|
|
64
64
|
methods.setValue('countryCode', countryCode);
|
|
65
65
|
}, [countryCode]);
|
|
66
66
|
var onSubmit = function (formData) {
|
|
67
|
-
dispatch(updateLeadIndividualAsync(
|
|
67
|
+
dispatch(updateLeadIndividualAsync(deepCopy(getFelids(formData))));
|
|
68
68
|
};
|
|
69
69
|
var onBack = function () {
|
|
70
70
|
var _a;
|
|
@@ -25,7 +25,7 @@ import { AuthForType } from '../../../../@types';
|
|
|
25
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
26
26
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
27
27
|
import Form from '../../../../components/Form';
|
|
28
|
-
import { maskPhone, maskID } from '../../../../utils';
|
|
28
|
+
import { maskPhone, maskID, deepCopy } from '../../../../utils';
|
|
29
29
|
import { OTPValidation } from './validation';
|
|
30
30
|
import OTPInput from './OTPInput';
|
|
31
31
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -70,10 +70,10 @@ var OTP = function () {
|
|
|
70
70
|
}, []);
|
|
71
71
|
var onSubmit = function (formData) {
|
|
72
72
|
if (isNidAuth) {
|
|
73
|
-
dispatch(verifyNIDOtpLeadIdentityAsync(
|
|
73
|
+
dispatch(verifyNIDOtpLeadIdentityAsync(deepCopy(formData)));
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
dispatch(verifyMobileOtpAsync(
|
|
76
|
+
dispatch(verifyMobileOtpAsync(deepCopy(formData)));
|
|
77
77
|
};
|
|
78
78
|
var onBack = function () {
|
|
79
79
|
dispatch(handlePrevScreenStep());
|
|
@@ -30,6 +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
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
34
35
|
display: 'flex',
|
|
35
36
|
flexDirection: 'column'
|
|
@@ -91,7 +92,7 @@ var Mobile = function (_a) {
|
|
|
91
92
|
dispatch(resetStore());
|
|
92
93
|
}, []);
|
|
93
94
|
var onSubmit = function (formData) {
|
|
94
|
-
dispatch(createMobileAuthAsync(
|
|
95
|
+
dispatch(createMobileAuthAsync(deepCopy(formData)));
|
|
95
96
|
};
|
|
96
97
|
var onBack = function () {
|
|
97
98
|
var screen = isKuwait ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
|
|
@@ -29,6 +29,7 @@ import Text from '../../../../components/Text';
|
|
|
29
29
|
import IDNumber from './IDNumber';
|
|
30
30
|
import DOB from './DOB';
|
|
31
31
|
import TAC from './TAC';
|
|
32
|
+
import { deepCopy } from '../../../../utils';
|
|
32
33
|
var FormStyled = styled(Form)(function () { return ({
|
|
33
34
|
display: 'flex',
|
|
34
35
|
flexDirection: 'column'
|
|
@@ -77,7 +78,7 @@ var NID = function (_a) {
|
|
|
77
78
|
React.useEffect(function () {
|
|
78
79
|
}, []);
|
|
79
80
|
var onSubmit = function (data) {
|
|
80
|
-
dispatch(createNIDAuthAsync(
|
|
81
|
+
dispatch(createNIDAuthAsync(deepCopy(data)));
|
|
81
82
|
};
|
|
82
83
|
var handleCollapseOpenClose = function (flag) {
|
|
83
84
|
setCollapse(flag);
|
|
@@ -25,6 +25,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
25
25
|
import Collapse from '../../../../components/Collapse';
|
|
26
26
|
import IDNumber from './IDNumber';
|
|
27
27
|
import DOB from './DOB';
|
|
28
|
+
import { deepCopy } from '../../../../utils';
|
|
28
29
|
var FormStyled = styled(Form)(function () { return ({
|
|
29
30
|
display: 'flex',
|
|
30
31
|
flexDirection: 'column'
|
|
@@ -45,7 +46,7 @@ var NID = function (_a) {
|
|
|
45
46
|
dispatch(clearError());
|
|
46
47
|
}, [methods.formState.isValid]);
|
|
47
48
|
var onSubmit = function (data) {
|
|
48
|
-
dispatch(createNIDAuthIdentityAsync(
|
|
49
|
+
dispatch(createNIDAuthIdentityAsync(deepCopy(data)));
|
|
49
50
|
};
|
|
50
51
|
var handleCollapseOpenClose = function (flag) {
|
|
51
52
|
setCollapse(flag);
|
|
@@ -25,7 +25,7 @@ import { AuthForType } from '../../../../@types';
|
|
|
25
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
26
26
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
27
27
|
import Form from '../../../../components/Form';
|
|
28
|
-
import { maskPhone, maskID } from '../../../../utils';
|
|
28
|
+
import { maskPhone, maskID, deepCopy } from '../../../../utils';
|
|
29
29
|
import { OTPValidation } from './validation';
|
|
30
30
|
import OTPInput from './OTPInput';
|
|
31
31
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -70,10 +70,10 @@ var OTP = function () {
|
|
|
70
70
|
}, []);
|
|
71
71
|
var onSubmit = function (formData) {
|
|
72
72
|
if (isNidAuth) {
|
|
73
|
-
dispatch(verifyNIDOtpAsync(
|
|
73
|
+
dispatch(verifyNIDOtpAsync(deepCopy(formData)));
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
dispatch(verifyMobileOtpAsync(
|
|
76
|
+
dispatch(verifyMobileOtpAsync(deepCopy(formData)));
|
|
77
77
|
};
|
|
78
78
|
var onBack = function () {
|
|
79
79
|
var screen = isNidAuth ? 'CONNECT_EXPRESS_NID_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
@@ -16,7 +16,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import Collapse from '@mui/material/Collapse';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
19
|
-
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
19
|
+
import { deepCopy, removeAllCharsFromNumber } from '../../../../utils';
|
|
20
20
|
import { clearError, entitySelector, updateEntityCapital } from '../../../app/entity/entityStore';
|
|
21
21
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
22
22
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
@@ -68,7 +68,7 @@ var EntityCapital = function (_a) {
|
|
|
68
68
|
var isCapitalShareCountVerified = dataVerified['capital.shares.count'] && ((_d = (_c = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _c === void 0 ? void 0 : _c.count) === null || _d === void 0 ? void 0 : _d.toString()) === ((_e = watch('capitalShareCount')) === null || _e === void 0 ? void 0 : _e.toString());
|
|
69
69
|
var isCapitalShareValueVerified = dataVerified['capital.shares.value'] && ((_g = (_f = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.toString()) === removeAllCharsFromNumber(watch('capitalShareValue'));
|
|
70
70
|
var onSubmit = function (data) {
|
|
71
|
-
dispatch(updateEntityCapital(
|
|
71
|
+
dispatch(updateEntityCapital(deepCopy(getFelids(data))));
|
|
72
72
|
};
|
|
73
73
|
var onBack = function () {
|
|
74
74
|
dispatch(handlePrevScreenStep());
|
|
@@ -17,7 +17,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { convertToEnglishDateFormat, getFileDetailsFromDocument, isKW, isSA } from '../../../../utils';
|
|
20
|
+
import { convertToEnglishDateFormat, deepCopy, getFileDetailsFromDocument, isKW, isSA } from '../../../../utils';
|
|
21
21
|
import { BusinessType, DocumentPurpose } from '../../../../@types';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Collapse from '../../../../components/Collapse';
|
|
@@ -107,7 +107,7 @@ var EntityName = function (_a) {
|
|
|
107
107
|
var isExpiryDateVerified = dataVerified['license.expiry_date'] && expDateRes === watch('expiryDate');
|
|
108
108
|
var isArticleIdVerified = dataVerified['AOA_file_id'];
|
|
109
109
|
var onSubmit = function (data) {
|
|
110
|
-
dispatch(updateEntityName(
|
|
110
|
+
dispatch(updateEntityName(deepCopy(getFelids(data))));
|
|
111
111
|
};
|
|
112
112
|
var handleIssueDateOpenClose = function (flag) {
|
|
113
113
|
setIssueAnchorEl(flag);
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { maskPhone } from '../../../../utils';
|
|
21
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Text from '../../../../components/Text';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -70,7 +70,7 @@ var VerifyNumber = function (_a) {
|
|
|
70
70
|
};
|
|
71
71
|
}, [methods.formState.isValid]);
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
|
-
dispatch(verifyEntityLeadOTP(
|
|
73
|
+
dispatch(verifyEntityLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -19,7 +19,7 @@ import Box from '@mui/material/Box';
|
|
|
19
19
|
import { alpha, styled } from '@mui/material/styles';
|
|
20
20
|
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
21
21
|
import { DocumentPurpose, IndividualType } from '../../../../@types';
|
|
22
|
-
import { getIndividualType, isSA } from '../../../../utils';
|
|
22
|
+
import { deepCopy, getIndividualType, isSA } from '../../../../utils';
|
|
23
23
|
import Form from '../../../../components/Form';
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
25
|
import Text from '../../../../components/Text';
|
|
@@ -106,7 +106,7 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
106
106
|
var _f = React.useState(), listActive = _f[0], setListActive = _f[1];
|
|
107
107
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
108
108
|
var onSubmit = function (data) {
|
|
109
|
-
dispatch(updateIndividualInfo(
|
|
109
|
+
dispatch(updateIndividualInfo(deepCopy(getFelids(data))));
|
|
110
110
|
};
|
|
111
111
|
var onBack = function () {
|
|
112
112
|
dispatch(handleCurrentActiveScreen('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
@@ -18,7 +18,7 @@ import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } fro
|
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { alpha, styled } from '@mui/material/styles';
|
|
20
20
|
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
21
|
-
import { convertToEnglishDateFormat, getUserName } from '../../../../utils';
|
|
21
|
+
import { convertToEnglishDateFormat, deepCopy, getUserName } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Collapse from '../../../../components/Collapse';
|
|
24
24
|
import Text from '../../../../components/Text';
|
|
@@ -136,7 +136,7 @@ var IndividualPersonalInfo = function (_a) {
|
|
|
136
136
|
var isBirthCityVerified = dataVerified['birth.city'] && ((_h = birth === null || birth === void 0 ? void 0 : birth.city) === null || _h === void 0 ? void 0 : _h.cityId) === ((_j = watch('placeOfBirthCity')) === null || _j === void 0 ? void 0 : _j.id);
|
|
137
137
|
var isNationalityVerified = dataVerified['nationality'] && nationalityRes === ((_k = watch('nationality')) === null || _k === void 0 ? void 0 : _k.iso2);
|
|
138
138
|
var onSubmit = function (data) {
|
|
139
|
-
dispatch(updateIndividualPersonalInfo(
|
|
139
|
+
dispatch(updateIndividualPersonalInfo(deepCopy(getFelids(data))));
|
|
140
140
|
};
|
|
141
141
|
React.useEffect(function () {
|
|
142
142
|
if (error)
|
|
@@ -25,6 +25,7 @@ import { individualSelector, clearError, updatePhoneInfo } from '../../../app/in
|
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
26
26
|
import { IndividualPhoneInfoValidationSchema } from './validation';
|
|
27
27
|
import MobileNumber from './MobileNumber';
|
|
28
|
+
import { deepCopy } from '../../../../utils';
|
|
28
29
|
var FormStyled = styled(Form)(function () { return ({
|
|
29
30
|
display: 'flex',
|
|
30
31
|
flexDirection: 'column'
|
|
@@ -51,7 +52,7 @@ var PhoneInfo = function (_a) {
|
|
|
51
52
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
52
53
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
53
54
|
var onSubmit = function (formData) {
|
|
54
|
-
dispatch(updatePhoneInfo(
|
|
55
|
+
dispatch(updatePhoneInfo(deepCopy(getFelids(formData))));
|
|
55
56
|
};
|
|
56
57
|
React.useEffect(function () {
|
|
57
58
|
if (error && methods.formState.isValid)
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { maskPhone } from '../../../../utils';
|
|
21
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Text from '../../../../components/Text';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -70,7 +70,7 @@ var VerifyNumber = function (_a) {
|
|
|
70
70
|
};
|
|
71
71
|
}, [methods.formState.isValid]);
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
|
-
dispatch(verifyLeadOTP(
|
|
73
|
+
dispatch(verifyLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
var dataLoading = loading || cityLoading;
|
|
@@ -27,6 +27,7 @@ import { PasswordValidation } from './validation';
|
|
|
27
27
|
import Password from './Password';
|
|
28
28
|
import { createPassword, passwordSelector, storePasswordScreen } from '../../../app/password/passwordStore';
|
|
29
29
|
import { useSelector } from 'react-redux';
|
|
30
|
+
import { deepCopy } from '../../../../utils';
|
|
30
31
|
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
31
32
|
var theme = _a.theme;
|
|
32
33
|
return ({
|
|
@@ -52,11 +53,11 @@ var CreatePassword = function (_a) {
|
|
|
52
53
|
useSetFromDefaultValues(methods, data.passwordData);
|
|
53
54
|
var onSubmit = function (data) {
|
|
54
55
|
if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
|
|
55
|
-
dispatch(storePasswordScreen(
|
|
56
|
+
dispatch(storePasswordScreen(deepCopy(data)));
|
|
56
57
|
dispatch(handleNextScreenStep('PASSWORD_RESET_PASSWORD_OTP_STEP'));
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
dispatch(createPassword(
|
|
60
|
+
dispatch(createPassword(deepCopy(data)));
|
|
60
61
|
};
|
|
61
62
|
var onBack = function () {
|
|
62
63
|
dispatch(handleCurrentActiveScreen('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
@@ -35,7 +35,7 @@ import Text from '../../../../components/Text';
|
|
|
35
35
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
36
|
import { passwordSelector, clearError, resetOTPScreen, resetPassword } from '../../../app/password/passwordStore';
|
|
37
37
|
import Button from '../../../shared/Button';
|
|
38
|
-
import { maskPhone } from '../../../../utils';
|
|
38
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
39
39
|
import { OTPValidation } from './validation';
|
|
40
40
|
import OTPInput from './OTPInput';
|
|
41
41
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -78,7 +78,7 @@ var OTP = function (_a) {
|
|
|
78
78
|
};
|
|
79
79
|
}, [methods.formState.isValid]);
|
|
80
80
|
var onSubmit = function (formData) {
|
|
81
|
-
dispatch(resetPassword(
|
|
81
|
+
dispatch(resetPassword(deepCopy(formData)));
|
|
82
82
|
};
|
|
83
83
|
var onBack = function () {
|
|
84
84
|
dispatch(handlePrevScreenStep());
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { maskPhone } from '../../../../utils';
|
|
21
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Text from '../../../../components/Text';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -70,7 +70,7 @@ var VerifyNumber = function (_a) {
|
|
|
70
70
|
};
|
|
71
71
|
}, [methods.formState.isValid]);
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
|
-
dispatch(verifyPasswordLeadOTP(
|
|
73
|
+
dispatch(verifyPasswordLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
@@ -21,6 +21,7 @@ import { clearError, signInSelector, createEmailAuth } from '../../../app/signIn
|
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import Button, { MobileButton } from '../../../shared/Button';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
|
+
import { deepCopy } from '../../../../utils';
|
|
24
25
|
import Collapse from '../../../../components/Collapse';
|
|
25
26
|
import Box from '@mui/material/Box';
|
|
26
27
|
import Divider from '@mui/material/Divider';
|
|
@@ -81,7 +82,7 @@ var Email = function (_a) {
|
|
|
81
82
|
handleClearError();
|
|
82
83
|
}, [methods.formState.isValid]);
|
|
83
84
|
var onSubmit = function (data) {
|
|
84
|
-
dispatch(createEmailAuth(
|
|
85
|
+
dispatch(createEmailAuth(deepCopy(data)));
|
|
85
86
|
};
|
|
86
87
|
var handleClearError = function () {
|
|
87
88
|
if (error)
|
|
@@ -24,6 +24,7 @@ import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings
|
|
|
24
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
25
25
|
import { clearError, createMobileAuth, signInSelector } from '../../../app/signIn/signInStore';
|
|
26
26
|
import { useLanguage } from '../../../../hooks';
|
|
27
|
+
import { deepCopy } from '../../../../utils';
|
|
27
28
|
import Divider from '@mui/material/Divider';
|
|
28
29
|
import Text from '../../../../components/Text';
|
|
29
30
|
import MobileNumber from './MobileNumber';
|
|
@@ -98,7 +99,7 @@ var Mobile = function (_a) {
|
|
|
98
99
|
dispatch(clearError());
|
|
99
100
|
}, [methods.formState.isValid]);
|
|
100
101
|
var onSubmit = function (data) {
|
|
101
|
-
dispatch(createMobileAuth(
|
|
102
|
+
dispatch(createMobileAuth(deepCopy(data)));
|
|
102
103
|
};
|
|
103
104
|
var onBack = function () {
|
|
104
105
|
dispatch(handlePrevScreenStep());
|
|
@@ -35,7 +35,7 @@ import { useLanguage } from '../../../../hooks';
|
|
|
35
35
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
36
36
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
37
37
|
import Form from '../../../../components/Form';
|
|
38
|
-
import { maskPhone, maskEmail } from '../../../../utils';
|
|
38
|
+
import { maskPhone, maskEmail, deepCopy } from '../../../../utils';
|
|
39
39
|
import { OTPValidation } from './validation';
|
|
40
40
|
import OTPInput from './OTPInput';
|
|
41
41
|
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
@@ -79,7 +79,7 @@ var OTP = function () {
|
|
|
79
79
|
};
|
|
80
80
|
}, [methods.formState.isValid]);
|
|
81
81
|
var onSubmit = function (formData) {
|
|
82
|
-
dispatch(verifyAuthOTP(
|
|
82
|
+
dispatch(verifyAuthOTP(deepCopy(formData)));
|
|
83
83
|
};
|
|
84
84
|
var onBack = function () {
|
|
85
85
|
dispatch(handlePrevScreenStep(isEmail ? 'SIGIN_EMAIL_STEP' : 'SIGIN_MOBILE_STEP'));
|
|
@@ -34,6 +34,7 @@ import Form from '../../../../components/Form';
|
|
|
34
34
|
import { useLanguage } from '../../../../hooks';
|
|
35
35
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
36
36
|
import Button from '../../../shared/Button';
|
|
37
|
+
import { deepCopy } from '../../../../utils';
|
|
37
38
|
import { signInSelector, verifyAuthPassword } from '../../../app/signIn/signInStore';
|
|
38
39
|
import PasswordInput from './PasswordInput';
|
|
39
40
|
import { PasswordValidation } from './validation';
|
|
@@ -57,7 +58,7 @@ var Password = function (_a) {
|
|
|
57
58
|
});
|
|
58
59
|
useSetFromDefaultValues(methods, defaultValues);
|
|
59
60
|
var onSubmit = function (data) {
|
|
60
|
-
dispatch(verifyAuthPassword(
|
|
61
|
+
dispatch(verifyAuthPassword(deepCopy(data)));
|
|
61
62
|
};
|
|
62
63
|
var onBack = function () {
|
|
63
64
|
dispatch(handlePrevScreenStep(isEmail ? 'SIGIN_EMAIL_STEP' : 'SIGIN_MOBILE_STEP'));
|
|
@@ -19,7 +19,7 @@ import Form from '../../../../components/Form';
|
|
|
19
19
|
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
20
20
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
21
|
import { DocumentPurpose } from '../../../../@types';
|
|
22
|
-
import { getFileDetailsFromDocument, isSA } from '../../../../utils';
|
|
22
|
+
import { deepCopy, getFileDetailsFromDocument, isSA } from '../../../../utils';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
24
|
import Button from '../../../shared/Button';
|
|
25
25
|
import { retrieveBoardStatus, taxSelector, updateTaxInfo } from '../../../app/tax/taxStore';
|
|
@@ -61,7 +61,7 @@ var TaxDetails = function () {
|
|
|
61
61
|
var isAr = useLanguage().isAr;
|
|
62
62
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
63
63
|
var onSubmit = function (data) {
|
|
64
|
-
dispatch(updateTaxInfo(
|
|
64
|
+
dispatch(updateTaxInfo(deepCopy(getFelids(data))));
|
|
65
65
|
};
|
|
66
66
|
var onBack = function () {
|
|
67
67
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import Box from '@mui/material/Box/Box';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import { maskPhone } from '../../../../utils';
|
|
21
|
+
import { deepCopy, maskPhone } from '../../../../utils';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Text from '../../../../components/Text';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -67,7 +67,7 @@ var VerifyNumber = function (_a) {
|
|
|
67
67
|
};
|
|
68
68
|
}, [methods.formState.isValid]);
|
|
69
69
|
var onSubmit = function (formData) {
|
|
70
|
-
dispatch(verifyTaxLeadOTP(
|
|
70
|
+
dispatch(verifyTaxLeadOTP(deepCopy(formData)));
|
|
71
71
|
};
|
|
72
72
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
73
73
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
package/build/utils/object.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export declare const hasKeyValue: (obj: any, path: string, value: string | numbe
|
|
|
7
7
|
export declare const hasNoneEditableValue: (obj: any, path: string) => boolean;
|
|
8
8
|
export declare const hasEditableValue: (obj: any, path: string) => boolean;
|
|
9
9
|
export declare const hasVerifiedValue: (obj: any, path: string) => boolean;
|
|
10
|
+
export declare function deepCopy(obj: any): any;
|
package/build/utils/object.js
CHANGED
|
@@ -50,3 +50,17 @@ export var hasVerifiedValue = function (obj, path) {
|
|
|
50
50
|
var value = VerificationStatus.VERIFIED;
|
|
51
51
|
return hasKeyValue(obj, path, value);
|
|
52
52
|
};
|
|
53
|
+
export function deepCopy(obj) {
|
|
54
|
+
if (typeof obj !== 'object') {
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(obj)) {
|
|
58
|
+
return obj.map(function (item) { return deepCopy(item); });
|
|
59
|
+
}
|
|
60
|
+
var newObj = {};
|
|
61
|
+
for (var key in obj) {
|
|
62
|
+
var value = obj[key];
|
|
63
|
+
newObj[key] = deepCopy(value);
|
|
64
|
+
}
|
|
65
|
+
return newObj;
|
|
66
|
+
}
|