@tap-payments/auth-jsconnect 2.0.54-test → 2.0.56-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +39 -14
- package/build/@types/app.js +9 -0
- package/build/@types/form.d.ts +11 -0
- package/build/api/auth.d.ts +14 -1
- package/build/api/auth.js +24 -1
- package/build/api/axios.js +2 -2
- package/build/api/data.d.ts +33 -7
- package/build/api/data.js +41 -16
- package/build/api/entity.d.ts +2 -0
- package/build/api/index.d.ts +11 -8
- package/build/api/individual.d.ts +1 -1
- package/build/app/rootReducer.d.ts +3 -0
- package/build/app/rootReducer.js +7 -1
- package/build/app/settings.js +8 -2
- package/build/app/store.d.ts +7 -1
- package/build/assets/locales/ar.json +14 -4
- package/build/assets/locales/en.json +14 -4
- package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
- package/build/components/AnimationFlow/AnimationFlow.js +5 -7
- package/build/components/AnimationFlow/BottomSheet.js +2 -1
- package/build/components/AnimationFlow/Dialog.d.ts +4 -1
- package/build/components/AnimationFlow/Dialog.js +9 -4
- package/build/components/FileInput/DragAndDrop.d.ts +9 -1
- package/build/components/FileInput/DragAndDrop.js +113 -8
- package/build/components/Lottie/Lottie.d.ts +878 -0
- package/build/components/Lottie/Lottie.js +58 -0
- package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
- package/build/components/Lottie/files/success.json +425 -0
- package/build/components/Lottie/index.d.ts +3 -0
- package/build/components/Lottie/index.js +3 -0
- package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
- package/build/components/ProgressBar/CircularProgressBar.js +48 -0
- package/build/components/ProgressBar/index.d.ts +2 -0
- package/build/components/ProgressBar/index.js +2 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -1
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +27 -34
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +10 -7
- package/build/constants/app.d.ts +15 -0
- package/build/constants/app.js +75 -3
- package/build/constants/assets.d.ts +17 -1
- package/build/constants/assets.js +22 -6
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +35 -0
- package/build/features/app/auth/authStore.js +148 -0
- package/build/features/app/bank/bankStore.d.ts +4 -0
- package/build/features/app/bank/bankStore.js +42 -22
- package/build/features/app/business/businessStore.js +53 -43
- package/build/features/app/connect/connectStore.d.ts +13 -1
- package/build/features/app/connect/connectStore.js +164 -4
- package/build/features/app/entity/entityStore.d.ts +53 -0
- package/build/features/app/entity/entityStore.js +461 -0
- package/build/features/app/individual/individualStore.js +19 -11
- package/build/features/app/otp/otpStore.d.ts +28 -0
- package/build/features/app/otp/otpStore.js +153 -0
- package/build/features/app/signIn/signInStore.js +2 -2
- package/build/features/auth/Auth.d.ts +10 -0
- package/build/features/auth/Auth.js +87 -0
- package/build/features/auth/index.d.ts +1 -0
- package/build/features/auth/index.js +1 -0
- package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTP.js +72 -0
- package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTPInput.js +44 -0
- package/build/features/auth/screens/OTP/index.d.ts +3 -0
- package/build/features/auth/screens/OTP/index.js +2 -0
- package/build/features/auth/screens/OTP/validation.d.ts +8 -0
- package/build/features/auth/screens/OTP/validation.js +4 -0
- package/build/features/bank/Bank.js +10 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +33 -8
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +12 -5
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.js +25 -7
- package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
- package/build/features/connect/Connect.d.ts +2 -1
- package/build/features/connect/Connect.js +40 -10
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +85 -0
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connect/screens/CivilID/index.d.ts +3 -0
- package/build/features/connect/screens/CivilID/index.js +2 -0
- package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connect/screens/CivilID/validation.js +4 -0
- package/build/features/connect/screens/Individual/Individual.js +6 -2
- package/build/features/connect/screens/Merchant/Merchant.js +35 -11
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +5 -0
- package/build/features/connect/screens/Merchant/SalesChannels.js +114 -0
- package/build/features/connect/screens/Merchant/SocialMedia.js +56 -11
- package/build/features/connect/screens/Merchant/validation.d.ts +87 -0
- package/build/features/connect/screens/Merchant/validation.js +68 -2
- package/build/features/connect/screens/Mobile/Mobile.js +7 -4
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +169 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/Entity.d.ts +7 -0
- package/build/features/entity/Entity.js +70 -0
- package/build/features/entity/index.d.ts +1 -0
- package/build/features/entity/index.js +1 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +139 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +56 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +112 -0
- package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +2 -0
- package/build/features/entity/screens/EntityInfoConfirm/index.js +2 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/entity/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/entity/screens/Success/Success.d.ts +5 -0
- package/build/features/entity/screens/Success/Success.js +16 -0
- package/build/features/entity/screens/Success/index.d.ts +3 -0
- package/build/features/entity/screens/Success/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +109 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/entity/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/entity/screens/Verify/OTPInput.js +47 -0
- package/build/features/entity/screens/Verify/Verify.d.ts +5 -0
- package/build/features/entity/screens/Verify/Verify.js +78 -0
- package/build/features/entity/screens/Verify/index.d.ts +2 -0
- package/build/features/entity/screens/Verify/index.js +2 -0
- package/build/features/entity/screens/Verify/validation.d.ts +8 -0
- package/build/features/entity/screens/Verify/validation.js +4 -0
- package/build/features/featuresScreens.d.ts +3 -0
- package/build/features/featuresScreens.js +48 -0
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +12 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +14 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
- package/build/features/otp/OTP.d.ts +7 -0
- package/build/features/otp/OTP.js +58 -0
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +1 -0
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +6 -0
- package/build/features/otp/screens/OTPVerify/OTPInput.js +47 -0
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +5 -0
- package/build/features/otp/screens/OTPVerify/Verify.js +49 -0
- package/build/features/otp/screens/OTPVerify/index.d.ts +2 -0
- package/build/features/otp/screens/OTPVerify/index.js +2 -0
- package/build/features/otp/screens/OTPVerify/validation.d.ts +8 -0
- package/build/features/otp/screens/OTPVerify/validation.js +4 -0
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +12 -5
- package/build/features/shared/Background/Background.d.ts +7 -5
- package/build/features/shared/Background/Background.js +16 -5
- package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
- package/build/features/shared/Dialog/CloseDialog.js +62 -0
- package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
- package/build/features/shared/Dialog/DialogContainer.js +56 -0
- package/build/features/shared/Dialog/index.d.ts +4 -0
- package/build/features/shared/Dialog/index.js +4 -0
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +8 -3
- package/build/features/shared/UploadFile/UploadFile.js +23 -8
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +12 -4
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +12 -4
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.js +2 -0
- package/build/hooks/useAppDispatch.d.ts +3 -0
- package/build/hooks/useErrorListener.js +3 -2
- package/build/hooks/useScreen.d.ts +3 -0
- package/build/hooks/useScreen.js +14 -0
- package/build/index.d.ts +5 -2
- package/build/index.js +11 -2
- package/build/utils/device.d.ts +1 -0
- package/build/utils/device.js +13 -0
- package/build/utils/html.d.ts +1 -0
- package/build/utils/html.js +6 -0
- package/build/utils/locale.js +1 -1
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +22 -20
- package/build/utils/string.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
5
|
+
import Input from '../../../shared/Input';
|
|
6
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
7
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
8
|
+
var LicenseName = function (_a) {
|
|
9
|
+
var _b, _c, _d;
|
|
10
|
+
var t = useTranslation().t;
|
|
11
|
+
var isAr = useLanguage().isAr;
|
|
12
|
+
var data = useAppSelector(entitySelector).data;
|
|
13
|
+
var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
|
|
14
|
+
var name = isAr ? (_c = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _c === void 0 ? void 0 : _c.ar : (_d = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _d === void 0 ? void 0 : _d.en;
|
|
15
|
+
return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('license_name_label'), readOnly: !!name, placeholder: t('license_name_label'), value: name, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }));
|
|
16
|
+
};
|
|
17
|
+
export default React.memo(LicenseName);
|
|
@@ -0,0 +1,28 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import Input from '../../../shared/Input';
|
|
17
|
+
import Collapse from '../../../../components/Collapse';
|
|
18
|
+
import { useAppSelector } from '../../../../hooks';
|
|
19
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
20
|
+
var LicenseNumber = function (_a) {
|
|
21
|
+
var _b, _c;
|
|
22
|
+
var t = useTranslation().t;
|
|
23
|
+
var data = useAppSelector(entitySelector).data;
|
|
24
|
+
var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
|
|
25
|
+
var number = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number;
|
|
26
|
+
return (_jsx(Collapse, __assign({ in: !!number }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('license_number_label'), readOnly: true, value: number, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) })) })));
|
|
27
|
+
};
|
|
28
|
+
export default React.memo(LicenseNumber);
|
|
@@ -0,0 +1,38 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import Input from '../../../shared/Input';
|
|
16
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
17
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import { entitySelector, clearError } from '../../../app/entity/entityStore';
|
|
19
|
+
import DatePicker from '../../../../components/DatePicker';
|
|
20
|
+
import { InputLabelStyled } from './ActivitiesList';
|
|
21
|
+
var OperationStartDate = function (_a) {
|
|
22
|
+
var _b, _c, _d;
|
|
23
|
+
var onDateClicked = _a.onDateClicked;
|
|
24
|
+
var t = useTranslation().t;
|
|
25
|
+
var dispatch = useAppDispatch();
|
|
26
|
+
var control = useFormContext().control;
|
|
27
|
+
var _e = useAppSelector(entitySelector), data = _e.data, error = _e.error;
|
|
28
|
+
var oDateControl = useController({ control: control, name: 'operationStartDate' });
|
|
29
|
+
var handleOperationStartDateChange = function (data) {
|
|
30
|
+
if (error)
|
|
31
|
+
dispatch(clearError());
|
|
32
|
+
oDateControl.field.onChange(data);
|
|
33
|
+
};
|
|
34
|
+
var dateValue = (_b = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
35
|
+
var storedDate = (_d = (_c = data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.business_operation_start_at;
|
|
36
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: !!storedDate ? (_jsx(Input, { label: t('business_start_date'), readOnly: true, value: dateValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } })) : (_jsxs(_Fragment, { children: [_jsx(InputLabelStyled, { children: t('business_start_date') }), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleOperationStartDateChange })] })) })));
|
|
37
|
+
};
|
|
38
|
+
export default OperationStartDate;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
+
export declare const CollapseStyled: import("@emotion/styled").StyledComponent<import("../../../../components/Collapse").CollapseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
4
|
+
declare const SalesChannels: () => JSX.Element;
|
|
5
|
+
export default SalesChannels;
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import Box from '@mui/material/Box';
|
|
24
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
25
|
+
import { useTranslation } from 'react-i18next';
|
|
26
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
27
|
+
import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
28
|
+
import Text from '../../../../components/Text';
|
|
29
|
+
import { entitySelector, clearError } from '../../../app/entity/entityStore';
|
|
30
|
+
import CheckBox from '../../../../components/CheckBox';
|
|
31
|
+
import Warning from '../../../../components/Warning';
|
|
32
|
+
import Collapse from '../../../../components/Collapse';
|
|
33
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
34
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return (__assign({ margin: theme.spacing(2.5, 2.5, 0.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
37
|
+
});
|
|
38
|
+
var ContainerStyled = styled(Box)(function (_a) {
|
|
39
|
+
var theme = _a.theme;
|
|
40
|
+
return ({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
padding: theme.spacing(0, 0.5, 0, 0.5),
|
|
45
|
+
height: theme.spacing(3.625),
|
|
46
|
+
marginBlockEnd: theme.spacing(0.2)
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
50
|
+
var theme = _a.theme;
|
|
51
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
|
|
52
|
+
});
|
|
53
|
+
var CheckBoxStyled = styled(CheckBox)(function (_a) {
|
|
54
|
+
var theme = _a.theme;
|
|
55
|
+
return ({
|
|
56
|
+
marginInlineEnd: theme.spacing(-1),
|
|
57
|
+
'& .MuiSvgIcon-root': {
|
|
58
|
+
fontSize: 30
|
|
59
|
+
},
|
|
60
|
+
'&.Mui-checked': {
|
|
61
|
+
color: theme.palette.text.primary,
|
|
62
|
+
borderRadius: theme.spacing(2.5)
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
export var MandatoryStyled = styled('span')(function (_a) {
|
|
67
|
+
var theme = _a.theme;
|
|
68
|
+
return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
|
|
69
|
+
});
|
|
70
|
+
export var CollapseStyled = styled(Collapse)(function (_a) {
|
|
71
|
+
var theme = _a.theme;
|
|
72
|
+
return ({
|
|
73
|
+
marginBlockStart: theme.spacing(2)
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
var SalesChannels = function () {
|
|
77
|
+
var _a;
|
|
78
|
+
var _b = React.useState([]), channelsMenuList = _b[0], setChannelsMenuList = _b[1];
|
|
79
|
+
var t = useTranslation().t;
|
|
80
|
+
var isAr = useLanguage().isAr;
|
|
81
|
+
var control = useFormContext().control;
|
|
82
|
+
var dispatch = useAppDispatch();
|
|
83
|
+
var channelsControl = useController({ name: 'salesChannels', control: control });
|
|
84
|
+
var channelsChecked = channelsControl.field.value;
|
|
85
|
+
var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
+
var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error;
|
|
87
|
+
var channelList = (data.verify.responseBody || {}).channelList;
|
|
88
|
+
var salesChannels = (data.entityData || {}).salesChannels;
|
|
89
|
+
React.useEffect(function () {
|
|
90
|
+
if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
|
|
91
|
+
setChannelsMenuList(channelList);
|
|
92
|
+
}
|
|
93
|
+
}, [channelList]);
|
|
94
|
+
var handleSalesChannelChange = function (event, checked) {
|
|
95
|
+
var selected = channelsMenuList.find(function (channel) { return channel.id === event.target.id; });
|
|
96
|
+
var isExists = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
97
|
+
if (isExists) {
|
|
98
|
+
var updatedIdList = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.filter(function (channel) { return channel.id !== (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
99
|
+
channelsControl.field.onChange(updatedIdList);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
channelsControl.field.onChange(__spreadArray(__spreadArray([], channelsChecked, true), [selected], false));
|
|
103
|
+
if (error)
|
|
104
|
+
dispatch(clearError());
|
|
105
|
+
};
|
|
106
|
+
var getSelectedChannelsFlag = function (item) {
|
|
107
|
+
if (channelsChecked)
|
|
108
|
+
return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
|
|
109
|
+
};
|
|
110
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('channel_of_service') }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name.ar : channel.name.en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
|
|
111
|
+
};
|
|
112
|
+
export default SalesChannels;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const EntityInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
8
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
9
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
11
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
12
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
15
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
|
+
}>>[] | undefined>;
|
|
19
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
20
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
23
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
25
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
26
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
27
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
29
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
31
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
32
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
33
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
34
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
35
|
+
}>>[] | undefined>;
|
|
36
|
+
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
38
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
39
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
40
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
41
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
42
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
43
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
44
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
45
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
46
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
47
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
48
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
49
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
50
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
51
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
52
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
53
|
+
}>>[] | undefined>;
|
|
54
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
55
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
56
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
57
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
58
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
59
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
60
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
61
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
62
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
63
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
64
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
65
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
66
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
67
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
68
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
69
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
70
|
+
}>>[] | undefined>;
|
|
71
|
+
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
72
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
73
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
74
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
75
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
76
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
77
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
78
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
79
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
80
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
81
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
82
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
83
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
84
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
85
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
86
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
87
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
88
|
+
}>>[] | undefined>;
|
|
89
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
90
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
91
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
92
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
93
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
94
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
95
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
96
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
97
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
98
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
99
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
100
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
101
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
102
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
103
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
104
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
105
|
+
}>>[] | undefined>;
|
|
106
|
+
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
107
|
+
}>>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var EntityInfoValidationSchema = yup.object().shape({
|
|
3
|
+
activities: yup.array().of(yup.object().shape({
|
|
4
|
+
ar: yup.string(),
|
|
5
|
+
en: yup.string()
|
|
6
|
+
})),
|
|
7
|
+
salesChannels: yup
|
|
8
|
+
.array()
|
|
9
|
+
.min(1, 'choose_atleast_one_channel')
|
|
10
|
+
.of(yup.object().shape({
|
|
11
|
+
id: yup.string(),
|
|
12
|
+
name_en: yup.string(),
|
|
13
|
+
name_ar: yup.string()
|
|
14
|
+
}))
|
|
15
|
+
.required('choose_atleast_one_channel'),
|
|
16
|
+
operationStartDate: yup.string().required('choose_any_business_date')
|
|
17
|
+
});
|
|
@@ -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);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
5
|
+
import { updateBoardSuccess, entitySelector } from '../../../app/entity/entityStore';
|
|
6
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
7
|
+
var Success = function (_a) {
|
|
8
|
+
var t = useTranslation().t;
|
|
9
|
+
var dispatch = useAppDispatch();
|
|
10
|
+
var _b = useAppSelector(entitySelector), loading = _b.loading, error = _b.error;
|
|
11
|
+
var onSuccess = function () {
|
|
12
|
+
dispatch(updateBoardSuccess());
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(SuccessScreen, { title: t('entity_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
|
|
15
|
+
};
|
|
16
|
+
export default React.memo(Success);
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { styled } from '@mui/material/styles';
|
|
16
|
+
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
21
|
+
import Box from '@mui/material/Box';
|
|
22
|
+
import Text from '../../../../components/Text';
|
|
23
|
+
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
|
+
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
26
|
+
var TitleStyled = styled(Text)(function (_a) {
|
|
27
|
+
var _b;
|
|
28
|
+
var theme = _a.theme;
|
|
29
|
+
return (__assign(__assign({}, theme.typography.body1), (_b = { fontWeight: theme.typography.fontWeightBold, color: theme.palette.text.primary, lineHeight: 1.75, paddingBottom: theme.spacing(3) }, _b[theme.breakpoints.down('sm')] = {}, _b)));
|
|
30
|
+
});
|
|
31
|
+
var ContainerStyled = styled(Container)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return ({
|
|
34
|
+
justifyContent: 'space-between',
|
|
35
|
+
minHeight: theme.spacing(30),
|
|
36
|
+
alignItems: 'center'
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
40
|
+
var theme = _a.theme;
|
|
41
|
+
return ({
|
|
42
|
+
width: '100%',
|
|
43
|
+
paddingTop: theme.spacing(3)
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
var SuccessWithFlowButtons = function () {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
var t = useTranslation().t;
|
|
49
|
+
var isAr = useLanguage().isAr;
|
|
50
|
+
var data = useAppSelector(entitySelector).data;
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank, merchant = _d.merchant, identification_id = _d.identification_id, vatID = _d.vatID;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
53
|
+
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
54
|
+
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
55
|
+
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
56
|
+
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
57
|
+
var taxID = vatID || '';
|
|
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) : '';
|
|
62
|
+
var settings = useAppSelector(settingsSelector);
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _f.contact, board_id = _f.board_id, board_info_id = _f.board_info_id;
|
|
64
|
+
var email = (contact || { email: '' }).email;
|
|
65
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
|
|
66
|
+
var reMapFlowData = function (flows) {
|
|
67
|
+
if (flows === void 0) { flows = []; }
|
|
68
|
+
var images = ICONS_NAMES;
|
|
69
|
+
var mappedFlows = flows
|
|
70
|
+
.filter(function (item) { return item.name; })
|
|
71
|
+
.map(function (_a) {
|
|
72
|
+
var name = _a.name, url = _a.url, status = _a.status;
|
|
73
|
+
var type = status === 'initiated' || status === 'in_progress' ? 'pending' : 'completed';
|
|
74
|
+
var title = t("".concat(name, "_flow_").concat(type), {
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
76
|
+
business_type: brandName,
|
|
77
|
+
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
78
|
+
bank_name: bankName,
|
|
79
|
+
iban: t('masking_symbols') + iban,
|
|
80
|
+
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
81
|
+
});
|
|
82
|
+
var isCompleted = status === 'completed' && name !== 'password';
|
|
83
|
+
var isIndividual = name === 'individual';
|
|
84
|
+
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
85
|
+
var hoverSrc = "".concat(name, "_white_icon");
|
|
86
|
+
return {
|
|
87
|
+
name: name,
|
|
88
|
+
status: status,
|
|
89
|
+
title: title,
|
|
90
|
+
href: url,
|
|
91
|
+
src: images[src],
|
|
92
|
+
hoverSrc: images[hoverSrc],
|
|
93
|
+
isCompleted: isCompleted,
|
|
94
|
+
sx: isIndividual ? { textTransform: 'capitalize' } : {}
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
setButtons(mappedFlows);
|
|
98
|
+
};
|
|
99
|
+
useEffect(function () {
|
|
100
|
+
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
101
|
+
reMapFlowData(flows);
|
|
102
|
+
}, [flows, isAr]);
|
|
103
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
104
|
+
flowName: data.flowName,
|
|
105
|
+
email: email,
|
|
106
|
+
emailUrl: url
|
|
107
|
+
} }) })] }));
|
|
108
|
+
};
|
|
109
|
+
export default memo(SuccessWithFlowButtons);
|
|
@@ -0,0 +1,47 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import Box from '@mui/material/Box/Box';
|
|
15
|
+
import { styled } from '@mui/material/styles';
|
|
16
|
+
import OTPField from '../../../shared/OTP';
|
|
17
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
19
|
+
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
+
import { resendOTP } from '../../../app/entity/entityStore';
|
|
22
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return ({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
fontFamily: theme.typography.fontFamily
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
var OTPInput = function (_a) {
|
|
31
|
+
var loading = _a.loading, setLoading = _a.setLoading;
|
|
32
|
+
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
33
|
+
var t = useTranslation().t;
|
|
34
|
+
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
+
var dispatch = useAppDispatch();
|
|
36
|
+
var handleOnOTPChange = function (otp) {
|
|
37
|
+
otpControl.field.onChange(otp);
|
|
38
|
+
};
|
|
39
|
+
var handleOnResendOTP = function () {
|
|
40
|
+
if (otpControl.field.value)
|
|
41
|
+
setValue('otp', '', { shouldValidate: true });
|
|
42
|
+
dispatch(resendOTP());
|
|
43
|
+
};
|
|
44
|
+
var otpValue = otpControl.field.value;
|
|
45
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
|
+
};
|
|
47
|
+
export default React.memo(OTPInput);
|