@reltio/components 1.4.1409 → 1.4.1411
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/NotMatchButton/NotMatchButton.d.ts +2 -1
- package/cjs/components/NotMatchButton/NotMatchButton.js +2 -1
- package/cjs/components/ProfileBand/styles.d.ts +1 -1
- package/cjs/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +1 -1
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +5 -4
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.js +5 -2
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +2 -2
- package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +1 -1
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +3 -4
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +4 -6
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.js +21 -22
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +2 -3
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +23 -24
- package/cjs/components/workflow/components/AttributesChanges/types/diffTypes.d.ts +3 -5
- package/cjs/components/workflow/components/TaskActionButtons/TaskActionButtons.d.ts +7 -0
- package/cjs/components/workflow/components/TaskActionButtons/TaskActionButtons.js +25 -0
- package/cjs/components/workflow/helpers/dcrHelpers.d.ts +3 -1
- package/cjs/components/workflow/helpers/dcrHelpers.js +9 -1
- package/cjs/components/workflow/hooks/useChangeRequest.d.ts +1 -1
- package/cjs/components/workflow/hooks/useWorkflowActions.d.ts +2 -1
- package/cjs/components/workflow/hooks/useWorkflowActions.js +6 -38
- package/cjs/components/workflow/hooks/useWorkflowDefaultActionSuccessHandler.d.ts +1 -0
- package/cjs/components/workflow/hooks/useWorkflowDefaultActionSuccessHandler.js +47 -0
- package/cjs/components/workflow/hooks/useWorkflowTasks.js +1 -1
- package/cjs/components/workflow/index.d.ts +2 -0
- package/cjs/components/workflow/index.js +5 -1
- package/cjs/hooks/useMarkAsNotMatchRequest.d.ts +3 -2
- package/cjs/hooks/useMarkAsNotMatchRequest.js +5 -3
- package/cjs/hooks/useMergeAllRequest.d.ts +2 -2
- package/esm/components/NotMatchButton/NotMatchButton.d.ts +2 -1
- package/esm/components/NotMatchButton/NotMatchButton.js +2 -1
- package/esm/components/ProfileBand/styles.d.ts +1 -1
- package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +1 -1
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +5 -4
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.js +6 -3
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +2 -2
- package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +1 -1
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +1 -2
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +4 -6
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.js +13 -14
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +2 -3
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +1 -2
- package/esm/components/workflow/components/AttributesChanges/types/diffTypes.d.ts +3 -5
- package/esm/components/workflow/components/TaskActionButtons/TaskActionButtons.d.ts +7 -0
- package/esm/components/workflow/components/TaskActionButtons/TaskActionButtons.js +18 -0
- package/esm/components/workflow/helpers/dcrHelpers.d.ts +3 -1
- package/esm/components/workflow/helpers/dcrHelpers.js +7 -1
- package/esm/components/workflow/hooks/useChangeRequest.d.ts +1 -1
- package/esm/components/workflow/hooks/useWorkflowActions.d.ts +2 -1
- package/esm/components/workflow/hooks/useWorkflowActions.js +5 -17
- package/esm/components/workflow/hooks/useWorkflowDefaultActionSuccessHandler.d.ts +1 -0
- package/esm/components/workflow/hooks/useWorkflowDefaultActionSuccessHandler.js +20 -0
- package/esm/components/workflow/hooks/useWorkflowTasks.js +2 -2
- package/esm/components/workflow/index.d.ts +2 -0
- package/esm/components/workflow/index.js +2 -0
- package/esm/hooks/useMarkAsNotMatchRequest.d.ts +3 -2
- package/esm/hooks/useMarkAsNotMatchRequest.js +5 -3
- package/esm/hooks/useMergeAllRequest.d.ts +2 -2
- package/package.json +3 -3
- package/cjs/components/workflow/constants/operations.d.ts +0 -25
- package/cjs/components/workflow/constants/operations.js +0 -30
- package/cjs/components/workflow/types/dcrTypes.d.ts +0 -69
- package/cjs/components/workflow/types/dcrTypes.js +0 -2
- package/esm/components/workflow/constants/operations.d.ts +0 -25
- package/esm/components/workflow/constants/operations.js +0 -27
- package/esm/components/workflow/types/dcrTypes.d.ts +0 -69
- package/esm/components/workflow/types/dcrTypes.js +0 -1
|
@@ -31,7 +31,7 @@ var useWorkflowTasks = function (config) {
|
|
|
31
31
|
var parsedProcessTypes = !Array.isArray(processTypes) || processTypes.includes('*') ? null : processTypes;
|
|
32
32
|
var requests = (parsedProcessTypes || [null]).map(function (processType) {
|
|
33
33
|
return (0, mdm_sdk_1.getTasksForEntity)({
|
|
34
|
-
entityUri: entityUri,
|
|
34
|
+
entityUri: (0, mdm_sdk_1.isDCRUri)(entityUri) ? (0, mdm_sdk_1.getEntityUriFromDCRUri)(entityUri) : entityUri,
|
|
35
35
|
workflowPath: workflowPath,
|
|
36
36
|
environment: environment,
|
|
37
37
|
tenant: tenant,
|
|
@@ -7,3 +7,5 @@ export { useWorkflowAssignee } from './hooks/useWorkflowAssignee';
|
|
|
7
7
|
export { useWorkflowComments } from './hooks/useWorkflowComments';
|
|
8
8
|
export { useWorkflowCheckPermission } from './hooks/useWorkflowCheckPermission';
|
|
9
9
|
export { useWorkflowTasks } from './hooks/useWorkflowTasks';
|
|
10
|
+
export { TaskActionButtons } from './components/TaskActionButtons/TaskActionButtons';
|
|
11
|
+
export { useWorkflowDefaultActionSuccessHandler } from './hooks/useWorkflowDefaultActionSuccessHandler';
|
|
@@ -3,7 +3,7 @@ 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.useWorkflowTasks = exports.useWorkflowCheckPermission = exports.useWorkflowComments = exports.useWorkflowAssignee = exports.WorkflowComments = exports.AssigneeSelector = exports.TaskActions = exports.AddWorkflowButton = exports.WorkflowTaskCard = void 0;
|
|
6
|
+
exports.useWorkflowDefaultActionSuccessHandler = exports.TaskActionButtons = exports.useWorkflowTasks = exports.useWorkflowCheckPermission = exports.useWorkflowComments = exports.useWorkflowAssignee = exports.WorkflowComments = exports.AssigneeSelector = exports.TaskActions = exports.AddWorkflowButton = exports.WorkflowTaskCard = void 0;
|
|
7
7
|
var WorkflowTaskCard_1 = require("./cards/WorkflowTaskCard");
|
|
8
8
|
Object.defineProperty(exports, "WorkflowTaskCard", { enumerable: true, get: function () { return WorkflowTaskCard_1.WorkflowTaskCard; } });
|
|
9
9
|
var AddWorkflowButton_1 = require("./components/AddWorkflowButton/AddWorkflowButton");
|
|
@@ -22,3 +22,7 @@ var useWorkflowCheckPermission_1 = require("./hooks/useWorkflowCheckPermission")
|
|
|
22
22
|
Object.defineProperty(exports, "useWorkflowCheckPermission", { enumerable: true, get: function () { return useWorkflowCheckPermission_1.useWorkflowCheckPermission; } });
|
|
23
23
|
var useWorkflowTasks_1 = require("./hooks/useWorkflowTasks");
|
|
24
24
|
Object.defineProperty(exports, "useWorkflowTasks", { enumerable: true, get: function () { return useWorkflowTasks_1.useWorkflowTasks; } });
|
|
25
|
+
var TaskActionButtons_1 = require("./components/TaskActionButtons/TaskActionButtons");
|
|
26
|
+
Object.defineProperty(exports, "TaskActionButtons", { enumerable: true, get: function () { return TaskActionButtons_1.TaskActionButtons; } });
|
|
27
|
+
var useWorkflowDefaultActionSuccessHandler_1 = require("./hooks/useWorkflowDefaultActionSuccessHandler");
|
|
28
|
+
Object.defineProperty(exports, "useWorkflowDefaultActionSuccessHandler", { enumerable: true, get: function () { return useWorkflowDefaultActionSuccessHandler_1.useWorkflowDefaultActionSuccessHandler; } });
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Entity } from '@reltio/mdm-sdk';
|
|
1
|
+
import { ApiError, Entity } from '@reltio/mdm-sdk';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
entities: Entity[];
|
|
4
4
|
entity: Entity;
|
|
5
5
|
onFinishRequest?: () => void;
|
|
6
6
|
onStartRequest?: () => void;
|
|
7
7
|
onSuccess?: () => void;
|
|
8
|
+
onError?: (error?: ApiError) => void;
|
|
8
9
|
};
|
|
9
|
-
export declare const useMarkAsNotMatchRequest: ({ entities, entity, onFinishRequest, onStartRequest, onSuccess }: Props) => {
|
|
10
|
+
export declare const useMarkAsNotMatchRequest: ({ entities, entity, onFinishRequest, onStartRequest, onSuccess, onError }: Props) => {
|
|
10
11
|
isPending: boolean;
|
|
11
12
|
sendMarkAsNotMatchRequest: () => void;
|
|
12
13
|
};
|
|
@@ -8,13 +8,14 @@ var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
|
8
8
|
var react_redux_1 = require("react-redux");
|
|
9
9
|
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
10
10
|
var react_1 = require("react");
|
|
11
|
+
var core_1 = require("../core");
|
|
11
12
|
var useIsMountedRef_1 = require("./useIsMountedRef");
|
|
12
13
|
var useMarkAsNotMatchRequest = function (_a) {
|
|
13
|
-
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, onSuccess = _a.onSuccess;
|
|
14
|
+
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, onSuccess = _a.onSuccess, _b = _a.onError, onError = _b === void 0 ? core_1.noop : _b;
|
|
14
15
|
var isMountedRef = (0, useIsMountedRef_1.useIsMountedRef)();
|
|
15
16
|
var tenant = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getTenant);
|
|
16
17
|
var dtssPath = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getDtssPath);
|
|
17
|
-
var
|
|
18
|
+
var _c = (0, react_1.useState)(false), isPending = _c[0], setIsPending = _c[1];
|
|
18
19
|
var sendMarkAsNotMatchRequest = (0, react_1.useCallback)(function () {
|
|
19
20
|
onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
|
|
20
21
|
setIsPending(true);
|
|
@@ -23,11 +24,12 @@ var useMarkAsNotMatchRequest = function (_a) {
|
|
|
23
24
|
.then(function () {
|
|
24
25
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
25
26
|
})
|
|
27
|
+
.catch(onError)
|
|
26
28
|
.finally(function () {
|
|
27
29
|
onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
|
|
28
30
|
isMountedRef.current && setIsPending(false);
|
|
29
31
|
});
|
|
30
|
-
}, [dtssPath, entities, entity, isMountedRef, onFinishRequest, onStartRequest, onSuccess, tenant]);
|
|
32
|
+
}, [dtssPath, entities, entity, isMountedRef, onFinishRequest, onStartRequest, onError, onSuccess, tenant]);
|
|
31
33
|
return { isPending: isPending, sendMarkAsNotMatchRequest: sendMarkAsNotMatchRequest };
|
|
32
34
|
};
|
|
33
35
|
exports.useMarkAsNotMatchRequest = useMarkAsNotMatchRequest;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Entity } from '@reltio/mdm-sdk';
|
|
1
|
+
import { ApiError, Entity } from '@reltio/mdm-sdk';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
entities: Entity[];
|
|
4
4
|
entity: Entity;
|
|
5
5
|
onFinishRequest?: () => void;
|
|
6
6
|
onStartRequest?: () => void;
|
|
7
7
|
onSuccess?: () => void;
|
|
8
|
-
onError?: () => void;
|
|
8
|
+
onError?: (error?: ApiError) => void;
|
|
9
9
|
};
|
|
10
10
|
export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest, onSuccess, onError }: Props) => {
|
|
11
11
|
isPending: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Entity } from '@reltio/mdm-sdk';
|
|
1
|
+
import { ApiError, Entity } from '@reltio/mdm-sdk';
|
|
2
2
|
import { ActionButtonMode } from '../ActionButton/ActionButton';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
declare type Props = {
|
|
@@ -12,6 +12,7 @@ declare type Props = {
|
|
|
12
12
|
onStartRequest?: () => void;
|
|
13
13
|
onFinishRequest?: () => void;
|
|
14
14
|
onSuccess?: () => void;
|
|
15
|
+
onError?: (error?: ApiError) => void;
|
|
15
16
|
};
|
|
16
17
|
export declare const NotMatchButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
|
|
17
18
|
export {};
|
|
@@ -27,12 +27,13 @@ import { noop } from '../../core';
|
|
|
27
27
|
import i18n from 'ui-i18n';
|
|
28
28
|
import { useMarkAsNotMatchRequest } from '../../hooks/useMarkAsNotMatchRequest';
|
|
29
29
|
export var NotMatchButton = forwardRef(function (_a, ref) {
|
|
30
|
-
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, entity = _a.entity, entities = _a.entities, onStartRequest = _a.onStartRequest, onFinishRequest = _a.onFinishRequest, onSuccess = _a.onSuccess, otherProps = __rest(_a, ["className", "mode", "onMenuClose", "disabled", "entity", "entities", "onStartRequest", "onFinishRequest", "onSuccess"]);
|
|
30
|
+
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, entity = _a.entity, entities = _a.entities, onStartRequest = _a.onStartRequest, onFinishRequest = _a.onFinishRequest, onError = _a.onError, onSuccess = _a.onSuccess, otherProps = __rest(_a, ["className", "mode", "onMenuClose", "disabled", "entity", "entities", "onStartRequest", "onFinishRequest", "onError", "onSuccess"]);
|
|
31
31
|
var sendMarkAsNotMatchRequest = useMarkAsNotMatchRequest({
|
|
32
32
|
entity: entity,
|
|
33
33
|
entities: entities,
|
|
34
34
|
onStartRequest: onStartRequest,
|
|
35
35
|
onFinishRequest: onFinishRequest,
|
|
36
|
+
onError: onError,
|
|
36
37
|
onSuccess: onSuccess
|
|
37
38
|
}).sendMarkAsNotMatchRequest;
|
|
38
39
|
return (React.createElement(ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: i18n.text('Not a match'), icon: NotMatchIcon, onClick: sendMarkAsNotMatchRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inactive" | "label" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inactive" | "label" | "secondaryLabel" | "entityType" | "profileBand" | "entityId" | "badge" | "profileIcon" | "profileBandWrapper" | "imageProfileIcon" | "profileInfo" | "businessCard" | "specialInfo">;
|
|
2
2
|
export default useStyles;
|
package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js
CHANGED
|
@@ -12,6 +12,6 @@ var DataChangeRequestTaskCard = function (_a) {
|
|
|
12
12
|
var _b = useChangeRequest(dcrUri), dcr = _b.dcr, groupedObjects = _b.groupedObjects;
|
|
13
13
|
return (React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DcrTaskIcon }, dcr &&
|
|
14
14
|
groupedObjects.map(function (object, index) { return (React.createElement(LineDecorator, { key: index, last: index === groupedObjects.length - 1, divider: true },
|
|
15
|
-
React.createElement(AttributesChanges, { entityInfo: object.entity, relationsInfo: object.relations, changes: dcr.changes, objectsInfo: dcr.objectsInfo }))); })));
|
|
15
|
+
React.createElement(AttributesChanges, { entityInfo: object.entity, relationsInfo: object.relations, changes: dcr.changes, objectsInfo: dcr.objectsInfo, dcrUri: dcrUri }))); })));
|
|
16
16
|
};
|
|
17
17
|
export default DataChangeRequestTaskCard;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DCRChanges, DCRObjectsInfo,
|
|
2
|
+
import { DCRChanges, DCRObjectsInfo, DCREntityInfo, DCRRelationInfo } from '@reltio/mdm-sdk';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
changes: DCRChanges;
|
|
5
5
|
objectsInfo: DCRObjectsInfo;
|
|
6
|
-
entityInfo:
|
|
7
|
-
|
|
6
|
+
entityInfo: DCREntityInfo;
|
|
7
|
+
dcrUri: string;
|
|
8
|
+
relationsInfo?: DCRRelationInfo[];
|
|
8
9
|
max?: number;
|
|
9
10
|
};
|
|
10
|
-
declare const AttributesChanges: ({ changes, objectsInfo, entityInfo, relationsInfo, max }: Props) => JSX.Element;
|
|
11
|
+
declare const AttributesChanges: ({ changes, dcrUri, objectsInfo, entityInfo, relationsInfo, max }: Props) => JSX.Element;
|
|
11
12
|
export default AttributesChanges;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import i18n from 'ui-i18n';
|
|
4
|
-
import { flatten } from 'ramda';
|
|
4
|
+
import { always, any, flatten, ifElse, propOr } from 'ramda';
|
|
5
5
|
import mdmModule from '@reltio/mdm-module';
|
|
6
6
|
import { getEntityUriForLink, getLabel } from '@reltio/mdm-sdk';
|
|
7
7
|
import { mergeChanges } from './helpers/mergeHelpers';
|
|
@@ -10,9 +10,10 @@ import DCRChangesList from './components/DCRChangesList/DCRChangesList';
|
|
|
10
10
|
import { AttributesChangesContext } from './contexts/AttributesChangesContext';
|
|
11
11
|
import { useCollapsibleList } from './hooks/useCollapsibleList';
|
|
12
12
|
import EntityUriLink from '../../../EntityUriLink/EntityUriLink';
|
|
13
|
+
import { getEntityUriForChangeRequest, isCreateEntityOperation } from '../../helpers/dcrHelpers';
|
|
13
14
|
import { useStyles } from './styles';
|
|
14
15
|
var AttributesChanges = function (_a) {
|
|
15
|
-
var changes = _a.changes, objectsInfo = _a.objectsInfo, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo, max = _a.max;
|
|
16
|
+
var changes = _a.changes, dcrUri = _a.dcrUri, objectsInfo = _a.objectsInfo, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo, max = _a.max;
|
|
16
17
|
var styles = useStyles();
|
|
17
18
|
var metadata = useSelector(mdmModule.selectors.getMetadata);
|
|
18
19
|
var _b = useMemo(function () { return mergeChanges(metadata, changes, entityInfo, relationsInfo); }, [metadata, changes, entityInfo, relationsInfo]), mergedEntityChanges = _b[0], mergedRelationsChanges = _b[1];
|
|
@@ -23,9 +24,11 @@ var AttributesChanges = function (_a) {
|
|
|
23
24
|
: mergedEntityChanges;
|
|
24
25
|
}, [mergedEntityChanges, mergedRelationsChanges]);
|
|
25
26
|
var _c = useCollapsibleList(changesList, max), isExpanded = _c.isExpanded, onToggle = _c.onToggle, itemsToShow = _c.itemsToShow, collapsedSuggestionsCount = _c.collapsedSuggestionsCount;
|
|
27
|
+
var entityUri = ifElse(any(isCreateEntityOperation), always(getEntityUriForChangeRequest(dcrUri, entityInfo.uri)), always(getEntityUriForLink(entityInfo)))(propOr([], entityInfo.uri, changes));
|
|
28
|
+
var screen = ifElse(any(isCreateEntityOperation), always('dcrReview'), always('profile'))(propOr([], entityInfo.uri, changes));
|
|
26
29
|
return (React.createElement(AttributesChangesContext.Provider, { value: objectsInfo },
|
|
27
30
|
React.createElement("div", { className: styles.container },
|
|
28
|
-
React.createElement(EntityUriLink, { className: styles.uri, value:
|
|
31
|
+
React.createElement(EntityUriLink, { className: styles.uri, value: entityUri, screen: screen },
|
|
29
32
|
React.createElement("div", { className: styles.label }, getLabel(entityInfo.label))),
|
|
30
33
|
React.createElement(DCRChangesList, { changes: itemsToShow }),
|
|
31
34
|
collapsedSuggestionsCount > 0 && (React.createElement(ShowMoreLink, { onClick: onToggle, suggestionsCount: collapsedSuggestionsCount, isExpanded: isExpanded, className: styles.showMoreLink })))));
|
package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DCROperationTypes } from '@reltio/mdm-sdk';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
label: React.ReactNode;
|
|
5
5
|
oldValue?: React.ReactNode;
|
|
6
6
|
newValue?: React.ReactNode;
|
|
7
|
-
operation?:
|
|
7
|
+
operation?: DCROperationTypes;
|
|
8
8
|
className?: string;
|
|
9
9
|
};
|
|
10
10
|
declare const ChangeView: ({ label, oldValue, newValue, operation, className }: Props) => JSX.Element;
|
|
@@ -10,10 +10,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { complement, curry, flatten, is, isEmpty, pathOr, propOr, times } from 'ramda';
|
|
13
|
-
import { DataTypes, getAttributeTypeSubAttributes, getLabel, getRelationAttributesList, getRelationType, isEmptyValue, isSpecialAttribute } from '@reltio/mdm-sdk';
|
|
13
|
+
import { DataTypes, DCRTypes, getAttributeTypeSubAttributes, getLabel, getRelationAttributesList, getRelationType, isEmptyValue, isSpecialAttribute } from '@reltio/mdm-sdk';
|
|
14
14
|
import { getFilteredAttrTypes } from '../../../../attributes/helpers/attributesView';
|
|
15
15
|
import { getOperationType } from './helpers';
|
|
16
|
-
import { DCRTypes } from '../../../constants/operations';
|
|
17
16
|
var getValues = function (attributes, attrType) {
|
|
18
17
|
if ('newValue' in attributes || 'oldValue' in attributes) {
|
|
19
18
|
var newValue = attributes.newValue, oldValue = attributes.oldValue, type_1 = attributes.type;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { AttributeType } from '@reltio/mdm-sdk';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const getOperationType: (type: string, oldValue?: DCRAttributeValue) => OperationTypes;
|
|
5
|
-
export declare const getOperationLabel: (operation: OperationTypes) => string;
|
|
1
|
+
import { AttributeType, DCRAttributeValue, DCRObjectsInfo, DCROperationTypes, DCRValue } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const getOperationType: (type: string, oldValue?: DCRAttributeValue) => DCROperationTypes;
|
|
3
|
+
export declare const getOperationLabel: (operation: DCROperationTypes) => string;
|
|
6
4
|
export declare const getAttributeDescription: (attrType: AttributeType, value: DCRAttributeValue, currentEntityUri: string, objectsInfo?: DCRObjectsInfo) => {
|
|
7
5
|
objectUri: string;
|
|
8
6
|
objectLabel: string;
|
|
9
7
|
};
|
|
10
|
-
export declare const getDataTypeDefinition: (attributeType: AttributeType, attributeValue:
|
|
8
|
+
export declare const getDataTypeDefinition: (attributeType: AttributeType, attributeValue: DCRValue) => any;
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import i18n from 'ui-i18n';
|
|
2
2
|
import { allPass, always, equals, evolve, pipe, prop, when } from 'ramda';
|
|
3
|
-
import { DataTypes, getAttrDataTypeDefinition, isUrl } from '@reltio/mdm-sdk';
|
|
4
|
-
import { DCRTypes, OperationTypes } from '../../../constants/operations';
|
|
3
|
+
import { DataTypes, DCRTypes, getAttrDataTypeDefinition, isUrl, DCROperationTypes } from '@reltio/mdm-sdk';
|
|
5
4
|
export var getOperationType = function (type, oldValue) {
|
|
6
5
|
switch (type) {
|
|
7
6
|
case DCRTypes.CREATE_RELATIONSHIP:
|
|
8
7
|
case DCRTypes.INSERT_ATTRIBUTE:
|
|
9
|
-
return
|
|
8
|
+
return DCROperationTypes.ADDED;
|
|
10
9
|
case DCRTypes.UPDATE_TAGS:
|
|
11
10
|
case DCRTypes.UPDATE_ROLES:
|
|
12
11
|
case DCRTypes.UPDATE_ATTRIBUTE:
|
|
13
|
-
return
|
|
12
|
+
return DCROperationTypes.EDITED;
|
|
14
13
|
case DCRTypes.DELETE_ATTRIBUTE:
|
|
15
14
|
case DCRTypes.DELETE_RELATIONSHIP:
|
|
16
|
-
return
|
|
15
|
+
return DCROperationTypes.DELETED;
|
|
17
16
|
case DCRTypes.PIN_ATTRIBUTE:
|
|
18
|
-
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.pin) ?
|
|
17
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.pin) ? DCROperationTypes.PIN_DELETED : DCROperationTypes.PINNED;
|
|
19
18
|
case DCRTypes.IGNORE_ATTRIBUTE:
|
|
20
|
-
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.ignored) ?
|
|
19
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.ignored) ? DCROperationTypes.IGNORE_DELETED : DCROperationTypes.IGNORED;
|
|
21
20
|
}
|
|
22
21
|
};
|
|
23
22
|
export var getOperationLabel = function (operation) {
|
|
24
23
|
var _a;
|
|
25
24
|
var labels = (_a = {},
|
|
26
|
-
_a[
|
|
27
|
-
_a[
|
|
28
|
-
_a[
|
|
29
|
-
_a[
|
|
30
|
-
_a[
|
|
31
|
-
_a[
|
|
32
|
-
_a[
|
|
25
|
+
_a[DCROperationTypes.ADDED] = i18n.text('added'),
|
|
26
|
+
_a[DCROperationTypes.EDITED] = i18n.text('edited'),
|
|
27
|
+
_a[DCROperationTypes.DELETED] = i18n.text('deleted'),
|
|
28
|
+
_a[DCROperationTypes.PINNED] = i18n.text('pinned'),
|
|
29
|
+
_a[DCROperationTypes.PIN_DELETED] = i18n.text('pin deleted'),
|
|
30
|
+
_a[DCROperationTypes.IGNORED] = i18n.text('ignored'),
|
|
31
|
+
_a[DCROperationTypes.IGNORE_DELETED] = i18n.text('ignore deleted'),
|
|
33
32
|
_a);
|
|
34
33
|
return labels[operation] || '';
|
|
35
34
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Metadata } from '@reltio/mdm-sdk';
|
|
1
|
+
import { DCRChanges, DCREntityInfo, Metadata, DCRRelationInfo } from '@reltio/mdm-sdk';
|
|
2
2
|
import { Diff } from '../types/diffTypes';
|
|
3
|
-
|
|
4
|
-
declare const mergeChanges: (metadata: Metadata, changes: DCRChanges, entityInfo: EntityInfo, relationsInfo: RelationInfo[]) => [Diff[], Diff[]];
|
|
3
|
+
declare const mergeChanges: (metadata: Metadata, changes: DCRChanges, entityInfo: DCREntityInfo, relationsInfo: DCRRelationInfo[]) => [Diff[], Diff[]];
|
|
5
4
|
export { mergeChanges };
|
|
@@ -10,8 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { concat, curry, difference, flatten, identity, isNil, omit, path, pick, pipe, propEq, propOr, reduce } from 'ramda';
|
|
13
|
-
import { EntityAttrTypes, generateTempUri, getRoleLabel, isEmptyValue } from '@reltio/mdm-sdk';
|
|
14
|
-
import { DCRTypes } from '../../../constants/operations';
|
|
13
|
+
import { DCRTypes, EntityAttrTypes, generateTempUri, getRoleLabel, isEmptyValue } from '@reltio/mdm-sdk';
|
|
15
14
|
import { getEntityChanges, getRelationChanges } from './attributesHelpers';
|
|
16
15
|
var ATTRIBUTE_DELIMITER = '/';
|
|
17
16
|
var SPECIAL_ATTRIBUTES_NAMES = [
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { AttributeType } from '@reltio/mdm-sdk';
|
|
2
|
-
|
|
3
|
-
import { OperationTypes } from '../../../constants/operations';
|
|
4
|
-
export declare type RelationAttributeValue = DCRAttributeValue & RelationInfo;
|
|
1
|
+
import { AttributeType, ChangeValue, DCRAttributeValue, DCROperationTypes, DCRRelationInfo } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare type RelationAttributeValue = DCRAttributeValue & DCRRelationInfo;
|
|
5
3
|
export declare type Diff = {
|
|
6
4
|
level: number;
|
|
7
5
|
label: string;
|
|
@@ -9,7 +7,7 @@ export declare type Diff = {
|
|
|
9
7
|
attributeValue?: DCRAttributeValue | RelationAttributeValue;
|
|
10
8
|
newValue?: ChangeValue;
|
|
11
9
|
oldValue?: ChangeValue;
|
|
12
|
-
operation?:
|
|
10
|
+
operation?: DCROperationTypes;
|
|
13
11
|
};
|
|
14
12
|
export declare type Title = {
|
|
15
13
|
label: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { partition, propEq } from 'ramda';
|
|
3
|
+
import Button from '@material-ui/core/Button';
|
|
4
|
+
import { useWorkflowActions } from '../../hooks/useWorkflowActions';
|
|
5
|
+
export var TaskActionButtons = function (_a) {
|
|
6
|
+
var task = _a.task;
|
|
7
|
+
var taskId = task.taskId, possibleActions = task.possibleActions, assignee = task.assignee, isOpen = task.isOpen, preferredAction = task.preferredAction;
|
|
8
|
+
var _b = useWorkflowActions({
|
|
9
|
+
taskId: taskId,
|
|
10
|
+
possibleActions: possibleActions,
|
|
11
|
+
assignee: assignee,
|
|
12
|
+
isOpen: isOpen
|
|
13
|
+
}), actions = _b.actions, disabled = _b.actionRequestIsInProgress;
|
|
14
|
+
var _c = partition(propEq('text', preferredAction.label), actions), preferredActions = _c[0], otherActions = _c[1];
|
|
15
|
+
return (React.createElement(React.Fragment, null,
|
|
16
|
+
otherActions.map(function (action) { return (React.createElement(Button, { variant: "outlined", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); }),
|
|
17
|
+
preferredActions.map(function (action) { return (React.createElement(Button, { variant: "contained", color: "primary", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); })));
|
|
18
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangeRequest, DCRChanges, DCRObjectInfo, DCRObjectsInfo, GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
2
2
|
export declare const getEntitiesObjects: any;
|
|
3
3
|
export declare const getRelationsObjects: any;
|
|
4
4
|
export declare const extractObjectsFromChangeRequest: (changes: DCRChanges, objectsInfo: DCRObjectsInfo) => DCRObjectInfo[];
|
|
5
5
|
export declare const createEntityRelationsObjectByEntity: any;
|
|
6
6
|
export declare const createEntityRelationsObjectByRelation: any;
|
|
7
7
|
export declare const concatEntityRelationsObjects: (acc: Record<string, GroupedObjectsInfo>, object: GroupedObjectsInfo) => Record<string, GroupedObjectsInfo>;
|
|
8
|
+
export declare const getEntityUriForChangeRequest: (dcrUri: string, entityUri: string) => string;
|
|
9
|
+
export declare const isCreateEntityOperation: (dcr: ChangeRequest) => boolean;
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { isEntityUri, isRelationUri } from '@reltio/mdm-sdk';
|
|
12
|
+
import { DCRTypes, isEntityUri, isRelationUri } from '@reltio/mdm-sdk';
|
|
13
13
|
import { allPass, concat, curry, equals, filter, keys, map, pathOr, pipe, prop, uniq } from 'ramda';
|
|
14
14
|
export var getEntitiesObjects = filter(pipe(prop('uri'), isEntityUri));
|
|
15
15
|
export var getRelationsObjects = filter(pipe(prop('uri'), isRelationUri));
|
|
@@ -41,3 +41,9 @@ export var concatEntityRelationsObjects = function (acc, object) {
|
|
|
41
41
|
};
|
|
42
42
|
return acc;
|
|
43
43
|
};
|
|
44
|
+
export var getEntityUriForChangeRequest = function (dcrUri, entityUri) {
|
|
45
|
+
return "".concat(dcrUri, "/changes/").concat(entityUri);
|
|
46
|
+
};
|
|
47
|
+
export var isCreateEntityOperation = function (dcr) {
|
|
48
|
+
return dcr.type === DCRTypes.CREATE_ENTITY;
|
|
49
|
+
};
|
|
@@ -3,7 +3,8 @@ declare type TaskAction = {
|
|
|
3
3
|
text: string;
|
|
4
4
|
onClick: () => void;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
declare type Props = Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee' | 'isOpen'>;
|
|
7
|
+
export declare const useWorkflowActions: ({ possibleActions, assignee, taskId, isOpen }: Props) => {
|
|
7
8
|
actions: TaskAction[];
|
|
8
9
|
actionRequestIsInProgress: boolean;
|
|
9
10
|
};
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { useCallback, useContext, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
3
|
import { runTaskAction } from '@reltio/mdm-sdk';
|
|
4
|
-
import mdmModule
|
|
5
|
-
import { ViewIdContext } from '../../../contexts/ViewIdContext';
|
|
4
|
+
import mdmModule from '@reltio/mdm-module';
|
|
6
5
|
import { showWorkflowError } from '../helpers/errors';
|
|
7
6
|
import { WorkflowTasksContext } from '../../../contexts/WorkflowTasksContext';
|
|
8
7
|
import { isOpenTask } from '../helpers';
|
|
9
8
|
export var useWorkflowActions = function (_a) {
|
|
10
9
|
var possibleActions = _a.possibleActions, assignee = _a.assignee, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
11
|
-
var
|
|
10
|
+
var onActionSuccess = (useContext(WorkflowTasksContext) || {}).onActionSuccess;
|
|
12
11
|
var workflowPath = useSelector(mdmModule.selectors.getWorkflowPath);
|
|
13
12
|
var environment = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);
|
|
14
13
|
var tenant = useSelector(mdmModule.selectors.getTenant);
|
|
15
14
|
var username = useSelector(mdmModule.selectors.getUserName);
|
|
16
|
-
var
|
|
17
|
-
var _c = useState(false), actionRequestIsInProgress = _c[0], setActionRequestIsInProgress = _c[1];
|
|
18
|
-
var viewId = useContext(ViewIdContext);
|
|
19
|
-
var dispatch = useDispatch();
|
|
15
|
+
var _b = useState(false), actionRequestIsInProgress = _b[0], setActionRequestIsInProgress = _b[1];
|
|
20
16
|
var performTaskAction = useCallback(function (action) { return function () {
|
|
21
17
|
if (workflowPath && taskId) {
|
|
22
18
|
setActionRequestIsInProgress(true);
|
|
@@ -28,14 +24,6 @@ export var useWorkflowActions = function (_a) {
|
|
|
28
24
|
action: action
|
|
29
25
|
})
|
|
30
26
|
.then(function () {
|
|
31
|
-
if (action === 'Delete') {
|
|
32
|
-
dispatch(ui.actions.entityDeletionFinished());
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
// entity refreshing
|
|
36
|
-
dispatch(profile.entity.actions.loadEntity({ viewId: viewId, uri: entityUri }));
|
|
37
|
-
loadTasks === null || loadTasks === void 0 ? void 0 : loadTasks();
|
|
38
|
-
}
|
|
39
27
|
onActionSuccess === null || onActionSuccess === void 0 ? void 0 : onActionSuccess(action);
|
|
40
28
|
})
|
|
41
29
|
.catch(showWorkflowError)
|
|
@@ -43,7 +31,7 @@ export var useWorkflowActions = function (_a) {
|
|
|
43
31
|
setActionRequestIsInProgress(false);
|
|
44
32
|
});
|
|
45
33
|
}
|
|
46
|
-
}; }, [workflowPath, taskId, environment, tenant,
|
|
34
|
+
}; }, [workflowPath, taskId, environment, tenant, onActionSuccess]);
|
|
47
35
|
var actions = useMemo(function () {
|
|
48
36
|
return username === assignee && isOpenTask(isOpen)
|
|
49
37
|
? (possibleActions || []).map(function (_a) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useWorkflowDefaultActionSuccessHandler: () => (action: string) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useCallback, useContext } from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import mdmModule, { profile, ui } from '@reltio/mdm-module';
|
|
4
|
+
import { ViewIdContext, WorkflowTasksContext } from '../../../contexts';
|
|
5
|
+
export var useWorkflowDefaultActionSuccessHandler = function () {
|
|
6
|
+
var loadTasks = (useContext(WorkflowTasksContext) || {}).loadTasks;
|
|
7
|
+
var viewId = useContext(ViewIdContext);
|
|
8
|
+
var entityUri = useSelector(mdmModule.selectors.getEntityUri);
|
|
9
|
+
var dispatch = useDispatch();
|
|
10
|
+
return useCallback(function (action) {
|
|
11
|
+
if (action === 'Delete') {
|
|
12
|
+
dispatch(ui.actions.entityDeletionFinished());
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// entity refreshing
|
|
16
|
+
dispatch(profile.entity.actions.loadEntity({ viewId: viewId, uri: entityUri }));
|
|
17
|
+
loadTasks === null || loadTasks === void 0 ? void 0 : loadTasks();
|
|
18
|
+
}
|
|
19
|
+
}, [dispatch, entityUri, loadTasks, viewId]);
|
|
20
|
+
};
|
|
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { filter, flatten, isNil, map, mergeLeft, pipe, prop, propEq, reject, uniqBy, when } from 'ramda';
|
|
4
4
|
import mdmModule from '@reltio/mdm-module';
|
|
5
|
-
import { getTasksForEntity, isTempUri } from '@reltio/mdm-sdk';
|
|
5
|
+
import { getEntityUriFromDCRUri, getTasksForEntity, isDCRUri, isTempUri } from '@reltio/mdm-sdk';
|
|
6
6
|
import { useSafePromise } from '../../../hooks/useSafePromise';
|
|
7
7
|
import { useWorkflowCheckPermission } from './useWorkflowCheckPermission';
|
|
8
8
|
export var useWorkflowTasks = function (config) {
|
|
@@ -25,7 +25,7 @@ export var useWorkflowTasks = function (config) {
|
|
|
25
25
|
var parsedProcessTypes = !Array.isArray(processTypes) || processTypes.includes('*') ? null : processTypes;
|
|
26
26
|
var requests = (parsedProcessTypes || [null]).map(function (processType) {
|
|
27
27
|
return getTasksForEntity({
|
|
28
|
-
entityUri: entityUri,
|
|
28
|
+
entityUri: isDCRUri(entityUri) ? getEntityUriFromDCRUri(entityUri) : entityUri,
|
|
29
29
|
workflowPath: workflowPath,
|
|
30
30
|
environment: environment,
|
|
31
31
|
tenant: tenant,
|
|
@@ -7,3 +7,5 @@ export { useWorkflowAssignee } from './hooks/useWorkflowAssignee';
|
|
|
7
7
|
export { useWorkflowComments } from './hooks/useWorkflowComments';
|
|
8
8
|
export { useWorkflowCheckPermission } from './hooks/useWorkflowCheckPermission';
|
|
9
9
|
export { useWorkflowTasks } from './hooks/useWorkflowTasks';
|
|
10
|
+
export { TaskActionButtons } from './components/TaskActionButtons/TaskActionButtons';
|
|
11
|
+
export { useWorkflowDefaultActionSuccessHandler } from './hooks/useWorkflowDefaultActionSuccessHandler';
|
|
@@ -7,3 +7,5 @@ export { useWorkflowAssignee } from './hooks/useWorkflowAssignee';
|
|
|
7
7
|
export { useWorkflowComments } from './hooks/useWorkflowComments';
|
|
8
8
|
export { useWorkflowCheckPermission } from './hooks/useWorkflowCheckPermission';
|
|
9
9
|
export { useWorkflowTasks } from './hooks/useWorkflowTasks';
|
|
10
|
+
export { TaskActionButtons } from './components/TaskActionButtons/TaskActionButtons';
|
|
11
|
+
export { useWorkflowDefaultActionSuccessHandler } from './hooks/useWorkflowDefaultActionSuccessHandler';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Entity } from '@reltio/mdm-sdk';
|
|
1
|
+
import { ApiError, Entity } from '@reltio/mdm-sdk';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
entities: Entity[];
|
|
4
4
|
entity: Entity;
|
|
5
5
|
onFinishRequest?: () => void;
|
|
6
6
|
onStartRequest?: () => void;
|
|
7
7
|
onSuccess?: () => void;
|
|
8
|
+
onError?: (error?: ApiError) => void;
|
|
8
9
|
};
|
|
9
|
-
export declare const useMarkAsNotMatchRequest: ({ entities, entity, onFinishRequest, onStartRequest, onSuccess }: Props) => {
|
|
10
|
+
export declare const useMarkAsNotMatchRequest: ({ entities, entity, onFinishRequest, onStartRequest, onSuccess, onError }: Props) => {
|
|
10
11
|
isPending: boolean;
|
|
11
12
|
sendMarkAsNotMatchRequest: () => void;
|
|
12
13
|
};
|
|
@@ -2,13 +2,14 @@ import { isDataTenantEntity, markDataTenantEntityAsNotMatch, markMixedEntitiesAs
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import mdmModule from '@reltio/mdm-module';
|
|
4
4
|
import { useCallback, useState } from 'react';
|
|
5
|
+
import { noop } from '../core';
|
|
5
6
|
import { useIsMountedRef } from './useIsMountedRef';
|
|
6
7
|
export var useMarkAsNotMatchRequest = function (_a) {
|
|
7
|
-
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, onSuccess = _a.onSuccess;
|
|
8
|
+
var entities = _a.entities, entity = _a.entity, onFinishRequest = _a.onFinishRequest, onStartRequest = _a.onStartRequest, onSuccess = _a.onSuccess, _b = _a.onError, onError = _b === void 0 ? noop : _b;
|
|
8
9
|
var isMountedRef = useIsMountedRef();
|
|
9
10
|
var tenant = useSelector(mdmModule.selectors.getTenant);
|
|
10
11
|
var dtssPath = useSelector(mdmModule.selectors.getDtssPath);
|
|
11
|
-
var
|
|
12
|
+
var _c = useState(false), isPending = _c[0], setIsPending = _c[1];
|
|
12
13
|
var sendMarkAsNotMatchRequest = useCallback(function () {
|
|
13
14
|
onStartRequest === null || onStartRequest === void 0 ? void 0 : onStartRequest();
|
|
14
15
|
setIsPending(true);
|
|
@@ -17,10 +18,11 @@ export var useMarkAsNotMatchRequest = function (_a) {
|
|
|
17
18
|
.then(function () {
|
|
18
19
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
19
20
|
})
|
|
21
|
+
.catch(onError)
|
|
20
22
|
.finally(function () {
|
|
21
23
|
onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
|
|
22
24
|
isMountedRef.current && setIsPending(false);
|
|
23
25
|
});
|
|
24
|
-
}, [dtssPath, entities, entity, isMountedRef, onFinishRequest, onStartRequest, onSuccess, tenant]);
|
|
26
|
+
}, [dtssPath, entities, entity, isMountedRef, onFinishRequest, onStartRequest, onError, onSuccess, tenant]);
|
|
25
27
|
return { isPending: isPending, sendMarkAsNotMatchRequest: sendMarkAsNotMatchRequest };
|
|
26
28
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Entity } from '@reltio/mdm-sdk';
|
|
1
|
+
import { ApiError, Entity } from '@reltio/mdm-sdk';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
entities: Entity[];
|
|
4
4
|
entity: Entity;
|
|
5
5
|
onFinishRequest?: () => void;
|
|
6
6
|
onStartRequest?: () => void;
|
|
7
7
|
onSuccess?: () => void;
|
|
8
|
-
onError?: () => void;
|
|
8
|
+
onError?: (error?: ApiError) => void;
|
|
9
9
|
};
|
|
10
10
|
export declare const useMergeAllRequest: ({ entities, entity, onFinishRequest, onStartRequest, onSuccess, onError }: Props) => {
|
|
11
11
|
isPending: boolean;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1411",
|
|
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.1411",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1411",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|