@reltio/components 1.4.906 → 1.4.910

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.
Files changed (69) hide show
  1. package/cjs/components/ActionButton/ActionButton.d.ts +16 -0
  2. package/cjs/components/ActionButton/ActionButton.js +90 -0
  3. package/cjs/components/ActionButton/styles.d.ts +1 -0
  4. package/cjs/components/ActionButton/styles.js +50 -0
  5. package/cjs/components/MergeButton/MergeButton.d.ts +15 -0
  6. package/cjs/components/MergeButton/MergeButton.js +64 -0
  7. package/cjs/components/NotMatchButton/NotMatchButton.d.ts +15 -0
  8. package/cjs/components/NotMatchButton/NotMatchButton.js +64 -0
  9. package/cjs/components/ProfileMatchCard/ProfileMatchCard.d.ts +2 -1
  10. package/cjs/components/ProfileMatchCard/ProfileMatchCard.js +3 -2
  11. package/cjs/components/attributes/AttributesView/AttributesView.d.ts +1 -1
  12. package/cjs/components/attributes/AttributesView/AttributesView.js +2 -2
  13. package/cjs/components/attributes/AttributesView/index.d.ts +1 -1
  14. package/cjs/components/attributes/editMode/AttributesList/AttributesList.js +3 -1
  15. package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.js +4 -1
  16. package/cjs/components/attributes/editMode/AttributesView/AttributesView.d.ts +1 -1
  17. package/cjs/components/attributes/editMode/AttributesView/AttributesView.js +9 -2
  18. package/cjs/components/attributes/editMode/AttributesView/index.d.ts +9 -1
  19. package/cjs/components/attributes/editMode/contexts/PinnedAttributesContext.d.ts +2 -0
  20. package/cjs/components/attributes/editMode/contexts/PinnedAttributesContext.js +8 -0
  21. package/cjs/components/attributes/readMode/AttributesView/index.d.ts +8 -0
  22. package/cjs/components/attributes/types/attributesView.d.ts +4 -0
  23. package/cjs/components/index.d.ts +3 -0
  24. package/cjs/components/index.js +8 -1
  25. package/cjs/contexts/CollaborationContext/index.d.ts +1 -0
  26. package/cjs/contexts/CollaborationContext/index.js +1 -0
  27. package/cjs/hooks/index.d.ts +2 -0
  28. package/cjs/hooks/index.js +5 -1
  29. package/cjs/hooks/useCollaboration.d.ts +11 -10
  30. package/cjs/hooks/useCollaboration.js +24 -15
  31. package/cjs/hooks/useMarkAsNotMatchRequest.d.ts +12 -0
  32. package/cjs/hooks/useMarkAsNotMatchRequest.js +29 -0
  33. package/cjs/hooks/useMergeAllRequest.d.ts +12 -0
  34. package/cjs/hooks/useMergeAllRequest.js +29 -0
  35. package/esm/components/ActionButton/ActionButton.d.ts +16 -0
  36. package/esm/components/ActionButton/ActionButton.js +65 -0
  37. package/esm/components/ActionButton/styles.d.ts +1 -0
  38. package/esm/components/ActionButton/styles.js +47 -0
  39. package/esm/components/MergeButton/MergeButton.d.ts +15 -0
  40. package/esm/components/MergeButton/MergeButton.js +39 -0
  41. package/esm/components/NotMatchButton/NotMatchButton.d.ts +15 -0
  42. package/esm/components/NotMatchButton/NotMatchButton.js +39 -0
  43. package/esm/components/ProfileMatchCard/ProfileMatchCard.d.ts +2 -1
  44. package/esm/components/ProfileMatchCard/ProfileMatchCard.js +3 -2
  45. package/esm/components/attributes/AttributesView/AttributesView.d.ts +1 -1
  46. package/esm/components/attributes/AttributesView/AttributesView.js +2 -2
  47. package/esm/components/attributes/AttributesView/index.d.ts +1 -1
  48. package/esm/components/attributes/editMode/AttributesList/AttributesList.js +4 -2
  49. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.js +5 -2
  50. package/esm/components/attributes/editMode/AttributesView/AttributesView.d.ts +1 -1
  51. package/esm/components/attributes/editMode/AttributesView/AttributesView.js +10 -3
  52. package/esm/components/attributes/editMode/AttributesView/index.d.ts +9 -1
  53. package/esm/components/attributes/editMode/contexts/PinnedAttributesContext.d.ts +2 -0
  54. package/esm/components/attributes/editMode/contexts/PinnedAttributesContext.js +2 -0
  55. package/esm/components/attributes/readMode/AttributesView/index.d.ts +8 -0
  56. package/esm/components/attributes/types/attributesView.d.ts +4 -0
  57. package/esm/components/index.d.ts +3 -0
  58. package/esm/components/index.js +3 -0
  59. package/esm/contexts/CollaborationContext/index.d.ts +1 -0
  60. package/esm/contexts/CollaborationContext/index.js +1 -0
  61. package/esm/hooks/index.d.ts +2 -0
  62. package/esm/hooks/index.js +2 -0
  63. package/esm/hooks/useCollaboration.d.ts +11 -10
  64. package/esm/hooks/useCollaboration.js +25 -16
  65. package/esm/hooks/useMarkAsNotMatchRequest.d.ts +12 -0
  66. package/esm/hooks/useMarkAsNotMatchRequest.js +22 -0
  67. package/esm/hooks/useMergeAllRequest.d.ts +12 -0
  68. package/esm/hooks/useMergeAllRequest.js +22 -0
  69. package/package.json +3 -3
@@ -9,6 +9,10 @@ declare const _default: import("react-redux").ConnectedComponent<({ className, e
9
9
  excludeUris?: string[];
10
10
  className?: string;
11
11
  attributesCount?: number;
12
+ pinnedAttributes?: {
13
+ attributes: string[];
14
+ roles?: string[];
15
+ }[];
12
16
  }) => JSX.Element, import("react-redux").Omit<{
13
17
  entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
14
18
  metadata: import("@reltio/mdm-sdk").Metadata;
@@ -17,5 +21,9 @@ declare const _default: import("react-redux").ConnectedComponent<({ className, e
17
21
  excludeUris?: string[];
18
22
  className?: string;
19
23
  attributesCount?: number;
24
+ pinnedAttributes?: {
25
+ attributes: string[];
26
+ roles?: string[];
27
+ }[];
20
28
  }, "metadata">>;
21
29
  export default _default;
@@ -6,6 +6,10 @@ declare type OwnProps = {
6
6
  entity?: Entity | Record<string, never>;
7
7
  excludeUris?: string[];
8
8
  includeUris?: string[];
9
+ pinnedAttributes?: {
10
+ attributes: string[];
11
+ roles?: string[];
12
+ }[];
9
13
  mode?: Mode;
10
14
  };
11
15
  declare type StateProps = {
@@ -122,3 +122,6 @@ export { default as OvIcon } from './attributes/OvIcon';
122
122
  export { default as RelationEditor } from './RelationEditor';
123
123
  export * from './workflow';
124
124
  export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
125
+ export { MergeButton } from './MergeButton/MergeButton';
126
+ export { NotMatchButton } from './NotMatchButton/NotMatchButton';
127
+ export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
@@ -121,3 +121,6 @@ export { default as OvIcon } from './attributes/OvIcon';
121
121
  export { default as RelationEditor } from './RelationEditor';
122
122
  export * from './workflow';
123
123
  export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
124
+ export { MergeButton } from './MergeButton/MergeButton';
125
+ export { NotMatchButton } from './NotMatchButton/NotMatchButton';
126
+ export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
@@ -6,6 +6,7 @@ export declare const CollaborationContext: React.Context<{
6
6
  comments: Comment[];
7
7
  currentComment: Comment;
8
8
  getComments: (uri: string, pageToken?: string) => void;
9
+ getCommentsCount: (objectIds: string[]) => void;
9
10
  getComment: (commentId: Comment['commentId']) => void;
10
11
  createComment: (params: Pick<Comment, 'content' | 'namedUsers' | 'objectType' | 'relatedObjectUris'> & {
11
12
  uri: string;
@@ -6,6 +6,7 @@ export var CollaborationContext = React.createContext({
6
6
  currentComment: null,
7
7
  getComment: noop,
8
8
  getComments: function () { return new Promise(noop); },
9
+ getCommentsCount: noop,
9
10
  createComment: function () { return new Promise(noop); },
10
11
  editComment: function () { return new Promise(noop); },
11
12
  createReply: function () { return new Promise(noop); },
@@ -13,3 +13,5 @@ export { useWhyDidYouUpdate } from './useWhyDidYouUpdate';
13
13
  export { useConfigPermissions } from './useConfigPermissions';
14
14
  export { useMatchesLoader } from './useMatchesLoader';
15
15
  export { usePagingSimulator } from './usePagingSimulator';
16
+ export { useMergeAllRequest } from './useMergeAllRequest';
17
+ export { useMarkAsNotMatchRequest } from './useMarkAsNotMatchRequest';
@@ -13,3 +13,5 @@ export { useWhyDidYouUpdate } from './useWhyDidYouUpdate';
13
13
  export { useConfigPermissions } from './useConfigPermissions';
14
14
  export { useMatchesLoader } from './useMatchesLoader';
15
15
  export { usePagingSimulator } from './usePagingSimulator';
16
+ export { useMergeAllRequest } from './useMergeAllRequest';
17
+ export { useMarkAsNotMatchRequest } from './useMarkAsNotMatchRequest';
@@ -1,19 +1,20 @@
1
1
  import { CollaborationObjectTypes, Comment, CommentsMap } from '@reltio/mdm-sdk';
2
2
  export declare const useCollaboration: (objectIds?: string[], objectTypes?: CollaborationObjectTypes[]) => {
3
- commentsMap: CommentsMap;
4
- currentComment: Comment;
3
+ clearCurrentComment: () => void;
5
4
  comments: Comment[];
6
- getComment: (commentId: string) => void;
5
+ commentsMap: CommentsMap;
6
+ createComment: ({ content, namedUsers, objectType, uri, relatedObjectUris }: any) => Promise<void>;
7
7
  createReply: ({ content, namedUsers, commentId, action, uri }: any) => Promise<void>;
8
- editComment: ({ content, namedUsers, objectType, uri, relatedObjectUris, commentId, replies }: any) => Promise<void>;
8
+ currentComment: Comment;
9
9
  deleteComment: ({ uri, commentId }: any) => void;
10
- createComment: ({ content, namedUsers, objectType, uri, relatedObjectUris }: any) => Promise<void>;
11
- clearCurrentComment: () => void;
12
- resolveThread: ({ commentId, uri }: any) => void;
13
- reOpenThread: ({ commentId, uri }: any) => void;
14
- sending: boolean;
10
+ editComment: ({ content, namedUsers, objectType, uri, relatedObjectUris, commentId, replies }: any) => Promise<void>;
11
+ getComment: (commentId: string) => void;
12
+ getComments: (relatedObjectUri: string, pageToken?: string) => void;
13
+ getCommentsCount: (objectIds: string[], shouldResetCommentsMap?: any) => void;
15
14
  loading: boolean;
16
15
  objectTypes: CollaborationObjectTypes[];
17
- getComments: (relatedObjectUri: string, pageToken?: string) => void;
18
16
  pageToken: string;
17
+ reOpenThread: ({ commentId, uri }: any) => void;
18
+ resolveThread: ({ commentId, uri }: any) => void;
19
+ sending: boolean;
19
20
  };
@@ -17,7 +17,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
17
17
  import { useCallback, useEffect, useState } from 'react';
18
18
  import { useSelector } from 'react-redux';
19
19
  import { andThen, fromPairs, map, otherwise, pipe, props, uniqBy, prop, propEq, when, always } from 'ramda';
20
- import { createComment as createCommentRequest, createReply as createReplyRequest, getComment as getCommentRequest, getCommentsCount, updateComment as updateCommentRequest, deleteComment as deleteCommentRequest, getComments as getCommentsRequest, isTempUri } from '@reltio/mdm-sdk';
20
+ import { createComment as createCommentRequest, createReply as createReplyRequest, getComment as getCommentRequest, getCommentsCount as getCommentsCountRequest, updateComment as updateCommentRequest, deleteComment as deleteCommentRequest, getComments as getCommentsRequest, isTempUri } from '@reltio/mdm-sdk';
21
21
  import mdm from '@reltio/mdm-module';
22
22
  var defaultObjectIds = [];
23
23
  var catchErrorInRequest = function (e) { return console.error('Collaboration error', e); };
@@ -33,18 +33,26 @@ export var useCollaboration = function (objectIds, objectTypes) {
33
33
  var _d = useState(null), currentComment = _d[0], setCurrentComment = _d[1];
34
34
  var _e = useState(false), sending = _e[0], setSending = _e[1];
35
35
  var _f = useState(false), loading = _f[0], setLoading = _f[1];
36
- useEffect(function () {
37
- if (isCollaborationEnabled && entity && !isTempUri(entity.uri)) {
36
+ var addCommentsToCommentsMap = useCallback(function (commentsMap) {
37
+ setCommentsMap(function (currentCommentsMap) { return (__assign(__assign({}, currentCommentsMap), commentsMap)); });
38
+ }, []);
39
+ var entityUri = entity === null || entity === void 0 ? void 0 : entity.uri;
40
+ var getCommentsCount = useCallback(function (objectIds, shouldResetCommentsMap) {
41
+ if (shouldResetCommentsMap === void 0) { shouldResetCommentsMap = false; }
42
+ if (isCollaborationEnabled && entityUri && !isTempUri(entityUri)) {
38
43
  var onError = function (e) {
39
44
  console.warn('Collaboration error', e);
40
45
  setCommentsMap(null);
41
46
  };
42
- pipe(getCommentsCount, andThen(map(props(['objectId', 'comments']))), andThen(fromPairs), andThen(setCommentsMap), otherwise(onError))({ uris: objectIds, tenant: tenant, collaborationPath: collaborationPath });
47
+ pipe(getCommentsCountRequest, andThen(map(props(['objectId', 'comments']))), andThen(fromPairs), andThen(shouldResetCommentsMap ? setCommentsMap : addCommentsToCommentsMap), otherwise(onError))({ uris: objectIds, tenant: tenant, collaborationPath: collaborationPath });
43
48
  }
44
49
  else {
45
50
  setCommentsMap(null);
46
51
  }
47
- }, [entity, isCollaborationEnabled, tenant, collaborationPath, objectIds]);
52
+ }, [addCommentsToCommentsMap, collaborationPath, entityUri, isCollaborationEnabled, tenant]);
53
+ useEffect(function () {
54
+ getCommentsCount(objectIds, true);
55
+ }, [objectIds, getCommentsCount]);
48
56
  var getComments = useCallback(function (relatedObjectUri, pageToken) {
49
57
  getCommentsRequest({ collaborationPath: collaborationPath, tenant: tenant, relatedObjectUri: relatedObjectUri, pageToken: pageToken })
50
58
  .then(function (_a) {
@@ -198,21 +206,22 @@ export var useCollaboration = function (objectIds, objectTypes) {
198
206
  setCurrentComment(null);
199
207
  }, []);
200
208
  return {
201
- commentsMap: commentsMap,
202
- currentComment: currentComment,
209
+ clearCurrentComment: clearCurrentComment,
203
210
  comments: comments,
204
- getComment: getComment,
211
+ commentsMap: commentsMap,
212
+ createComment: createComment,
205
213
  createReply: createReply,
206
- editComment: editComment,
214
+ currentComment: currentComment,
207
215
  deleteComment: deleteComment,
208
- createComment: createComment,
209
- clearCurrentComment: clearCurrentComment,
210
- resolveThread: resolveThread,
211
- reOpenThread: reOpenThread,
212
- sending: sending,
216
+ editComment: editComment,
217
+ getComment: getComment,
218
+ getComments: getComments,
219
+ getCommentsCount: getCommentsCount,
213
220
  loading: loading,
214
221
  objectTypes: objectTypes,
215
- getComments: getComments,
216
- pageToken: pageToken
222
+ pageToken: pageToken,
223
+ reOpenThread: reOpenThread,
224
+ resolveThread: resolveThread,
225
+ sending: sending
217
226
  };
218
227
  };
@@ -0,0 +1,12 @@
1
+ import { Entity } from '@reltio/mdm-sdk';
2
+ declare type Props = {
3
+ entities: Entity[];
4
+ entity: Entity;
5
+ onFinishRequest?: () => void;
6
+ onStartRequest?: () => void;
7
+ };
8
+ export declare const useMarkAsNotMatchRequest: ({ entities, entity, onFinishRequest, onStartRequest }: Props) => {
9
+ isPending: boolean;
10
+ sendMarkAsNotMatchRequest: () => void;
11
+ };
12
+ export {};
@@ -0,0 +1,22 @@
1
+ import { isDataTenantEntity, markDataTenantEntityAsNotMatch, markMixedEntitiesAsNotMatches } from '@reltio/mdm-sdk';
2
+ import { useSelector } from 'react-redux';
3
+ import mdmModule from '@reltio/mdm-module';
4
+ import { useCallback, useState } from 'react';
5
+ export var useMarkAsNotMatchRequest = function (_a) {
6
+ var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest;
7
+ var tenant = useSelector(mdmModule.selectors.getTenant);
8
+ var dtssPath = useSelector(mdmModule.selectors.getDtssPath);
9
+ var _b = useState(false), isPending = _b[0], setIsPending = _b[1];
10
+ var sendMarkAsNotMatchRequest = useCallback(function () {
11
+ onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
12
+ setIsPending(true);
13
+ var params = { dtssPath: dtssPath, customerTenant: tenant, entity: entity, entities: entities };
14
+ (isDataTenantEntity(entity)
15
+ ? markDataTenantEntityAsNotMatch(params)
16
+ : markMixedEntitiesAsNotMatches(params)).finally(function () {
17
+ onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
18
+ setIsPending(false);
19
+ });
20
+ }, [dtssPath, entities, entity, onFinishRequest, onStartRequest, tenant]);
21
+ return { isPending: isPending, sendMarkAsNotMatchRequest: sendMarkAsNotMatchRequest };
22
+ };
@@ -0,0 +1,12 @@
1
+ import { Entity } from '@reltio/mdm-sdk';
2
+ declare type Props = {
3
+ entities: Entity[];
4
+ entity: Entity;
5
+ onFinishRequest?: () => void;
6
+ onStartRequest?: () => void;
7
+ };
8
+ export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest }: Props) => {
9
+ isPending: boolean;
10
+ sendMergeAllRequest: () => void;
11
+ };
12
+ export {};
@@ -0,0 +1,22 @@
1
+ import { useCallback, useState } from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import mdmModule from '@reltio/mdm-module';
4
+ import { isDataTenantEntity, mergeCustomerTenantEntityWithMixedEntities, mergeDataTenantEntity } from '@reltio/mdm-sdk';
5
+ export var useMergeAllRequest = function (_a) {
6
+ var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest;
7
+ var tenant = useSelector(mdmModule.selectors.getTenant);
8
+ var dtssPath = useSelector(mdmModule.selectors.getDtssPath);
9
+ var _b = useState(false), isPending = _b[0], setIsPending = _b[1];
10
+ var sendMergeAllRequest = useCallback(function () {
11
+ onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
12
+ setIsPending(true);
13
+ var params = { dtssPath: dtssPath, customerTenant: tenant, entity: entity, entities: entities };
14
+ (isDataTenantEntity(entity)
15
+ ? mergeDataTenantEntity(params)
16
+ : mergeCustomerTenantEntityWithMixedEntities(params)).finally(function () {
17
+ onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
18
+ setIsPending(false);
19
+ });
20
+ }, [dtssPath, entities, entity, onFinishRequest, onStartRequest, tenant]);
21
+ return { isPending: isPending, sendMergeAllRequest: sendMergeAllRequest };
22
+ };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.906",
3
+ "version": "1.4.910",
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.906",
11
- "@reltio/mdm-sdk": "^1.4.906",
10
+ "@reltio/mdm-module": "^1.4.910",
11
+ "@reltio/mdm-sdk": "^1.4.910",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",