@tap-payments/auth-jsconnect 2.0.55 → 2.0.56

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 (53) hide show
  1. package/build/@types/redux.d.ts +4 -0
  2. package/build/constants/app.js +9 -9
  3. package/build/features/app/bank/bankStore.d.ts +2 -2
  4. package/build/features/app/bank/bankStore.js +54 -51
  5. package/build/features/app/brand/brandStore.d.ts +3 -3
  6. package/build/features/app/brand/brandStore.js +133 -114
  7. package/build/features/app/business/businessStore.js +3 -4
  8. package/build/features/app/connect/connectStore.js +3 -2
  9. package/build/features/app/connectExpress/connectExpressStore.d.ts +3 -3
  10. package/build/features/app/connectExpress/connectExpressStore.js +80 -76
  11. package/build/features/app/entity/entityStore.d.ts +3 -3
  12. package/build/features/app/entity/entityStore.js +130 -120
  13. package/build/features/app/individual/individualStore.d.ts +4 -4
  14. package/build/features/app/individual/individualStore.js +227 -219
  15. package/build/features/app/password/passwordStore.d.ts +2 -0
  16. package/build/features/app/password/passwordStore.js +24 -12
  17. package/build/features/app/tax/taxStore.d.ts +2 -2
  18. package/build/features/app/tax/taxStore.js +59 -55
  19. package/build/features/bank/screens/BankDetails/BankDetails.js +7 -6
  20. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  21. package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -2
  22. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +3 -11
  23. package/build/features/brand/screens/BrandInfo/BrandInfo.js +7 -6
  24. package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  25. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
  26. package/build/features/connect/screens/Merchant/Merchant.js +2 -1
  27. package/build/features/connect/screens/Merchant/validation.d.ts +3 -0
  28. package/build/features/connect/screens/Merchant/validation.js +2 -1
  29. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +5 -4
  30. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +5 -4
  31. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -9
  32. package/build/features/entity/screens/EntityCapital/EntityCapital.js +3 -2
  33. package/build/features/entity/screens/EntityName/EntityName.js +3 -2
  34. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  35. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +19 -18
  36. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -2
  37. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +3 -2
  38. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
  39. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
  40. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
  41. package/build/features/password/screens/Verify/Verify.js +7 -20
  42. package/build/features/shared/Button/IndividualActionButtons.js +2 -2
  43. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  44. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  45. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  46. package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -3
  47. package/build/hooks/index.d.ts +1 -0
  48. package/build/hooks/index.js +1 -0
  49. package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
  50. package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
  51. package/build/utils/string.d.ts +1 -1
  52. package/build/utils/string.js +3 -1
  53. package/package.json +1 -1
@@ -17,7 +17,7 @@ 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 } from '../../../../hooks';
20
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
21
21
  import { DocumentPurpose, IndividualType } from '../../../../@types';
22
22
  import { isSA } from '../../../../utils';
23
23
  import Form from '../../../../components/Form';
@@ -80,10 +80,27 @@ var AdditionalIndividualInfo = function (_a) {
80
80
  mode: 'onChange'
81
81
  });
82
82
  useSetFromDefaultValues(methods, data.individualData, true);
83
+ var defaultCivilIdFiles = React.useMemo(function () { return getFileDetailsFromDocument(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT); }, [user === null || user === void 0 ? void 0 : user.documents]);
84
+ var defaultSignatureFiles = React.useMemo(function () { return getFileDetailsFromDocument(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE); }, [user === null || user === void 0 ? void 0 : user.documents]);
85
+ var originalReadOnly = useFormReadOnly(methods, {
86
+ isPEP: typeof isPEP === 'boolean',
87
+ isInfluencer: typeof isInfluencer === 'boolean',
88
+ civilID: defaultCivilIdFiles,
89
+ signatureFileId: defaultSignatureFiles
90
+ });
91
+ var noneEditable = useDataNoneEditable(user === null || user === void 0 ? void 0 : user.data_status, [
92
+ 'occupation',
93
+ 'source_of_income',
94
+ 'monthly_income',
95
+ 'is_relative_PEP',
96
+ 'is_influencer'
97
+ ]);
98
+ var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
99
+ var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
83
100
  var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
84
101
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
85
102
  var onSubmit = function (data) {
86
- dispatch(updateIndividualInfo(data));
103
+ dispatch(updateIndividualInfo(getFelids(data)));
87
104
  };
88
105
  var onBack = function () {
89
106
  dispatch(handleCurrentActiveScreen('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
@@ -106,22 +123,6 @@ var AdditionalIndividualInfo = function (_a) {
106
123
  return t('type_board_member');
107
124
  return t('type_user');
108
125
  };
109
- var defaultCivilIdFiles = React.useMemo(function () { return getFileDetailsFromDocument(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT); }, [user === null || user === void 0 ? void 0 : user.documents]);
110
- var defaultSignatureFiles = React.useMemo(function () { return getFileDetailsFromDocument(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE); }, [user === null || user === void 0 ? void 0 : user.documents]);
111
- var originalReadOnly = useFormReadOnly(methods, {
112
- isPEP: typeof isPEP === 'boolean',
113
- isInfluencer: typeof isInfluencer === 'boolean',
114
- civilID: defaultCivilIdFiles,
115
- signatureFileId: defaultSignatureFiles
116
- });
117
- var noneEditable = useDataNoneEditable(user === null || user === void 0 ? void 0 : user.data_status, [
118
- 'occupation',
119
- 'source_of_income',
120
- 'monthly_income',
121
- 'is_relative_PEP',
122
- 'is_influencer'
123
- ]);
124
- var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
125
126
  var showSignatureFile = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
126
127
  var showOccupationFile = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
127
128
  var showSourceOfIncome = (user === null || user === void 0 ? void 0 : user.type) === IndividualType.USER || (user === null || user === void 0 ? void 0 : user.type) === IndividualType.BUYER;
@@ -17,7 +17,7 @@ import { useTranslation } from 'react-i18next';
17
17
  import { handleCurrentActiveScreen, handlePrevScreenStep, 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 } from '../../../../hooks';
20
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
21
21
  import { IndividualType } from '../../../../@types';
22
22
  import Form from '../../../../components/Form';
23
23
  import Collapse from '../../../../components/Collapse';
@@ -101,8 +101,9 @@ var IndividualPersonalInfo = function (_a) {
101
101
  'nationality'
102
102
  ]);
103
103
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
104
+ var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
104
105
  var onSubmit = function (data) {
105
- dispatch(updateIndividualPersonalInfo(data));
106
+ dispatch(updateIndividualPersonalInfo(getFelids(data)));
106
107
  };
107
108
  React.useEffect(function () {
108
109
  if (error)
@@ -16,7 +16,7 @@ import { useForm, FormProvider } from 'react-hook-form';
16
16
  import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
- import { useAppDispatch, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
19
+ import { useAppDispatch, useExcludeReadOnlyFelids, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
20
20
  import { useLanguage, useAppSelector } from '../../../../hooks';
21
21
  import Form from '../../../../components/Form';
22
22
  import Collapse from '../../../../components/Collapse';
@@ -49,8 +49,9 @@ var PhoneInfo = function (_a) {
49
49
  var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
50
50
  var originalReadOnly = useFormReadOnly(methods);
51
51
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
52
+ var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
52
53
  var onSubmit = function (formData) {
53
- dispatch(updatePhoneInfo(formData));
54
+ dispatch(updatePhoneInfo(getFelids(formData)));
54
55
  };
55
56
  React.useEffect(function () {
56
57
  if (error && methods.formState.isValid)
@@ -1,16 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { Trans, useTranslation } from 'react-i18next';
4
+ import { handlePrevScreenStep } from '../../../../app/settings';
4
5
  import SuccessScreen from '../../../shared/SuccessScreen';
5
6
  import { maskEmail } from '../../../../utils';
6
7
  import { individualSelector } from '../../../../features/app/individual/individualStore';
7
- import { useAppSelector } from '../../../../hooks';
8
+ import { useAppSelector, useAppDispatch } from '../../../../hooks';
8
9
  var ResetPasswordSuccess = function (_a) {
9
10
  var _b, _c;
10
11
  var t = useTranslation().t;
12
+ var dispatch = useAppDispatch();
11
13
  var data = useAppSelector(individualSelector).data;
12
14
  var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
13
15
  var maskedEmail = maskEmail(email);
14
- return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true }));
16
+ var onBack = function () {
17
+ dispatch(handlePrevScreenStep());
18
+ };
19
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
15
20
  };
16
21
  export default React.memo(ResetPasswordSuccess);
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
13
  import * as React from 'react';
25
14
  import { useForm, FormProvider } from 'react-hook-form';
@@ -49,14 +38,18 @@ var CreatePassword = function (_a) {
49
38
  var isAr = useLanguage().isAr;
50
39
  var dispatch = useAppDispatch();
51
40
  var _b = useSelector(passwordSelector), data = _b.data, loading = _b.loading, error = _b.error;
52
- var operationType = data.verify.operationType;
53
- var _c = data.passwordData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
41
+ var _c = data.verify, operationType = _c.operationType, responseBody = _c.responseBody;
42
+ var _d = data.passwordData, password = _d.password, confirmPassword = _d.confirmPassword;
43
+ var flows = (responseBody || {}).flows;
54
44
  var methods = useForm({
55
45
  resolver: yupResolver(PasswordValidation),
56
- defaultValues: defaultValues,
46
+ defaultValues: {
47
+ password: password,
48
+ confirmPassword: confirmPassword
49
+ },
57
50
  mode: 'onChange'
58
51
  });
59
- useSetFromDefaultValues(methods, defaultValues);
52
+ useSetFromDefaultValues(methods, data.passwordData);
60
53
  var onSubmit = function (data) {
61
54
  if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
62
55
  dispatch(storePasswordScreen(data));
@@ -68,6 +61,6 @@ var CreatePassword = function (_a) {
68
61
  var onBack = function () {
69
62
  dispatch(handleCurrentActiveScreen('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
70
63
  };
71
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
64
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: !(flows === null || flows === void 0 ? void 0 : flows.length), onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
72
65
  };
73
66
  export default React.memo(CreatePassword);
@@ -1,16 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { Trans, useTranslation } from 'react-i18next';
4
+ import { handlePrevScreenStep } from '../../../../app/settings';
4
5
  import SuccessScreen from '../../../shared/SuccessScreen';
5
- import { useAppSelector } from '../../../../hooks';
6
+ import { useAppSelector, useAppDispatch } from '../../../../hooks';
6
7
  import { maskEmail } from '../../../../utils';
7
8
  import { passwordSelector } from '../../../app/password/passwordStore';
8
9
  var ResetPasswordSuccess = function (_a) {
9
10
  var _b, _c;
10
11
  var t = useTranslation().t;
12
+ var dispatch = useAppDispatch();
11
13
  var data = useAppSelector(passwordSelector).data;
12
14
  var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
13
15
  var maskedEmail = maskEmail(email);
14
- return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true }));
16
+ var onBack = function () {
17
+ dispatch(handlePrevScreenStep());
18
+ };
19
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
15
20
  };
16
21
  export default React.memo(ResetPasswordSuccess);
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
13
  import * as React from 'react';
25
14
  import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
@@ -28,7 +17,6 @@ import { useForm, FormProvider } from 'react-hook-form';
28
17
  import { yupResolver } from '@hookform/resolvers/yup';
29
18
  import Box from '@mui/material/Box/Box';
30
19
  import { styled } from '@mui/material/styles';
31
- import { handlePrevScreenStep } from '../../../../app/settings';
32
20
  import { useLanguage, useAppSelector } from '../../../../hooks';
33
21
  import { maskPhone } from '../../../../utils';
34
22
  import Form from '../../../../components/Form';
@@ -61,16 +49,18 @@ var VerifyNumber = function (_a) {
61
49
  var _b, _c, _d;
62
50
  var dispatch = useAppDispatch();
63
51
  var _e = useAppSelector(passwordSelector), data = _e.data, loading = _e.loading, error = _e.error;
64
- var _f = data.otpData, responseBody = _f.responseBody, defaultValues = __rest(_f, ["responseBody"]);
52
+ var otp = data.otpData.otp;
65
53
  var methods = useForm({
66
54
  resolver: yupResolver(OTPValidation),
67
- defaultValues: defaultValues,
55
+ defaultValues: {
56
+ otp: otp
57
+ },
68
58
  mode: 'onChange'
69
59
  });
70
- useSetFromDefaultValues(methods, defaultValues);
60
+ useSetFromDefaultValues(methods, data.otpData);
71
61
  var t = useTranslation().t;
72
62
  var isAr = useLanguage().isAr;
73
- var _g = React.useState(false), resendLoading = _g[0], setResendLoading = _g[1];
63
+ var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
74
64
  var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
75
65
  React.useEffect(function () {
76
66
  if (error && methods.formState.isValid && phone)
@@ -82,10 +72,7 @@ var VerifyNumber = function (_a) {
82
72
  var onSubmit = function (formData) {
83
73
  dispatch(verifyPasswordLeadOTP(formData));
84
74
  };
85
- var onBack = function () {
86
- dispatch(handlePrevScreenStep());
87
- };
88
75
  var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
89
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
76
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
90
77
  };
91
78
  export default React.memo(VerifyNumber);
@@ -26,7 +26,7 @@ var ArrowIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return
26
26
  height: theme.spacing(2),
27
27
  transform: isAr ? 'scaleX(-1)' : 'scaleX(1)',
28
28
  marginInlineEnd: theme.spacing(-0.375),
29
- verticalAlign: 'middle'
29
+ verticalAlign: 'unset'
30
30
  });
31
31
  });
32
32
  var CheckIconStyled = styled(CheckIcon)(function (_a) {
@@ -67,7 +67,7 @@ var Image = styled('img')(function (_a) {
67
67
  height: theme.spacing(3),
68
68
  fontSize: theme.spacing(3),
69
69
  marginInlineStart: theme.spacing(1),
70
- verticalAlign: 'middle'
70
+ verticalAlign: 'sub'
71
71
  });
72
72
  });
73
73
  var TextStyled = styled('span')(function () { return ({
@@ -7,6 +7,8 @@ export interface ThankYouProps {
7
7
  loading?: boolean;
8
8
  error?: string;
9
9
  description?: string | React.ReactElement;
10
+ enableBack?: boolean;
11
+ onBack?: () => void;
10
12
  }
11
- declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error }: ThankYouProps) => JSX.Element>;
13
+ declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack }: ThankYouProps) => JSX.Element>;
12
14
  export default _default;
@@ -15,6 +15,7 @@ import { styled } from '@mui/material/styles';
15
15
  import * as React from 'react';
16
16
  import { useTranslation } from 'react-i18next';
17
17
  import Text from '../../../components/Text';
18
+ import Button from '../../../components/Button';
18
19
  import Container from '../Containers/ScreenContainer';
19
20
  import { EmailProvidersButton, SuccessButton } from '../../shared/Button';
20
21
  import Icon from '../../../components/Icon';
@@ -54,9 +55,9 @@ var IconStyled = styled(Icon)(function (_a) {
54
55
  _b);
55
56
  });
56
57
  var ThankYou = function (_a) {
57
- var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error;
58
+ var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack;
58
59
  var t = useTranslation().t;
59
60
  var isAr = useLanguage().isAr;
60
- return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) }))] }));
61
+ return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] }));
61
62
  };
62
63
  export default React.memo(ThankYou);
@@ -1,16 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { Trans, useTranslation } from 'react-i18next';
4
+ import { handlePrevScreenStep } from '../../../../app/settings';
4
5
  import SuccessScreen from '../../../shared/SuccessScreen';
5
- import { useAppSelector } from '../../../../hooks';
6
+ import { useAppSelector, useAppDispatch } from '../../../../hooks';
6
7
  import { maskEmail } from '../../../../utils';
7
- import { taxSelector } from '../../../../features/app/tax/taxStore';
8
+ import { taxSelector } from '../../../app/tax/taxStore';
8
9
  var ResetPasswordSuccess = function (_a) {
9
10
  var _b, _c;
10
11
  var t = useTranslation().t;
12
+ var dispatch = useAppDispatch();
11
13
  var data = useAppSelector(taxSelector).data;
12
14
  var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
13
15
  var maskedEmail = maskEmail(email);
14
- return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true }));
16
+ var onBack = function () {
17
+ dispatch(handlePrevScreenStep());
18
+ };
19
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
15
20
  };
16
21
  export default React.memo(ResetPasswordSuccess);
@@ -16,7 +16,7 @@ import { useForm, FormProvider } from 'react-hook-form';
16
16
  import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import Form from '../../../../components/Form';
19
- import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly } from '../../../../hooks';
19
+ import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
20
20
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
21
21
  import { DocumentPurpose } from '../../../../@types';
22
22
  import { getFileDetailsFromDocument, isSA } from '../../../../utils';
@@ -53,11 +53,12 @@ var TaxDetails = function () {
53
53
  var originalReadOnly = useFormReadOnly(methods, { documentId: defaultTaxFiles });
54
54
  var noneEditable = useDataNoneEditable(entity === null || entity === void 0 ? void 0 : entity.data_status, ['tax_number', 'documents', 'is_vat_acknowledged']);
55
55
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
56
+ var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
56
57
  var t = useTranslation().t;
57
58
  var isAr = useLanguage().isAr;
58
59
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
59
60
  var onSubmit = function (data) {
60
- dispatch(updateTaxInfo(data));
61
+ dispatch(updateTaxInfo(getFelids(data)));
61
62
  };
62
63
  var onBack = function () {
63
64
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
@@ -66,6 +67,6 @@ var TaxDetails = function () {
66
67
  }
67
68
  dispatch(retrieveBoardStatus());
68
69
  };
69
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, { readOnly: readOnly['vatId'] || noneEditable['tax_number'] }), _jsx(TaxDocument, { show: isSACountry, defaultFiles: defaultTaxFiles, readOnly: readOnly['documentId'] || noneEditable['documents'] }), _jsx(ConfirmPolicy, { readOnly: readOnly['documentId'] || noneEditable['is_vat_acknowledged'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid || uploading, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
70
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, { readOnly: readOnly['vatId'] || noneEditable['tax_number'] }), _jsx(TaxDocument, { show: isSACountry, defaultFiles: defaultTaxFiles, readOnly: readOnly['documentId'] || noneEditable['documents'] }), _jsx(ConfirmPolicy, { readOnly: readOnly['confirmPolicy'] || noneEditable['is_vat_acknowledged'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid || uploading, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
70
71
  };
71
72
  export default TaxDetails;
@@ -18,3 +18,4 @@ export * from './useVerifyToken';
18
18
  export * from './useFormReadOnly';
19
19
  export * from './useDataNoneEditable';
20
20
  export * from './useFormErrorAndUpdateReadOnly';
21
+ export * from './useExcludeReadOnlyFelids';
@@ -18,3 +18,4 @@ export * from './useVerifyToken';
18
18
  export * from './useFormReadOnly';
19
19
  export * from './useDataNoneEditable';
20
20
  export * from './useFormErrorAndUpdateReadOnly';
21
+ export * from './useExcludeReadOnlyFelids';
@@ -0,0 +1,11 @@
1
+ import { FieldValues, UseFormReturn } from 'react-hook-form';
2
+ declare type ReadOnly<TF, V> = {
3
+ [key in keyof TF]: V;
4
+ };
5
+ export declare const useExcludeReadOnlyFelids: <TF extends FieldValues = FieldValues>({ formState }: UseFormReturn<TF, any>, readOnly: ReadOnly<TF, boolean>) => {
6
+ getFelids: <T extends TF = TF>(data: T) => {
7
+ originalFormData: T;
8
+ formData: T;
9
+ };
10
+ };
11
+ export {};
@@ -0,0 +1,33 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { settingsSelector } from '../app/settings';
13
+ import { useAppSelector } from './useAppSelector';
14
+ export var useExcludeReadOnlyFelids = function (_a, readOnly) {
15
+ var formState = _a.formState;
16
+ var settingData = useAppSelector(settingsSelector).data;
17
+ var getFelids = function (data) {
18
+ if (settingData.boardMaturity !== false)
19
+ return { originalFormData: data, formData: data };
20
+ var object = {};
21
+ var objectCopy = __assign({}, data);
22
+ for (var key in data) {
23
+ if (readOnly[key] === true)
24
+ continue;
25
+ object[key] = data[key];
26
+ }
27
+ return {
28
+ originalFormData: objectCopy,
29
+ formData: object
30
+ };
31
+ };
32
+ return { getFelids: getFelids };
33
+ };
@@ -69,5 +69,5 @@ export declare const getUserNameObject: (name: string) => {
69
69
  last: string;
70
70
  };
71
71
  export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/png" | "image/jpg" | "application/pdf";
72
- export declare const isStringMasked: (value: string) => boolean;
72
+ export declare const isStringHasOneAsterisk: (value: string) => boolean;
73
73
  export declare const isOtherLicense: (item?: License) => boolean;
@@ -298,7 +298,9 @@ export var getFileType = function (type) {
298
298
  return '';
299
299
  }
300
300
  };
301
- export var isStringMasked = function (value) {
301
+ export var isStringHasOneAsterisk = function (value) {
302
+ if (!value)
303
+ return false;
302
304
  return value.includes('*') ? true : false;
303
305
  };
304
306
  export var isOtherLicense = function (item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.55",
3
+ "version": "2.0.56",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",