@tap-payments/auth-jsconnect 2.10.15-development → 2.10.16-development
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/features/auth/screens/AuthenticationList/EntityList.js +4 -2
- package/build/features/business/screens/BusinessType/LicenseList.js +1 -3
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +4 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +0 -2
- package/package.json +1 -1
|
@@ -76,12 +76,13 @@ var EntityList = function (_a) {
|
|
|
76
76
|
var selectedEntity = selectedEntityControl.field.value;
|
|
77
77
|
React.useEffect(function () {
|
|
78
78
|
if (entityList.length > 0) {
|
|
79
|
-
var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; });
|
|
80
|
-
var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false)
|
|
79
|
+
var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; }) || [];
|
|
80
|
+
var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false);
|
|
81
81
|
setList(list_1);
|
|
82
82
|
if (filteredEntityList.length) {
|
|
83
83
|
setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
|
|
84
84
|
setValue('licenseNumber', '');
|
|
85
|
+
setValue('unifiedNumber', '');
|
|
85
86
|
setValue('licenseType', '');
|
|
86
87
|
setValue('legalName', '');
|
|
87
88
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -125,6 +126,7 @@ var EntityList = function (_a) {
|
|
|
125
126
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
126
127
|
else {
|
|
127
128
|
setValue('licenseNumber', '');
|
|
129
|
+
setValue('unifiedNumber', '');
|
|
128
130
|
setValue('legalName', '');
|
|
129
131
|
setValue('licenseType', '');
|
|
130
132
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -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) {
|
|
@@ -104,8 +104,6 @@ var LicenseList = function (_a) {
|
|
|
104
104
|
};
|
|
105
105
|
var getLicenseName = function (item) {
|
|
106
106
|
var _a, _b;
|
|
107
|
-
if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isOtherLicense(item) && isSA(country_code))
|
|
108
|
-
return t('v1_add_unified_number');
|
|
109
107
|
if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
|
|
110
108
|
return t('future_work');
|
|
111
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) || '');
|
|
@@ -75,12 +75,13 @@ 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 });
|
|
83
83
|
setValue('licenseNumber', '');
|
|
84
|
+
setValue('unifiedNumber', '');
|
|
84
85
|
setValue('licenseType', '');
|
|
85
86
|
setValue('legalName', '');
|
|
86
87
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -124,6 +125,7 @@ var EntityList = function (_a) {
|
|
|
124
125
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
|
|
125
126
|
else {
|
|
126
127
|
setValue('licenseNumber', '');
|
|
128
|
+
setValue('unifiedNumber', '');
|
|
127
129
|
setValue('legalName', '');
|
|
128
130
|
setValue('licenseType', '');
|
|
129
131
|
handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
|
|
@@ -110,8 +110,6 @@ var LicenseList = function (_a) {
|
|
|
110
110
|
};
|
|
111
111
|
var getLicenseName = function (item) {
|
|
112
112
|
var _a, _b;
|
|
113
|
-
if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isOtherLicense(item) && isSACountry)
|
|
114
|
-
return t('v1_add_unified_number');
|
|
115
113
|
if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
|
|
116
114
|
return t('future_work');
|
|
117
115
|
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) || '');
|