@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
|
@@ -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 {};
|
|
@@ -56,12 +56,13 @@ var core_1 = require("../../core");
|
|
|
56
56
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
57
57
|
var useMarkAsNotMatchRequest_1 = require("../../hooks/useMarkAsNotMatchRequest");
|
|
58
58
|
exports.NotMatchButton = (0, react_1.forwardRef)(function (_a, ref) {
|
|
59
|
-
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButton_1.ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? core_1.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"]);
|
|
59
|
+
var className = _a.className, _b = _a.mode, mode = _b === void 0 ? ActionButton_1.ActionButtonMode.iconButton : _b, _c = _a.onMenuClose, onMenuClose = _c === void 0 ? core_1.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"]);
|
|
60
60
|
var sendMarkAsNotMatchRequest = (0, useMarkAsNotMatchRequest_1.useMarkAsNotMatchRequest)({
|
|
61
61
|
entity: entity,
|
|
62
62
|
entities: entities,
|
|
63
63
|
onStartRequest: onStartRequest,
|
|
64
64
|
onFinishRequest: onFinishRequest,
|
|
65
|
+
onError: onError,
|
|
65
66
|
onSuccess: onSuccess
|
|
66
67
|
}).sendMarkAsNotMatchRequest;
|
|
67
68
|
return (react_1.default.createElement(ActionButton_1.ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: ui_i18n_1.default.text('Not a match'), icon: NotMatchDark_1.default, 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/cjs/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js
CHANGED
|
@@ -17,6 +17,6 @@ var DataChangeRequestTaskCard = function (_a) {
|
|
|
17
17
|
var _b = (0, useChangeRequest_1.useChangeRequest)(dcrUri), dcr = _b.dcr, groupedObjects = _b.groupedObjects;
|
|
18
18
|
return (react_1.default.createElement(GenericWorkflowTaskCard_1.default, { task: task, Icon: DcrTaskIcon_1.default }, dcr &&
|
|
19
19
|
groupedObjects.map(function (object, index) { return (react_1.default.createElement(LineDecorator_1.default, { key: index, last: index === groupedObjects.length - 1, divider: true },
|
|
20
|
-
react_1.default.createElement(AttributesChanges_1.default, { entityInfo: object.entity, relationsInfo: object.relations, changes: dcr.changes, objectsInfo: dcr.objectsInfo }))); })));
|
|
20
|
+
react_1.default.createElement(AttributesChanges_1.default, { entityInfo: object.entity, relationsInfo: object.relations, changes: dcr.changes, objectsInfo: dcr.objectsInfo, dcrUri: dcrUri }))); })));
|
|
21
21
|
};
|
|
22
22
|
exports.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;
|
|
@@ -38,9 +38,10 @@ var DCRChangesList_1 = __importDefault(require("./components/DCRChangesList/DCRC
|
|
|
38
38
|
var AttributesChangesContext_1 = require("./contexts/AttributesChangesContext");
|
|
39
39
|
var useCollapsibleList_1 = require("./hooks/useCollapsibleList");
|
|
40
40
|
var EntityUriLink_1 = __importDefault(require("../../../EntityUriLink/EntityUriLink"));
|
|
41
|
+
var dcrHelpers_1 = require("../../helpers/dcrHelpers");
|
|
41
42
|
var styles_1 = require("./styles");
|
|
42
43
|
var AttributesChanges = function (_a) {
|
|
43
|
-
var changes = _a.changes, objectsInfo = _a.objectsInfo, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo, max = _a.max;
|
|
44
|
+
var changes = _a.changes, dcrUri = _a.dcrUri, objectsInfo = _a.objectsInfo, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo, max = _a.max;
|
|
44
45
|
var styles = (0, styles_1.useStyles)();
|
|
45
46
|
var metadata = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getMetadata);
|
|
46
47
|
var _b = (0, react_1.useMemo)(function () { return (0, mergeHelpers_1.mergeChanges)(metadata, changes, entityInfo, relationsInfo); }, [metadata, changes, entityInfo, relationsInfo]), mergedEntityChanges = _b[0], mergedRelationsChanges = _b[1];
|
|
@@ -51,9 +52,11 @@ var AttributesChanges = function (_a) {
|
|
|
51
52
|
: mergedEntityChanges;
|
|
52
53
|
}, [mergedEntityChanges, mergedRelationsChanges]);
|
|
53
54
|
var _c = (0, useCollapsibleList_1.useCollapsibleList)(changesList, max), isExpanded = _c.isExpanded, onToggle = _c.onToggle, itemsToShow = _c.itemsToShow, collapsedSuggestionsCount = _c.collapsedSuggestionsCount;
|
|
55
|
+
var entityUri = (0, ramda_1.ifElse)((0, ramda_1.any)(dcrHelpers_1.isCreateEntityOperation), (0, ramda_1.always)((0, dcrHelpers_1.getEntityUriForChangeRequest)(dcrUri, entityInfo.uri)), (0, ramda_1.always)((0, mdm_sdk_1.getEntityUriForLink)(entityInfo)))((0, ramda_1.propOr)([], entityInfo.uri, changes));
|
|
56
|
+
var screen = (0, ramda_1.ifElse)((0, ramda_1.any)(dcrHelpers_1.isCreateEntityOperation), (0, ramda_1.always)('dcrReview'), (0, ramda_1.always)('profile'))((0, ramda_1.propOr)([], entityInfo.uri, changes));
|
|
54
57
|
return (react_1.default.createElement(AttributesChangesContext_1.AttributesChangesContext.Provider, { value: objectsInfo },
|
|
55
58
|
react_1.default.createElement("div", { className: styles.container },
|
|
56
|
-
react_1.default.createElement(EntityUriLink_1.default, { className: styles.uri, value:
|
|
59
|
+
react_1.default.createElement(EntityUriLink_1.default, { className: styles.uri, value: entityUri, screen: screen },
|
|
57
60
|
react_1.default.createElement("div", { className: styles.label }, (0, mdm_sdk_1.getLabel)(entityInfo.label))),
|
|
58
61
|
react_1.default.createElement(DCRChangesList_1.default, { changes: itemsToShow }),
|
|
59
62
|
collapsedSuggestionsCount > 0 && (react_1.default.createElement(ShowMoreLink_1.default, { onClick: onToggle, suggestionsCount: collapsedSuggestionsCount, isExpanded: isExpanded, className: styles.showMoreLink })))));
|
package/cjs/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;
|
|
@@ -16,7 +16,6 @@ var ramda_1 = require("ramda");
|
|
|
16
16
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
17
17
|
var attributesView_1 = require("../../../../attributes/helpers/attributesView");
|
|
18
18
|
var helpers_1 = require("./helpers");
|
|
19
|
-
var operations_1 = require("../../../constants/operations");
|
|
20
19
|
var getValues = function (attributes, attrType) {
|
|
21
20
|
if ('newValue' in attributes || 'oldValue' in attributes) {
|
|
22
21
|
var newValue = attributes.newValue, oldValue = attributes.oldValue, type_1 = attributes.type;
|
|
@@ -42,7 +41,7 @@ var getEntityChanges = (0, ramda_1.curry)(function (metadata, entityInfo, change
|
|
|
42
41
|
exports.getEntityChanges = getEntityChanges;
|
|
43
42
|
var getRelationChanges = (0, ramda_1.curry)(function (metadata, relationInfo, changes, changeType) {
|
|
44
43
|
var addRelationOperationIfNeeded = function (changes, changeType) {
|
|
45
|
-
if (changeType ===
|
|
44
|
+
if (changeType === mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP || (0, mdm_sdk_1.isEmptyValue)(changes)) {
|
|
46
45
|
var operation = (0, helpers_1.getOperationType)(changeType);
|
|
47
46
|
return operation ? { operation: operation } : {};
|
|
48
47
|
}
|
|
@@ -70,7 +69,7 @@ var getAttributesList = function (metadata, attrTypes, attributes, level) {
|
|
|
70
69
|
};
|
|
71
70
|
var getSimpleAttributeValue = function (attributeType, attributeValue) {
|
|
72
71
|
var value = (0, mdm_sdk_1.isSpecialAttribute)(attributeType) ? attributeValue : attributeValue.value;
|
|
73
|
-
return (0, ramda_1.is)(Object, value) ? value : { newValue: attributeValue, type:
|
|
72
|
+
return (0, ramda_1.is)(Object, value) ? value : { newValue: attributeValue, type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE };
|
|
74
73
|
};
|
|
75
74
|
var dcrAttributesFactory = function (metadata, attributeType, attributeValue, level) {
|
|
76
75
|
switch (attributeType.type) {
|
|
@@ -103,7 +102,7 @@ var getReferenceAttributeChange = function (metadata, attributeType, attributeVa
|
|
|
103
102
|
};
|
|
104
103
|
var getDiffParameters = function (_a) {
|
|
105
104
|
var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
106
|
-
return type ===
|
|
105
|
+
return type === mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE ? { type: type, newValue: newValue, oldValue: oldValue } : { type: type, newValue: oldValue || newValue };
|
|
107
106
|
};
|
|
108
107
|
var getSimpleAttributeChange = function (attributeType, attributeValue, level) {
|
|
109
108
|
var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.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;
|
|
@@ -7,36 +7,35 @@ exports.getDataTypeDefinition = exports.getAttributeDescription = exports.getOpe
|
|
|
7
7
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
8
|
var ramda_1 = require("ramda");
|
|
9
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
|
-
var operations_1 = require("../../../constants/operations");
|
|
11
10
|
var getOperationType = function (type, oldValue) {
|
|
12
11
|
switch (type) {
|
|
13
|
-
case
|
|
14
|
-
case
|
|
15
|
-
return
|
|
16
|
-
case
|
|
17
|
-
case
|
|
18
|
-
case
|
|
19
|
-
return
|
|
20
|
-
case
|
|
21
|
-
case
|
|
22
|
-
return
|
|
23
|
-
case
|
|
24
|
-
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.pin) ?
|
|
25
|
-
case
|
|
26
|
-
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.ignored) ?
|
|
12
|
+
case mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP:
|
|
13
|
+
case mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE:
|
|
14
|
+
return mdm_sdk_1.DCROperationTypes.ADDED;
|
|
15
|
+
case mdm_sdk_1.DCRTypes.UPDATE_TAGS:
|
|
16
|
+
case mdm_sdk_1.DCRTypes.UPDATE_ROLES:
|
|
17
|
+
case mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE:
|
|
18
|
+
return mdm_sdk_1.DCROperationTypes.EDITED;
|
|
19
|
+
case mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE:
|
|
20
|
+
case mdm_sdk_1.DCRTypes.DELETE_RELATIONSHIP:
|
|
21
|
+
return mdm_sdk_1.DCROperationTypes.DELETED;
|
|
22
|
+
case mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE:
|
|
23
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.pin) ? mdm_sdk_1.DCROperationTypes.PIN_DELETED : mdm_sdk_1.DCROperationTypes.PINNED;
|
|
24
|
+
case mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE:
|
|
25
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.ignored) ? mdm_sdk_1.DCROperationTypes.IGNORE_DELETED : mdm_sdk_1.DCROperationTypes.IGNORED;
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
exports.getOperationType = getOperationType;
|
|
30
29
|
var getOperationLabel = function (operation) {
|
|
31
30
|
var _a;
|
|
32
31
|
var labels = (_a = {},
|
|
33
|
-
_a[
|
|
34
|
-
_a[
|
|
35
|
-
_a[
|
|
36
|
-
_a[
|
|
37
|
-
_a[
|
|
38
|
-
_a[
|
|
39
|
-
_a[
|
|
32
|
+
_a[mdm_sdk_1.DCROperationTypes.ADDED] = ui_i18n_1.default.text('added'),
|
|
33
|
+
_a[mdm_sdk_1.DCROperationTypes.EDITED] = ui_i18n_1.default.text('edited'),
|
|
34
|
+
_a[mdm_sdk_1.DCROperationTypes.DELETED] = ui_i18n_1.default.text('deleted'),
|
|
35
|
+
_a[mdm_sdk_1.DCROperationTypes.PINNED] = ui_i18n_1.default.text('pinned'),
|
|
36
|
+
_a[mdm_sdk_1.DCROperationTypes.PIN_DELETED] = ui_i18n_1.default.text('pin deleted'),
|
|
37
|
+
_a[mdm_sdk_1.DCROperationTypes.IGNORED] = ui_i18n_1.default.text('ignored'),
|
|
38
|
+
_a[mdm_sdk_1.DCROperationTypes.IGNORE_DELETED] = ui_i18n_1.default.text('ignore deleted'),
|
|
40
39
|
_a);
|
|
41
40
|
return labels[operation] || '';
|
|
42
41
|
};
|
|
@@ -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 };
|
|
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.mergeChanges = void 0;
|
|
15
15
|
var ramda_1 = require("ramda");
|
|
16
16
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
17
|
-
var operations_1 = require("../../../constants/operations");
|
|
18
17
|
var attributesHelpers_1 = require("./attributesHelpers");
|
|
19
18
|
var ATTRIBUTE_DELIMITER = '/';
|
|
20
19
|
var SPECIAL_ATTRIBUTES_NAMES = [
|
|
@@ -33,7 +32,7 @@ var prepareStartOrEndDate = function (_a) {
|
|
|
33
32
|
if (isExistNewValue && isExistOldValue) {
|
|
34
33
|
return [
|
|
35
34
|
{
|
|
36
|
-
type:
|
|
35
|
+
type: mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE,
|
|
37
36
|
oldValue: { value: parseValue(oldValue[0]) },
|
|
38
37
|
newValue: { value: parseValue(newValue[0]) }
|
|
39
38
|
}
|
|
@@ -42,7 +41,7 @@ var prepareStartOrEndDate = function (_a) {
|
|
|
42
41
|
else if (isExistNewValue) {
|
|
43
42
|
return [
|
|
44
43
|
{
|
|
45
|
-
type:
|
|
44
|
+
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
46
45
|
newValue: { value: parseValue(newValue[0]) }
|
|
47
46
|
}
|
|
48
47
|
];
|
|
@@ -50,7 +49,7 @@ var prepareStartOrEndDate = function (_a) {
|
|
|
50
49
|
else if (isExistOldValue) {
|
|
51
50
|
return [
|
|
52
51
|
{
|
|
53
|
-
type:
|
|
52
|
+
type: mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE,
|
|
54
53
|
oldValue: { value: parseValue(oldValue[0]) }
|
|
55
54
|
}
|
|
56
55
|
];
|
|
@@ -58,19 +57,19 @@ var prepareStartOrEndDate = function (_a) {
|
|
|
58
57
|
};
|
|
59
58
|
var prepareRolesOrTags = function (metadata, change) {
|
|
60
59
|
var _a = change.newValue, newValue = _a === void 0 ? [] : _a, _b = change.oldValue, oldValue = _b === void 0 ? [] : _b, type = change.type;
|
|
61
|
-
var getLabel = type ===
|
|
60
|
+
var getLabel = type === mdm_sdk_1.DCRTypes.UPDATE_ROLES ? (0, mdm_sdk_1.getRoleLabel)(metadata) : ramda_1.identity;
|
|
62
61
|
var diffNewValue = (0, ramda_1.difference)(newValue, oldValue);
|
|
63
62
|
var diffOldValue = (0, ramda_1.difference)(oldValue, newValue);
|
|
64
63
|
var items = [];
|
|
65
64
|
if (diffNewValue.length) {
|
|
66
65
|
items.push({
|
|
67
|
-
type:
|
|
66
|
+
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
68
67
|
newValue: { value: diffNewValue.map(getLabel).join(', ') }
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
if (diffOldValue.length) {
|
|
72
71
|
items.push({
|
|
73
|
-
type:
|
|
72
|
+
type: mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE,
|
|
74
73
|
oldValue: { value: diffOldValue.map(getLabel).join(', ') }
|
|
75
74
|
});
|
|
76
75
|
}
|
|
@@ -78,7 +77,7 @@ var prepareRolesOrTags = function (metadata, change) {
|
|
|
78
77
|
};
|
|
79
78
|
var getPath = function (change) {
|
|
80
79
|
var type = change.type, attributePath = change.attributePath, refObjectURI = change.refObjectURI, refAttributeType = change.refAttributeType;
|
|
81
|
-
var path = type ===
|
|
80
|
+
var path = type === mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE ? (0, mdm_sdk_1.generateTempUri)(attributePath) : attributePath;
|
|
82
81
|
if (refObjectURI) {
|
|
83
82
|
var typePath = refAttributeType.split('/attributes/');
|
|
84
83
|
var id = refObjectURI.split(ATTRIBUTE_DELIMITER)[1];
|
|
@@ -118,7 +117,7 @@ var createEntityOrRelation = function (metadata, value) {
|
|
|
118
117
|
if (roles) {
|
|
119
118
|
newObject[mdm_sdk_1.EntityAttrTypes.roles.name] = [
|
|
120
119
|
{
|
|
121
|
-
type:
|
|
120
|
+
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
122
121
|
newValue: { value: roles.map((0, mdm_sdk_1.getRoleLabel)(metadata)).join(', ') }
|
|
123
122
|
}
|
|
124
123
|
];
|
|
@@ -126,7 +125,7 @@ var createEntityOrRelation = function (metadata, value) {
|
|
|
126
125
|
if (tags) {
|
|
127
126
|
newObject[mdm_sdk_1.EntityAttrTypes.tags.name] = [
|
|
128
127
|
{
|
|
129
|
-
type:
|
|
128
|
+
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
130
129
|
newValue: { value: tags.join(', ') }
|
|
131
130
|
}
|
|
132
131
|
];
|
|
@@ -134,7 +133,7 @@ var createEntityOrRelation = function (metadata, value) {
|
|
|
134
133
|
if (startDate) {
|
|
135
134
|
newObject[mdm_sdk_1.EntityAttrTypes.startDate.name] = [
|
|
136
135
|
{
|
|
137
|
-
type:
|
|
136
|
+
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
138
137
|
newValue: { value: startDate }
|
|
139
138
|
}
|
|
140
139
|
];
|
|
@@ -142,7 +141,7 @@ var createEntityOrRelation = function (metadata, value) {
|
|
|
142
141
|
if (endDate) {
|
|
143
142
|
newObject[mdm_sdk_1.EntityAttrTypes.endDate.name] = [
|
|
144
143
|
{
|
|
145
|
-
type:
|
|
144
|
+
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
146
145
|
newValue: { value: endDate }
|
|
147
146
|
}
|
|
148
147
|
];
|
|
@@ -153,31 +152,31 @@ var mergeAttributesInChange = function (metadata, objectInfo, change, container)
|
|
|
153
152
|
if (container === void 0) { container = {}; }
|
|
154
153
|
var type = change.type;
|
|
155
154
|
switch (type) {
|
|
156
|
-
case
|
|
155
|
+
case mdm_sdk_1.DCRTypes.UPDATE_PROFILE_PIC_BY_URL:
|
|
157
156
|
container['defaultProfilePicValue'] = [change.newValue];
|
|
158
157
|
break;
|
|
159
|
-
case
|
|
158
|
+
case mdm_sdk_1.DCRTypes.UPDATE_TAGS:
|
|
160
159
|
container[mdm_sdk_1.EntityAttrTypes.tags.name] = prepareRolesOrTags(metadata, change);
|
|
161
160
|
break;
|
|
162
|
-
case
|
|
161
|
+
case mdm_sdk_1.DCRTypes.UPDATE_ROLES: {
|
|
163
162
|
container[mdm_sdk_1.EntityAttrTypes.roles.name] = prepareRolesOrTags(metadata, change);
|
|
164
163
|
break;
|
|
165
164
|
}
|
|
166
|
-
case
|
|
165
|
+
case mdm_sdk_1.DCRTypes.UPDATE_START_DATE:
|
|
167
166
|
container[mdm_sdk_1.EntityAttrTypes.startDate.name] = prepareStartOrEndDate(change);
|
|
168
167
|
break;
|
|
169
|
-
case
|
|
168
|
+
case mdm_sdk_1.DCRTypes.UPDATE_END_DATE:
|
|
170
169
|
container[mdm_sdk_1.EntityAttrTypes.endDate.name] = prepareStartOrEndDate(change);
|
|
171
170
|
break;
|
|
172
|
-
case
|
|
173
|
-
case
|
|
171
|
+
case mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP:
|
|
172
|
+
case mdm_sdk_1.DCRTypes.CREATE_ENTITY: {
|
|
174
173
|
return __assign(__assign({}, container), createEntityOrRelation(metadata, change.newValue));
|
|
175
174
|
}
|
|
176
|
-
case
|
|
177
|
-
case
|
|
178
|
-
case
|
|
179
|
-
case
|
|
180
|
-
case
|
|
175
|
+
case mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE:
|
|
176
|
+
case mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE:
|
|
177
|
+
case mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE:
|
|
178
|
+
case mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE:
|
|
179
|
+
case mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE:
|
|
181
180
|
prepareAttribute(container, change);
|
|
182
181
|
break;
|
|
183
182
|
default:
|
|
@@ -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,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TaskActionButtons = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var ramda_1 = require("ramda");
|
|
9
|
+
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
10
|
+
var useWorkflowActions_1 = require("../../hooks/useWorkflowActions");
|
|
11
|
+
var TaskActionButtons = function (_a) {
|
|
12
|
+
var task = _a.task;
|
|
13
|
+
var taskId = task.taskId, possibleActions = task.possibleActions, assignee = task.assignee, isOpen = task.isOpen, preferredAction = task.preferredAction;
|
|
14
|
+
var _b = (0, useWorkflowActions_1.useWorkflowActions)({
|
|
15
|
+
taskId: taskId,
|
|
16
|
+
possibleActions: possibleActions,
|
|
17
|
+
assignee: assignee,
|
|
18
|
+
isOpen: isOpen
|
|
19
|
+
}), actions = _b.actions, disabled = _b.actionRequestIsInProgress;
|
|
20
|
+
var _c = (0, ramda_1.partition)((0, ramda_1.propEq)('text', preferredAction.label), actions), preferredActions = _c[0], otherActions = _c[1];
|
|
21
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
22
|
+
otherActions.map(function (action) { return (react_1.default.createElement(Button_1.default, { variant: "outlined", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); }),
|
|
23
|
+
preferredActions.map(function (action) { return (react_1.default.createElement(Button_1.default, { variant: "contained", color: "primary", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); })));
|
|
24
|
+
};
|
|
25
|
+
exports.TaskActionButtons = TaskActionButtons;
|
|
@@ -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;
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.concatEntityRelationsObjects = exports.createEntityRelationsObjectByRelation = exports.createEntityRelationsObjectByEntity = exports.extractObjectsFromChangeRequest = exports.getRelationsObjects = exports.getEntitiesObjects = void 0;
|
|
14
|
+
exports.isCreateEntityOperation = exports.getEntityUriForChangeRequest = exports.concatEntityRelationsObjects = exports.createEntityRelationsObjectByRelation = exports.createEntityRelationsObjectByEntity = exports.extractObjectsFromChangeRequest = exports.getRelationsObjects = exports.getEntitiesObjects = void 0;
|
|
15
15
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
16
16
|
var ramda_1 = require("ramda");
|
|
17
17
|
exports.getEntitiesObjects = (0, ramda_1.filter)((0, ramda_1.pipe)((0, ramda_1.prop)('uri'), mdm_sdk_1.isEntityUri));
|
|
@@ -46,3 +46,11 @@ var concatEntityRelationsObjects = function (acc, object) {
|
|
|
46
46
|
return acc;
|
|
47
47
|
};
|
|
48
48
|
exports.concatEntityRelationsObjects = concatEntityRelationsObjects;
|
|
49
|
+
var getEntityUriForChangeRequest = function (dcrUri, entityUri) {
|
|
50
|
+
return "".concat(dcrUri, "/changes/").concat(entityUri);
|
|
51
|
+
};
|
|
52
|
+
exports.getEntityUriForChangeRequest = getEntityUriForChangeRequest;
|
|
53
|
+
var isCreateEntityOperation = function (dcr) {
|
|
54
|
+
return dcr.type === mdm_sdk_1.DCRTypes.CREATE_ENTITY;
|
|
55
|
+
};
|
|
56
|
+
exports.isCreateEntityOperation = isCreateEntityOperation;
|
|
@@ -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,48 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.useWorkflowActions = void 0;
|
|
27
7
|
var react_1 = require("react");
|
|
28
8
|
var react_redux_1 = require("react-redux");
|
|
29
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
30
|
-
var mdm_module_1 =
|
|
31
|
-
var ViewIdContext_1 = require("../../../contexts/ViewIdContext");
|
|
10
|
+
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
32
11
|
var errors_1 = require("../helpers/errors");
|
|
33
12
|
var WorkflowTasksContext_1 = require("../../../contexts/WorkflowTasksContext");
|
|
34
13
|
var helpers_1 = require("../helpers");
|
|
35
14
|
var useWorkflowActions = function (_a) {
|
|
36
15
|
var possibleActions = _a.possibleActions, assignee = _a.assignee, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
37
|
-
var
|
|
16
|
+
var onActionSuccess = ((0, react_1.useContext)(WorkflowTasksContext_1.WorkflowTasksContext) || {}).onActionSuccess;
|
|
38
17
|
var workflowPath = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getWorkflowPath);
|
|
39
18
|
var environment = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
40
19
|
var tenant = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getTenant);
|
|
41
20
|
var username = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getUserName);
|
|
42
|
-
var
|
|
43
|
-
var _c = (0, react_1.useState)(false), actionRequestIsInProgress = _c[0], setActionRequestIsInProgress = _c[1];
|
|
44
|
-
var viewId = (0, react_1.useContext)(ViewIdContext_1.ViewIdContext);
|
|
45
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
21
|
+
var _b = (0, react_1.useState)(false), actionRequestIsInProgress = _b[0], setActionRequestIsInProgress = _b[1];
|
|
46
22
|
var performTaskAction = (0, react_1.useCallback)(function (action) { return function () {
|
|
47
23
|
if (workflowPath && taskId) {
|
|
48
24
|
setActionRequestIsInProgress(true);
|
|
@@ -54,14 +30,6 @@ var useWorkflowActions = function (_a) {
|
|
|
54
30
|
action: action
|
|
55
31
|
})
|
|
56
32
|
.then(function () {
|
|
57
|
-
if (action === 'Delete') {
|
|
58
|
-
dispatch(mdm_module_1.ui.actions.entityDeletionFinished());
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
// entity refreshing
|
|
62
|
-
dispatch(mdm_module_1.profile.entity.actions.loadEntity({ viewId: viewId, uri: entityUri }));
|
|
63
|
-
loadTasks === null || loadTasks === void 0 ? void 0 : loadTasks();
|
|
64
|
-
}
|
|
65
33
|
onActionSuccess === null || onActionSuccess === void 0 ? void 0 : onActionSuccess(action);
|
|
66
34
|
})
|
|
67
35
|
.catch(errors_1.showWorkflowError)
|
|
@@ -69,7 +37,7 @@ var useWorkflowActions = function (_a) {
|
|
|
69
37
|
setActionRequestIsInProgress(false);
|
|
70
38
|
});
|
|
71
39
|
}
|
|
72
|
-
}; }, [workflowPath, taskId, environment, tenant,
|
|
40
|
+
}; }, [workflowPath, taskId, environment, tenant, onActionSuccess]);
|
|
73
41
|
var actions = (0, react_1.useMemo)(function () {
|
|
74
42
|
return username === assignee && (0, helpers_1.isOpenTask)(isOpen)
|
|
75
43
|
? (possibleActions || []).map(function (_a) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useWorkflowDefaultActionSuccessHandler: () => (action: string) => void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useWorkflowDefaultActionSuccessHandler = void 0;
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var react_redux_1 = require("react-redux");
|
|
29
|
+
var mdm_module_1 = __importStar(require("@reltio/mdm-module"));
|
|
30
|
+
var contexts_1 = require("../../../contexts");
|
|
31
|
+
var useWorkflowDefaultActionSuccessHandler = function () {
|
|
32
|
+
var loadTasks = ((0, react_1.useContext)(contexts_1.WorkflowTasksContext) || {}).loadTasks;
|
|
33
|
+
var viewId = (0, react_1.useContext)(contexts_1.ViewIdContext);
|
|
34
|
+
var entityUri = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getEntityUri);
|
|
35
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
36
|
+
return (0, react_1.useCallback)(function (action) {
|
|
37
|
+
if (action === 'Delete') {
|
|
38
|
+
dispatch(mdm_module_1.ui.actions.entityDeletionFinished());
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// entity refreshing
|
|
42
|
+
dispatch(mdm_module_1.profile.entity.actions.loadEntity({ viewId: viewId, uri: entityUri }));
|
|
43
|
+
loadTasks === null || loadTasks === void 0 ? void 0 : loadTasks();
|
|
44
|
+
}
|
|
45
|
+
}, [dispatch, entityUri, loadTasks, viewId]);
|
|
46
|
+
};
|
|
47
|
+
exports.useWorkflowDefaultActionSuccessHandler = useWorkflowDefaultActionSuccessHandler;
|