@tap-payments/auth-jsconnect 2.8.62-development → 2.8.63-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/redux.d.ts +0 -1
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/app/settings.js +2 -3
- package/build/components/Providers/ThemeProvider.js +1 -1
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +3 -0
- package/build/constants/app.js +3 -0
- package/build/features/app/bank/bankStore.d.ts +19 -13
- package/build/features/app/bank/bankStore.js +165 -183
- package/build/features/app/board/boardStore.js +10 -16
- package/build/features/app/brand/brandStore.d.ts +31 -16
- package/build/features/app/brand/brandStore.js +239 -243
- package/build/features/app/business/businessStore.js +1 -7
- package/build/features/app/entity/entityStore.d.ts +34 -20
- package/build/features/app/entity/entityStore.js +249 -204
- package/build/features/app/individual/individualStore.d.ts +36 -17
- package/build/features/app/individual/individualStore.js +270 -221
- package/build/features/app/password/passwordStore.d.ts +25 -19
- package/build/features/app/password/passwordStore.js +216 -170
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/bank/screens/BankDetails/BankDetails.js +4 -17
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +11 -48
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +4 -22
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +6 -22
- package/build/features/business/screens/Activities/Activities.js +1 -9
- package/build/features/business/screens/Customers/Customers.js +1 -9
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +9 -33
- package/build/features/entity/screens/EntityName/EntityName.js +14 -31
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +10 -43
- package/build/features/individual/screens/IndividualList/IndividualList.js +0 -7
- package/build/features/individual/screens/IndividualList/UserList.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +18 -73
- package/build/features/password/Password.js +1 -1
- package/build/features/shared/Button/FlowsButtons.js +1 -7
- package/build/features/signIn/SignIn.js +2 -10
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/utils/common.js +4 -4
- package/package.json +2 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -15,13 +15,13 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
15
15
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
16
|
import Form from '../../../../components/Form';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import { BrandActivitiesValidationSchema } from './validation';
|
|
21
21
|
import Button from '../../../shared/Button';
|
|
22
22
|
import { brandSelector, updateBrandActivities } from '../../../app/brand/brandStore';
|
|
23
|
-
import { handlePrevScreenStep
|
|
24
|
-
import { deepCopy
|
|
23
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
24
|
+
import { deepCopy } from '../../../../utils';
|
|
25
25
|
import { useTranslation } from 'react-i18next';
|
|
26
26
|
import ActivitiesList from './ActivitiesList';
|
|
27
27
|
import CustomerBase from './CustomerBase';
|
|
@@ -36,12 +36,11 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
36
36
|
flexDirection: 'column'
|
|
37
37
|
}); });
|
|
38
38
|
var BrandActivities = function (_a) {
|
|
39
|
-
var _b, _c, _d, _e;
|
|
40
|
-
var
|
|
39
|
+
var _b, _c, _d, _e, _f;
|
|
40
|
+
var _g = React.useState(), listActive = _g[0], setListActive = _g[1];
|
|
41
41
|
var dispatch = useAppDispatch();
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var _h = data.brandActivities, activities = _h.activities, customerLocations = _h.customerLocations, expectedCustomer = _h.expectedCustomer, expectedSale = _h.expectedSale, termAndConditionChecked = _h.termAndConditionChecked, refundPolicy = _h.refundPolicy, transactionPolicy = _h.transactionPolicy;
|
|
42
|
+
var _h = useAppSelector(brandSelector), data = _h.data, loading = _h.loading, error = _h.error;
|
|
43
|
+
var _j = data.brandActivities, activities = _j.activities, customerLocations = _j.customerLocations, expectedCustomer = _j.expectedCustomer, expectedSale = _j.expectedSale, termAndConditionChecked = _j.termAndConditionChecked, refundPolicy = _j.refundPolicy, transactionPolicy = _j.transactionPolicy;
|
|
45
44
|
var ListType;
|
|
46
45
|
(function (ListType) {
|
|
47
46
|
ListType["ActivitiesList"] = "ActivitiesList";
|
|
@@ -49,14 +48,6 @@ var BrandActivities = function (_a) {
|
|
|
49
48
|
ListType["ExpectedCustomerList"] = "ExpectedCustomerList";
|
|
50
49
|
ListType["ExpectedSalesList"] = "ExpectedSalesList";
|
|
51
50
|
})(ListType || (ListType = {}));
|
|
52
|
-
React.useEffect(function () {
|
|
53
|
-
sendCustomEventToGTM({
|
|
54
|
-
event: 'Send Event',
|
|
55
|
-
event_category: 'Board Flows - Brand',
|
|
56
|
-
event_action: 'Update Brand Activities Details Page',
|
|
57
|
-
event_label: settingsData.businessCountry.iso2
|
|
58
|
-
});
|
|
59
|
-
}, []);
|
|
60
51
|
var methods = useForm({
|
|
61
52
|
resolver: yupResolver(BrandActivitiesValidationSchema()),
|
|
62
53
|
defaultValues: {
|
|
@@ -71,8 +62,7 @@ var BrandActivities = function (_a) {
|
|
|
71
62
|
mode: 'onChange'
|
|
72
63
|
});
|
|
73
64
|
useSetFromDefaultValues(methods, data.brandActivities, true);
|
|
74
|
-
var
|
|
75
|
-
var _k = brand || {}, data_status = _k.data_status, data_verification = _k.data_verification, operations = _k.operations;
|
|
65
|
+
var _k = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, data_status = _k.data_status, data_verification = _k.data_verification, operations = _k.operations;
|
|
76
66
|
var originalReadOnly = useFormReadOnly(methods);
|
|
77
67
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
78
68
|
'activities',
|
|
@@ -88,32 +78,6 @@ var BrandActivities = function (_a) {
|
|
|
88
78
|
'operations.sales_range'
|
|
89
79
|
]);
|
|
90
80
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
91
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
92
|
-
activities: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.activities,
|
|
93
|
-
customerLocations: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.customerLocations,
|
|
94
|
-
expectedCustomer: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.expectedCustomer,
|
|
95
|
-
expectedSale: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.expectedSale,
|
|
96
|
-
termAndConditionChecked: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.termAndConditionChecked,
|
|
97
|
-
refundPolicy: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.transactionPolicy,
|
|
98
|
-
transactionPolicy: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.refundPolicy
|
|
99
|
-
}, [
|
|
100
|
-
{
|
|
101
|
-
name: 'activities',
|
|
102
|
-
keys: ['id']
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'customerLocations',
|
|
106
|
-
keys: ['id']
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'expectedCustomer',
|
|
110
|
-
keys: ['id']
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'expectedSale',
|
|
114
|
-
keys: ['id']
|
|
115
|
-
}
|
|
116
|
-
]).isDirty;
|
|
117
81
|
var locations = methods.watch('customerLocations');
|
|
118
82
|
var isCustomerLocationsHasVerifiedValue = React.useMemo(function () {
|
|
119
83
|
var _a, _b;
|
|
@@ -128,11 +92,10 @@ var BrandActivities = function (_a) {
|
|
|
128
92
|
return (locationIds === null || locationIds === void 0 ? void 0 : locationIds.length) === (Ids === null || Ids === void 0 ? void 0 : Ids.length) && locationIds.every(function (locationId) { return Ids.includes(locationId); });
|
|
129
93
|
}, [locations, operations]);
|
|
130
94
|
var isCustomerLocationsVerified = dataVerified['operations.customer_base_location'] && isCustomerLocationsHasVerifiedValue;
|
|
131
|
-
var isExpectedSalesRangeVerified = dataVerified['operations.sales_range'] && ((
|
|
132
|
-
var isExpectedCustomersVerified = dataVerified['operations.customer_base'] && ((
|
|
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);
|
|
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);
|
|
133
97
|
var onSubmit = function (data) {
|
|
134
|
-
|
|
135
|
-
dispatch(updateBrandActivities(formData));
|
|
98
|
+
dispatch(updateBrandActivities(deepCopy(getFelids(data))));
|
|
136
99
|
};
|
|
137
100
|
var onBack = function () {
|
|
138
101
|
dispatch(handlePrevScreenStep());
|
|
@@ -14,11 +14,11 @@ import React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
17
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
18
18
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
|
-
import { deepCopy, mapSalesChannel
|
|
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';
|
|
@@ -39,7 +39,7 @@ var BrandInfo = function (_a) {
|
|
|
39
39
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
40
40
|
var _d = data.brandData, brandName = _d.brandName, salesChannels = _d.salesChannels, brandLogoId = _d.brandLogoId, responseBody = _d.responseBody;
|
|
41
41
|
var _e = data.verify.responseBody || {}, brand = _e.brand, flows = _e.flows;
|
|
42
|
-
var _f = brand || {}, logo_details = _f.logo_details, data_status = _f.data_status, data_verification = _f.data_verification, name = _f.name
|
|
42
|
+
var _f = brand || {}, logo_details = _f.logo_details, data_status = _f.data_status, data_verification = _f.data_verification, name = _f.name;
|
|
43
43
|
var methods = useForm({
|
|
44
44
|
resolver: yupResolver(BrandValidationSchema()),
|
|
45
45
|
defaultValues: {
|
|
@@ -52,17 +52,6 @@ var BrandInfo = function (_a) {
|
|
|
52
52
|
var watch = methods.watch;
|
|
53
53
|
useSetFromDefaultValues(methods, data.brandData, true);
|
|
54
54
|
var defaultBrandLogoFile = React.useMemo(function () { return logo_details && __assign(__assign({}, logo_details), { docId: '' }); }, [logo_details]);
|
|
55
|
-
var initialSalesChannels = React.useMemo(function () { return mapSalesChannel(channel_services || []); }, [channel_services]);
|
|
56
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
57
|
-
brandName: ((name === null || name === void 0 ? void 0 : name.en) || '').trim(),
|
|
58
|
-
salesChannels: initialSalesChannels,
|
|
59
|
-
brandLogoId: defaultBrandLogoFile === null || defaultBrandLogoFile === void 0 ? void 0 : defaultBrandLogoFile.id
|
|
60
|
-
}, [
|
|
61
|
-
{
|
|
62
|
-
name: 'salesChannels',
|
|
63
|
-
keys: ['id', 'address', 'code', 'sub']
|
|
64
|
-
}
|
|
65
|
-
]).isDirty;
|
|
66
55
|
var originalReadOnly = useFormReadOnly(methods, { brandLogoId: defaultBrandLogoFile });
|
|
67
56
|
var noneEditable = useDataNoneEditable(data_status, ['name.en', 'name.ar', 'channel_services', 'logo']);
|
|
68
57
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
@@ -70,16 +59,9 @@ var BrandInfo = function (_a) {
|
|
|
70
59
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
71
60
|
var isBrandNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && ((name === null || name === void 0 ? void 0 : name.en) === watch('brandName') || (name === null || name === void 0 ? void 0 : name.ar) === watch('brandName'));
|
|
72
61
|
var onSubmit = function (data) {
|
|
73
|
-
|
|
74
|
-
dispatch(updateBrand(formData));
|
|
62
|
+
dispatch(updateBrand(deepCopy(getFelids(data))));
|
|
75
63
|
};
|
|
76
64
|
var onBack = function () {
|
|
77
|
-
sendCustomEventToGTM({
|
|
78
|
-
event: 'Send Event',
|
|
79
|
-
event_category: 'Board Flows - Brand',
|
|
80
|
-
event_action: 'Brand Details Back button',
|
|
81
|
-
event_label: settingsData.businessCountry.iso2
|
|
82
|
-
});
|
|
83
65
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
84
66
|
dispatch(handlePrevScreenStep());
|
|
85
67
|
return;
|
|
@@ -14,12 +14,12 @@ import React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
18
|
-
import { handlePrevScreenStep
|
|
17
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
18
|
+
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
|
|
22
|
+
import { deepCopy } from '../../../../utils';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
24
|
import { clearError, brandSelector, updateSegmentBrand } from '../../../app/brand/brandStore';
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
@@ -46,10 +46,9 @@ var BrandInfo = function (_a) {
|
|
|
46
46
|
var t = useTranslation().t;
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var _l = useAppSelector(brandSelector), data = _l.data, loading = _l.loading, error = _l.error;
|
|
49
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
50
49
|
var _m = data.brandSegmentData, segmentLocation = _m.segmentLocation, segmentProfit = _m.segmentProfit, segmentTech = _m.segmentTech, teamSize = _m.teamSize;
|
|
51
|
-
var
|
|
52
|
-
var
|
|
50
|
+
var brand = (data.verify.responseBody || {}).brand;
|
|
51
|
+
var _o = brand || {}, data_status = _o.data_status, data_verification = _o.data_verification, resSegment = _o.segment;
|
|
53
52
|
var methods = useForm({
|
|
54
53
|
resolver: yupResolver(BrandValidationSchema()),
|
|
55
54
|
defaultValues: {
|
|
@@ -62,12 +61,6 @@ var BrandInfo = function (_a) {
|
|
|
62
61
|
});
|
|
63
62
|
var watch = methods.watch;
|
|
64
63
|
useSetFromDefaultValues(methods, data.brandSegmentData, true);
|
|
65
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
66
|
-
segmentLocation: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.segmentLocation,
|
|
67
|
-
segmentProfit: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.segmentProfit,
|
|
68
|
-
segmentTech: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.segmentTech,
|
|
69
|
-
teamSize: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.teamSize
|
|
70
|
-
}).isDirty;
|
|
71
64
|
var originalReadOnly = useFormReadOnly(methods);
|
|
72
65
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
73
66
|
'segment.location_type',
|
|
@@ -88,20 +81,11 @@ var BrandInfo = function (_a) {
|
|
|
88
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);
|
|
89
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);
|
|
90
83
|
var onSubmit = function (data) {
|
|
91
|
-
|
|
92
|
-
dispatch(updateSegmentBrand(formData));
|
|
84
|
+
dispatch(updateSegmentBrand(deepCopy(getFelids(data))));
|
|
93
85
|
};
|
|
94
86
|
var onBack = function () {
|
|
95
87
|
dispatch(handlePrevScreenStep());
|
|
96
88
|
};
|
|
97
|
-
React.useEffect(function () {
|
|
98
|
-
sendCustomEventToGTM({
|
|
99
|
-
event: 'Send Event',
|
|
100
|
-
event_category: 'Board Flows - Brand',
|
|
101
|
-
event_action: 'Update Business Market & Size',
|
|
102
|
-
event_label: settingsData.businessCountry.iso2
|
|
103
|
-
});
|
|
104
|
-
}, []);
|
|
105
89
|
React.useEffect(function () {
|
|
106
90
|
if (error)
|
|
107
91
|
dispatch(clearError());
|
|
@@ -20,7 +20,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
21
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
|
-
import { deepCopy
|
|
23
|
+
import { deepCopy } from '../../../../utils';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
25
|
import Collapse from '../../../../components/Collapse';
|
|
26
26
|
import OperationStartDate from './OperationStartDate';
|
|
@@ -65,14 +65,6 @@ var Activities = function () {
|
|
|
65
65
|
var onBack = function () {
|
|
66
66
|
dispatch(handlePrevScreenStep());
|
|
67
67
|
};
|
|
68
|
-
React.useEffect(function () {
|
|
69
|
-
sendCustomEventToGTM({
|
|
70
|
-
event: 'Send Event',
|
|
71
|
-
event_category: 'Account Creation Flow',
|
|
72
|
-
event_action: 'Brand Activities Details Page',
|
|
73
|
-
event_label: settingsData.businessCountry.iso2
|
|
74
|
-
});
|
|
75
|
-
}, []);
|
|
76
68
|
React.useEffect(function () {
|
|
77
69
|
if (error)
|
|
78
70
|
dispatch(clearError());
|
|
@@ -30,7 +30,7 @@ import TransactionPolicy from './TransactionPolicy';
|
|
|
30
30
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
31
31
|
import Collapse from '../../../../components/Collapse';
|
|
32
32
|
import { businessSelector, clearError, updateCustomersInfo } from '../../../app/business/businessStore';
|
|
33
|
-
import { deepCopy
|
|
33
|
+
import { deepCopy } from '../../../../utils';
|
|
34
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
35
35
|
display: 'flex',
|
|
36
36
|
flexDirection: 'column'
|
|
@@ -76,14 +76,6 @@ var Customers = function (_a) {
|
|
|
76
76
|
'operations.sales_range'
|
|
77
77
|
]);
|
|
78
78
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
79
|
-
React.useEffect(function () {
|
|
80
|
-
sendCustomEventToGTM({
|
|
81
|
-
event: 'Send Event',
|
|
82
|
-
event_category: 'Account Creation Flow',
|
|
83
|
-
event_action: 'Business Market and Size Details Page',
|
|
84
|
-
event_label: settingsData.businessCountry.iso2
|
|
85
|
-
});
|
|
86
|
-
}, []);
|
|
87
79
|
React.useEffect(function () {
|
|
88
80
|
var _a, _b;
|
|
89
81
|
var isTermsAgreed = !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
@@ -52,7 +52,7 @@ import { useAppSelector, useAppDispatch, useLanguage } from '../../../../hooks';
|
|
|
52
52
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
53
53
|
import BusinessCountry from '../../../shared/BusinessCountry';
|
|
54
54
|
import Button from '../../../shared/Button';
|
|
55
|
-
import { findCountryByIso2, isKW, isOtherThanKWOrSA,
|
|
55
|
+
import { findCountryByIso2, isKW, isOtherThanKWOrSA, updateLocationUrlWithCountry } from '../../../../utils';
|
|
56
56
|
import Collapse from '../../../../components/Collapse';
|
|
57
57
|
import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
|
|
58
58
|
import { connectSelector, setDefaultCountryCode, updateBusinessCountry, storeIsStartFromBusinessCountry, clearError } from '../../../app/connect/connectStore';
|
|
@@ -81,12 +81,6 @@ 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
|
-
});
|
|
90
84
|
if (settingsData.appConfig.mode !== 'popup')
|
|
91
85
|
updateLocationUrlWithCountry(iso2);
|
|
92
86
|
if (!data.leadId) return [3, 2];
|
|
@@ -15,11 +15,11 @@ import { FormProvider, useForm } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import Collapse from '@mui/material/Collapse';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
19
|
-
import { deepCopy,
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
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
|
-
import { handlePrevScreenStep
|
|
22
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
24
|
import Form from '../../../../components/Form';
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
@@ -39,36 +39,21 @@ var EntityCapital = function (_a) {
|
|
|
39
39
|
var isAr = useLanguage().isAr;
|
|
40
40
|
var t = useTranslation().t;
|
|
41
41
|
var dispatch = useAppDispatch();
|
|
42
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
43
42
|
var _k = data.entityCapitalData, responseBody = _k.responseBody, capitalPaid = _k.capitalPaid, capitalShareCount = _k.capitalShareCount, capitalShareValue = _k.capitalShareValue, activities = _k.activities;
|
|
44
43
|
var entity = (data.verify.responseBody || {}).entity;
|
|
45
|
-
var _l = entity || {}, data_verification = _l.data_verification, capital = _l.capital
|
|
46
|
-
var resCapitalPaidValue = (_b = capital === null || capital === void 0 ? void 0 : capital.paid) === null || _b === void 0 ? void 0 : _b.toString();
|
|
47
|
-
var resCapitalShareCount = (_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();
|
|
48
|
-
var resCapitalShareValue = (_f = (_e = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.toString();
|
|
44
|
+
var _l = entity || {}, data_verification = _l.data_verification, capital = _l.capital;
|
|
49
45
|
var methods = useForm({
|
|
50
46
|
resolver: yupResolver(EntityCapitalValidationSchema()),
|
|
51
47
|
defaultValues: {
|
|
52
48
|
activities: activities,
|
|
53
49
|
capitalPaid: capitalPaid,
|
|
54
|
-
capitalShareCount: capitalShareCount
|
|
50
|
+
capitalShareCount: capitalShareCount,
|
|
55
51
|
capitalShareValue: capitalShareValue
|
|
56
52
|
},
|
|
57
53
|
mode: 'onChange'
|
|
58
54
|
});
|
|
59
55
|
useSetFromDefaultValues(methods, data.entityCapitalData, true);
|
|
60
56
|
var watch = methods.watch;
|
|
61
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
62
|
-
activities: resActivities,
|
|
63
|
-
capitalPaid: resCapitalPaidValue && formatNumberAsCurrency(resCapitalPaidValue),
|
|
64
|
-
capitalShareCount: resCapitalShareCount,
|
|
65
|
-
capitalShareValue: resCapitalShareValue && formatNumberAsCurrency(resCapitalShareValue)
|
|
66
|
-
}, [
|
|
67
|
-
{
|
|
68
|
-
name: 'activities',
|
|
69
|
-
keys: ['id']
|
|
70
|
-
}
|
|
71
|
-
]).isDirty;
|
|
72
57
|
var originalReadOnly = useFormReadOnly(methods);
|
|
73
58
|
var noneEditable = useDataNoneEditable(entity === null || entity === void 0 ? void 0 : entity.data_status, [
|
|
74
59
|
'activities',
|
|
@@ -79,20 +64,11 @@ var EntityCapital = function (_a) {
|
|
|
79
64
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
80
65
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
81
66
|
var dataVerified = useDataVerified(data_verification, ['capital.paid', 'capital.shares.count', 'capital.shares.value']);
|
|
82
|
-
var isCapitalPaidVerified = dataVerified['capital.paid'] &&
|
|
83
|
-
var isCapitalShareCountVerified = dataVerified['capital.shares.count'] &&
|
|
84
|
-
var isCapitalShareValueVerified = dataVerified['capital.shares.value'] &&
|
|
85
|
-
React.useEffect(function () {
|
|
86
|
-
sendCustomEventToGTM({
|
|
87
|
-
event: 'Send Event',
|
|
88
|
-
event_category: 'Board Flows - Entity',
|
|
89
|
-
event_action: 'Entity Activities and Capital Details Page',
|
|
90
|
-
event_label: settingsData.businessCountry.iso2
|
|
91
|
-
});
|
|
92
|
-
}, []);
|
|
67
|
+
var isCapitalPaidVerified = dataVerified['capital.paid'] && ((_b = capital === null || capital === void 0 ? void 0 : capital.paid) === null || _b === void 0 ? void 0 : _b.toString()) === removeAllCharsFromNumber(watch('capitalPaid'));
|
|
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
|
+
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'));
|
|
93
70
|
var onSubmit = function (data) {
|
|
94
|
-
|
|
95
|
-
dispatch(updateEntityCapital(formData));
|
|
71
|
+
dispatch(updateEntityCapital(deepCopy(getFelids(data))));
|
|
96
72
|
};
|
|
97
73
|
var onBack = function () {
|
|
98
74
|
dispatch(handlePrevScreenStep());
|
|
@@ -15,9 +15,9 @@ import { FormProvider, useForm } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { convertToEnglishDateFormat, deepCopy, getFileDetailsFromDocument, isKW, isSA
|
|
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';
|
|
@@ -38,22 +38,22 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
38
38
|
flexDirection: 'column'
|
|
39
39
|
}); });
|
|
40
40
|
var EntityName = function (_a) {
|
|
41
|
-
var _b
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
41
|
+
var _b;
|
|
42
|
+
var _c = React.useState(false), issueAnchorEl = _c[0], setIssueAnchorEl = _c[1];
|
|
43
|
+
var _d = React.useState(false), expiryAnchorEl = _d[0], setExpiryAnchorEl = _d[1];
|
|
44
|
+
var _e = React.useState(false), entityTypeAnchorEl = _e[0], setEntityTypeAnchorEl = _e[1];
|
|
45
|
+
var _f = useAppSelector(entitySelector), data = _f.data, loading = _f.loading, error = _f.error, uploading = _f.uploading, uploadingArticle = _f.uploadingArticle;
|
|
46
46
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var dispatch = useAppDispatch();
|
|
50
|
-
var
|
|
50
|
+
var _g = data.entityNameData, legalName = _g.legalName, licenseNumber = _g.licenseNumber, licenseType = _g.licenseType, entityType = _g.entityType, issuingDate = _g.issuingDate, expiryDate = _g.expiryDate, unifiedNumber = _g.unifiedNumber, certificateId = _g.certificateId, articleId = _g.articleId;
|
|
51
51
|
var country_code = settingsData.businessCountry.iso2;
|
|
52
52
|
var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
|
|
53
53
|
var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
|
|
54
54
|
var isCR = licenseType === BusinessType.CR;
|
|
55
|
-
var
|
|
56
|
-
var
|
|
55
|
+
var _h = data.verify.responseBody || {}, entity = _h.entity, flows = _h.flows;
|
|
56
|
+
var _j = entity || {}, AOA_file = _j.AOA_file, id = _j.id, documents = _j.documents, data_status = _j.data_status, data_verification = _j.data_verification, legal_name = _j.legal_name, type = _j.type, license = _j.license;
|
|
57
57
|
var getSchema = function () {
|
|
58
58
|
if (isSACountry)
|
|
59
59
|
return EntityNameValidationSchema();
|
|
@@ -80,18 +80,6 @@ var EntityName = function (_a) {
|
|
|
80
80
|
useSetFromDefaultValues(methods, data.entityNameData, true);
|
|
81
81
|
var defaultCertificateFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.CR); }, [documents]);
|
|
82
82
|
var defaultArticleFile = React.useMemo(function () { return AOA_file && __assign(__assign({}, AOA_file), { docId: id }); }, [AOA_file]);
|
|
83
|
-
var issueDateRes = (license === null || license === void 0 ? void 0 : license.issuing_date) && convertToEnglishDateFormat(new Date(license.issuing_date));
|
|
84
|
-
var expDateRes = (license === null || license === void 0 ? void 0 : license.expiry_date) && convertToEnglishDateFormat(new Date(license.expiry_date));
|
|
85
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
86
|
-
legalName: (legal_name === null || legal_name === void 0 ? void 0 : legal_name.en) || (legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar),
|
|
87
|
-
licenseNumber: license === null || license === void 0 ? void 0 : license.number,
|
|
88
|
-
licenseType: (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR,
|
|
89
|
-
entityType: type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]),
|
|
90
|
-
issuingDate: issueDateRes,
|
|
91
|
-
expiryDate: expDateRes,
|
|
92
|
-
unifiedNumber: (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number,
|
|
93
|
-
articleId: defaultArticleFile === null || defaultArticleFile === void 0 ? void 0 : defaultArticleFile.id
|
|
94
|
-
}).isDirty;
|
|
95
83
|
var originalReadOnly = useFormReadOnly(methods, { certificateId: defaultCertificateFiles, articleId: defaultArticleFile });
|
|
96
84
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
97
85
|
'legal_name.en',
|
|
@@ -116,16 +104,17 @@ var EntityName = function (_a) {
|
|
|
116
104
|
'license.expiry_date',
|
|
117
105
|
'AOA_file_id'
|
|
118
106
|
]);
|
|
107
|
+
var issueDateRes = (license === null || license === void 0 ? void 0 : license.issuing_date) && convertToEnglishDateFormat(new Date(license.issuing_date));
|
|
108
|
+
var expDateRes = (license === null || license === void 0 ? void 0 : license.expiry_date) && convertToEnglishDateFormat(new Date(license.expiry_date));
|
|
119
109
|
var isLegalNameVerified = dataVerified['legal_name.en'] && dataVerified['legal_name.ar'] && ((legal_name === null || legal_name === void 0 ? void 0 : legal_name.en) === watch('legalName') || (legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar) === watch('legalName'));
|
|
120
110
|
var isEntityTypeVerified = dataVerified['type'] && type === watch('entityType');
|
|
121
111
|
var isLicenseNumberVerified = dataVerified['license.number'] && (license === null || license === void 0 ? void 0 : license.number) === watch('licenseNumber');
|
|
122
|
-
var isUnifiedNumberVerified = dataVerified['license.additional_info'] && ((
|
|
112
|
+
var isUnifiedNumberVerified = dataVerified['license.additional_info'] && ((_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) === watch('unifiedNumber');
|
|
123
113
|
var isIssuingDateVerified = dataVerified['license.issuing_date'] && issueDateRes === watch('issuingDate');
|
|
124
114
|
var isExpiryDateVerified = dataVerified['license.expiry_date'] && expDateRes === watch('expiryDate');
|
|
125
115
|
var isArticleIdVerified = dataVerified['AOA_file_id'];
|
|
126
116
|
var onSubmit = function (data) {
|
|
127
|
-
|
|
128
|
-
dispatch(updateEntityName(formData));
|
|
117
|
+
dispatch(updateEntityName(deepCopy(getFelids(data))));
|
|
129
118
|
};
|
|
130
119
|
var handleIssueDateOpenClose = function (flag) {
|
|
131
120
|
setIssueAnchorEl(flag);
|
|
@@ -137,12 +126,6 @@ var EntityName = function (_a) {
|
|
|
137
126
|
setEntityTypeAnchorEl(flag);
|
|
138
127
|
};
|
|
139
128
|
var onBack = function () {
|
|
140
|
-
sendCustomEventToGTM({
|
|
141
|
-
event: 'Send Event',
|
|
142
|
-
event_category: 'Board Flows - Entity',
|
|
143
|
-
event_action: 'Entity Details Back button',
|
|
144
|
-
event_label: settingsData.businessCountry.iso2
|
|
145
|
-
});
|
|
146
129
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
147
130
|
dispatch(handlePrevScreenStep());
|
|
148
131
|
return;
|
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -17,9 +17,9 @@ import { useTranslation } from 'react-i18next';
|
|
|
17
17
|
import { handleCurrentActiveScreen, settingsSelector } from '../../../../app/settings';
|
|
18
18
|
import Box from '@mui/material/Box';
|
|
19
19
|
import { alpha, styled } from '@mui/material/styles';
|
|
20
|
-
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
20
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
21
21
|
import { DocumentPurpose, IndividualType } from '../../../../@types';
|
|
22
|
-
import { deepCopy, getIndividualType, isKW, isKWOrSA
|
|
22
|
+
import { deepCopy, getIndividualType, isKW, isKWOrSA } from '../../../../utils';
|
|
23
23
|
import Form from '../../../../components/Form';
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
25
|
import Text from '../../../../components/Text';
|
|
@@ -53,16 +53,16 @@ var ListType;
|
|
|
53
53
|
ListType["OccupationList"] = "OccupationList";
|
|
54
54
|
})(ListType || (ListType = {}));
|
|
55
55
|
var AdditionalIndividualInfo = function (_a) {
|
|
56
|
-
var _b
|
|
56
|
+
var _b;
|
|
57
57
|
var t = useTranslation().t;
|
|
58
58
|
var isAr = useLanguage().isAr;
|
|
59
59
|
var dispatch = useAppDispatch();
|
|
60
|
-
var
|
|
60
|
+
var _c = useAppSelector(individualSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
61
61
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
62
62
|
var verify = data.verify;
|
|
63
63
|
var user = (verify.responseBody || {}).user;
|
|
64
|
-
var
|
|
65
|
-
var
|
|
64
|
+
var _d = data.individualData, occupation = _d.occupation, sourceIncome = _d.sourceIncome, monthlyIncome = _d.monthlyIncome, employerName = _d.employerName, isPEP = _d.isPEP, isInfluencer = _d.isInfluencer, civilID = _d.civilID, signatureFileId = _d.signatureFileId, civilIDUploading = _d.civilIDUploading, signatureFileUploading = _d.signatureFileUploading, shareCount = _d.shareCount, shareValue = _d.shareValue, isAuthorized = _d.isAuthorized;
|
|
65
|
+
var _e = user || {}, documents = _e.documents, is_authorized = _e.is_authorized, data_status = _e.data_status, data_verification = _e.data_verification, names = _e.names, role = _e.role, occupationRes = _e.occupation, is_relative_PEP = _e.is_relative_PEP, is_influencer = _e.is_influencer, objects = _e.objects;
|
|
66
66
|
var isKWCountry = React.useMemo(function () { return isKW(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
67
67
|
var isOtherThanKWAndSa = React.useMemo(function () { return !isKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
68
68
|
var showIsAuthorized = isOtherThanKWAndSa;
|
|
@@ -95,30 +95,6 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
95
95
|
civilID: defaultCivilIdFiles,
|
|
96
96
|
signatureFileId: defaultSignatureFiles
|
|
97
97
|
});
|
|
98
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
99
|
-
occupation: ((_b = occupationRes === null || occupationRes === void 0 ? void 0 : occupationRes.chapter) === null || _b === void 0 ? void 0 : _b.id) && { id: occupationRes.chapter.id },
|
|
100
|
-
sourceIncome: source_income === null || source_income === void 0 ? void 0 : source_income[0],
|
|
101
|
-
monthlyIncome: monthly_income,
|
|
102
|
-
employerName: '',
|
|
103
|
-
isPEP: is_relative_PEP,
|
|
104
|
-
isInfluencer: is_influencer,
|
|
105
|
-
shareCount: (_c = shares === null || shares === void 0 ? void 0 : shares.count) === null || _c === void 0 ? void 0 : _c.toString(),
|
|
106
|
-
shareValue: (_d = shares === null || shares === void 0 ? void 0 : shares.value) === null || _d === void 0 ? void 0 : _d.toString(),
|
|
107
|
-
isAuthorized: is_authorized
|
|
108
|
-
}, [
|
|
109
|
-
{
|
|
110
|
-
name: 'occupation',
|
|
111
|
-
keys: ['id']
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: 'sourceIncome',
|
|
115
|
-
keys: ['id']
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'monthlyIncome',
|
|
119
|
-
keys: ['id']
|
|
120
|
-
}
|
|
121
|
-
]).isDirty;
|
|
122
98
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
123
99
|
'occupation',
|
|
124
100
|
'source_of_income',
|
|
@@ -130,22 +106,13 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
130
106
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
131
107
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
132
108
|
var dataVerified = useDataVerified(data_verification, ['occupation', 'is_relative_PEP', 'is_influencer']);
|
|
133
|
-
var isOccupationVerified = dataVerified['occupation'] && (occupationRes === null || occupationRes === void 0 ? void 0 : occupationRes.id) === ((
|
|
109
|
+
var isOccupationVerified = dataVerified['occupation'] && (occupationRes === null || occupationRes === void 0 ? void 0 : occupationRes.id) === ((_b = watch('occupation')) === null || _b === void 0 ? void 0 : _b.id);
|
|
134
110
|
var isPEPSwitchVerified = dataVerified['is_relative_PEP'] && is_relative_PEP === watch('isPEP');
|
|
135
111
|
var isInfluencerSwitchVerified = dataVerified['is_influencer'] && is_influencer === watch('isInfluencer');
|
|
136
112
|
var isAuthorizedSwitchVerified = dataVerified['is_authorized'] && is_authorized === watch('isAuthorized');
|
|
137
|
-
var
|
|
138
|
-
React.useEffect(function () {
|
|
139
|
-
sendCustomEventToGTM({
|
|
140
|
-
event: 'Send Event',
|
|
141
|
-
event_category: 'Board Flows - Individual',
|
|
142
|
-
event_action: 'Income Details Page',
|
|
143
|
-
event_label: settingsData.businessCountry.iso2
|
|
144
|
-
});
|
|
145
|
-
}, []);
|
|
113
|
+
var _f = React.useState(), listActive = _f[0], setListActive = _f[1];
|
|
146
114
|
var onSubmit = function (data) {
|
|
147
|
-
|
|
148
|
-
dispatch(updateIndividualInfo(formData));
|
|
115
|
+
dispatch(updateIndividualInfo(deepCopy(getFelids(__assign(__assign({}, data), { signatureFileUploading: signatureFileUploading, civilIDUploading: civilIDUploading })))));
|
|
149
116
|
};
|
|
150
117
|
var onBack = function () {
|
|
151
118
|
dispatch(handleCurrentActiveScreen('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
|
|
@@ -170,7 +137,7 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
170
137
|
return t('type_board_member');
|
|
171
138
|
return t('type_user');
|
|
172
139
|
};
|
|
173
|
-
var
|
|
140
|
+
var _g = React.useMemo(function () { return getIndividualType(objects); }, [objects]), isUser = _g.isUser, isShareholder = _g.isShareholder, isBoardMember = _g.isBoardMember, isBuyer = _g.isBuyer;
|
|
174
141
|
var isUserORBuyerType = isUser || isBuyer;
|
|
175
142
|
var isUserORBoardMemberType = isUser || isBoardMember;
|
|
176
143
|
var isAuthorizedValue = watch('isAuthorized');
|
|
@@ -20,7 +20,6 @@ import Collapse from '../../../../components/Collapse';
|
|
|
20
20
|
import Warning from '../../../../components/Warning';
|
|
21
21
|
import Button from '../../../../components/Button';
|
|
22
22
|
import Loader from '../../../../components/Loader';
|
|
23
|
-
import { sendCustomEventToGTM } from '../../../../utils';
|
|
24
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
24
|
import { individualSelector, retrieveBoardStatus } from '../../../app/individual/individualStore';
|
|
26
25
|
import UserList from './UserList';
|
|
@@ -55,12 +54,6 @@ var IndividualList = function () {
|
|
|
55
54
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
56
55
|
var flows = (data.verify.responseBody || {}).flows;
|
|
57
56
|
var onBack = function () {
|
|
58
|
-
sendCustomEventToGTM({
|
|
59
|
-
event: 'Send Event',
|
|
60
|
-
event_category: 'Board Flows - Individual',
|
|
61
|
-
event_action: 'Individual Details Back Button',
|
|
62
|
-
event_label: settingsData.businessCountry.iso2
|
|
63
|
-
});
|
|
64
57
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
65
58
|
dispatch(handlePrevScreenStep());
|
|
66
59
|
return;
|