@tap-payments/auth-jsconnect 2.10.20-development → 2.11.1-beta
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 +1 -2
- package/build/@types/app.js +0 -1
- package/build/@types/form.d.ts +0 -2
- package/build/@types/index.d.ts +0 -1
- package/build/@types/index.js +0 -1
- package/build/api/auth.d.ts +1 -9
- package/build/api/entity.d.ts +0 -3
- package/build/api/index.d.ts +1 -7
- package/build/api/index.js +1 -3
- package/build/api/lead.d.ts +0 -1
- package/build/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +1 -3
- package/build/app/store.d.ts +0 -2
- package/build/assets/locales/ar.json +16 -48
- package/build/assets/locales/en.json +45 -51
- package/build/components/OTPTimer/OTPTimer.d.ts +1 -2
- package/build/components/OTPTimer/OTPTimer.js +4 -4
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +3 -21
- package/build/constants/app.js +5 -122
- package/build/constants/flows.d.ts +0 -15
- package/build/constants/flows.js +0 -15
- package/build/constants/validation.d.ts +0 -2
- package/build/constants/validation.js +0 -2
- package/build/features/app/business/businessStore.js +10 -15
- package/build/features/app/connectExpress/connectExpressStore.js +3 -17
- package/build/features/app/individual/individualStore.js +1 -0
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/auth/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -13
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +5 -11
- package/build/features/business/screens/BusinessType/LicenseList.js +7 -15
- package/build/features/business/screens/BusinessType/validation.d.ts +3 -6
- package/build/features/business/screens/BusinessType/validation.js +10 -31
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +0 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +7 -23
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +3 -6
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +21 -57
- package/build/features/entity/screens/EntityName/EntityName.js +1 -2
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +3 -14
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +0 -67
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +0 -1
- package/build/features/shared/Button/FlowsButtons.js +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +4 -5
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +1 -3
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/index.d.ts +2 -3
- package/build/index.js +2 -4
- package/build/theme/palette.js +0 -12
- package/build/theme/typography.js +0 -4
- package/build/utils/common.js +4 -4
- package/build/utils/string.d.ts +1 -2
- package/build/utils/string.js +2 -11
- package/package.json +2 -2
- package/build/@types/terminal.d.ts +0 -116
- package/build/@types/terminal.js +0 -1
- package/build/api/terminal.d.ts +0 -28
- package/build/api/terminal.js +0 -45
- package/build/components/DeviceCard/DeviceCard.d.ts +0 -18
- package/build/components/DeviceCard/DeviceCard.js +0 -103
- package/build/components/DeviceCard/index.d.ts +0 -3
- package/build/components/DeviceCard/index.js +0 -2
- package/build/features/app/terminal/terminalStore.d.ts +0 -110
- package/build/features/app/terminal/terminalStore.js +0 -676
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +0 -35
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +0 -84
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +0 -36
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +0 -81
- package/build/features/shared/PushNotification/PushNotification.d.ts +0 -11
- package/build/features/shared/PushNotification/PushNotification.js +0 -34
- package/build/features/shared/PushNotification/index.d.ts +0 -2
- package/build/features/shared/PushNotification/index.js +0 -2
- package/build/features/terminal/Terminal.d.ts +0 -14
- package/build/features/terminal/Terminal.js +0 -95
- package/build/features/terminal/index.d.ts +0 -1
- package/build/features/terminal/index.js +0 -1
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +0 -3
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +0 -69
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +0 -2
- package/build/features/terminal/screens/LinkNewTerminal/index.js +0 -2
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +0 -10
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +0 -28
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +0 -3
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +0 -51
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +0 -2
- package/build/features/terminal/screens/LinkedSuccess/index.js +0 -2
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +0 -3
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +0 -55
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +0 -2
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +0 -2
- package/build/features/terminal/screens/Loading/Loading.d.ts +0 -4
- package/build/features/terminal/screens/Loading/Loading.js +0 -10
- package/build/features/terminal/screens/Loading/index.d.ts +0 -2
- package/build/features/terminal/screens/Loading/index.js +0 -2
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +0 -3
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +0 -58
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +0 -2
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +0 -2
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +0 -36
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +0 -34
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/terminal/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/terminal/screens/OperatorError/index.d.ts +0 -2
- package/build/features/terminal/screens/OperatorError/index.js +0 -2
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +0 -3
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +0 -21
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +0 -2
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +0 -2
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +0 -3
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +0 -32
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +0 -2
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +0 -2
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +0 -9
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +0 -20
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +0 -3
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +0 -153
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +0 -2
- package/build/features/terminal/screens/TerminalDeviceList/index.js +0 -2
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +0 -9
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +0 -13
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +0 -3
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +0 -47
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
- package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +0 -3
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +0 -53
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +0 -2
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +0 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +0 -3
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +0 -98
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +0 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +0 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +0 -26
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +0 -30
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +0 -7
- package/build/features/terminal/screens/Verify/OTPInput.js +0 -51
- package/build/features/terminal/screens/Verify/Verify.d.ts +0 -5
- package/build/features/terminal/screens/Verify/Verify.js +0 -85
- package/build/features/terminal/screens/Verify/index.d.ts +0 -2
- package/build/features/terminal/screens/Verify/index.js +0 -2
- package/build/features/terminal/screens/Verify/validation.d.ts +0 -8
- package/build/features/terminal/screens/Verify/validation.js +0 -4
- package/build/features/terminal/screens/shared/Header.d.ts +0 -10
- package/build/features/terminal/screens/shared/Header.js +0 -30
- package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
- package/build/features/terminal/screens/shared/TerminalList.js +0 -25
- package/build/features/terminal/screens/shared/index.d.ts +0 -5
- package/build/features/terminal/screens/shared/index.js +0 -5
- package/build/features/terminal/screens/shared/styles.d.ts +0 -196
- package/build/features/terminal/screens/shared/styles.js +0 -155
- package/build/features/terminal/screens/shared/utils.d.ts +0 -7
- package/build/features/terminal/screens/shared/utils.js +0 -24
|
@@ -36,7 +36,7 @@ import { businessSelector, clearError } from '../../../app/business/businessStor
|
|
|
36
36
|
import Text from '../../../../components/Text';
|
|
37
37
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
38
38
|
import Collapse from '../../../../components/Collapse';
|
|
39
|
-
import { isKW, isOtherLicense
|
|
39
|
+
import { isKW, isOtherLicense } from '../../../../utils';
|
|
40
40
|
import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
|
|
41
41
|
import { settingsSelector } from '../../../../app/settings';
|
|
42
42
|
var InputStyled = styled(InputSelect)(function (_a) {
|
|
@@ -66,7 +66,6 @@ var LicenseList = function (_a) {
|
|
|
66
66
|
var responseBody = businessTypeData.responseBody, selectedLicense = businessTypeData.selectedLicense, licenseNumber = businessTypeData.licenseNumber, entityLegalName = businessTypeData.entityLegalName;
|
|
67
67
|
var licenseList = (responseBody || { licenseList: [] }).licenseList;
|
|
68
68
|
var country_code = settingsData.businessCountry.iso2;
|
|
69
|
-
var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
|
|
70
69
|
var onOpenLicenseList = function (event) {
|
|
71
70
|
var _a;
|
|
72
71
|
setAnchorEl(event.currentTarget);
|
|
@@ -100,10 +99,8 @@ var LicenseList = function (_a) {
|
|
|
100
99
|
}
|
|
101
100
|
}, [country_code]);
|
|
102
101
|
var getLicenseNumber = function (item) {
|
|
103
|
-
var _a
|
|
104
|
-
|
|
105
|
-
return ((_b = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) || '';
|
|
106
|
-
return ((_c = item === null || item === void 0 ? void 0 : item.license) === null || _c === void 0 ? void 0 : _c.number) || '';
|
|
102
|
+
var _a;
|
|
103
|
+
return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
107
104
|
};
|
|
108
105
|
var getLicenseName = function (item) {
|
|
109
106
|
var _a, _b;
|
|
@@ -112,18 +109,13 @@ var LicenseList = function (_a) {
|
|
|
112
109
|
return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
|
|
113
110
|
};
|
|
114
111
|
var onSelectItem = function (license) {
|
|
115
|
-
var _a, _b, _c;
|
|
116
112
|
if (error)
|
|
117
113
|
dispatch(clearError());
|
|
118
114
|
selectedLicenseControl.field.onChange(license);
|
|
119
|
-
if (isOtherLicense(license))
|
|
115
|
+
if (isOtherLicense(license))
|
|
120
116
|
setValue('licenseNumber', '', { shouldValidate: true });
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
else {
|
|
124
|
-
setValue('licenseNumber', ((_a = license === null || license === void 0 ? void 0 : license.license) === null || _a === void 0 ? void 0 : _a.number) || '', { shouldValidate: true });
|
|
125
|
-
setValue('unifiedNumber', ((_c = (_b = license === null || license === void 0 ? void 0 : license.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '', { shouldValidate: true });
|
|
126
|
-
}
|
|
117
|
+
else
|
|
118
|
+
setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
|
|
127
119
|
onCloseLicenseList();
|
|
128
120
|
};
|
|
129
121
|
var getLicenseFullName = function (item) {
|
|
@@ -134,7 +126,7 @@ var LicenseList = function (_a) {
|
|
|
134
126
|
var selected = selectedLicenseControl.field.value;
|
|
135
127
|
var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
|
|
136
128
|
var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
|
|
137
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value:
|
|
129
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
138
130
|
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
|
|
139
131
|
} }) }))] }) })));
|
|
140
132
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export declare const LicenseValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
selectedLicense: any;
|
|
4
|
-
|
|
5
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
4
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
5
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
6
|
selectedLicense: any;
|
|
8
|
-
|
|
9
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
8
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
11
9
|
selectedLicense: any;
|
|
12
|
-
|
|
13
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
10
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
11
|
}>>>;
|
|
15
12
|
export declare const KWLicenseValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
13
|
selectedLicense: any;
|
|
@@ -1,55 +1,34 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, MAX_FILE_SIZE, VALID_FILE_FORMATS, FL_MIN_LICENSE_LENGTH,
|
|
2
|
+
import { REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, MAX_FILE_SIZE, VALID_FILE_FORMATS, FL_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH } from '../../../../constants';
|
|
3
3
|
import { BusinessType } from '../../../../@types';
|
|
4
|
-
import { isOtherLicense } from '../../../../utils';
|
|
5
4
|
var objectElements = {
|
|
6
5
|
legal_name: yup.object().shape({
|
|
7
6
|
ar: yup.string(),
|
|
8
7
|
en: yup.string()
|
|
9
8
|
}),
|
|
10
9
|
license: yup.object().shape({
|
|
11
|
-
number: yup.string()
|
|
10
|
+
number: yup.string()
|
|
12
11
|
}),
|
|
13
12
|
type: yup.string()
|
|
14
13
|
};
|
|
15
14
|
export var LicenseValidationSchema = yup.object().shape({
|
|
16
15
|
selectedLicense: yup.object().shape(objectElements).required(''),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
test: function (value) {
|
|
21
|
-
var _a;
|
|
22
|
-
var selectedEntityLicense = this.parent.selectedEntityLicense;
|
|
23
|
-
var selectedLicense = this.parent.selectedLicense;
|
|
24
|
-
var isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
25
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
26
|
-
if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
|
|
27
|
-
return false;
|
|
28
|
-
if (isFL || !isOtherLicense(selectedEntityLicense))
|
|
29
|
-
return true;
|
|
30
|
-
if (length === 0)
|
|
31
|
-
return this.createError({ message: '' });
|
|
32
|
-
return length >= UNIFIED_NUMBER_MIN_LENGTH ? true : this.createError({ message: 'unified_number_required' });
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
licenseNumber: yup.string().test({
|
|
36
|
-
name: 'licenseNumber',
|
|
37
|
-
message: '',
|
|
16
|
+
licenseNumber: yup
|
|
17
|
+
.string()
|
|
18
|
+
.test({
|
|
38
19
|
test: function (value) {
|
|
39
|
-
var _a;
|
|
40
20
|
var selectedLicense = this.parent.selectedLicense;
|
|
41
|
-
var selectedEntityLicense = this.parent.selectedEntityLicense;
|
|
42
21
|
var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
|
|
43
22
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
44
|
-
if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
|
|
45
|
-
return false;
|
|
46
|
-
if (isCR || !isOtherLicense(selectedEntityLicense))
|
|
47
|
-
return true;
|
|
48
23
|
if (length === 0)
|
|
49
|
-
return
|
|
24
|
+
return true;
|
|
25
|
+
if (isCR) {
|
|
26
|
+
return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
|
|
27
|
+
}
|
|
50
28
|
return length >= FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
|
|
51
29
|
}
|
|
52
30
|
})
|
|
31
|
+
.required('')
|
|
53
32
|
});
|
|
54
33
|
export var KWLicenseValidationSchema = yup.object().shape({
|
|
55
34
|
selectedLicense: yup.object().shape(objectElements).required(''),
|
|
@@ -75,8 +75,8 @@ var EntityList = function (_a) {
|
|
|
75
75
|
var selectedEntityControl = useController({ control: control, name: 'entityInfo' });
|
|
76
76
|
React.useEffect(function () {
|
|
77
77
|
if (entityList.length > 0) {
|
|
78
|
-
var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; })
|
|
79
|
-
var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false);
|
|
78
|
+
var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; });
|
|
79
|
+
var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false) || [];
|
|
80
80
|
setList(list_1);
|
|
81
81
|
if (filteredEntityList.length) {
|
|
82
82
|
setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
|
|
@@ -78,7 +78,6 @@ var CollectBusinessInfo = function (_a) {
|
|
|
78
78
|
var onSubmit = function (data) {
|
|
79
79
|
var dataValues = {
|
|
80
80
|
brandName: data.brandName,
|
|
81
|
-
unifiedNumber: data.unifiedNumber,
|
|
82
81
|
selectedLicense: data.selectedLicense,
|
|
83
82
|
licenseNumber: data.licenseNumber,
|
|
84
83
|
termAndConditionChecked: data.termAndConditionChecked
|
|
@@ -41,7 +41,6 @@ import CheckIcon from '../../../shared/CheckIcon';
|
|
|
41
41
|
import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
|
|
42
42
|
import LicenseNumber from './LicenseNumber';
|
|
43
43
|
import LicenseType from './LicenseType';
|
|
44
|
-
import UnifiedNumber from './UnifiedNumber';
|
|
45
44
|
var InputStyled = styled(InputSelect)(function (_a) {
|
|
46
45
|
var theme = _a.theme;
|
|
47
46
|
return ({
|
|
@@ -105,10 +104,8 @@ var LicenseList = function (_a) {
|
|
|
105
104
|
}
|
|
106
105
|
}, [country_code]);
|
|
107
106
|
var getLicenseNumber = function (item) {
|
|
108
|
-
var _a
|
|
109
|
-
|
|
110
|
-
return ((_b = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) || '';
|
|
111
|
-
return ((_c = item === null || item === void 0 ? void 0 : item.license) === null || _c === void 0 ? void 0 : _c.number) || '';
|
|
107
|
+
var _a;
|
|
108
|
+
return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
112
109
|
};
|
|
113
110
|
var getLicenseName = function (item) {
|
|
114
111
|
var _a, _b;
|
|
@@ -117,18 +114,13 @@ var LicenseList = function (_a) {
|
|
|
117
114
|
return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
|
|
118
115
|
};
|
|
119
116
|
var onSelectItem = function (license) {
|
|
120
|
-
var _a, _b, _c;
|
|
121
117
|
if (error)
|
|
122
118
|
dispatch(clearError());
|
|
123
119
|
selectedLicenseControl.field.onChange(license);
|
|
124
|
-
if (isOtherLicense(license))
|
|
120
|
+
if (isOtherLicense(license))
|
|
125
121
|
setValue('licenseNumber', '', { shouldValidate: true });
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
else {
|
|
129
|
-
setValue('licenseNumber', ((_a = license === null || license === void 0 ? void 0 : license.license) === null || _a === void 0 ? void 0 : _a.number) || '', { shouldValidate: true });
|
|
130
|
-
setValue('unifiedNumber', ((_c = (_b = license === null || license === void 0 ? void 0 : license.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '', { shouldValidate: true });
|
|
131
|
-
}
|
|
122
|
+
else
|
|
123
|
+
setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
|
|
132
124
|
onCloseLicenseList();
|
|
133
125
|
};
|
|
134
126
|
var getLicenseFullName = function (item) {
|
|
@@ -136,21 +128,13 @@ var LicenseList = function (_a) {
|
|
|
136
128
|
return _jsx("span", { children: "".concat(getLicenseName(item), " - ").concat(getLicenseNumber(item)) });
|
|
137
129
|
return _jsx("span", { children: "".concat(getLicenseNumber(item), " - ").concat(getLicenseName(item)) });
|
|
138
130
|
};
|
|
139
|
-
var showLicenseNumber = function () {
|
|
140
|
-
if (isKWCountry)
|
|
141
|
-
return show && isCR;
|
|
142
|
-
if (isSACountry)
|
|
143
|
-
return show && isFL;
|
|
144
|
-
return show;
|
|
145
|
-
};
|
|
146
131
|
var show = !anchorEl;
|
|
147
132
|
var selected = selectedLicenseControl.field.value;
|
|
148
133
|
var licenseReadonly = !isOtherLicense(selected);
|
|
149
134
|
var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
|
|
150
|
-
var isFL = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.FL;
|
|
151
135
|
var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
|
|
152
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry || isOtherThanKWOrSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value:
|
|
136
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry || isOtherThanKWOrSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
153
137
|
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
|
|
154
|
-
} }) }))] })), _jsx(LicenseType, { show: show && isKWCountry, readOnly: readOnly }), _jsx(LicenseNumber, { show:
|
|
138
|
+
} }) }))] })), _jsx(LicenseType, { show: show && isKWCountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: isKWCountry ? isCR : show, readOnly: licenseReadonly })] }));
|
|
155
139
|
};
|
|
156
140
|
export default React.memo(LicenseList);
|
|
@@ -42,12 +42,12 @@ var LicenseNumber = function (_a) {
|
|
|
42
42
|
var clearLicenseNumber = function () {
|
|
43
43
|
licenseNumberControl.field.onChange('');
|
|
44
44
|
};
|
|
45
|
-
var licenseNumberValue = licenseNumberControl.field.value
|
|
45
|
+
var licenseNumberValue = licenseNumberControl.field.value;
|
|
46
46
|
var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
47
47
|
var length = isKWCountry || isOtherThanKWOrSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_MAX_LENGTH : FL_NUMBER_MAX_LENGTH;
|
|
48
48
|
var minLength = isKWCountry || isOtherThanKWOrSACountry ? KW_MIN_LICENSE_LENGTH : isCR ? CR_MIN_LICENSE_LENGTH : FL_MIN_LICENSE_LENGTH;
|
|
49
49
|
var label = isCR ? 'cr_number' : 'fl_number';
|
|
50
50
|
var showCheckIcon = isKWCountry || isOtherThanKWOrSACountry ? (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) >= minLength : (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length;
|
|
51
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer,
|
|
51
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: isKWCountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon || (readOnly && licenseNumberValue) ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) }) })));
|
|
52
52
|
};
|
|
53
53
|
export default React.memo(LicenseNumber);
|
|
@@ -77,6 +77,6 @@ var TAC = function (_a) {
|
|
|
77
77
|
return;
|
|
78
78
|
tacControl.field.onChange(checked);
|
|
79
79
|
};
|
|
80
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: {
|
|
80
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
|
|
81
81
|
};
|
|
82
82
|
export default React.memo(TAC);
|
|
@@ -15,18 +15,15 @@ export declare const OtherThanKWOrSABusinessDataSchema: (isLeadIdPassed: boolean
|
|
|
15
15
|
export declare const BusinessDataSchema: (isLeadIdPassed: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
16
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
17
17
|
selectedLicense: any;
|
|
18
|
-
|
|
19
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
20
19
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
21
20
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
22
21
|
selectedLicense: any;
|
|
23
|
-
|
|
24
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
25
23
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
26
24
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
27
25
|
selectedLicense: any;
|
|
28
|
-
|
|
29
|
-
licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
26
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
30
27
|
}>>>;
|
|
31
28
|
export declare const KWBusinessDataSchema: (isLeadIdPassed: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
32
29
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { KW_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH,
|
|
2
|
+
import { KW_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH, BRAND_NAME_MAX_LENGTH } from '../../../../constants';
|
|
3
3
|
import { BusinessType } from '../../../../@types';
|
|
4
4
|
var objectElements = {
|
|
5
5
|
legal_name: yup.object().shape({
|
|
@@ -7,7 +7,7 @@ var objectElements = {
|
|
|
7
7
|
en: yup.string()
|
|
8
8
|
}),
|
|
9
9
|
license: yup.object().shape({
|
|
10
|
-
number: yup.string()
|
|
10
|
+
number: yup.string()
|
|
11
11
|
}),
|
|
12
12
|
type: yup.string()
|
|
13
13
|
};
|
|
@@ -94,40 +94,22 @@ export var BusinessDataSchema = function (isLeadIdPassed) {
|
|
|
94
94
|
})
|
|
95
95
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
96
96
|
selectedLicense: yup.object().shape(objectElements).required(''),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
test: function (value) {
|
|
101
|
-
var _a;
|
|
102
|
-
var selectedLicense = this.parent.selectedLicense;
|
|
103
|
-
var isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
104
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
105
|
-
if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
|
|
106
|
-
return false;
|
|
107
|
-
if (isFL || length >= UNIFIED_NUMBER_MIN_LENGTH)
|
|
108
|
-
return true;
|
|
109
|
-
if (length === 0)
|
|
110
|
-
return this.createError({ message: '' });
|
|
111
|
-
return this.createError({ message: 'unified_number_required' });
|
|
112
|
-
}
|
|
113
|
-
}),
|
|
114
|
-
licenseNumber: yup.string().test({
|
|
115
|
-
name: 'licenseNumber',
|
|
116
|
-
message: '',
|
|
97
|
+
licenseNumber: yup
|
|
98
|
+
.string()
|
|
99
|
+
.test({
|
|
117
100
|
test: function (value) {
|
|
118
|
-
var _a;
|
|
119
101
|
var selectedLicense = this.parent.selectedLicense;
|
|
120
102
|
var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
|
|
121
103
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
122
|
-
if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
|
|
123
|
-
return false;
|
|
124
|
-
if (isCR || length >= FL_MIN_LICENSE_LENGTH)
|
|
125
|
-
return true;
|
|
126
104
|
if (length === 0)
|
|
127
|
-
return
|
|
128
|
-
|
|
105
|
+
return true;
|
|
106
|
+
if (isCR) {
|
|
107
|
+
return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
|
|
108
|
+
}
|
|
109
|
+
return length >= FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
|
|
129
110
|
}
|
|
130
|
-
})
|
|
111
|
+
})
|
|
112
|
+
.required(''),
|
|
131
113
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond')
|
|
132
114
|
});
|
|
133
115
|
}
|
|
@@ -145,40 +127,22 @@ export var BusinessDataSchema = function (isLeadIdPassed) {
|
|
|
145
127
|
})
|
|
146
128
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
147
129
|
selectedLicense: yup.object().shape(objectElements).required(''),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
test: function (value) {
|
|
152
|
-
var _a;
|
|
153
|
-
var selectedLicense = this.parent.selectedLicense;
|
|
154
|
-
var isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
|
|
155
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
156
|
-
if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
|
|
157
|
-
return false;
|
|
158
|
-
if (isFL || length >= UNIFIED_NUMBER_MIN_LENGTH)
|
|
159
|
-
return true;
|
|
160
|
-
if (length === 0)
|
|
161
|
-
return this.createError({ message: '' });
|
|
162
|
-
return this.createError({ message: 'unified_number_required' });
|
|
163
|
-
}
|
|
164
|
-
}),
|
|
165
|
-
licenseNumber: yup.string().test({
|
|
166
|
-
name: 'licenseNumber',
|
|
167
|
-
message: '',
|
|
130
|
+
licenseNumber: yup
|
|
131
|
+
.string()
|
|
132
|
+
.test({
|
|
168
133
|
test: function (value) {
|
|
169
|
-
var _a;
|
|
170
134
|
var selectedLicense = this.parent.selectedLicense;
|
|
171
135
|
var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
|
|
172
136
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
173
|
-
if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
|
|
174
|
-
return false;
|
|
175
|
-
if (isCR || length >= FL_MIN_LICENSE_LENGTH)
|
|
176
|
-
return true;
|
|
177
137
|
if (length === 0)
|
|
178
|
-
return
|
|
179
|
-
|
|
138
|
+
return true;
|
|
139
|
+
if (isCR) {
|
|
140
|
+
return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
|
|
141
|
+
}
|
|
142
|
+
return length >= FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
|
|
180
143
|
}
|
|
181
144
|
})
|
|
145
|
+
.required('')
|
|
182
146
|
});
|
|
183
147
|
};
|
|
184
148
|
export var KWBusinessDataSchema = function (isLeadIdPassed) {
|
|
@@ -155,9 +155,8 @@ var EntityName = function (_a) {
|
|
|
155
155
|
}, [methods.formState.isValid]);
|
|
156
156
|
var disabled = !methods.formState.isValid || uploading || uploadingArticle;
|
|
157
157
|
var showLicenseNumber = isKWCountry ? isCR : true;
|
|
158
|
-
var showExpiryDate = isSACountry ? !isCR : true;
|
|
159
158
|
var showUnifiedNumber = isSACountry ? isCR : false;
|
|
160
159
|
var disableBack = settingsData.appConfig.mode === 'content';
|
|
161
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']), isVerified: isLegalNameVerified }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); }, isVerified: isEntityTypeVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(
|
|
160
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']), isVerified: isLegalNameVerified }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); }, isVerified: isEntityTypeVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseNumber, { show: showLicenseNumber, readOnly: readOnly['licenseNumber'] || noneEditable['license.number'], isVerified: isLicenseNumberVerified }), _jsx(UnifiedNumber, { show: showUnifiedNumber, readOnly: readOnly['unifiedNumber'] || noneEditable['license.additional_info'], isVerified: isUnifiedNumberVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !entityTypeAnchorEl }, { children: _jsx(IssuingDate, { onDateClicked: handleIssueDateOpenClose, readOnly: readOnly['issuingDate'] || noneEditable['license.issuing_date'], isVerified: isIssuingDateVerified }) })), _jsx(Collapse, __assign({ in: !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(ExpiryDate, { onDateClicked: handleExpiryDateOpenClose, readOnly: readOnly['expiryDate'] || noneEditable['license.expiry_date'], isVerified: isExpiryDateVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseCertificate, { defaultFiles: defaultCertificateFiles, show: isSACountry ? false : !isKWCountry || isCR, readOnly: readOnly['certificateId'] || noneEditable['documents'] }), _jsx(Article, { defaultFile: defaultArticleFile, show: !isSACountry, readOnly: readOnly['articleId'] || noneEditable['AOA_file_id'], isVerified: isArticleIdVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
162
161
|
};
|
|
163
162
|
export default EntityName;
|
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
|
-
import {
|
|
17
|
+
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
18
18
|
import Collapse from '../../../../components/Collapse';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
@@ -31,7 +31,7 @@ var UnifiedNumber = function (_a) {
|
|
|
31
31
|
var target = _a.target;
|
|
32
32
|
if (bckError)
|
|
33
33
|
dispatch(clearError());
|
|
34
|
-
var value =
|
|
34
|
+
var value = removeAllOtherThanCharsAndNumber(target.value);
|
|
35
35
|
unifiedNumberControl.field.onChange(value);
|
|
36
36
|
};
|
|
37
37
|
var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
|
|
@@ -6,7 +6,7 @@ export declare const EntityNameValidationSchema: () => yup.ObjectSchema<import("
|
|
|
6
6
|
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
7
|
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
8
8
|
issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
-
expiryDate: yup.
|
|
9
|
+
expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
10
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
11
11
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
12
12
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -16,7 +16,7 @@ export declare const EntityNameValidationSchema: () => yup.ObjectSchema<import("
|
|
|
16
16
|
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
17
17
|
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
18
|
issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
19
|
-
expiryDate: yup.
|
|
19
|
+
expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
20
20
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
21
21
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
22
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -26,7 +26,7 @@ export declare const EntityNameValidationSchema: () => yup.ObjectSchema<import("
|
|
|
26
26
|
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
27
27
|
unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
28
28
|
issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
29
|
-
expiryDate: yup.
|
|
29
|
+
expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
30
30
|
certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
31
31
|
articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
32
32
|
}>>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { BusinessType } from '../../../../@types';
|
|
3
|
-
import { KW_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH
|
|
3
|
+
import { KW_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH } from '../../../../constants';
|
|
4
4
|
export var EntityNameValidationSchema = function () {
|
|
5
5
|
return yup.object().shape({
|
|
6
6
|
legalName: yup
|
|
@@ -32,20 +32,9 @@ export var EntityNameValidationSchema = function () {
|
|
|
32
32
|
}
|
|
33
33
|
})
|
|
34
34
|
.required(''),
|
|
35
|
-
unifiedNumber: yup.string().
|
|
36
|
-
name: 'unifiedNumber',
|
|
37
|
-
message: '',
|
|
38
|
-
test: function (value) {
|
|
39
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
40
|
-
if (length >= UNIFIED_NUMBER_MIN_LENGTH)
|
|
41
|
-
return true;
|
|
42
|
-
if (length === 0)
|
|
43
|
-
return this.createError({ message: '' });
|
|
44
|
-
return this.createError({ message: 'unified_number_required' });
|
|
45
|
-
}
|
|
46
|
-
}),
|
|
35
|
+
unifiedNumber: yup.string().optional(),
|
|
47
36
|
issuingDate: yup.string().required('choose_any_issuing_date'),
|
|
48
|
-
expiryDate: yup.string().
|
|
37
|
+
expiryDate: yup.string().required('choose_any_expiry_date'),
|
|
49
38
|
certificateId: yup.array().optional(),
|
|
50
39
|
articleId: yup.string().optional()
|
|
51
40
|
});
|
|
@@ -12,4 +12,3 @@ export declare const entityFeatureScreens: Array<FeatureScreenStep>;
|
|
|
12
12
|
export declare const brandFeatureScreens: Array<FeatureScreenStep>;
|
|
13
13
|
export declare const boardFeatureScreens: Array<FeatureScreenStep>;
|
|
14
14
|
export declare const kycFeatureScreens: Array<FeatureScreenStep>;
|
|
15
|
-
export declare const terminalFeatureScreens: Array<FeatureScreenStep>;
|
|
@@ -141,19 +141,6 @@ import KycOperatorErrorPage from './kyc/screens/OperatorError';
|
|
|
141
141
|
import KycSuccessPage from './kyc/screens/Success';
|
|
142
142
|
import KycTermsPage from './kyc/screens/Terms';
|
|
143
143
|
import KycUsersPage from './kyc/screens/Users';
|
|
144
|
-
import TerminalLoadingPage from './terminal/screens/Loading';
|
|
145
|
-
import TerminalOperatorErrorPage from './terminal/screens/OperatorError';
|
|
146
|
-
import TerminalVerifyPage from './terminal/screens/Verify';
|
|
147
|
-
import NoTerminalDeviceLinkedPage from './terminal/screens/NoTerminalDeviceLinked';
|
|
148
|
-
import TerminalDeviceListPage from './terminal/screens/TerminalDeviceList';
|
|
149
|
-
import TerminalListPage from './terminal/screens/TerminalListPage';
|
|
150
|
-
import LinkNewTerminalPage from './terminal/screens/LinkNewTerminal';
|
|
151
|
-
import LinkedTerminalInfoPage from './terminal/screens/LinkedTerminalInfo';
|
|
152
|
-
import UnlinkedTerminalInfoPage from './terminal/screens/UnlinkedTerminalInfo';
|
|
153
|
-
import LinkedSuccessPage from './terminal/screens/LinkedSuccess';
|
|
154
|
-
import UnlinkedSuccessPage from './terminal/screens/UnlinkedSuccess';
|
|
155
|
-
import TerminalBoardPage from './terminal/screens/SuccessWithFlowButtons';
|
|
156
|
-
import TerminalResetPasswordSuccessPage from './terminal/screens/ResetPasswordSuccess';
|
|
157
144
|
export var connectFeatureScreens = [
|
|
158
145
|
{
|
|
159
146
|
name: 'CONNECT_BUSINESS_COUNTRY_STEP',
|
|
@@ -718,57 +705,3 @@ export var kycFeatureScreens = [
|
|
|
718
705
|
element: KycSuccessPage
|
|
719
706
|
}
|
|
720
707
|
];
|
|
721
|
-
export var terminalFeatureScreens = [
|
|
722
|
-
{
|
|
723
|
-
name: CONNECT_FLOWS.terminal.loadingData,
|
|
724
|
-
element: TerminalLoadingPage
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
name: CONNECT_FLOWS.terminal.operatorError,
|
|
728
|
-
element: TerminalOperatorErrorPage
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
name: CONNECT_FLOWS.terminal.verify,
|
|
732
|
-
element: TerminalVerifyPage
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
name: CONNECT_FLOWS.terminal.noTerminalLinked,
|
|
736
|
-
element: NoTerminalDeviceLinkedPage
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
name: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
740
|
-
element: TerminalDeviceListPage
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
name: CONNECT_FLOWS.terminal.terminalLinkNew,
|
|
744
|
-
element: LinkNewTerminalPage
|
|
745
|
-
},
|
|
746
|
-
{
|
|
747
|
-
name: CONNECT_FLOWS.terminal.terminalList,
|
|
748
|
-
element: TerminalListPage
|
|
749
|
-
},
|
|
750
|
-
{
|
|
751
|
-
name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
|
|
752
|
-
element: LinkedTerminalInfoPage
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
name: CONNECT_FLOWS.terminal.unlinkedTerminalInfo,
|
|
756
|
-
element: UnlinkedTerminalInfoPage
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
name: CONNECT_FLOWS.terminal.terminalLinkedSuccess,
|
|
760
|
-
element: LinkedSuccessPage
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
name: CONNECT_FLOWS.terminal.terminalUnlinkedSuccess,
|
|
764
|
-
element: UnlinkedSuccessPage
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
name: CONNECT_FLOWS.terminal.board,
|
|
768
|
-
element: TerminalBoardPage
|
|
769
|
-
},
|
|
770
|
-
{
|
|
771
|
-
name: CONNECT_FLOWS.terminal.resetPassword,
|
|
772
|
-
element: TerminalResetPasswordSuccessPage
|
|
773
|
-
}
|
|
774
|
-
];
|
|
@@ -112,5 +112,5 @@ export default function CustomButton(_a) {
|
|
|
112
112
|
}, 500);
|
|
113
113
|
};
|
|
114
114
|
}, []);
|
|
115
|
-
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, __assign({ sx: sx }, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props
|
|
115
|
+
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, __assign({ sx: sx }, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); }, isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props))), _jsx(ButtonStyled, __assign({ disabled: disabled, isLoading: btnLoading, type: !btnLoading ? 'submit' : 'button', isBack: isBackEnabled, endIcon: btnLoading === false ? !disableNextIcon && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) : undefined }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!btnLoading })) }))] }))] }));
|
|
116
116
|
}
|