@tap-payments/auth-jsconnect 2.8.62-beta → 2.8.62-development

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