@tap-payments/auth-jsconnect 1.0.93-test → 1.0.96-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 +7 -2
- package/build/@types/form.d.ts +2 -1
- package/build/api/auth.d.ts +22 -3
- package/build/api/axios.d.ts +2 -0
- package/build/api/axios.js +64 -0
- package/build/api/country.d.ts +1 -2
- package/build/api/country.js +7 -8
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +9 -2
- package/build/api/entity.d.ts +3 -1
- package/build/api/entity.js +11 -2
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +5 -2
- package/build/api/index.d.ts +10 -9
- package/build/api/ip.d.ts +1 -1
- package/build/api/ip.js +5 -2
- package/build/api/lead.d.ts +4 -1
- package/build/api/lead.js +14 -2
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +60 -4
- package/build/app/settings.d.ts +9 -12
- package/build/app/settings.js +87 -111
- package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
- package/build/components/AnimationFlow/AnimationFlow.js +2 -2
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +16 -4
- package/build/components/AnimationFlow/Loader.js +1 -1
- package/build/constants/api.d.ts +2 -1
- package/build/constants/api.js +5 -3
- package/build/constants/app.d.ts +6 -0
- package/build/constants/app.js +16 -4
- package/build/features/app/bank/bankStore.js +6 -4
- package/build/features/app/business/businessStore.d.ts +3 -11
- package/build/features/app/business/businessStore.js +69 -62
- package/build/features/app/connect/connectStore.d.ts +6 -17
- package/build/features/app/connect/connectStore.js +112 -61
- package/build/features/app/individual/individualStore.d.ts +3 -7
- package/build/features/app/individual/individualStore.js +28 -54
- package/build/features/app/password/passwordStore.d.ts +29 -1
- package/build/features/app/password/passwordStore.js +184 -8
- package/build/features/app/tax/taxStore.js +7 -5
- package/build/features/bank/Bank.js +4 -4
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -3
- package/build/features/business/Business.js +5 -8
- package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
- package/build/features/business/screens/OTP/OTPInput.js +3 -9
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/features/connect/Connect.js +4 -8
- package/build/features/connect/screens/Merchant/BrandName.js +3 -2
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OTP/OTPInput.js +3 -13
- package/build/features/featuresScreens.js +5 -0
- package/build/features/individual/Individual.js +5 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +10 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -3
- package/build/features/password/Password.js +12 -6
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
- package/build/features/password/screens/OTP/OTP.d.ts +8 -0
- package/build/features/password/screens/OTP/OTP.js +78 -0
- package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/password/screens/OTP/OTPInput.js +46 -0
- package/build/features/password/screens/OTP/index.d.ts +3 -0
- package/build/features/password/screens/OTP/index.js +2 -0
- package/build/features/password/screens/OTP/validation.d.ts +8 -0
- package/build/features/password/screens/OTP/validation.js +4 -0
- package/build/features/password/screens/Success/Success.js +8 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
- package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
- package/build/features/password/screens/Verify/OTPInput.js +1 -1
- package/build/features/shared/Background/Background.js +3 -2
- package/build/features/shared/Background/LogoBackground.d.ts +1 -4
- package/build/features/shared/Background/LogoBackground.js +4 -32
- package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
- package/build/features/shared/Button/FlowsButtons.js +94 -6
- package/build/features/shared/Button/SuccessButton.js +17 -13
- package/build/features/shared/Footer/Footer.js +2 -3
- package/build/features/tax/Tax.js +3 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -3
- package/build/hooks/useAppConfig.d.ts +1 -4
- package/build/hooks/useAppConfig.js +13 -110
- package/build/hooks/useAppTheme.js +3 -2
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +1 -2
- package/build/utils/array.d.ts +3 -0
- package/build/utils/array.js +10 -0
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +4 -0
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import { memo, useEffect } from 'react';
|
|
|
14
14
|
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
15
15
|
import { handleLanguage, settingsSelector } from '../../app/settings';
|
|
16
16
|
import { FeatureContainer } from '../shared/Containers';
|
|
17
|
-
import { businessSelector,
|
|
17
|
+
import { businessSelector, verifyLeadToken } from '../app/business/businessStore';
|
|
18
18
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
19
19
|
import { store } from '../../app/store';
|
|
20
20
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
@@ -29,7 +29,7 @@ var Business = memo(function (props) {
|
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
31
|
var _b = useAppSelector(businessSelector), customLoading = _b.customLoading, businessError = _b.error;
|
|
32
|
-
|
|
32
|
+
useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(businessError || error);
|
|
34
34
|
useStepStartedListener();
|
|
35
35
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
@@ -44,13 +44,10 @@ var Business = memo(function (props) {
|
|
|
44
44
|
dispatch(verifyLeadToken(token));
|
|
45
45
|
};
|
|
46
46
|
useEffect(function () {
|
|
47
|
-
if (!
|
|
47
|
+
if (!settingLoading)
|
|
48
48
|
verifyToken();
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
dispatch(getCountries());
|
|
52
|
-
}, []);
|
|
53
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
49
|
+
}, [settingLoading]);
|
|
50
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
54
51
|
var Element = _a.element, name = _a.name;
|
|
55
52
|
var isActive = activeScreen.name === name;
|
|
56
53
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -44,7 +44,7 @@ var IDBOD = function (_a) {
|
|
|
44
44
|
dispatch(clearError());
|
|
45
45
|
}, [methods.formState.isValid]);
|
|
46
46
|
var onSubmit = function (data) {
|
|
47
|
-
dispatch(updateLeadIdentity(
|
|
47
|
+
dispatch(updateLeadIdentity(data));
|
|
48
48
|
};
|
|
49
49
|
var handleCollapseOpenClose = function (flag) {
|
|
50
50
|
setCollapse(flag);
|
|
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import OTPField from '../../../shared/OTP';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import {
|
|
21
|
-
import { useAppDispatch
|
|
20
|
+
import { resendOTPLeadIdentity } from '../../../app/business/businessStore';
|
|
21
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
22
22
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
23
|
var theme = _a.theme;
|
|
24
24
|
return ({
|
|
@@ -32,19 +32,13 @@ var OTPInput = function (_a) {
|
|
|
32
32
|
var t = useTranslation().t;
|
|
33
33
|
var dispatch = useAppDispatch();
|
|
34
34
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
-
var data = useAppSelector(businessSelector).data;
|
|
36
|
-
var nidData = data.nidData;
|
|
37
35
|
var handleOnOTPChange = function (otp) {
|
|
38
36
|
otpControl.field.onChange(otp);
|
|
39
37
|
};
|
|
40
38
|
var handleOnResendOTP = function () {
|
|
41
39
|
if (otpControl.field.value)
|
|
42
40
|
setValue('otp', '', { shouldValidate: true });
|
|
43
|
-
|
|
44
|
-
nid: nidData.nid,
|
|
45
|
-
dob: nidData.dob
|
|
46
|
-
};
|
|
47
|
-
dispatch(updateLeadIdentity(__assign(__assign({}, params), { isResend: true })));
|
|
41
|
+
dispatch(resendOTPLeadIdentity());
|
|
48
42
|
};
|
|
49
43
|
var otpValue = otpControl.field.value;
|
|
50
44
|
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
@@ -14,14 +14,15 @@ import React, { 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
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
18
|
-
import {
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
20
|
-
import { allAreTruthy, showLastFour } from '../../../../utils';
|
|
20
|
+
import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
24
|
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
25
26
|
var TitleStyled = styled(Text)(function (_a) {
|
|
26
27
|
var _b;
|
|
27
28
|
var theme = _a.theme;
|
|
@@ -46,7 +47,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
46
47
|
var _a, _b, _c;
|
|
47
48
|
var t = useTranslation().t;
|
|
48
49
|
var isAr = useLanguage().isAr;
|
|
49
|
-
var dispatch = useAppDispatch();
|
|
50
50
|
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
51
51
|
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
52
52
|
var data = useAppSelector(businessSelector).data;
|
|
@@ -58,6 +58,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
58
58
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
59
59
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
60
60
|
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) || '';
|
|
61
|
+
var settings = useAppSelector(settingsSelector);
|
|
62
|
+
var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
|
|
63
|
+
var email = (contact || { email: '' }).email;
|
|
64
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
61
65
|
var reMapFlowData = function (flows) {
|
|
62
66
|
if (flows === void 0) { flows = []; }
|
|
63
67
|
var images = ICONS_NAMES;
|
|
@@ -80,6 +84,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
80
84
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
81
85
|
return {
|
|
82
86
|
name: name,
|
|
87
|
+
status: status,
|
|
83
88
|
title: title,
|
|
84
89
|
href: url,
|
|
85
90
|
src: images[src],
|
|
@@ -97,6 +102,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
97
102
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
98
103
|
reMapFlowData(flows);
|
|
99
104
|
}, [flows, isAr]);
|
|
100
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons,
|
|
105
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
106
|
+
flowName: data.flowName,
|
|
107
|
+
email: email,
|
|
108
|
+
emailUrl: url
|
|
109
|
+
} }) })] }));
|
|
101
110
|
};
|
|
102
111
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -10,13 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { memo
|
|
13
|
+
import { memo } from 'react';
|
|
14
14
|
import { FeatureContainer } from '../shared/Containers';
|
|
15
|
-
import { useAppTheme,
|
|
15
|
+
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
16
16
|
import { settingsSelector } from '../../app/settings';
|
|
17
17
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
18
18
|
import { store } from '../../app/store';
|
|
19
|
-
import { connectSelector
|
|
19
|
+
import { connectSelector } from '../app/connect/connectStore';
|
|
20
20
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
21
21
|
import Collapse from '../../components/Collapse';
|
|
22
22
|
import { reactElement } from '../../utils';
|
|
@@ -26,17 +26,13 @@ import CustomFooter from '../shared/Footer';
|
|
|
26
26
|
import Background from '../shared/Background';
|
|
27
27
|
var Connect = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
|
-
var dispatch = useAppDispatch();
|
|
30
29
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
30
|
var connectError = useAppSelector(connectSelector).error;
|
|
32
31
|
useAppConfig(__assign({ navigation: CONNECT_SCREENS_NAVIGATION }, props));
|
|
33
32
|
useErrorListener(connectError || error);
|
|
34
33
|
useStepStartedListener();
|
|
35
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
36
|
-
|
|
37
|
-
dispatch(getCountries());
|
|
38
|
-
}, []);
|
|
39
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
35
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
40
36
|
var Element = _a.element, name = _a.name;
|
|
41
37
|
var isActive = activeScreen.name === name;
|
|
42
38
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -63,9 +63,10 @@ import Tooltip from '../../../../components/Tooltip';
|
|
|
63
63
|
import Collapse from '../../../../components/Collapse';
|
|
64
64
|
import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
|
|
65
65
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
66
|
-
import { checkBrandNameAvailability
|
|
66
|
+
import { checkBrandNameAvailability } from '../../../app/connect/connectStore';
|
|
67
67
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
68
68
|
import { debounce } from 'lodash-es';
|
|
69
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
69
70
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
70
71
|
var theme = _a.theme;
|
|
71
72
|
return ({
|
|
@@ -107,7 +108,7 @@ var BrandName = function (_a) {
|
|
|
107
108
|
var brandControl = useController({ control: control, name: 'brandName' });
|
|
108
109
|
var brandNameValue = brandControl.field.value;
|
|
109
110
|
var error = (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
110
|
-
var data = useAppSelector(
|
|
111
|
+
var data = useAppSelector(settingsSelector).data;
|
|
111
112
|
var checkBrand = debounce(function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
112
113
|
var onSuccess;
|
|
113
114
|
return __generator(this, function (_a) {
|
|
@@ -96,7 +96,7 @@ var Mobile = function (_a) {
|
|
|
96
96
|
dispatch(clearError());
|
|
97
97
|
}, [methods.formState.isValid]);
|
|
98
98
|
var onSubmit = function (formData) {
|
|
99
|
-
dispatch(createMobileAuth(
|
|
99
|
+
dispatch(createMobileAuth(formData));
|
|
100
100
|
};
|
|
101
101
|
var onBack = function () {
|
|
102
102
|
dispatch(handlePrevScreenStep());
|
|
@@ -107,6 +107,6 @@ var Mobile = function (_a) {
|
|
|
107
107
|
var disabled = !methods.formState.isValid || !!error;
|
|
108
108
|
var title = t('join_our_community');
|
|
109
109
|
var subTitle = t('ide_terms_and_conditions_description');
|
|
110
|
-
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') }))] }))] })) }))] }));
|
|
110
|
+
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') }))] }))] })) }))] }));
|
|
111
111
|
};
|
|
112
112
|
export default React.memo(Mobile);
|
|
@@ -72,7 +72,7 @@ var NID = function (_a) {
|
|
|
72
72
|
handleClearError();
|
|
73
73
|
}, [methods.formState.isValid]);
|
|
74
74
|
var onSubmit = function (data) {
|
|
75
|
-
dispatch(createNIDAuth(
|
|
75
|
+
dispatch(createNIDAuth(data));
|
|
76
76
|
};
|
|
77
77
|
var handleCollapseOpenClose = function (flag) {
|
|
78
78
|
setCollapse(flag);
|
|
@@ -17,7 +17,7 @@ import Box from '@mui/material/Box/Box';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import OTPField from '../../../shared/OTP';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { connectSelector,
|
|
20
|
+
import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
|
|
21
21
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
22
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
23
|
var theme = _a.theme;
|
|
@@ -33,8 +33,6 @@ var OTPInput = function (_a) {
|
|
|
33
33
|
var dispatch = useAppDispatch();
|
|
34
34
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
35
|
var data = useAppSelector(connectSelector).data;
|
|
36
|
-
var mobileData = data.mobileData;
|
|
37
|
-
var nidData = data.nidData;
|
|
38
36
|
var isAbsher = data.otpData.isAbsher;
|
|
39
37
|
var handleOnOTPChange = function (otp) {
|
|
40
38
|
otpControl.field.onChange(otp);
|
|
@@ -42,20 +40,12 @@ var OTPInput = function (_a) {
|
|
|
42
40
|
var handleOnResendOTP = function () {
|
|
43
41
|
if (otpControl.field.value)
|
|
44
42
|
setValue('otp', '', { shouldValidate: true });
|
|
45
|
-
|
|
46
|
-
countryCode: mobileData.countryCode,
|
|
47
|
-
mobile: mobileData.mobile
|
|
48
|
-
};
|
|
49
|
-
dispatch(createMobileAuth(__assign(__assign({}, params), { isResend: true })));
|
|
43
|
+
dispatch(resendOTPMobile());
|
|
50
44
|
};
|
|
51
45
|
var handleOnResendAbsherOTP = function () {
|
|
52
46
|
if (otpControl.field.value)
|
|
53
47
|
setValue('otp', '', { shouldValidate: true });
|
|
54
|
-
|
|
55
|
-
nid: nidData.nid,
|
|
56
|
-
dob: nidData.dob
|
|
57
|
-
};
|
|
58
|
-
dispatch(createNIDAuth(__assign(__assign({}, params), { isResend: true })));
|
|
48
|
+
dispatch(resendOTPNID());
|
|
59
49
|
};
|
|
60
50
|
var otpValue = otpControl.field.value;
|
|
61
51
|
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: isAbsher ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
@@ -14,6 +14,7 @@ import SuccessPage from './business/screens/Success';
|
|
|
14
14
|
import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
|
|
15
15
|
import PasswordVerifyPage from './password/screens/Verify';
|
|
16
16
|
import CreatePasswordPage from './password/screens/CreatePassword';
|
|
17
|
+
import PasswordOTPPage from './password/screens/OTP';
|
|
17
18
|
import SuccessPasswordPage from './password/screens/Success';
|
|
18
19
|
import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
|
|
19
20
|
import IndividualVerifyPage from './individual/screens/Verify';
|
|
@@ -91,6 +92,10 @@ export var passwordFeatureScreens = [
|
|
|
91
92
|
name: 'PASSWORD_CREATE_PASSWORD_STEP',
|
|
92
93
|
element: CreatePasswordPage
|
|
93
94
|
},
|
|
95
|
+
{
|
|
96
|
+
name: 'PASSWORD_RESET_PASSWORD_OTP_STEP',
|
|
97
|
+
element: PasswordOTPPage
|
|
98
|
+
},
|
|
94
99
|
{
|
|
95
100
|
name: 'PASSWORD_SUCCESS_STEP',
|
|
96
101
|
element: SuccessPasswordPage
|
|
@@ -21,7 +21,7 @@ import { getParameterByName, reactElement } from '../../utils';
|
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
22
|
import { INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { individualFeatureScreens } from '../featuresScreens';
|
|
24
|
-
import {
|
|
24
|
+
import { individualSelector, verifyLeadToken } from '../app/individual/individualStore';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
26
|
import Background from '../shared/Background';
|
|
27
27
|
var Individual = memo(function (props) {
|
|
@@ -29,7 +29,7 @@ var Individual = memo(function (props) {
|
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
31
|
var _b = useAppSelector(individualSelector), customLoading = _b.customLoading, individualError = _b.error;
|
|
32
|
-
|
|
32
|
+
useAppConfig(__assign({ navigation: INDIVIDUAL_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(individualError || error);
|
|
34
34
|
useStepStartedListener();
|
|
35
35
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
@@ -44,13 +44,10 @@ var Individual = memo(function (props) {
|
|
|
44
44
|
dispatch(verifyLeadToken(token));
|
|
45
45
|
};
|
|
46
46
|
useEffect(function () {
|
|
47
|
-
if (!
|
|
47
|
+
if (!settingLoading)
|
|
48
48
|
verifyToken();
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
dispatch(getCountries());
|
|
52
|
-
}, []);
|
|
53
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
49
|
+
}, [settingLoading]);
|
|
50
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
54
51
|
var Element = _a.element, name = _a.name;
|
|
55
52
|
var isActive = activeScreen.name === name;
|
|
56
53
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
-
import { handleCurrentActiveScreen } from '../../../../app/settings';
|
|
19
|
+
import { handleCurrentActiveScreen, settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
@@ -30,17 +30,21 @@ import EmployerName from './EmployerName';
|
|
|
30
30
|
import EmployerLocation from './EmployerLocation';
|
|
31
31
|
import SourceOfIncome from './SourceOfIncome';
|
|
32
32
|
import { individualSelector, updateIndividualInfo } from '../../../app/individual/individualStore';
|
|
33
|
+
import Occupation from './Occupation';
|
|
33
34
|
var ListType;
|
|
34
35
|
(function (ListType) {
|
|
35
36
|
ListType["SourceOfIncomeList"] = "SourceOfIncomeList";
|
|
36
37
|
ListType["EmployerLocationList"] = "EmployerLocationList";
|
|
37
38
|
ListType["MonthlyIncomeList"] = "MonthlyIncomeList";
|
|
39
|
+
ListType["OccupationList"] = "OccupationList";
|
|
38
40
|
})(ListType || (ListType = {}));
|
|
39
41
|
var AdditionalIndividualInfo = function (_a) {
|
|
40
42
|
var t = useTranslation().t;
|
|
41
43
|
var isAr = useLanguage().isAr;
|
|
42
44
|
var dispatch = useAppDispatch();
|
|
43
45
|
var _b = useAppSelector(individualSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
46
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
47
|
+
var countries = settingsData.countries;
|
|
44
48
|
var methods = useForm({
|
|
45
49
|
resolver: yupResolver(IndividualInfoValidationSchema),
|
|
46
50
|
defaultValues: data.individualData,
|
|
@@ -73,7 +77,11 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
73
77
|
var isSourceOfIncomeListActive = listActive === ListType.SourceOfIncomeList;
|
|
74
78
|
var isEmployerLocationListActive = listActive === ListType.EmployerLocationList;
|
|
75
79
|
var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
|
|
76
|
-
|
|
80
|
+
var isOccupationListActive = listActive === ListType.OccupationList;
|
|
81
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive &&
|
|
82
|
+
employerFieldsActive &&
|
|
83
|
+
!isMonthlyIncomeListActive &&
|
|
84
|
+
!isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
77
85
|
};
|
|
78
86
|
export default React.memo(AdditionalIndividualInfo);
|
|
79
87
|
AdditionalIndividualInfo.defaultProps = {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Occupation as OccupationType } from '../../../../@types';
|
|
3
|
+
interface OccupationProps {
|
|
4
|
+
show: boolean;
|
|
5
|
+
onSelectOccupation?: (occupation: OccupationType) => void;
|
|
6
|
+
onListOpen?: () => void;
|
|
7
|
+
onListClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const Occupation: ({ ...rest }: OccupationProps) => JSX.Element;
|
|
10
|
+
export default Occupation;
|
|
@@ -0,0 +1,89 @@
|
|
|
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 __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
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import Box from '@mui/material/Box';
|
|
26
|
+
import { styled } from '@mui/material/styles';
|
|
27
|
+
import { useTranslation } from 'react-i18next';
|
|
28
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
29
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
30
|
+
import { individualSelector } from '../../../app/individual/individualStore';
|
|
31
|
+
import Text from '../../../../components/Text';
|
|
32
|
+
import Collapse from '../../../../components/Collapse';
|
|
33
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
34
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
35
|
+
import Input from '../../../shared/Input';
|
|
36
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
37
|
+
import SimpleList from '../../../../components/SimpleList';
|
|
38
|
+
var Container = styled(Box)(function () { return ({
|
|
39
|
+
display: 'flex'
|
|
40
|
+
}); });
|
|
41
|
+
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
42
|
+
var theme = _a.theme, isSelected = _a.isSelected;
|
|
43
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
44
|
+
});
|
|
45
|
+
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
46
|
+
var theme = _a.theme;
|
|
47
|
+
return ({
|
|
48
|
+
color: theme.palette.success.main,
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'flex-end'
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
var Occupation = function (_a) {
|
|
54
|
+
var _b, _c;
|
|
55
|
+
var rest = __rest(_a, []);
|
|
56
|
+
var _d = React.useState([]), occupationList = _d[0], setOccupationList = _d[1];
|
|
57
|
+
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
58
|
+
var t = useTranslation().t;
|
|
59
|
+
var isAr = useLanguage().isAr;
|
|
60
|
+
var data = useAppSelector(individualSelector).data;
|
|
61
|
+
var control = useFormContext().control;
|
|
62
|
+
var occupationsList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.occupationList) || [];
|
|
63
|
+
var occupationControl = useController({ control: control, name: 'occupation' });
|
|
64
|
+
React.useEffect(function () {
|
|
65
|
+
if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
|
|
66
|
+
setOccupationList(occupationsList);
|
|
67
|
+
}
|
|
68
|
+
}, [occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.occupation]);
|
|
69
|
+
var onOpenList = function (event) {
|
|
70
|
+
var _a;
|
|
71
|
+
setAnchorEl(event.currentTarget);
|
|
72
|
+
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
73
|
+
};
|
|
74
|
+
var onCloseList = function () {
|
|
75
|
+
var _a;
|
|
76
|
+
setAnchorEl(null);
|
|
77
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
78
|
+
};
|
|
79
|
+
var onSelectItem = function (occupation) {
|
|
80
|
+
onCloseList();
|
|
81
|
+
occupationControl.field.onChange(occupation);
|
|
82
|
+
};
|
|
83
|
+
var occupation = occupationControl.field.value;
|
|
84
|
+
var error = (_c = occupationControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
85
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('occupation_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_occupation'), value: (isAr ? occupation === null || occupation === void 0 ? void 0 : occupation.name_ar : occupation === null || occupation === void 0 ? void 0 : occupation.name_en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name_en', list: occupationList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
86
|
+
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) }, { children: isAr ? item.name_ar : item === null || item === void 0 ? void 0 : item.name_en })) }), item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) && _jsx(CheckIconStyled, {})] }));
|
|
87
|
+
} }) }))] })) })));
|
|
88
|
+
};
|
|
89
|
+
export default Occupation;
|
|
@@ -2,18 +2,21 @@ import * as yup from 'yup';
|
|
|
2
2
|
import { ObjectShape } from 'yup/lib/object';
|
|
3
3
|
import { CountryCode } from '../../../../@types';
|
|
4
4
|
export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
|
|
5
|
+
occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
5
6
|
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
6
7
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
7
8
|
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
8
9
|
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
9
10
|
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
10
11
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
12
|
+
occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
11
13
|
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
12
14
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
13
15
|
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
14
16
|
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
15
17
|
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
16
18
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
19
|
+
occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
17
20
|
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
18
21
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
19
22
|
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export var IndividualInfoValidationSchema = yup.object().shape({
|
|
3
|
+
occupation: yup.object().required('alert_choose_occupation'),
|
|
3
4
|
sourceIncome: yup.object().required('choose_any_source_of_income'),
|
|
4
5
|
monthlyIncome: yup.object().optional(),
|
|
5
6
|
employerLocation: yup.object().when('sourceIncome', function (sourceIncome) {
|
|
@@ -14,14 +14,15 @@ import React, { 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
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import { allAreTruthy, showLastFour } from '../../../../utils';
|
|
19
|
+
import { allAreTruthy, 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';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
24
|
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
25
26
|
var TitleStyled = styled(Text)(function (_a) {
|
|
26
27
|
var _b;
|
|
27
28
|
var theme = _a.theme;
|
|
@@ -57,6 +58,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
57
58
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
58
59
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
59
60
|
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) || '';
|
|
61
|
+
var settings = useAppSelector(settingsSelector);
|
|
62
|
+
var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
|
|
63
|
+
var email = (contact || { email: '' }).email;
|
|
64
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
60
65
|
var reMapFlowData = function (flows) {
|
|
61
66
|
if (flows === void 0) { flows = []; }
|
|
62
67
|
var images = ICONS_NAMES;
|
|
@@ -79,6 +84,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
79
84
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
80
85
|
return {
|
|
81
86
|
name: name,
|
|
87
|
+
status: status,
|
|
82
88
|
title: title,
|
|
83
89
|
href: url,
|
|
84
90
|
src: images[src],
|
|
@@ -96,6 +102,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
96
102
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
97
103
|
reMapFlowData(flows);
|
|
98
104
|
}, [flows, isAr]);
|
|
99
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons,
|
|
105
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
106
|
+
flowName: data.flowName,
|
|
107
|
+
email: email,
|
|
108
|
+
emailUrl: url
|
|
109
|
+
} }) })] }));
|
|
100
110
|
};
|
|
101
111
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -19,9 +19,9 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
20
|
import { FeatureContainer } from '../shared/Containers';
|
|
21
21
|
import { getParameterByName, reactElement } from '../../utils';
|
|
22
|
-
import { PASSWORD_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { PASSWORD_OPERATION_TYPE, PASSWORD_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { passwordFeatureScreens } from '../featuresScreens';
|
|
24
|
-
import { passwordSelector, verifyLeadToken } from '../app/password/passwordStore';
|
|
24
|
+
import { passwordSelector, verifyLeadToken, verifyOperationToken } from '../app/password/passwordStore';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
26
|
import Background from '../shared/Background';
|
|
27
27
|
var Password = memo(function (props) {
|
|
@@ -29,25 +29,31 @@ var Password = memo(function (props) {
|
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
31
|
var _b = useAppSelector(passwordSelector), customLoading = _b.customLoading, passwordError = _b.error;
|
|
32
|
-
|
|
32
|
+
useAppConfig(__assign({ navigation: PASSWORD_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(passwordError || error);
|
|
34
34
|
useStepStartedListener();
|
|
35
35
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
36
36
|
var verifyToken = function () {
|
|
37
37
|
var token = getParameterByName('token');
|
|
38
38
|
var lang = getParameterByName('lang');
|
|
39
|
+
var operationType = getParameterByName('operation_type');
|
|
40
|
+
var leadId = getParameterByName('lead_id') || '';
|
|
39
41
|
if (!token)
|
|
40
42
|
throw new Error('Auth token is not found!');
|
|
41
43
|
if (!lang)
|
|
42
44
|
throw new Error('Language is not found!');
|
|
43
45
|
dispatch(handleLanguage(lang));
|
|
46
|
+
if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
|
|
47
|
+
dispatch(verifyOperationToken({ token: token, leadId: leadId }));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
44
50
|
dispatch(verifyLeadToken(token));
|
|
45
51
|
};
|
|
46
52
|
useEffect(function () {
|
|
47
|
-
if (!
|
|
53
|
+
if (!settingLoading)
|
|
48
54
|
verifyToken();
|
|
49
|
-
}, [
|
|
50
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
55
|
+
}, [settingLoading]);
|
|
56
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
51
57
|
var Element = _a.element, name = _a.name;
|
|
52
58
|
var isActive = activeScreen.name === name;
|
|
53
59
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|