@reltio/components 1.4.1424 → 1.4.1426
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/PopupWithArrow/styles.d.ts +1 -1
- package/cjs/components/ProfileCard/ProfileCardPlaceholder/styles.d.ts +1 -1
- package/cjs/components/ProfilesList/styles.d.ts +1 -1
- package/cjs/components/ScreenProfileBand/ScreenProfileBand.js +1 -1
- package/cjs/components/activityLog/activities/RelationObject/styles.d.ts +1 -1
- package/cjs/components/workflow/components/WorkflowComments/styles.d.ts +1 -1
- package/cjs/contexts/CollaborationContext/index.d.ts +4 -0
- package/cjs/contexts/CollaborationContext/index.js +10 -1
- package/cjs/contexts/index.d.ts +1 -1
- package/cjs/contexts/index.js +2 -1
- package/cjs/hooks/useCollaboration.js +1 -2
- package/cjs/hooks/useScrollToAttributeError/styles.d.ts +1 -1
- package/cjs/hooks/useUsers.js +3 -1
- package/esm/components/PopupWithArrow/styles.d.ts +1 -1
- package/esm/components/ProfileCard/ProfileCardPlaceholder/styles.d.ts +1 -1
- package/esm/components/ProfilesList/styles.d.ts +1 -1
- package/esm/components/ScreenProfileBand/ScreenProfileBand.js +2 -2
- package/esm/components/activityLog/activities/RelationObject/styles.d.ts +1 -1
- package/esm/components/workflow/components/WorkflowComments/styles.d.ts +1 -1
- package/esm/contexts/CollaborationContext/index.d.ts +4 -0
- package/esm/contexts/CollaborationContext/index.js +8 -0
- package/esm/contexts/index.d.ts +1 -1
- package/esm/contexts/index.js +1 -1
- package/esm/hooks/useCollaboration.js +1 -2
- package/esm/hooks/useScrollToAttributeError/styles.d.ts +1 -1
- package/esm/hooks/useUsers.js +3 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"popper" | "arrow" | "popoverRoot">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "info" | "avatar" | "thirdRow" | "@keyframes keyframes-wave" | "wave">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inactive" | "label" | "image" | "selected" | "secondaryLabel" | "item" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inactive" | "label" | "image" | "selected" | "secondaryLabel" | "item" | "info" | "avatar" | "clickable" | "businessCard" | "@keyframes animate" | "highlighted" | "justImported" | "secondRow">;
|
|
@@ -44,7 +44,7 @@ exports.ScreenProfileBand = (0, react_1.memo)(function (_a) {
|
|
|
44
44
|
var objectIds = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.getProfileBandObjectIdsForCollaboration)(entity); }, [entity]);
|
|
45
45
|
var collaboration = (0, hooks_1.useCollaboration)({ objectIds: objectIds });
|
|
46
46
|
var entityUri = (0, mdm_sdk_1.getEntityUriForLink)(entity);
|
|
47
|
-
return (react_1.default.createElement(contexts_1.
|
|
47
|
+
return (react_1.default.createElement(contexts_1.CollaborationContextProvider, { collaboration: collaboration },
|
|
48
48
|
react_1.default.createElement(ProfileBand_1.default, { className: (0, classnames_1.default)(className, constants_1.COMMENTS_CONTAINER_VISIBILITY_AREA), entity: (historySlice === null || historySlice === void 0 ? void 0 : historySlice.aEntity) || entity }, historySlice ? (react_1.default.createElement(history_1.ProfileBandHistory, null)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
49
49
|
react_1.default.createElement(ProfileBandNavigation_1.ProfileBandNavigation, { className: styles.profileBandNavigation }),
|
|
50
50
|
react_1.default.createElement(CommentsContainer_1.default, { className: styles.comments, uri: entityUri, relatedObjectUris: (0, mdm_sdk_1.createRelatedObjectUris)(mdm_sdk_1.CollaborationObjectTypes.ENTITY, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"link" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"link" | "delimiter" | "relationship">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const useCommentStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<never>;
|
|
2
|
-
export const useCollapsedCommentsStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
2
|
+
export const useCollapsedCommentsStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"circleButton" | "delimiter">;
|
|
3
3
|
export const useWorkflowStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "commentsContainer" | "filledInputRoot">;
|
|
4
4
|
export const useExpandedComments: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"messageContainer">;
|
|
@@ -3,8 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CollaborationContext = void 0;
|
|
6
|
+
exports.CollaborationContextProvider = exports.CollaborationContext = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var hooks_1 = require("../../hooks");
|
|
9
|
+
var UsersContext_1 = require("../UsersContext");
|
|
8
10
|
var noop = function () { };
|
|
9
11
|
exports.CollaborationContext = react_1.default.createContext({
|
|
10
12
|
comments: [],
|
|
@@ -30,3 +32,10 @@ exports.CollaborationContext = react_1.default.createContext({
|
|
|
30
32
|
editReply: function () { return new Promise(noop); }
|
|
31
33
|
});
|
|
32
34
|
exports.CollaborationContext.displayName = 'CollaborationContext';
|
|
35
|
+
var CollaborationContextProvider = function (_a) {
|
|
36
|
+
var collaboration = _a.collaboration, children = _a.children;
|
|
37
|
+
var users = (0, hooks_1.useUsers)();
|
|
38
|
+
return (react_1.default.createElement(exports.CollaborationContext.Provider, { value: collaboration },
|
|
39
|
+
react_1.default.createElement(UsersContext_1.UsersContext.Provider, { value: users }, children)));
|
|
40
|
+
};
|
|
41
|
+
exports.CollaborationContextProvider = CollaborationContextProvider;
|
package/cjs/contexts/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { HistoryDiffContext } from './HistoryAppearanceContext';
|
|
|
3
3
|
export { PopupBoundariesContext } from './PopupBoundariesContext';
|
|
4
4
|
export { ViewIdContext } from './ViewIdContext';
|
|
5
5
|
export { BlockImageGalleryDialogContext } from './BlockImageGalleryDialogContext';
|
|
6
|
-
export { CollaborationContext } from './CollaborationContext';
|
|
6
|
+
export { CollaborationContext, CollaborationContextProvider } from './CollaborationContext';
|
|
7
7
|
export { UsersContext } from './UsersContext';
|
|
8
8
|
export { PivotingAttributeContext } from './PivotingAttributeContext';
|
|
9
9
|
export { ProfilePerspectiveViewContext } from './ProfilePerspectiveViewContext';
|
package/cjs/contexts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LabelsContext = exports.UrlGeneratorsContext = exports.ScrollToErrorProvider = exports.ScrollToErrorContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.SandboxAPIContext = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
3
|
+
exports.LabelsContext = exports.UrlGeneratorsContext = exports.ScrollToErrorProvider = exports.ScrollToErrorContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.SandboxAPIContext = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
4
4
|
var AsyncMountContext_1 = require("./AsyncMountContext");
|
|
5
5
|
Object.defineProperty(exports, "AsyncMountContext", { enumerable: true, get: function () { return AsyncMountContext_1.AsyncMountContext; } });
|
|
6
6
|
var HistoryAppearanceContext_1 = require("./HistoryAppearanceContext");
|
|
@@ -13,6 +13,7 @@ var BlockImageGalleryDialogContext_1 = require("./BlockImageGalleryDialogContext
|
|
|
13
13
|
Object.defineProperty(exports, "BlockImageGalleryDialogContext", { enumerable: true, get: function () { return BlockImageGalleryDialogContext_1.BlockImageGalleryDialogContext; } });
|
|
14
14
|
var CollaborationContext_1 = require("./CollaborationContext");
|
|
15
15
|
Object.defineProperty(exports, "CollaborationContext", { enumerable: true, get: function () { return CollaborationContext_1.CollaborationContext; } });
|
|
16
|
+
Object.defineProperty(exports, "CollaborationContextProvider", { enumerable: true, get: function () { return CollaborationContext_1.CollaborationContextProvider; } });
|
|
16
17
|
var UsersContext_1 = require("./UsersContext");
|
|
17
18
|
Object.defineProperty(exports, "UsersContext", { enumerable: true, get: function () { return UsersContext_1.UsersContext; } });
|
|
18
19
|
var PivotingAttributeContext_1 = require("./PivotingAttributeContext");
|
|
@@ -128,7 +128,7 @@ var useCollaboration = function (_a) {
|
|
|
128
128
|
objectType: objectType,
|
|
129
129
|
visibility: 'public',
|
|
130
130
|
namedUsers: namedUsers,
|
|
131
|
-
permanentLink: ''
|
|
131
|
+
permanentLink: "".concat(window.location.href, "&commentId=").concat(encodeURIComponent('{commentId}'))
|
|
132
132
|
};
|
|
133
133
|
return (0, mdm_sdk_1.createComment)({ collaborationPath: collaborationPath, tenant: tenant, data: data })
|
|
134
134
|
.then(function (_a) {
|
|
@@ -148,7 +148,6 @@ var useCollaboration = function (_a) {
|
|
|
148
148
|
objectType: objectType,
|
|
149
149
|
visibility: 'public',
|
|
150
150
|
namedUsers: namedUsers,
|
|
151
|
-
permanentLink: '',
|
|
152
151
|
commentId: commentId,
|
|
153
152
|
replies: replies
|
|
154
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"@keyframes highlightAnimation" | "highlightError" | "highlightWarning" | "simpleAttribute">;
|
package/cjs/hooks/useUsers.js
CHANGED
|
@@ -8,6 +8,8 @@ var react_1 = require("react");
|
|
|
8
8
|
var react_redux_1 = require("react-redux");
|
|
9
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
10
|
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
11
|
+
var memoize_one_1 = __importDefault(require("memoize-one"));
|
|
12
|
+
var getAllUsersForTenantMemoized = (0, memoize_one_1.default)(function (tenant, servicesPath) { return (0, mdm_sdk_1.getAllUsersForTenant)({ tenant: tenant, servicesPath: servicesPath }); });
|
|
11
13
|
var useUsers = function () {
|
|
12
14
|
var _a = (0, react_1.useState)([]), users = _a[0], setUsers = _a[1];
|
|
13
15
|
var tenant = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getTenant);
|
|
@@ -17,7 +19,7 @@ var useUsers = function () {
|
|
|
17
19
|
setUsers([]);
|
|
18
20
|
};
|
|
19
21
|
(0, react_1.useEffect)(function () {
|
|
20
|
-
(
|
|
22
|
+
getAllUsersForTenantMemoized(tenant, servicesPath)
|
|
21
23
|
.then(function (users) { return setUsers(users); })
|
|
22
24
|
.catch(onError);
|
|
23
25
|
}, [tenant, servicesPath]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"popper" | "arrow" | "popoverRoot">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "info" | "avatar" | "thirdRow" | "@keyframes keyframes-wave" | "wave">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inactive" | "label" | "image" | "selected" | "secondaryLabel" | "item" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inactive" | "label" | "image" | "selected" | "secondaryLabel" | "item" | "info" | "avatar" | "clickable" | "businessCard" | "@keyframes animate" | "highlighted" | "justImported" | "secondRow">;
|
|
@@ -4,7 +4,7 @@ import { CollaborationObjectTypes, createRelatedObjectUris, getEntityUriForLink,
|
|
|
4
4
|
import ProfileBand from '../ProfileBand/ProfileBand';
|
|
5
5
|
import { ProfileBandNavigation } from '../ProfileBandNavigation';
|
|
6
6
|
import CommentsContainer from '../CommentsContainer/CommentsContainer';
|
|
7
|
-
import {
|
|
7
|
+
import { CollaborationContextProvider } from '../../contexts';
|
|
8
8
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../constants';
|
|
9
9
|
import { useCollaboration } from '../../hooks';
|
|
10
10
|
import { ProfileBandHistory } from '../history';
|
|
@@ -15,7 +15,7 @@ export var ScreenProfileBand = memo(function (_a) {
|
|
|
15
15
|
var objectIds = useMemo(function () { return getProfileBandObjectIdsForCollaboration(entity); }, [entity]);
|
|
16
16
|
var collaboration = useCollaboration({ objectIds: objectIds });
|
|
17
17
|
var entityUri = getEntityUriForLink(entity);
|
|
18
|
-
return (React.createElement(
|
|
18
|
+
return (React.createElement(CollaborationContextProvider, { collaboration: collaboration },
|
|
19
19
|
React.createElement(ProfileBand, { className: classnames(className, COMMENTS_CONTAINER_VISIBILITY_AREA), entity: (historySlice === null || historySlice === void 0 ? void 0 : historySlice.aEntity) || entity }, historySlice ? (React.createElement(ProfileBandHistory, null)) : (React.createElement(React.Fragment, null,
|
|
20
20
|
React.createElement(ProfileBandNavigation, { className: styles.profileBandNavigation }),
|
|
21
21
|
React.createElement(CommentsContainer, { className: styles.comments, uri: entityUri, relatedObjectUris: createRelatedObjectUris(CollaborationObjectTypes.ENTITY, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"link" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"link" | "delimiter" | "relationship">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const useCommentStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<never>;
|
|
2
|
-
export const useCollapsedCommentsStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
2
|
+
export const useCollapsedCommentsStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"circleButton" | "delimiter">;
|
|
3
3
|
export const useWorkflowStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "commentsContainer" | "filledInputRoot">;
|
|
4
4
|
export const useExpandedComments: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"messageContainer">;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useUsers } from '../../hooks';
|
|
3
|
+
import { UsersContext } from '../UsersContext';
|
|
2
4
|
var noop = function () { };
|
|
3
5
|
export var CollaborationContext = React.createContext({
|
|
4
6
|
comments: [],
|
|
@@ -24,3 +26,9 @@ export var CollaborationContext = React.createContext({
|
|
|
24
26
|
editReply: function () { return new Promise(noop); }
|
|
25
27
|
});
|
|
26
28
|
CollaborationContext.displayName = 'CollaborationContext';
|
|
29
|
+
export var CollaborationContextProvider = function (_a) {
|
|
30
|
+
var collaboration = _a.collaboration, children = _a.children;
|
|
31
|
+
var users = useUsers();
|
|
32
|
+
return (React.createElement(CollaborationContext.Provider, { value: collaboration },
|
|
33
|
+
React.createElement(UsersContext.Provider, { value: users }, children)));
|
|
34
|
+
};
|
package/esm/contexts/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { HistoryDiffContext } from './HistoryAppearanceContext';
|
|
|
3
3
|
export { PopupBoundariesContext } from './PopupBoundariesContext';
|
|
4
4
|
export { ViewIdContext } from './ViewIdContext';
|
|
5
5
|
export { BlockImageGalleryDialogContext } from './BlockImageGalleryDialogContext';
|
|
6
|
-
export { CollaborationContext } from './CollaborationContext';
|
|
6
|
+
export { CollaborationContext, CollaborationContextProvider } from './CollaborationContext';
|
|
7
7
|
export { UsersContext } from './UsersContext';
|
|
8
8
|
export { PivotingAttributeContext } from './PivotingAttributeContext';
|
|
9
9
|
export { ProfilePerspectiveViewContext } from './ProfilePerspectiveViewContext';
|
package/esm/contexts/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { HistoryDiffContext } from './HistoryAppearanceContext';
|
|
|
3
3
|
export { PopupBoundariesContext } from './PopupBoundariesContext';
|
|
4
4
|
export { ViewIdContext } from './ViewIdContext';
|
|
5
5
|
export { BlockImageGalleryDialogContext } from './BlockImageGalleryDialogContext';
|
|
6
|
-
export { CollaborationContext } from './CollaborationContext';
|
|
6
|
+
export { CollaborationContext, CollaborationContextProvider } from './CollaborationContext';
|
|
7
7
|
export { UsersContext } from './UsersContext';
|
|
8
8
|
export { PivotingAttributeContext } from './PivotingAttributeContext';
|
|
9
9
|
export { ProfilePerspectiveViewContext } from './ProfilePerspectiveViewContext';
|
|
@@ -122,7 +122,7 @@ export var useCollaboration = function (_a) {
|
|
|
122
122
|
objectType: objectType,
|
|
123
123
|
visibility: 'public',
|
|
124
124
|
namedUsers: namedUsers,
|
|
125
|
-
permanentLink: ''
|
|
125
|
+
permanentLink: "".concat(window.location.href, "&commentId=").concat(encodeURIComponent('{commentId}'))
|
|
126
126
|
};
|
|
127
127
|
return createCommentRequest({ collaborationPath: collaborationPath, tenant: tenant, data: data })
|
|
128
128
|
.then(function (_a) {
|
|
@@ -142,7 +142,6 @@ export var useCollaboration = function (_a) {
|
|
|
142
142
|
objectType: objectType,
|
|
143
143
|
visibility: 'public',
|
|
144
144
|
namedUsers: namedUsers,
|
|
145
|
-
permanentLink: '',
|
|
146
145
|
commentId: commentId,
|
|
147
146
|
replies: replies
|
|
148
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"@keyframes highlightAnimation" | "highlightError" | "highlightWarning" | "simpleAttribute">;
|
package/esm/hooks/useUsers.js
CHANGED
|
@@ -2,6 +2,8 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { getAllUsersForTenant } from '@reltio/mdm-sdk';
|
|
4
4
|
import mdm from '@reltio/mdm-module';
|
|
5
|
+
import memoizeOne from 'memoize-one';
|
|
6
|
+
var getAllUsersForTenantMemoized = memoizeOne(function (tenant, servicesPath) { return getAllUsersForTenant({ tenant: tenant, servicesPath: servicesPath }); });
|
|
5
7
|
export var useUsers = function () {
|
|
6
8
|
var _a = useState([]), users = _a[0], setUsers = _a[1];
|
|
7
9
|
var tenant = useSelector(mdm.selectors.getTenant);
|
|
@@ -11,7 +13,7 @@ export var useUsers = function () {
|
|
|
11
13
|
setUsers([]);
|
|
12
14
|
};
|
|
13
15
|
useEffect(function () {
|
|
14
|
-
|
|
16
|
+
getAllUsersForTenantMemoized(tenant, servicesPath)
|
|
15
17
|
.then(function (users) { return setUsers(users); })
|
|
16
18
|
.catch(onError);
|
|
17
19
|
}, [tenant, servicesPath]);
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1426",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1426",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1426",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|