@reltio/components 1.4.1675 → 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.
@@ -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) {
@@ -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.1675",
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.1675",
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",