@reltio/components 1.4.1674 → 1.4.1676
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/cjs/components/attributes/editMode/MoreAttributesButton/MoreAttributesButton.js +1 -1
- package/cjs/hooks/useRelationsLoader.d.ts +2 -1
- package/cjs/hooks/useRelationsLoader.js +9 -2
- package/esm/components/attributes/editMode/MoreAttributesButton/MoreAttributesButton.js +1 -1
- package/esm/hooks/useRelationsLoader.d.ts +2 -1
- package/esm/hooks/useRelationsLoader.js +6 -2
- package/package.json +2 -2
|
@@ -98,7 +98,7 @@ var MoreAttributesButton = function (_a) {
|
|
|
98
98
|
react_1.default.createElement(Add_1.default, { classes: { root: styles.icon } }),
|
|
99
99
|
react_1.default.createElement("div", { className: styles.buttonLabel }, label)),
|
|
100
100
|
react_1.default.createElement(SelectionPopup_1.default, { open: isOpen, className: (0, classnames_1.default)(styles.moreAttributesPopup, styles.popupContainer), anchorEl: inputRef.current, onClose: (0, ramda_1.pipe)(addSelectedAttributes, closePopup, clearFilter, clearSelectedItems), onSearch: setFilter, containerHeight: containerHeight, title: popupTitle, containerWidth: LIST_CONTAINER_WIDTH, searchInputOnKeyDown: handleKeyDown },
|
|
101
|
-
react_1.default.createElement(VirtualGroupedList_1.default, { getItemSize: getItemSize, renderItem: listItemRenderer, renderGroupTitle: renderGroupTitle, items: items, height: listHeight, focusIndex: focusIndex }),
|
|
101
|
+
react_1.default.createElement(VirtualGroupedList_1.default, { getItemSize: getItemSize, renderItem: listItemRenderer, renderGroupTitle: renderGroupTitle, disableHorizontalScrollbar: true, items: items, height: listHeight, focusIndex: focusIndex }),
|
|
102
102
|
items.length === 0 && (react_1.default.createElement("div", { className: styles.noResultsCaptionContainer },
|
|
103
103
|
react_1.default.createElement(Typography_1.default, { variant: "caption", display: "block", gutterBottom: true }, ui_i18n_1.default.text('No results found')))))));
|
|
104
104
|
};
|
|
@@ -12,8 +12,9 @@ type Props = {
|
|
|
12
12
|
relationActivityFilter?: ActivityFilter;
|
|
13
13
|
mode: Mode;
|
|
14
14
|
searchByOv?: boolean;
|
|
15
|
+
showSnackbarMessage?: (message: string) => void;
|
|
15
16
|
};
|
|
16
|
-
export declare const useRelationsLoader: ({ sorting, filter, page, rowsPerPage, config, entity, relationActivityFilter, mode, searchByOv }: Props) => {
|
|
17
|
+
export declare const useRelationsLoader: ({ sorting, filter, page, rowsPerPage, config, entity, relationActivityFilter, mode, searchByOv, showSnackbarMessage }: Props) => {
|
|
17
18
|
isLoading: boolean;
|
|
18
19
|
reload: () => void;
|
|
19
20
|
};
|
|
@@ -10,10 +10,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
exports.useRelationsLoader = void 0;
|
|
15
18
|
var react_1 = require("react");
|
|
16
19
|
var ramda_1 = require("ramda");
|
|
20
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
17
21
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
18
22
|
var useSafePromise_1 = require("./useSafePromise");
|
|
19
23
|
var usePrevious_1 = require("./usePrevious");
|
|
@@ -31,7 +35,7 @@ var isValidRequestConfig = function (config) {
|
|
|
31
35
|
return true;
|
|
32
36
|
};
|
|
33
37
|
var useRelationsLoader = function (_a) {
|
|
34
|
-
var sorting = _a.sorting, filter = _a.filter, page = _a.page, rowsPerPage = _a.rowsPerPage, config = _a.config, entity = _a.entity, relationActivityFilter = _a.relationActivityFilter, mode = _a.mode, _b = _a.searchByOv, searchByOv = _b === void 0 ? false : _b;
|
|
38
|
+
var sorting = _a.sorting, filter = _a.filter, page = _a.page, rowsPerPage = _a.rowsPerPage, config = _a.config, entity = _a.entity, relationActivityFilter = _a.relationActivityFilter, mode = _a.mode, _b = _a.searchByOv, searchByOv = _b === void 0 ? false : _b, showSnackbarMessage = _a.showSnackbarMessage;
|
|
35
39
|
var _c = (0, react_1.useState)(false), isLoading = _c[0], setIsLoading = _c[1];
|
|
36
40
|
var relationsLoaded = (0, contexts_1.useMdmAction)('relationsLoaded');
|
|
37
41
|
var tenant = (0, contexts_1.useMdmTenant)();
|
|
@@ -97,7 +101,10 @@ var useRelationsLoader = function (_a) {
|
|
|
97
101
|
if (!Array.isArray(result)) {
|
|
98
102
|
throw Error(JSON.stringify(result));
|
|
99
103
|
}
|
|
100
|
-
var _a = result[0], connections = _a.connections, total = _a.total;
|
|
104
|
+
var _a = result[0], connections = _a.connections, total = _a.total, notAllDataFetched = _a.notAllDataFetched;
|
|
105
|
+
if (notAllDataFetched && showSnackbarMessage) {
|
|
106
|
+
showSnackbarMessage(ui_i18n_1.default.text('This profile contains a large number of relationships. We have disabled filtering and sorting to help optimize performance.'));
|
|
107
|
+
}
|
|
101
108
|
relationsLoaded({ id: config.id, connections: connections, total: total, mode: modeRef.current });
|
|
102
109
|
})
|
|
103
110
|
.catch(function (e) {
|
|
@@ -70,7 +70,7 @@ var MoreAttributesButton = function (_a) {
|
|
|
70
70
|
React.createElement(AddIcon, { classes: { root: styles.icon } }),
|
|
71
71
|
React.createElement("div", { className: styles.buttonLabel }, label)),
|
|
72
72
|
React.createElement(SelectionPopup, { open: isOpen, className: classnames(styles.moreAttributesPopup, styles.popupContainer), anchorEl: inputRef.current, onClose: pipe(addSelectedAttributes, closePopup, clearFilter, clearSelectedItems), onSearch: setFilter, containerHeight: containerHeight, title: popupTitle, containerWidth: LIST_CONTAINER_WIDTH, searchInputOnKeyDown: handleKeyDown },
|
|
73
|
-
React.createElement(VirtualGroupedList, { getItemSize: getItemSize, renderItem: listItemRenderer, renderGroupTitle: renderGroupTitle, items: items, height: listHeight, focusIndex: focusIndex }),
|
|
73
|
+
React.createElement(VirtualGroupedList, { getItemSize: getItemSize, renderItem: listItemRenderer, renderGroupTitle: renderGroupTitle, disableHorizontalScrollbar: true, items: items, height: listHeight, focusIndex: focusIndex }),
|
|
74
74
|
items.length === 0 && (React.createElement("div", { className: styles.noResultsCaptionContainer },
|
|
75
75
|
React.createElement(Typography, { variant: "caption", display: "block", gutterBottom: true }, i18n.text('No results found')))))));
|
|
76
76
|
};
|
|
@@ -12,8 +12,9 @@ type Props = {
|
|
|
12
12
|
relationActivityFilter?: ActivityFilter;
|
|
13
13
|
mode: Mode;
|
|
14
14
|
searchByOv?: boolean;
|
|
15
|
+
showSnackbarMessage?: (message: string) => void;
|
|
15
16
|
};
|
|
16
|
-
export declare const useRelationsLoader: ({ sorting, filter, page, rowsPerPage, config, entity, relationActivityFilter, mode, searchByOv }: Props) => {
|
|
17
|
+
export declare const useRelationsLoader: ({ sorting, filter, page, rowsPerPage, config, entity, relationActivityFilter, mode, searchByOv, showSnackbarMessage }: Props) => {
|
|
17
18
|
isLoading: boolean;
|
|
18
19
|
reload: () => void;
|
|
19
20
|
};
|
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
13
|
import { cond, pipe, prop, T, evolve, filter as filterFn, when, identity, times, length, ifElse, always } from 'ramda';
|
|
14
|
+
import i18n from 'ui-i18n';
|
|
14
15
|
import { ActivityFilter, addGlobalFilterToQuery, getRelationsForDataTenantEntity, getRelationsForEntity, isAvailableEntityTypeUri, isAvailableRelationTypeUri, isDataTenantEntity, isObject, isTempUri, Mode, wrapInArrayIfNeeded } from '@reltio/mdm-sdk';
|
|
15
16
|
import { useSafePromise } from './useSafePromise';
|
|
16
17
|
import { usePrevious } from './usePrevious';
|
|
@@ -28,7 +29,7 @@ var isValidRequestConfig = function (config) {
|
|
|
28
29
|
return true;
|
|
29
30
|
};
|
|
30
31
|
export var useRelationsLoader = function (_a) {
|
|
31
|
-
var sorting = _a.sorting, filter = _a.filter, page = _a.page, rowsPerPage = _a.rowsPerPage, config = _a.config, entity = _a.entity, relationActivityFilter = _a.relationActivityFilter, mode = _a.mode, _b = _a.searchByOv, searchByOv = _b === void 0 ? false : _b;
|
|
32
|
+
var sorting = _a.sorting, filter = _a.filter, page = _a.page, rowsPerPage = _a.rowsPerPage, config = _a.config, entity = _a.entity, relationActivityFilter = _a.relationActivityFilter, mode = _a.mode, _b = _a.searchByOv, searchByOv = _b === void 0 ? false : _b, showSnackbarMessage = _a.showSnackbarMessage;
|
|
32
33
|
var _c = useState(false), isLoading = _c[0], setIsLoading = _c[1];
|
|
33
34
|
var relationsLoaded = useMdmAction('relationsLoaded');
|
|
34
35
|
var tenant = useMdmTenant();
|
|
@@ -94,7 +95,10 @@ export var useRelationsLoader = function (_a) {
|
|
|
94
95
|
if (!Array.isArray(result)) {
|
|
95
96
|
throw Error(JSON.stringify(result));
|
|
96
97
|
}
|
|
97
|
-
var _a = result[0], connections = _a.connections, total = _a.total;
|
|
98
|
+
var _a = result[0], connections = _a.connections, total = _a.total, notAllDataFetched = _a.notAllDataFetched;
|
|
99
|
+
if (notAllDataFetched && showSnackbarMessage) {
|
|
100
|
+
showSnackbarMessage(i18n.text('This profile contains a large number of relationships. We have disabled filtering and sorting to help optimize performance.'));
|
|
101
|
+
}
|
|
98
102
|
relationsLoaded({ id: config.id, connections: connections, total: total, mode: modeRef.current });
|
|
99
103
|
})
|
|
100
104
|
.catch(function (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1676",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
10
10
|
"@react-google-maps/api": "2.7.0",
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1676",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|