@reltio/components 1.4.908 → 1.4.909
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/ActionButton/ActionButton.d.ts +16 -0
- package/cjs/components/ActionButton/ActionButton.js +90 -0
- package/cjs/components/ActionButton/styles.d.ts +1 -0
- package/cjs/components/ActionButton/styles.js +50 -0
- package/cjs/components/MergeButton/MergeButton.d.ts +15 -0
- package/cjs/components/MergeButton/MergeButton.js +64 -0
- package/cjs/components/NotMatchButton/NotMatchButton.d.ts +15 -0
- package/cjs/components/NotMatchButton/NotMatchButton.js +64 -0
- package/cjs/components/ProfileMatchCard/ProfileMatchCard.d.ts +2 -1
- package/cjs/components/ProfileMatchCard/ProfileMatchCard.js +3 -2
- package/cjs/components/attributes/AttributesView/AttributesView.d.ts +1 -1
- package/cjs/components/attributes/AttributesView/AttributesView.js +2 -2
- package/cjs/components/attributes/AttributesView/index.d.ts +1 -1
- package/cjs/components/attributes/editMode/AttributesList/AttributesList.js +3 -1
- package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.js +4 -1
- package/cjs/components/attributes/editMode/AttributesView/AttributesView.d.ts +1 -1
- package/cjs/components/attributes/editMode/AttributesView/AttributesView.js +9 -2
- package/cjs/components/attributes/editMode/AttributesView/index.d.ts +9 -1
- package/cjs/components/attributes/editMode/contexts/PinnedAttributesContext.d.ts +2 -0
- package/cjs/components/attributes/editMode/contexts/PinnedAttributesContext.js +8 -0
- package/cjs/components/attributes/readMode/AttributesView/index.d.ts +8 -0
- package/cjs/components/attributes/types/attributesView.d.ts +4 -0
- package/cjs/components/index.d.ts +3 -0
- package/cjs/components/index.js +8 -1
- package/cjs/contexts/CollaborationContext/index.d.ts +1 -0
- package/cjs/contexts/CollaborationContext/index.js +1 -0
- package/cjs/hooks/index.d.ts +2 -0
- package/cjs/hooks/index.js +5 -1
- package/cjs/hooks/useCollaboration.d.ts +11 -10
- package/cjs/hooks/useCollaboration.js +24 -15
- package/cjs/hooks/useMarkAsNotMatchRequest.d.ts +12 -0
- package/cjs/hooks/useMarkAsNotMatchRequest.js +29 -0
- package/cjs/hooks/useMergeAllRequest.d.ts +12 -0
- package/cjs/hooks/useMergeAllRequest.js +29 -0
- package/esm/components/ActionButton/ActionButton.d.ts +16 -0
- package/esm/components/ActionButton/ActionButton.js +65 -0
- package/esm/components/ActionButton/styles.d.ts +1 -0
- package/esm/components/ActionButton/styles.js +47 -0
- package/esm/components/MergeButton/MergeButton.d.ts +15 -0
- package/esm/components/MergeButton/MergeButton.js +39 -0
- package/esm/components/NotMatchButton/NotMatchButton.d.ts +15 -0
- package/esm/components/NotMatchButton/NotMatchButton.js +39 -0
- package/esm/components/ProfileMatchCard/ProfileMatchCard.d.ts +2 -1
- package/esm/components/ProfileMatchCard/ProfileMatchCard.js +3 -2
- package/esm/components/attributes/AttributesView/AttributesView.d.ts +1 -1
- package/esm/components/attributes/AttributesView/AttributesView.js +2 -2
- package/esm/components/attributes/AttributesView/index.d.ts +1 -1
- package/esm/components/attributes/editMode/AttributesList/AttributesList.js +4 -2
- package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.js +5 -2
- package/esm/components/attributes/editMode/AttributesView/AttributesView.d.ts +1 -1
- package/esm/components/attributes/editMode/AttributesView/AttributesView.js +10 -3
- package/esm/components/attributes/editMode/AttributesView/index.d.ts +9 -1
- package/esm/components/attributes/editMode/contexts/PinnedAttributesContext.d.ts +2 -0
- package/esm/components/attributes/editMode/contexts/PinnedAttributesContext.js +2 -0
- package/esm/components/attributes/readMode/AttributesView/index.d.ts +8 -0
- package/esm/components/attributes/types/attributesView.d.ts +4 -0
- package/esm/components/index.d.ts +3 -0
- package/esm/components/index.js +3 -0
- package/esm/contexts/CollaborationContext/index.d.ts +1 -0
- package/esm/contexts/CollaborationContext/index.js +1 -0
- package/esm/hooks/index.d.ts +2 -0
- package/esm/hooks/index.js +2 -0
- package/esm/hooks/useCollaboration.d.ts +11 -10
- package/esm/hooks/useCollaboration.js +25 -16
- package/esm/hooks/useMarkAsNotMatchRequest.d.ts +12 -0
- package/esm/hooks/useMarkAsNotMatchRequest.js +22 -0
- package/esm/hooks/useMergeAllRequest.d.ts +12 -0
- package/esm/hooks/useMergeAllRequest.js +22 -0
- 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;
|
|
@@ -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';
|
package/esm/components/index.js
CHANGED
|
@@ -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); },
|
package/esm/hooks/index.d.ts
CHANGED
|
@@ -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';
|
package/esm/hooks/index.js
CHANGED
|
@@ -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
|
-
|
|
4
|
-
currentComment: Comment;
|
|
3
|
+
clearCurrentComment: () => void;
|
|
5
4
|
comments: Comment[];
|
|
6
|
-
|
|
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
|
-
|
|
8
|
+
currentComment: Comment;
|
|
9
9
|
deleteComment: ({ uri, commentId }: any) => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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(
|
|
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
|
-
}, [
|
|
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
|
-
|
|
202
|
-
currentComment: currentComment,
|
|
209
|
+
clearCurrentComment: clearCurrentComment,
|
|
203
210
|
comments: comments,
|
|
204
|
-
|
|
211
|
+
commentsMap: commentsMap,
|
|
212
|
+
createComment: createComment,
|
|
205
213
|
createReply: createReply,
|
|
206
|
-
|
|
214
|
+
currentComment: currentComment,
|
|
207
215
|
deleteComment: deleteComment,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
sending: sending,
|
|
216
|
+
editComment: editComment,
|
|
217
|
+
getComment: getComment,
|
|
218
|
+
getComments: getComments,
|
|
219
|
+
getCommentsCount: getCommentsCount,
|
|
213
220
|
loading: loading,
|
|
214
221
|
objectTypes: objectTypes,
|
|
215
|
-
|
|
216
|
-
|
|
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.
|
|
3
|
+
"version": "1.4.909",
|
|
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.909",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.909",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|