@tap-payments/auth-jsconnect 2.1.41-test → 2.1.42-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 +0 -4
- package/build/@types/form.d.ts +6 -3
- package/build/api/entity.d.ts +8 -0
- package/build/api/entity.js +15 -0
- package/build/api/index.d.ts +2 -6
- package/build/api/index.js +1 -3
- package/build/api/lead.d.ts +0 -4
- package/build/assets/locales/ar.json +1 -5
- package/build/assets/locales/en.json +1 -7
- package/build/components/FileInput/DragAndDrop.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +1 -3
- package/build/components/ProgressBar/CircularProgressBar.js +2 -2
- package/build/constants/assets.d.ts +0 -1
- package/build/constants/assets.js +0 -1
- package/build/constants/validation.d.ts +0 -1
- package/build/constants/validation.js +0 -1
- package/build/features/app/bank/bankStore.js +1 -1
- package/build/features/app/business/businessStore.d.ts +9 -7
- package/build/features/app/business/businessStore.js +67 -29
- package/build/features/app/connect/connectStore.d.ts +1 -1
- package/build/features/app/connect/connectStore.js +29 -66
- package/build/features/app/individual/individualStore.d.ts +16 -4
- package/build/features/app/individual/individualStore.js +89 -11
- package/build/features/business/screens/BusinessType/Article.js +13 -10
- package/build/features/business/screens/BusinessType/BusinessType.js +4 -2
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +50 -12
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +11 -1
- package/build/features/connect/screens/Merchant/BrandList.js +2 -15
- package/build/features/connect/screens/Merchant/Merchant.js +5 -24
- package/build/features/connect/screens/Merchant/validation.d.ts +0 -6
- package/build/features/connect/screens/Merchant/validation.js +1 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -18
- package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +62 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +59 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +12 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +23 -2
- package/build/features/shared/UploadFile/UploadFile.js +1 -1
- package/build/theme/typography.js +1 -1
- package/package.json +1 -1
- package/build/api/file.d.ts +0 -13
- package/build/api/file.js +0 -24
- package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
- package/build/features/connect/screens/Merchant/Segments.js +0 -79
- package/build/features/connect/screens/Merchant/TeamSize.d.ts +0 -8
- package/build/features/connect/screens/Merchant/TeamSize.js +0 -79
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +0 -38
- package/build/features/shared/UploadMultipleFile/UploadFile.js +0 -184
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +0 -27
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +0 -147
- package/build/features/shared/UploadMultipleFile/index.d.ts +0 -2
- package/build/features/shared/UploadMultipleFile/index.js +0 -2
|
@@ -21,13 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { connectSelector } from '../../../app/connect/connectStore';
|
|
25
24
|
import * as React from 'react';
|
|
26
25
|
import { useTranslation } from 'react-i18next';
|
|
27
26
|
import { useFormContext, useController } from 'react-hook-form';
|
|
28
27
|
import Box from '@mui/material/Box';
|
|
29
28
|
import { styled } from '@mui/material/styles';
|
|
30
|
-
import {
|
|
29
|
+
import { useLanguage } from '../../../../hooks';
|
|
31
30
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
32
31
|
import Input from '../../../shared/Input';
|
|
33
32
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
@@ -53,9 +52,7 @@ var BrandList = function (_a) {
|
|
|
53
52
|
var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
54
53
|
var t = useTranslation().t;
|
|
55
54
|
var isAr = useLanguage().isAr;
|
|
56
|
-
var
|
|
57
|
-
var _c = data.individualData.responseBody || {}, segments_list = _c.segments_list, team_size_list = _c.team_size_list;
|
|
58
|
-
var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
|
|
55
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
59
56
|
var selectedBrandControl = useController({ control: control, name: 'selectedBrandItem' });
|
|
60
57
|
var selectedBrand = selectedBrandControl.field.value;
|
|
61
58
|
var onOpenBrandList = function (event) {
|
|
@@ -87,16 +84,6 @@ var BrandList = function (_a) {
|
|
|
87
84
|
setValue('salesChannels', [], { shouldValidate: true });
|
|
88
85
|
setValue('brandName', '');
|
|
89
86
|
}
|
|
90
|
-
setValue('segment', segments_list.find(function (_a) {
|
|
91
|
-
var _b;
|
|
92
|
-
var id = _a.id;
|
|
93
|
-
return ((_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.type) === id;
|
|
94
|
-
}), { shouldValidate: true });
|
|
95
|
-
setValue('teamSize', team_size_list.find(function (_a) {
|
|
96
|
-
var _b;
|
|
97
|
-
var id = _a.id;
|
|
98
|
-
return ((_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.team) === id;
|
|
99
|
-
}), { shouldValidate: true });
|
|
100
87
|
onCloseBrandList();
|
|
101
88
|
};
|
|
102
89
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), readOnly: true, onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', list: list, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import TeamSize from '../../../connect/screens/Merchant/TeamSize';
|
|
14
13
|
import * as React from 'react';
|
|
15
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
@@ -28,47 +27,34 @@ import BrandName from './BrandName';
|
|
|
28
27
|
import TAC from './TAC';
|
|
29
28
|
import BrandList from './BrandList';
|
|
30
29
|
import SalesChannels from './SalesChannels';
|
|
31
|
-
import Segments from './Segments';
|
|
32
|
-
var ListType;
|
|
33
|
-
(function (ListType) {
|
|
34
|
-
ListType["SegmentsList"] = "SegmentsList";
|
|
35
|
-
ListType["TeamSizeList"] = "TeamSizeList";
|
|
36
|
-
})(ListType || (ListType = {}));
|
|
37
30
|
var Merchant = function (_a) {
|
|
38
31
|
var _b;
|
|
39
32
|
var _c = React.useState(false), brandNameChecking = _c[0], setBrandNameChecking = _c[1];
|
|
40
33
|
var _d = React.useState(false), isBrandListOpen = _d[0], setIsBrandListOpen = _d[1];
|
|
41
34
|
var _e = React.useState(false), isRequiredNewBrand = _e[0], setIsRequiredNewBrand = _e[1];
|
|
42
35
|
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
|
|
36
|
+
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels;
|
|
44
37
|
var brandList = (responseBody || {}).brand_list;
|
|
45
|
-
var _h = React.useState(), listActive = _h[0], setListActive = _h[1];
|
|
46
38
|
var methods = useForm({
|
|
47
39
|
resolver: yupResolver(MerchantValidationSchema(isRequiredNewBrand)),
|
|
48
40
|
defaultValues: {
|
|
49
41
|
brandName: brandName,
|
|
50
42
|
selectedBrandItem: selectedBrandItem,
|
|
51
43
|
termAndConditionChecked: termAndConditionChecked,
|
|
52
|
-
salesChannels: salesChannels
|
|
53
|
-
segment: segment,
|
|
54
|
-
teamSize: teamSize
|
|
44
|
+
salesChannels: salesChannels
|
|
55
45
|
},
|
|
56
46
|
mode: 'onChange'
|
|
57
47
|
});
|
|
58
48
|
var t = useTranslation().t;
|
|
59
49
|
var isAr = useLanguage().isAr;
|
|
60
50
|
var dispatch = useAppDispatch();
|
|
61
|
-
var brandListItem = methods.
|
|
51
|
+
var brandListItem = methods.watch('selectedBrandItem');
|
|
62
52
|
var onSubmit = function (formData) {
|
|
63
53
|
dispatch(updateLeadBrand(__assign(__assign({}, formData), { isNewBrand: isRequiredNewBrand })));
|
|
64
54
|
};
|
|
65
55
|
var onBack = function () {
|
|
66
56
|
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
67
57
|
};
|
|
68
|
-
React.useEffect(function () {
|
|
69
|
-
methods.setValue('segment', segment, { shouldValidate: true });
|
|
70
|
-
methods.setValue('teamSize', teamSize, { shouldValidate: true });
|
|
71
|
-
}, [segment, teamSize]);
|
|
72
58
|
React.useEffect(function () {
|
|
73
59
|
if (error)
|
|
74
60
|
dispatch(clearError());
|
|
@@ -81,7 +67,7 @@ var Merchant = function (_a) {
|
|
|
81
67
|
if (termAndConditionChecked === true)
|
|
82
68
|
methods.setValue('termAndConditionChecked', termAndConditionChecked);
|
|
83
69
|
}, [termAndConditionChecked]);
|
|
84
|
-
var brandErrChecks = !!
|
|
70
|
+
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
85
71
|
var disabled = brandErrChecks || brandNameChecking || ((_b = data.brandData.responseBody) === null || _b === void 0 ? void 0 : _b.response_code) === '5';
|
|
86
72
|
var hasBrandList = (brandList === null || brandList === void 0 ? void 0 : brandList.length) > 0;
|
|
87
73
|
var isOtherBrand = (brandListItem === null || brandListItem === void 0 ? void 0 : brandListItem.id) === 'other' && hasBrandList;
|
|
@@ -89,11 +75,6 @@ var Merchant = function (_a) {
|
|
|
89
75
|
React.useEffect(function () {
|
|
90
76
|
setIsRequiredNewBrand(isOtherBrand || isNewBrand);
|
|
91
77
|
}, [isOtherBrand, isNewBrand]);
|
|
92
|
-
|
|
93
|
-
setListActive(flag);
|
|
94
|
-
};
|
|
95
|
-
var isSegmentsListActive = listActive === ListType.SegmentsList;
|
|
96
|
-
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
97
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: !(isOtherBrand || isNewBrand), list: brandList, onListOpen: function () { return setIsBrandListOpen(true); }, onListClose: function () { return setIsBrandListOpen(false); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !isBrandListOpen, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Segments, { show: !isTeamSizeListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentsList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { show: !isSegmentsListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !isBrandListOpen }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !isBrandListOpen }), _jsx(Collapse, __assign({ in: !isBrandListOpen, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
78
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: !(isOtherBrand || isNewBrand), list: brandList, onListOpen: function () { return setIsBrandListOpen(true); }, onListClose: function () { return setIsBrandListOpen(false); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !isBrandListOpen, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Collapse, __assign({ in: !isBrandListOpen }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !isBrandListOpen }), _jsx(Collapse, __assign({ in: !isBrandListOpen, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
98
79
|
};
|
|
99
80
|
export default React.memo(Merchant);
|
|
@@ -9,8 +9,6 @@ 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
|
-
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
|
-
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>>;
|
|
14
12
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
13
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
14
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -21,8 +19,6 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
21
19
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
20
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
21
|
}>>[] | undefined>;
|
|
24
|
-
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
|
-
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>>;
|
|
26
22
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
27
23
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
24
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -33,6 +29,4 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
33
29
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
34
30
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
35
31
|
}>>[] | undefined>;
|
|
36
|
-
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
|
-
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>>;
|
|
38
32
|
}>>>;
|
|
@@ -86,8 +86,6 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
86
86
|
})
|
|
87
87
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
88
88
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
89
|
-
segment: yup.object().required('alert_choose_segment'),
|
|
90
|
-
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
91
89
|
salesChannels: yup
|
|
92
90
|
.array()
|
|
93
91
|
.min(1, 'choose_atleast_one_channel')
|
|
@@ -127,8 +125,6 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
127
125
|
return this.createError({ message: result });
|
|
128
126
|
}
|
|
129
127
|
})
|
|
130
|
-
.required('choose_atleast_one_channel')
|
|
131
|
-
segment: yup.object().required('alert_choose_segment'),
|
|
132
|
-
teamSize: yup.object().required('alert_choose_teamSize')
|
|
128
|
+
.required('choose_atleast_one_channel')
|
|
133
129
|
});
|
|
134
130
|
};
|
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -48,27 +48,14 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
48
48
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
49
49
|
var countries = settingsData.countries;
|
|
50
50
|
var user = (data.verify.responseBody || {}).user;
|
|
51
|
-
var _c = data.individualData, occupation = _c.occupation, sourceIncome = _c.sourceIncome, monthlyIncome = _c.monthlyIncome, employerName = _c.employerName, employerLocation = _c.employerLocation, isPEP = _c.isPEP, isInfluencer = _c.isInfluencer, civilID = _c.civilID, signatureFileId = _c.signatureFileId, civilIDUploading = _c.civilIDUploading, signatureFileUploading = _c.signatureFileUploading;
|
|
52
51
|
var methods = useForm({
|
|
53
52
|
resolver: yupResolver(IndividualInfoValidationSchema),
|
|
54
|
-
defaultValues:
|
|
55
|
-
occupation: occupation,
|
|
56
|
-
sourceIncome: sourceIncome,
|
|
57
|
-
monthlyIncome: monthlyIncome,
|
|
58
|
-
employerName: employerName,
|
|
59
|
-
employerLocation: employerLocation,
|
|
60
|
-
isPEP: isPEP,
|
|
61
|
-
isInfluencer: isInfluencer,
|
|
62
|
-
civilID: civilID,
|
|
63
|
-
signatureFileId: signatureFileId,
|
|
64
|
-
civilIDUploading: civilIDUploading,
|
|
65
|
-
signatureFileUploading: signatureFileUploading
|
|
66
|
-
},
|
|
53
|
+
defaultValues: data.individualData,
|
|
67
54
|
mode: 'onChange'
|
|
68
55
|
});
|
|
69
56
|
useSetFromDefaultValues(methods, data.individualData, true);
|
|
70
|
-
var
|
|
71
|
-
var
|
|
57
|
+
var _c = React.useState(), listActive = _c[0], setListActive = _c[1];
|
|
58
|
+
var _d = React.useState(false), employerFieldsActive = _d[0], setEmployerFieldsActive = _d[1];
|
|
72
59
|
React.useEffect(function () {
|
|
73
60
|
var _a, _b;
|
|
74
61
|
if (((_b = (_a = methods.getValues('sourceIncome')) === null || _a === void 0 ? void 0 : _a.name.en) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'salary')
|
|
@@ -89,8 +76,7 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
89
76
|
var isEmployerLocationListActive = listActive === ListType.EmployerLocationList;
|
|
90
77
|
var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
|
|
91
78
|
var isOccupationListActive = listActive === ListType.OccupationList;
|
|
92
|
-
|
|
93
|
-
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 && employerFieldsActive && !isMonthlyIncomeListActive && !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, {}), _jsx(SignatureFile, { show: user === null || user === void 0 ? void 0 : user.is_authorized })] })), _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, disableBack: true, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
79
|
+
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 && employerFieldsActive && !isMonthlyIncomeListActive && !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, {}), _jsx(SignatureFile, { show: user === null || user === void 0 ? void 0 : user.is_authorized })] })), _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, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
94
80
|
};
|
|
95
81
|
export default React.memo(AdditionalIndividualInfo);
|
|
96
82
|
AdditionalIndividualInfo.defaultProps = {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { ScreenContainer } from '../../../../features/shared/Containers';
|
|
3
4
|
import { styled } from '@mui/material/styles';
|
|
4
5
|
import { useTranslation } from 'react-i18next';
|
|
5
6
|
import { useController, useFormContext } from 'react-hook-form';
|
|
6
7
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
8
|
+
import { individualSelector, uploadCivilIdFile } from '../../../../features/app/individual/individualStore';
|
|
9
|
+
import { MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
|
|
10
|
+
import UploadFile from '../../../../features/shared/UploadFile';
|
|
11
|
+
import { maskFileName } from '../../../../utils';
|
|
9
12
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
10
13
|
var theme = _a.theme;
|
|
11
14
|
return ({
|
|
@@ -13,18 +16,66 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
13
16
|
});
|
|
14
17
|
});
|
|
15
18
|
var CivilIDFile = function () {
|
|
16
|
-
var _a;
|
|
19
|
+
var _a, _b;
|
|
20
|
+
var _c = React.useState(0), progress = _c[0], setProgress = _c[1];
|
|
17
21
|
var t = useTranslation().t;
|
|
18
|
-
var
|
|
19
|
-
var
|
|
22
|
+
var _d = useFormContext(), control = _d.control, setError = _d.setError, clearErrors = _d.clearErrors, setValue = _d.setValue;
|
|
23
|
+
var civilIDFileControl = useController({ name: 'civilIDFile', control: control });
|
|
20
24
|
var civilIDFileIdControl = useController({ name: 'civilID', control: control });
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
25
|
+
var _e = useAppSelector(individualSelector), data = _e.data, loading = _e.loading, sysError = _e.error;
|
|
26
|
+
var _f = data.attachmentsData, civilIDUploading = _f.civilIDUploading, civilIDFile = _f.civilIDFile, civilID = _f.civilID;
|
|
27
|
+
var dispatch = useAppDispatch();
|
|
28
|
+
var civilIDValue = civilIDFileControl.field.value;
|
|
29
|
+
var error = ((_a = civilIDFileControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || ((_b = civilIDFileIdControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message);
|
|
30
|
+
var handleCivilIDChange = function (files) {
|
|
31
|
+
var _a;
|
|
32
|
+
var file = files === null || files === void 0 ? void 0 : files[0];
|
|
33
|
+
if (!VALID_FILE_FORMATS.includes(file === null || file === void 0 ? void 0 : file.type)) {
|
|
34
|
+
setError('civilIDFile', { message: 'file_not_supported_alert' });
|
|
35
|
+
}
|
|
36
|
+
else if ((file === null || file === void 0 ? void 0 : file.size) > MAX_FILE_SIZE) {
|
|
37
|
+
setError('civilIDFile', { message: 'file_size_alert' });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
civilIDFileControl.field.onChange(file);
|
|
41
|
+
dispatch(uploadCivilIdFile({
|
|
42
|
+
file: file,
|
|
43
|
+
onProgress: function (value) {
|
|
44
|
+
setProgress(value);
|
|
45
|
+
},
|
|
46
|
+
title: (_a = data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.merchant_id
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
24
49
|
};
|
|
25
|
-
var handleReset = function (
|
|
26
|
-
|
|
50
|
+
var handleReset = function () {
|
|
51
|
+
civilIDFileControl.field.onChange(null);
|
|
52
|
+
civilIDFileIdControl.field.onChange('');
|
|
53
|
+
setProgress(0);
|
|
27
54
|
};
|
|
28
|
-
|
|
55
|
+
React.useEffect(function () {
|
|
56
|
+
if (!!civilIDFile) {
|
|
57
|
+
setValue('civilIDFile', civilIDFile);
|
|
58
|
+
setValue('civilID', civilID);
|
|
59
|
+
}
|
|
60
|
+
}, [civilIDFile, civilID]);
|
|
61
|
+
React.useEffect(function () {
|
|
62
|
+
if (sysError === 'file_upload_error') {
|
|
63
|
+
setError('civilIDFileId', { message: sysError });
|
|
64
|
+
civilIDFileControl.field.onChange(null);
|
|
65
|
+
setProgress(0);
|
|
66
|
+
}
|
|
67
|
+
}, [sysError]);
|
|
68
|
+
React.useEffect(function () {
|
|
69
|
+
if ((civilIDFileControl.formState.isValid || !!civilIDValue) && error != 'file_upload_error')
|
|
70
|
+
clearErrors();
|
|
71
|
+
}, [civilIDFileControl.formState.isValid, civilIDValue]);
|
|
72
|
+
React.useEffect(function () {
|
|
73
|
+
if (!!civilIDFile) {
|
|
74
|
+
civilIDFileControl.field.onChange(civilIDFile);
|
|
75
|
+
civilIDFileIdControl.field.onChange(civilID);
|
|
76
|
+
}
|
|
77
|
+
}, []);
|
|
78
|
+
var fileName = civilIDValue ? maskFileName(civilIDValue === null || civilIDValue === void 0 ? void 0 : civilIDValue.name) : '';
|
|
79
|
+
return (_jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isFileUploaded: !civilIDUploading && !!civilIDValue, isSubmitting: loading, isUploading: civilIDUploading, progress: progress, onReset: handleReset, initialFileName: fileName, error: error && t(error) }) }));
|
|
29
80
|
};
|
|
30
81
|
export default CivilIDFile;
|
|
@@ -10,14 +10,17 @@ 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 React from 'react';
|
|
14
|
+
import { ScreenContainer } from '../../../../features/shared/Containers';
|
|
15
|
+
import { styled } from '@mui/material/styles';
|
|
13
16
|
import { useTranslation } from 'react-i18next';
|
|
14
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
19
|
+
import { individualSelector, uploadSignatureFile } from '../../../../features/app/individual/individualStore';
|
|
20
|
+
import { MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
|
|
21
|
+
import UploadFile from '../../../../features/shared/UploadFile';
|
|
20
22
|
import Collapse from '../../../../components/Collapse';
|
|
23
|
+
import { maskFileName } from '../../../../utils';
|
|
21
24
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
22
25
|
var theme = _a.theme;
|
|
23
26
|
return ({
|
|
@@ -25,18 +28,63 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
25
28
|
});
|
|
26
29
|
});
|
|
27
30
|
var SignatureFile = function (_a) {
|
|
31
|
+
var _b, _c;
|
|
28
32
|
var show = _a.show;
|
|
33
|
+
var _d = React.useState(0), progress = _d[0], setProgress = _d[1];
|
|
29
34
|
var t = useTranslation().t;
|
|
30
|
-
var
|
|
35
|
+
var _e = useFormContext(), control = _e.control, setError = _e.setError, clearErrors = _e.clearErrors, setValue = _e.setValue;
|
|
36
|
+
var signatureFileControl = useController({ name: 'signatureFile', control: control });
|
|
31
37
|
var signatureFileIdControl = useController({ name: 'signatureFileId', control: control });
|
|
32
|
-
var
|
|
38
|
+
var _f = useAppSelector(individualSelector), data = _f.data, loading = _f.loading, sysError = _f.error;
|
|
39
|
+
var _g = data.attachmentsData, signatureFileUploading = _g.signatureFileUploading, signatureFile = _g.signatureFile, signatureFileId = _g.signatureFileId;
|
|
33
40
|
var dispatch = useAppDispatch();
|
|
34
|
-
var
|
|
35
|
-
|
|
41
|
+
var signatureValue = signatureFileControl.field.value;
|
|
42
|
+
var error = ((_b = signatureFileControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message) || ((_c = signatureFileIdControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message);
|
|
43
|
+
var handleSignatureChange = function (files) {
|
|
44
|
+
var file = files === null || files === void 0 ? void 0 : files[0];
|
|
45
|
+
if (!VALID_FILE_FORMATS.includes(file === null || file === void 0 ? void 0 : file.type)) {
|
|
46
|
+
setError('signatureFile', { message: 'file_not_supported_alert' });
|
|
47
|
+
}
|
|
48
|
+
else if ((file === null || file === void 0 ? void 0 : file.size) > MAX_FILE_SIZE) {
|
|
49
|
+
setError('signatureFile', { message: 'file_size_alert' });
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
signatureFileControl.field.onChange(file);
|
|
53
|
+
dispatch(uploadSignatureFile({
|
|
54
|
+
file: file,
|
|
55
|
+
onProgress: function (value) {
|
|
56
|
+
setProgress(value);
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
36
60
|
};
|
|
37
|
-
var handleReset = function (
|
|
38
|
-
|
|
61
|
+
var handleReset = function () {
|
|
62
|
+
signatureFileControl.field.onChange(null);
|
|
63
|
+
signatureFileIdControl.field.onChange('');
|
|
64
|
+
setProgress(0);
|
|
39
65
|
};
|
|
40
|
-
|
|
66
|
+
React.useEffect(function () {
|
|
67
|
+
if (sysError === 'file_upload_error') {
|
|
68
|
+
setError('signatureFileId', { message: sysError });
|
|
69
|
+
signatureFileControl.field.onChange(null);
|
|
70
|
+
setProgress(0);
|
|
71
|
+
}
|
|
72
|
+
}, [sysError]);
|
|
73
|
+
React.useEffect(function () {
|
|
74
|
+
if ((signatureFileControl.formState.isValid || !!signatureValue) && error != 'file_upload_error')
|
|
75
|
+
clearErrors();
|
|
76
|
+
}, [signatureFileControl.formState.isValid, signatureValue]);
|
|
77
|
+
React.useEffect(function () {
|
|
78
|
+
if (!!signatureFile) {
|
|
79
|
+
setValue('signatureFile', signatureFile);
|
|
80
|
+
setValue('signatureFileId', signatureFileId);
|
|
81
|
+
}
|
|
82
|
+
}, [signatureFile, signatureFileId]);
|
|
83
|
+
React.useEffect(function () {
|
|
84
|
+
if (!!signatureValue)
|
|
85
|
+
signatureFileControl.field.onChange(signatureFile);
|
|
86
|
+
}, []);
|
|
87
|
+
var fileName = signatureValue ? maskFileName(signatureValue === null || signatureValue === void 0 ? void 0 : signatureValue.name) : '';
|
|
88
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_signature_file'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_signature'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_signature_file'), onFileUploaded: handleSignatureChange, isFileUploaded: !signatureFileUploading && !!signatureValue, isSubmitting: loading, initialFileName: fileName, isUploading: signatureFileUploading, progress: progress, onReset: handleReset, error: error && t(error) }) }) })));
|
|
41
89
|
};
|
|
42
90
|
export default SignatureFile;
|
|
@@ -6,8 +6,10 @@ export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yu
|
|
|
6
6
|
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
7
7
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
8
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>>>>>;
|
|
9
|
-
civilID: yup.
|
|
10
|
-
|
|
9
|
+
civilID: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
10
|
+
civilIDFile: any;
|
|
11
|
+
signatureFileId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
12
|
+
signatureFile: any;
|
|
11
13
|
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
12
14
|
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
13
15
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
@@ -15,8 +17,10 @@ export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yu
|
|
|
15
17
|
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
16
18
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
17
19
|
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>>>>>;
|
|
18
|
-
civilID: yup.
|
|
19
|
-
|
|
20
|
+
civilID: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
+
civilIDFile: any;
|
|
22
|
+
signatureFileId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
23
|
+
signatureFile: any;
|
|
20
24
|
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
21
25
|
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
22
26
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
@@ -24,8 +28,10 @@ export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yu
|
|
|
24
28
|
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
25
29
|
monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
26
30
|
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>>>>>;
|
|
27
|
-
civilID: yup.
|
|
28
|
-
|
|
31
|
+
civilID: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
32
|
+
civilIDFile: any;
|
|
33
|
+
signatureFileId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
34
|
+
signatureFile: any;
|
|
29
35
|
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
30
36
|
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
31
37
|
}>>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
+
import { MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
|
|
2
3
|
export var IndividualInfoValidationSchema = yup.object().shape({
|
|
3
4
|
occupation: yup.object().required('alert_choose_occupation'),
|
|
4
5
|
sourceIncome: yup.object().required('choose_any_source_of_income'),
|
|
@@ -19,8 +20,28 @@ export var IndividualInfoValidationSchema = yup.object().shape({
|
|
|
19
20
|
return yup.object().optional();
|
|
20
21
|
}
|
|
21
22
|
}),
|
|
22
|
-
civilID: yup.
|
|
23
|
-
|
|
23
|
+
civilID: yup.string().optional(),
|
|
24
|
+
civilIDFile: yup
|
|
25
|
+
.mixed()
|
|
26
|
+
.test({
|
|
27
|
+
test: function (value) {
|
|
28
|
+
if (!!value)
|
|
29
|
+
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE ? true : this.createError({ message: 'alert_file_upload' });
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
signatureFileId: yup.string().optional(),
|
|
35
|
+
signatureFile: yup
|
|
36
|
+
.mixed()
|
|
37
|
+
.test({
|
|
38
|
+
test: function (value) {
|
|
39
|
+
if (!!value)
|
|
40
|
+
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE ? true : this.createError({ message: 'alert_file_upload' });
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.optional(),
|
|
24
45
|
isPEP: yup.boolean().required('please_choose_relative_pep'),
|
|
25
46
|
isInfluencer: yup.boolean().required('please_choose_are_you_influncer')
|
|
26
47
|
});
|
|
@@ -86,6 +86,6 @@ var UploadFile = function (_a) {
|
|
|
86
86
|
else
|
|
87
87
|
setShowFile(false);
|
|
88
88
|
}, [isFileUploaded]);
|
|
89
|
-
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !showFile
|
|
89
|
+
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !showFile }, { children: _jsx(InputContainerStyled, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: !!fileName, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: progress, uploading: isUploading, uploadSuccess: isFileUploaded, onSuccess: handleFileChange, error: error, multiple: multiple }) }) })), _jsx(Collapse, __assign({ in: showFile, timeout: 300 }, { children: _jsxs(InputContainerStyled, { children: [_jsxs(BoxStyled, { children: [_jsxs(Box, __assign({ sx: { display: 'flex' } }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: fileName })] })), _jsx(Box, { children: _jsx(CheckIcon, {}) })] }), _jsx(UploadBoxStyled, __assign({ onClick: handleReset }, { children: _jsx(ClearIconStyled, {}) }))] }) }))] }));
|
|
90
90
|
};
|
|
91
91
|
export default UploadFile;
|
package/package.json
CHANGED
package/build/api/file.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
export declare type UploadFileBody = {
|
|
3
|
-
file_link_create: boolean;
|
|
4
|
-
file?: File;
|
|
5
|
-
title: string | undefined;
|
|
6
|
-
purpose: string;
|
|
7
|
-
type?: string;
|
|
8
|
-
};
|
|
9
|
-
declare const fileService: {
|
|
10
|
-
uploadFile: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
11
|
-
uploadFileInfo: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
12
|
-
};
|
|
13
|
-
export { fileService };
|
package/build/api/file.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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 { ENDPOINT_PATHS } from '../constants';
|
|
13
|
-
import instance, { httpClient } from './axios';
|
|
14
|
-
var uploadFileInfo = function (data, config) {
|
|
15
|
-
return httpClient(__assign({ method: 'post', url: "".concat(ENDPOINT_PATHS.FILES_PATH), data: data, headers: { 'Content-Type': 'multipart/form-data' } }, config));
|
|
16
|
-
};
|
|
17
|
-
var uploadFile = function (data, config) {
|
|
18
|
-
return instance.post("".concat(ENDPOINT_PATHS.FILES_PATH), data, __assign({ headers: { 'Content-Type': 'multipart/form-data' } }, config));
|
|
19
|
-
};
|
|
20
|
-
var fileService = {
|
|
21
|
-
uploadFile: uploadFile,
|
|
22
|
-
uploadFileInfo: uploadFileInfo
|
|
23
|
-
};
|
|
24
|
-
export { fileService };
|