@tap-payments/auth-jsconnect 2.3.75-test → 2.3.80-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 +8 -0
- package/build/@types/form.d.ts +2 -1
- package/build/@types/redux.d.ts +4 -0
- package/build/api/index.d.ts +1 -0
- package/build/api/individual.d.ts +1 -0
- package/build/api/individual.js +15 -1
- package/build/api/lead.d.ts +1 -0
- package/build/assets/locales/ar.json +5 -1
- package/build/assets/locales/en.json +5 -1
- package/build/constants/app.js +9 -9
- package/build/constants/dummy.d.ts +8 -0
- package/build/constants/dummy.js +8 -0
- package/build/features/app/bank/bankStore.d.ts +2 -2
- package/build/features/app/bank/bankStore.js +54 -51
- package/build/features/app/business/businessStore.js +3 -4
- package/build/features/app/connect/connectStore.js +67 -35
- package/build/features/app/password/passwordStore.d.ts +2 -0
- package/build/features/app/password/passwordStore.js +24 -12
- package/build/features/bank/screens/BankDetails/BankDetails.js +7 -6
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +3 -11
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/connect/screens/Merchant/BusinessList.d.ts +10 -0
- package/build/features/connect/screens/Merchant/BusinessList.js +82 -0
- package/build/features/connect/screens/Merchant/Merchant.js +11 -6
- package/build/features/connect/screens/Merchant/validation.d.ts +7 -1
- package/build/features/connect/screens/Merchant/validation.js +6 -2
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/password/screens/Verify/Verify.js +7 -20
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
- package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +3 -1
- package/package.json +1 -1
|
@@ -29,29 +29,33 @@ import TAC from './TAC';
|
|
|
29
29
|
import BrandList from './BrandList';
|
|
30
30
|
import SalesChannels from './SalesChannels';
|
|
31
31
|
import Segments from './Segments';
|
|
32
|
+
import BusinessList from './BusinessList';
|
|
32
33
|
var ListType;
|
|
33
34
|
(function (ListType) {
|
|
34
35
|
ListType["SegmentsList"] = "SegmentsList";
|
|
35
36
|
ListType["TeamSizeList"] = "TeamSizeList";
|
|
36
37
|
ListType["BrandList"] = "BrandList";
|
|
38
|
+
ListType["BusinessList"] = "BusinessList";
|
|
37
39
|
})(ListType || (ListType = {}));
|
|
38
40
|
var Merchant = function (_a) {
|
|
39
41
|
var _b, _c;
|
|
40
42
|
var _d = React.useState(false), brandNameChecking = _d[0], setBrandNameChecking = _d[1];
|
|
41
43
|
var _e = React.useState(false), isRequiredNewBrand = _e[0], setIsRequiredNewBrand = _e[1];
|
|
42
44
|
var _f = useAppSelector(connectSelector), data = _f.data, loading = _f.loading, error = _f.error;
|
|
43
|
-
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels, segment = _g.segment, teamSize = _g.teamSize;
|
|
44
|
-
var
|
|
45
|
-
var
|
|
45
|
+
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels, segment = _g.segment, teamSize = _g.teamSize, business = _g.business;
|
|
46
|
+
var _h = responseBody || {}, brandList = _h.brand_list, businessList = _h.business_list;
|
|
47
|
+
var _j = React.useState(), listActive = _j[0], setListActive = _j[1];
|
|
48
|
+
var hasBusinessList = (businessList === null || businessList === void 0 ? void 0 : businessList.length) > 0;
|
|
46
49
|
var methods = useForm({
|
|
47
|
-
resolver: yupResolver(MerchantValidationSchema(isRequiredNewBrand)),
|
|
50
|
+
resolver: yupResolver(MerchantValidationSchema(isRequiredNewBrand, hasBusinessList)),
|
|
48
51
|
defaultValues: {
|
|
49
52
|
brandName: brandName || ((_b = selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.name) === null || _b === void 0 ? void 0 : _b.en),
|
|
50
53
|
selectedBrandItem: selectedBrandItem,
|
|
51
54
|
termAndConditionChecked: termAndConditionChecked,
|
|
52
55
|
salesChannels: salesChannels,
|
|
53
56
|
segment: segment,
|
|
54
|
-
teamSize: teamSize
|
|
57
|
+
teamSize: teamSize,
|
|
58
|
+
business: business
|
|
55
59
|
},
|
|
56
60
|
mode: 'onChange'
|
|
57
61
|
});
|
|
@@ -97,6 +101,7 @@ var Merchant = function (_a) {
|
|
|
97
101
|
var isSegmentsListActive = listActive === ListType.SegmentsList;
|
|
98
102
|
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
99
103
|
var isBrandListActive = listActive === ListType.BrandList;
|
|
100
|
-
|
|
104
|
+
var isBusinessListActive = listActive === ListType.BusinessList;
|
|
105
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: hasBrandList && !isTeamSizeListActive && !isSegmentsListActive && !isBusinessListActive, list: brandList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BusinessList, { show: hasBusinessList && (isOtherBrand || isNewBrand) && !isTeamSizeListActive && !isSegmentsListActive && !isBrandListActive, list: businessList, onListOpen: function () { return handleMenuClick(ListType.BusinessList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Segments, { show: !isTeamSizeListActive && !isBrandListActive && !isBusinessListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentsList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { show: !isSegmentsListActive && !isBrandListActive && !isBusinessListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !listActive }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
101
106
|
};
|
|
102
107
|
export default React.memo(Merchant);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
2
|
+
export declare const MerchantValidationSchema: (isNewBrand?: boolean, hasBusinessList?: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
4
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
5
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -9,8 +9,10 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
9
9
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
10
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
11
|
}>>[] | undefined>;
|
|
12
|
+
business: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
12
13
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
13
14
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
15
|
+
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
16
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
17
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
18
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -21,8 +23,10 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
21
23
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
24
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
25
|
}>>[] | undefined>;
|
|
26
|
+
business: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
24
27
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
25
28
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
29
|
+
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
26
30
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
27
31
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
32
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -33,6 +37,8 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
33
37
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
34
38
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
35
39
|
}>>[] | undefined>;
|
|
40
|
+
business: import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
36
41
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
37
42
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
43
|
+
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
38
44
|
}>>>;
|
|
@@ -69,8 +69,9 @@ var validationSalesChannels = function (channels) {
|
|
|
69
69
|
}
|
|
70
70
|
return true;
|
|
71
71
|
};
|
|
72
|
-
export var MerchantValidationSchema = function (isNewBrand) {
|
|
72
|
+
export var MerchantValidationSchema = function (isNewBrand, hasBusinessList) {
|
|
73
73
|
if (isNewBrand === void 0) { isNewBrand = true; }
|
|
74
|
+
if (hasBusinessList === void 0) { hasBusinessList = false; }
|
|
74
75
|
if (isNewBrand)
|
|
75
76
|
return yup.object().shape({
|
|
76
77
|
brandName: yup
|
|
@@ -88,6 +89,7 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
88
89
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
89
90
|
segment: yup.object().required('alert_choose_segment'),
|
|
90
91
|
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
92
|
+
business: hasBusinessList ? yup.object().required('alert_choose_business') : yup.object().optional(),
|
|
91
93
|
salesChannels: yup
|
|
92
94
|
.array()
|
|
93
95
|
.min(1, 'choose_atleast_one_channel')
|
|
@@ -128,7 +130,9 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
128
130
|
}
|
|
129
131
|
})
|
|
130
132
|
.required('choose_atleast_one_channel'),
|
|
133
|
+
business: yup.object().optional(),
|
|
131
134
|
segment: yup.object().required('alert_choose_segment'),
|
|
132
|
-
teamSize: yup.object().required('alert_choose_teamSize')
|
|
135
|
+
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
136
|
+
brandName: yup.string().optional()
|
|
133
137
|
});
|
|
134
138
|
};
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
6
|
import { maskEmail } from '../../../../utils';
|
|
6
|
-
import { entitySelector } from '
|
|
7
|
-
import { useAppSelector } from '../../../../hooks';
|
|
7
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
8
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(entitySelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
6
|
import { maskEmail } from '../../../../utils';
|
|
6
7
|
import { individualSelector } from '../../../../features/app/individual/individualStore';
|
|
7
|
-
import { useAppSelector } from '../../../../hooks';
|
|
8
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(individualSelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
|
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -49,14 +38,18 @@ var CreatePassword = function (_a) {
|
|
|
49
38
|
var isAr = useLanguage().isAr;
|
|
50
39
|
var dispatch = useAppDispatch();
|
|
51
40
|
var _b = useSelector(passwordSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
52
|
-
var
|
|
53
|
-
var
|
|
41
|
+
var _c = data.verify, operationType = _c.operationType, responseBody = _c.responseBody;
|
|
42
|
+
var _d = data.passwordData, password = _d.password, confirmPassword = _d.confirmPassword;
|
|
43
|
+
var flows = (responseBody || {}).flows;
|
|
54
44
|
var methods = useForm({
|
|
55
45
|
resolver: yupResolver(PasswordValidation),
|
|
56
|
-
defaultValues:
|
|
46
|
+
defaultValues: {
|
|
47
|
+
password: password,
|
|
48
|
+
confirmPassword: confirmPassword
|
|
49
|
+
},
|
|
57
50
|
mode: 'onChange'
|
|
58
51
|
});
|
|
59
|
-
useSetFromDefaultValues(methods,
|
|
52
|
+
useSetFromDefaultValues(methods, data.passwordData);
|
|
60
53
|
var onSubmit = function (data) {
|
|
61
54
|
if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
|
|
62
55
|
dispatch(storePasswordScreen(data));
|
|
@@ -68,6 +61,6 @@ var CreatePassword = function (_a) {
|
|
|
68
61
|
var onBack = function () {
|
|
69
62
|
dispatch(handleCurrentActiveScreen('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
70
63
|
};
|
|
71
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr,
|
|
64
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: !(flows === null || flows === void 0 ? void 0 : flows.length), onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
72
65
|
};
|
|
73
66
|
export default React.memo(CreatePassword);
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { useAppSelector } from '../../../../hooks';
|
|
6
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
6
7
|
import { maskEmail } from '../../../../utils';
|
|
7
8
|
import { passwordSelector } from '../../../app/password/passwordStore';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(passwordSelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
|
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import * as React from 'react';
|
|
25
14
|
import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
|
|
@@ -28,7 +17,6 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
28
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
29
18
|
import Box from '@mui/material/Box/Box';
|
|
30
19
|
import { styled } from '@mui/material/styles';
|
|
31
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
32
20
|
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
33
21
|
import { maskPhone } from '../../../../utils';
|
|
34
22
|
import Form from '../../../../components/Form';
|
|
@@ -61,16 +49,18 @@ var VerifyNumber = function (_a) {
|
|
|
61
49
|
var _b, _c, _d;
|
|
62
50
|
var dispatch = useAppDispatch();
|
|
63
51
|
var _e = useAppSelector(passwordSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
64
|
-
var
|
|
52
|
+
var otp = data.otpData.otp;
|
|
65
53
|
var methods = useForm({
|
|
66
54
|
resolver: yupResolver(OTPValidation),
|
|
67
|
-
defaultValues:
|
|
55
|
+
defaultValues: {
|
|
56
|
+
otp: otp
|
|
57
|
+
},
|
|
68
58
|
mode: 'onChange'
|
|
69
59
|
});
|
|
70
|
-
useSetFromDefaultValues(methods,
|
|
60
|
+
useSetFromDefaultValues(methods, data.otpData);
|
|
71
61
|
var t = useTranslation().t;
|
|
72
62
|
var isAr = useLanguage().isAr;
|
|
73
|
-
var
|
|
63
|
+
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
74
64
|
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
75
65
|
React.useEffect(function () {
|
|
76
66
|
if (error && methods.formState.isValid && phone)
|
|
@@ -82,10 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
82
72
|
var onSubmit = function (formData) {
|
|
83
73
|
dispatch(verifyPasswordLeadOTP(formData));
|
|
84
74
|
};
|
|
85
|
-
var onBack = function () {
|
|
86
|
-
dispatch(handlePrevScreenStep());
|
|
87
|
-
};
|
|
88
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
89
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true,
|
|
76
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
90
77
|
};
|
|
91
78
|
export default React.memo(VerifyNumber);
|
|
@@ -7,6 +7,8 @@ export interface ThankYouProps {
|
|
|
7
7
|
loading?: boolean;
|
|
8
8
|
error?: string;
|
|
9
9
|
description?: string | React.ReactElement;
|
|
10
|
+
enableBack?: boolean;
|
|
11
|
+
onBack?: () => void;
|
|
10
12
|
}
|
|
11
|
-
declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error }: ThankYouProps) => JSX.Element>;
|
|
13
|
+
declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack }: ThankYouProps) => JSX.Element>;
|
|
12
14
|
export default _default;
|
|
@@ -15,6 +15,7 @@ import { styled } from '@mui/material/styles';
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
17
|
import Text from '../../../components/Text';
|
|
18
|
+
import Button from '../../../components/Button';
|
|
18
19
|
import Container from '../Containers/ScreenContainer';
|
|
19
20
|
import { EmailProvidersButton, SuccessButton } from '../../shared/Button';
|
|
20
21
|
import Icon from '../../../components/Icon';
|
|
@@ -54,9 +55,9 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
54
55
|
_b);
|
|
55
56
|
});
|
|
56
57
|
var ThankYou = function (_a) {
|
|
57
|
-
var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error;
|
|
58
|
+
var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack;
|
|
58
59
|
var t = useTranslation().t;
|
|
59
60
|
var isAr = useLanguage().isAr;
|
|
60
|
-
return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) }))] }));
|
|
61
|
+
return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] }));
|
|
61
62
|
};
|
|
62
63
|
export default React.memo(ThankYou);
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { useAppSelector } from '../../../../hooks';
|
|
6
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
6
7
|
import { maskEmail } from '../../../../utils';
|
|
7
|
-
import { taxSelector } from '
|
|
8
|
+
import { taxSelector } from '../../../app/tax/taxStore';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(taxSelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
declare type ReadOnly<TF, V> = {
|
|
3
|
+
[key in keyof TF]: V;
|
|
4
|
+
};
|
|
5
|
+
export declare const useExcludeReadOnlyFelids: <TF extends FieldValues = FieldValues>({ formState }: UseFormReturn<TF, any>, readOnly: ReadOnly<TF, boolean>) => {
|
|
6
|
+
getFelids: <T extends TF = TF>(data: T) => {
|
|
7
|
+
originalFormData: T;
|
|
8
|
+
formData: T;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { settingsSelector } from '../app/settings';
|
|
13
|
+
import { useAppSelector } from './useAppSelector';
|
|
14
|
+
export var useExcludeReadOnlyFelids = function (_a, readOnly) {
|
|
15
|
+
var formState = _a.formState;
|
|
16
|
+
var settingData = useAppSelector(settingsSelector).data;
|
|
17
|
+
var getFelids = function (data) {
|
|
18
|
+
if (settingData.boardMaturity !== false)
|
|
19
|
+
return { originalFormData: data, formData: data };
|
|
20
|
+
var object = {};
|
|
21
|
+
var objectCopy = __assign({}, data);
|
|
22
|
+
for (var key in data) {
|
|
23
|
+
if (readOnly[key] === true)
|
|
24
|
+
continue;
|
|
25
|
+
object[key] = data[key];
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
originalFormData: objectCopy,
|
|
29
|
+
formData: object
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
return { getFelids: getFelids };
|
|
33
|
+
};
|
package/build/utils/string.d.ts
CHANGED
|
@@ -69,5 +69,5 @@ export declare const getUserNameObject: (name: string) => {
|
|
|
69
69
|
last: string;
|
|
70
70
|
};
|
|
71
71
|
export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/png" | "image/jpg" | "application/pdf";
|
|
72
|
-
export declare const
|
|
72
|
+
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
73
73
|
export declare const isOtherLicense: (item?: License) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -298,7 +298,9 @@ export var getFileType = function (type) {
|
|
|
298
298
|
return '';
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
|
-
export var
|
|
301
|
+
export var isStringHasOneAsterisk = function (value) {
|
|
302
|
+
if (!value)
|
|
303
|
+
return false;
|
|
302
304
|
return value.includes('*') ? true : false;
|
|
303
305
|
};
|
|
304
306
|
export var isOtherLicense = function (item) {
|