@tap-payments/auth-jsconnect 2.0.4 → 2.0.5
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/form.d.ts +2 -0
- package/build/api/entity.d.ts +8 -0
- package/build/api/entity.js +10 -1
- package/build/api/index.d.ts +1 -0
- package/build/api/lead.d.ts +1 -0
- package/build/assets/locales/ar.json +4 -1
- package/build/assets/locales/en.json +4 -1
- package/build/components/FileInput/DragAndDrop.d.ts +7 -0
- package/build/components/FileInput/DragAndDrop.js +39 -0
- package/build/components/FileInput/UploadInput.d.ts +7 -0
- package/build/components/FileInput/UploadInput.js +38 -0
- package/build/components/FileInput/index.d.ts +3 -0
- package/build/components/FileInput/index.js +3 -0
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.js +35 -5
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +42 -8
- package/build/features/app/business/businessStore.js +13 -6
- package/build/features/app/connect/connectStore.js +18 -16
- package/build/features/app/individual/individualStore.js +10 -9
- package/build/features/app/password/passwordStore.d.ts +4 -1
- package/build/features/app/password/passwordStore.js +20 -17
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/BankStatement.js +38 -0
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/validation.js +1 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
- package/build/features/business/screens/Activities/Activities.js +2 -1
- package/build/features/business/screens/Activities/LicenseName.d.ts +5 -0
- package/build/features/business/screens/Activities/LicenseName.js +30 -0
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
- package/build/features/connect/screens/Merchant/BrandList.js +1 -5
- package/build/features/connect/screens/Merchant/Merchant.js +10 -8
- package/build/features/connect/screens/Merchant/validation.js +4 -2
- package/build/features/connect/screens/Mobile/Mobile.js +1 -1
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/featuresScreens.js +15 -5
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/password/screens/Success/Success.js +2 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.js +3 -6
- package/build/features/shared/Button/SuccessButton.js +14 -0
- package/build/features/shared/UploadFile/UploadFile.d.ts +21 -0
- package/build/features/shared/UploadFile/UploadFile.js +77 -0
- package/build/features/shared/UploadFile/index.d.ts +2 -0
- package/build/features/shared/UploadFile/index.js +2 -0
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -13
- package/build/utils/string.js +2 -1
- package/package.json +2 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var ResetPasswordSuccess = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
17
|
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
20
|
import { individualSelector } from '../../../app/individual/individualStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
|
|
|
47
47
|
var _a, _b, _c;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var isAr = useLanguage().isAr;
|
|
50
|
-
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
51
|
-
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
52
50
|
var data = useAppSelector(individualSelector).data;
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
55
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
56
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
57
55
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
58
56
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
59
57
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
60
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
|
+
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
+
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
+
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
61
62
|
var settings = useAppSelector(settingsSelector);
|
|
62
|
-
var
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
|
|
63
64
|
var email = (contact || { email: '' }).email;
|
|
64
65
|
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
65
66
|
var reMapFlowData = function (flows) {
|
|
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
|
|
|
71
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
72
73
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
73
74
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
74
|
-
individual_name: username.toLowerCase(),
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
75
76
|
business_type: brandName,
|
|
76
77
|
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
77
78
|
bank_name: bankName,
|
|
78
79
|
iban: t('masking_symbols') + iban,
|
|
79
80
|
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
80
81
|
});
|
|
81
|
-
if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
|
|
82
|
-
setIsAcceptance(true);
|
|
83
82
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
84
83
|
var isIndividual = name === 'individual';
|
|
85
84
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
96
95
|
};
|
|
97
96
|
});
|
|
98
97
|
setButtons(mappedFlows);
|
|
99
|
-
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
100
|
-
if (isAllCompleted)
|
|
101
|
-
setIsPayout(true);
|
|
102
98
|
};
|
|
103
99
|
useEffect(function () {
|
|
104
100
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var ResetPasswordSuccess = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
5
|
-
import { updateLeadSuccess, passwordSelector,
|
|
5
|
+
import { updateLeadSuccess, passwordSelector, retrieveLeadPassword } from '../../../app/password/passwordStore';
|
|
6
6
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
7
7
|
import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
8
8
|
var Success = function (_a) {
|
|
@@ -12,7 +12,7 @@ var Success = function (_a) {
|
|
|
12
12
|
var operationType = data.verify.operationType;
|
|
13
13
|
var onSuccess = function () {
|
|
14
14
|
if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
|
|
15
|
-
dispatch(
|
|
15
|
+
dispatch(retrieveLeadPassword());
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
dispatch(updateLeadSuccess());
|
|
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
17
|
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
20
|
import { passwordSelector } from '../../../app/password/passwordStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
|
|
|
47
47
|
var _a, _b, _c;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var isAr = useLanguage().isAr;
|
|
50
|
-
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
51
|
-
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
52
50
|
var data = useAppSelector(passwordSelector).data;
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
55
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
56
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
57
55
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
58
56
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
59
57
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
60
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
|
+
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
+
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
+
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
61
62
|
var settings = useAppSelector(settingsSelector);
|
|
62
|
-
var
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
|
|
63
64
|
var email = (contact || { email: '' }).email;
|
|
64
65
|
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
65
66
|
var reMapFlowData = function (flows) {
|
|
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
|
|
|
71
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
72
73
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
73
74
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
74
|
-
individual_name: username.toLowerCase(),
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
75
76
|
business_type: brandName,
|
|
76
77
|
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
77
78
|
bank_name: bankName,
|
|
78
79
|
iban: t('masking_symbols') + iban,
|
|
79
80
|
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
80
81
|
});
|
|
81
|
-
if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
|
|
82
|
-
setIsAcceptance(true);
|
|
83
82
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
84
83
|
var isIndividual = name === 'individual';
|
|
85
84
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
96
95
|
};
|
|
97
96
|
});
|
|
98
97
|
setButtons(mappedFlows);
|
|
99
|
-
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
100
|
-
if (isAllCompleted)
|
|
101
|
-
setIsPayout(true);
|
|
102
98
|
};
|
|
103
99
|
useEffect(function () {
|
|
104
100
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
@@ -37,7 +37,7 @@ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop
|
|
|
37
37
|
width: theme.spacing(3),
|
|
38
38
|
height: theme.spacing(3),
|
|
39
39
|
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)',
|
|
40
|
-
marginInlineEnd: theme.spacing(0.
|
|
40
|
+
marginInlineEnd: theme.spacing(-0.375)
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
var BackIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
@@ -54,7 +54,7 @@ import Link from '@mui/material/Link';
|
|
|
54
54
|
import { ICONS_NAMES } from '../../../constants';
|
|
55
55
|
import CheckIcon from '@mui/icons-material/Check';
|
|
56
56
|
import { useAppDispatch, useLanguage } from '../../../hooks';
|
|
57
|
-
import { handleOpen, handleCurrentActiveScreen } from '../../../app/settings';
|
|
57
|
+
import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
|
|
58
58
|
import { getScreenNameBasedOnFlow } from '../../../utils';
|
|
59
59
|
import API from '../../../api';
|
|
60
60
|
var Image = styled('img')(function (_a) {
|
|
@@ -159,11 +159,11 @@ export default function FlowsButtons(_a) {
|
|
|
159
159
|
step_name: 'reset_password_auth',
|
|
160
160
|
encryption_contract: ['user_credentail.email']
|
|
161
161
|
};
|
|
162
|
+
dispatch(handleNextScreenStep());
|
|
162
163
|
return [4, API.authService
|
|
163
164
|
.createAuth(payload)
|
|
164
165
|
.then(function (response) {
|
|
165
166
|
var _a;
|
|
166
|
-
setLoading(false);
|
|
167
167
|
var data = response.data;
|
|
168
168
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
169
169
|
if (description) {
|
|
@@ -173,11 +173,8 @@ export default function FlowsButtons(_a) {
|
|
|
173
173
|
})
|
|
174
174
|
.catch(function (error) {
|
|
175
175
|
alert(error);
|
|
176
|
-
setLoading(false);
|
|
177
176
|
})
|
|
178
|
-
.finally(function () {
|
|
179
|
-
setLoading(false);
|
|
180
|
-
})];
|
|
177
|
+
.finally(function () { })];
|
|
181
178
|
case 1:
|
|
182
179
|
_a.sent();
|
|
183
180
|
return [2];
|
|
@@ -47,6 +47,20 @@ var ButtonStyled = styled(Button)(function (_a) {
|
|
|
47
47
|
easing: theme.transitions.easing.easeInOut,
|
|
48
48
|
duration: theme.transitions.duration.complex * 2
|
|
49
49
|
})
|
|
50
|
+
},
|
|
51
|
+
'&.MuiButton-contained': {
|
|
52
|
+
color: theme.palette.common.white,
|
|
53
|
+
backgroundColor: theme.palette.primary.main,
|
|
54
|
+
'&:hover': {
|
|
55
|
+
backgroundColor: theme.palette.primary.main
|
|
56
|
+
},
|
|
57
|
+
'&:active': {
|
|
58
|
+
backgroundColor: theme.palette.primary.main
|
|
59
|
+
},
|
|
60
|
+
':disabled': {
|
|
61
|
+
backgroundColor: theme.palette.primary.main,
|
|
62
|
+
color: theme.palette.common.white
|
|
63
|
+
}
|
|
50
64
|
}
|
|
51
65
|
});
|
|
52
66
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
component?: React.ElementType<any> | undefined;
|
|
5
|
+
ref?: React.Ref<unknown> | undefined;
|
|
6
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
7
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
8
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
10
|
+
interface UploadFileProps {
|
|
11
|
+
label: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
dragTitle: string;
|
|
14
|
+
uploadTitle: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
onFileUploaded: (file: File) => void;
|
|
18
|
+
onReset: () => void;
|
|
19
|
+
}
|
|
20
|
+
declare const UploadFile: ({ label, required, dragTitle, uploadTitle, loading, error, onFileUploaded, onReset }: UploadFileProps) => JSX.Element;
|
|
21
|
+
export default UploadFile;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import { ScreenContainer } from '../../shared/Containers';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { InputLabelStyled } from '../../shared/Input/Input';
|
|
18
|
+
import Mandatory from '../../shared/Mandatory';
|
|
19
|
+
import { DragAndDrop, UploadInput } from '../../../components/FileInput';
|
|
20
|
+
import Collapse from '../../../components/Collapse';
|
|
21
|
+
import Warning from '../../../components/Warning';
|
|
22
|
+
import Icon from '../../../components/Icon';
|
|
23
|
+
import { ICONS_NAMES } from '../../../constants';
|
|
24
|
+
import { useTranslation } from 'react-i18next';
|
|
25
|
+
import Loader from '../../../components/Loader';
|
|
26
|
+
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
27
|
+
var theme = _a.theme;
|
|
28
|
+
return ({
|
|
29
|
+
marginBlockStart: theme.spacing(0)
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
justifyContent: 'flex-start',
|
|
37
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '85%' }));
|
|
43
|
+
});
|
|
44
|
+
var UploadBoxStyled = styled(Box)(function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, padding: theme.spacing(0.75, 1.75, 0), cursor: 'pointer', width: '15%', display: 'flex', justifyContent: 'center' }));
|
|
47
|
+
});
|
|
48
|
+
var IconStyled = styled(Icon)(function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return ({
|
|
51
|
+
marginBlockStart: theme.spacing(0),
|
|
52
|
+
width: theme.spacing(3.5),
|
|
53
|
+
height: theme.spacing(3.5)
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
export var InputContainerStyled = styled(Box)(function (_a) {
|
|
57
|
+
var theme = _a.theme;
|
|
58
|
+
return ({
|
|
59
|
+
display: 'flex',
|
|
60
|
+
width: '100%'
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var UploadFile = function (_a) {
|
|
64
|
+
var label = _a.label, required = _a.required, dragTitle = _a.dragTitle, uploadTitle = _a.uploadTitle, loading = _a.loading, error = _a.error, onFileUploaded = _a.onFileUploaded, onReset = _a.onReset;
|
|
65
|
+
var _b = React.useState(''), fileName = _b[0], setFileName = _b[1];
|
|
66
|
+
var t = useTranslation().t;
|
|
67
|
+
var handleFileChange = function (file) {
|
|
68
|
+
setFileName(file === null || file === void 0 ? void 0 : file.name);
|
|
69
|
+
onFileUploaded === null || onFileUploaded === void 0 ? void 0 : onFileUploaded(file);
|
|
70
|
+
};
|
|
71
|
+
var handleReset = function () {
|
|
72
|
+
setFileName('');
|
|
73
|
+
onReset === null || onReset === void 0 ? void 0 : onReset();
|
|
74
|
+
};
|
|
75
|
+
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(DragAndDrop, { title: dragTitle, onSuccess: handleFileChange }), _jsx(UploadInput, { title: uploadTitle, onChange: handleFileChange })] }) })), _jsx(Collapse, __assign({ in: !!fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(BoxStyled, { children: loading ? t('loading_bank_statement') : fileName }), _jsxs(UploadBoxStyled, __assign({ onClick: handleReset }, { children: [_jsx(Collapse, __assign({ in: !loading }, { children: _jsx(IconStyled, { src: ICONS_NAMES.DELETE_ICON }) })), _jsx(Collapse, __assign({ in: loading }, { children: _jsx(Loader, { innerColor: 'white', outerColor: 'white', toggleAnimation: true, style: { width: 30, height: 30 }, svgStyle: { width: 30, height: 30 } }) }))] }))] }) })), _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: error })) }))] }));
|
|
76
|
+
};
|
|
77
|
+
export default UploadFile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var ResetPasswordSuccess = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
17
|
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
20
|
import { taxSelector } from '../../../app/tax/taxStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -47,19 +47,20 @@ var SuccessWithFlowButtons = function () {
|
|
|
47
47
|
var _a, _b, _c;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var isAr = useLanguage().isAr;
|
|
50
|
-
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
51
|
-
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
52
50
|
var data = useAppSelector(taxSelector).data;
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
55
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
56
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
57
55
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
58
56
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
59
57
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
60
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
|
+
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
+
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
+
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
61
62
|
var settings = useAppSelector(settingsSelector);
|
|
62
|
-
var
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
|
|
63
64
|
var email = (contact || { email: '' }).email;
|
|
64
65
|
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
65
66
|
var reMapFlowData = function (flows) {
|
|
@@ -71,15 +72,13 @@ var SuccessWithFlowButtons = function () {
|
|
|
71
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
72
73
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
73
74
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
74
|
-
individual_name: username.toLowerCase(),
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
75
76
|
business_type: brandName,
|
|
76
77
|
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
77
78
|
bank_name: bankName,
|
|
78
79
|
iban: t('masking_symbols') + iban,
|
|
79
80
|
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
80
81
|
});
|
|
81
|
-
if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
|
|
82
|
-
setIsAcceptance(true);
|
|
83
82
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
84
83
|
var isIndividual = name === 'individual';
|
|
85
84
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
@@ -96,9 +95,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
96
95
|
};
|
|
97
96
|
});
|
|
98
97
|
setButtons(mappedFlows);
|
|
99
|
-
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
100
|
-
if (isAllCompleted)
|
|
101
|
-
setIsPayout(true);
|
|
102
98
|
};
|
|
103
99
|
useEffect(function () {
|
|
104
100
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
package/build/utils/string.js
CHANGED
|
@@ -75,6 +75,7 @@ export var capitalizeTheFirstLetterOfEachWord = function (words) {
|
|
|
75
75
|
};
|
|
76
76
|
export var getRequestHeaders = function (deviceInfo) {
|
|
77
77
|
var app = deviceInfo.app, browser = deviceInfo.browser, connection = deviceInfo.connection, device = deviceInfo.device, source = deviceInfo.source;
|
|
78
|
+
console.log('bi:', browser.browser_id);
|
|
78
79
|
return {
|
|
79
80
|
al: encryptString(app.language || ''),
|
|
80
81
|
at: encryptString(source || ''),
|
|
@@ -93,7 +94,7 @@ export var getRequestHeaders = function (deviceInfo) {
|
|
|
93
94
|
bb: encryptString(''),
|
|
94
95
|
bv: encryptString(browser.version || ''),
|
|
95
96
|
bua: encryptString((browser.user_agent || '').substring(0, 80)),
|
|
96
|
-
bi:
|
|
97
|
+
bi: browser.browser_id || '',
|
|
97
98
|
ci: encryptString(connection.ip || ''),
|
|
98
99
|
cm: encryptString(connection.mac || ''),
|
|
99
100
|
l: encryptString((connection.latitude || 0).toString() + '-' + (connection.longitude || 0).toString())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"react-calendar": "~3.7.0",
|
|
95
95
|
"react-device-detect": "^2.2.2",
|
|
96
96
|
"react-dom": "^18.2.0",
|
|
97
|
+
"react-dropzone": "^14.2.2",
|
|
97
98
|
"react-hook-form": "^7.33.1",
|
|
98
99
|
"react-i18next": "^11.18.1",
|
|
99
100
|
"react-otp-input": "^2.4.0",
|