@tap-payments/auth-jsconnect 2.4.38-test → 2.4.39-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.
|
@@ -121,7 +121,7 @@ export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (
|
|
|
121
121
|
return [4, API.dataService.getTeamSize({ page: 0 })];
|
|
122
122
|
case 8:
|
|
123
123
|
teamSizeList = _j.sent();
|
|
124
|
-
|
|
124
|
+
thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP'));
|
|
125
125
|
_j.label = 9;
|
|
126
126
|
case 9: return [2, {
|
|
127
127
|
data: data,
|
|
@@ -112,7 +112,6 @@ var ActivitiesList = function (_a) {
|
|
|
112
112
|
var verify = data.verify;
|
|
113
113
|
var _h = verify.responseBody || {}, activities = _h.activities, brand = _h.brand;
|
|
114
114
|
var isCR = ((_d = (_c = (_b = verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.license) === null || _d === void 0 ? void 0 : _d.type) === LicenseType.CR;
|
|
115
|
-
var disabled = false;
|
|
116
115
|
var setSelectedActivitiesBeginning = function (list) {
|
|
117
116
|
var mapSelectedListFirst = __spreadArray(__spreadArray([], list.filter(function (a) { return (controlValue || []).some(function (c) { return a.id === c.id; }); }), true), list.filter(function (a) { return !(controlValue || []).some(function (c) { return a.id === c.id; }); }), true);
|
|
118
117
|
setActivitiesMenuList(mapSelectedListFirst);
|
|
@@ -144,19 +143,31 @@ var ActivitiesList = function (_a) {
|
|
|
144
143
|
var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
145
144
|
if (isActivityExists) {
|
|
146
145
|
var updatedIdList = controlValue === null || controlValue === void 0 ? void 0 : controlValue.filter(function (activity) { return activity.id !== (item === null || item === void 0 ? void 0 : item.id); });
|
|
146
|
+
if (!updatedIdList.length) {
|
|
147
|
+
activitiesControl.field.onChange([]);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
147
150
|
if (updatedIdList.length >= 1)
|
|
148
151
|
activitiesControl.field.onChange(updatedIdList);
|
|
149
152
|
return;
|
|
150
153
|
}
|
|
151
154
|
activitiesControl.field.onChange(__spreadArray(__spreadArray([], controlValue, true), [item], false));
|
|
152
155
|
};
|
|
156
|
+
var getSelectedActivityName = function (item) {
|
|
157
|
+
var _a, _b, _c;
|
|
158
|
+
var code = item === null || item === void 0 ? void 0 : item.isic_code;
|
|
159
|
+
var name = isAr ? ((_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar) || ((_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en) : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en;
|
|
160
|
+
return code ? "".concat(code, " - ").concat(name) : name;
|
|
161
|
+
};
|
|
153
162
|
var getSelectedActivities = function () {
|
|
154
|
-
var _a, _b, _c
|
|
163
|
+
var _a, _b, _c;
|
|
155
164
|
if ((controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) > 1) {
|
|
156
165
|
return (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) + ' ' + t('activities_selected');
|
|
157
166
|
}
|
|
158
167
|
var item = controlValue[0];
|
|
159
|
-
|
|
168
|
+
var code = item === null || item === void 0 ? void 0 : item.isic_code;
|
|
169
|
+
var name = isAr ? ((_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar) || ((_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en) : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en;
|
|
170
|
+
return code ? "".concat(code, " - ").concat(name) : name;
|
|
160
171
|
};
|
|
161
172
|
var getSelectedActivityFlag = function (item) {
|
|
162
173
|
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
@@ -164,9 +175,9 @@ var ActivitiesList = function (_a) {
|
|
|
164
175
|
var isActivityVerified = function (item) {
|
|
165
176
|
return hasVerifiedValue(brand === null || brand === void 0 ? void 0 : brand.data_verification, "activities.".concat(item.id));
|
|
166
177
|
};
|
|
167
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: readOnly,
|
|
168
|
-
var _a
|
|
169
|
-
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: item.id === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children:
|
|
178
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: readOnly, value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? onCloseList : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
179
|
+
var _a;
|
|
180
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: item.id === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children: getSelectedActivityName(item) })) })), getSelectedActivityFlag(item) && _jsx(CheckIcon, { isVerified: isActivityVerified(item) })] }));
|
|
170
181
|
} }) }))] })] }) })));
|
|
171
182
|
};
|
|
172
183
|
export default ActivitiesList;
|
package/build/utils/array.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare const fixBrandList: (items: Array<{
|
|
|
61
61
|
channel_services: any[];
|
|
62
62
|
}[];
|
|
63
63
|
export declare const findFirstId: (items: Array<SaleChannel>) => string;
|
|
64
|
-
export declare const sortActivitiesByName: (items: Array<
|
|
64
|
+
export declare const sortActivitiesByName: (items: Array<ActivityParams>, path: string) => ActivityParams[];
|
|
65
65
|
export declare const getFileDetailsFromDocument: (documents: Array<any>, purpose: string) => any;
|
|
66
66
|
export declare const getRecentDocumentBasedOnPurpose: (documents: Array<any>, purpose: string) => any;
|
|
67
67
|
export declare const findInArrayOrSubArray: (items: Array<any>, value: string | number) => null;
|