@reltio/components 1.4.909 → 1.4.913
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/history/HistoryMenuButton/HistoryMenuButton.js +46 -1
- package/cjs/components/history/HistoryMenuButton/MenuItemRenderer.d.ts +12 -0
- package/cjs/components/history/HistoryMenuButton/MenuItemRenderer.js +44 -0
- package/cjs/components/history/HistoryMenuButton/styles.d.ts +1 -1
- package/cjs/components/history/HistoryMenuButton/styles.js +13 -0
- package/cjs/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +6 -30
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +7 -4
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.js +19 -9
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +4 -4
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +3 -9
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +2 -2
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +4 -1
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.js +13 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -13
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +25 -9
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +1 -1
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +14 -2
- package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +1 -1
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +3 -2
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +35 -6
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +4 -6
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.js +4 -26
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +3 -2
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +109 -28
- package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +3 -2
- package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +4 -4
- package/cjs/components/workflow/components/AttributesChanges/types/diffTypes.d.ts +16 -0
- package/cjs/components/workflow/components/AttributesChanges/types/{DCRTypes.js → diffTypes.js} +0 -0
- package/cjs/components/workflow/components/LineDecorator/LineDecorator.d.ts +2 -1
- package/cjs/components/workflow/components/LineDecorator/LineDecorator.js +5 -2
- package/cjs/components/workflow/components/LineDecorator/styles.d.ts +1 -1
- package/cjs/components/workflow/components/LineDecorator/styles.js +4 -1
- package/cjs/components/workflow/{components/AttributesChanges/constants → constants}/operations.d.ts +0 -0
- package/cjs/components/workflow/{components/AttributesChanges/constants → constants}/operations.js +0 -0
- package/cjs/components/workflow/helpers/dcrHelpers.d.ts +7 -0
- package/cjs/components/workflow/helpers/dcrHelpers.js +48 -0
- package/cjs/components/workflow/hooks/useChangeRequest.d.ts +5 -0
- package/cjs/components/workflow/hooks/useChangeRequest.js +58 -0
- package/{esm/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts → cjs/components/workflow/types/dcrTypes.d.ts} +22 -16
- package/cjs/components/workflow/types/dcrTypes.js +2 -0
- package/esm/components/history/HistoryMenuButton/HistoryMenuButton.js +27 -1
- package/esm/components/history/HistoryMenuButton/MenuItemRenderer.d.ts +12 -0
- package/esm/components/history/HistoryMenuButton/MenuItemRenderer.js +20 -0
- package/esm/components/history/HistoryMenuButton/styles.d.ts +1 -1
- package/esm/components/history/HistoryMenuButton/styles.js +13 -0
- package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +6 -11
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +7 -4
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.js +19 -9
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +4 -4
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +3 -9
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +2 -2
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +4 -1
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.js +10 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -13
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +26 -10
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +1 -1
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +14 -2
- package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +1 -1
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +3 -2
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +35 -7
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +4 -6
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.js +4 -25
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +3 -2
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +112 -31
- package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +3 -2
- package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +4 -4
- package/esm/components/workflow/components/AttributesChanges/types/diffTypes.d.ts +16 -0
- package/esm/components/workflow/components/AttributesChanges/types/{DCRTypes.js → diffTypes.js} +0 -0
- package/esm/components/workflow/components/LineDecorator/LineDecorator.d.ts +2 -1
- package/esm/components/workflow/components/LineDecorator/LineDecorator.js +5 -2
- package/esm/components/workflow/components/LineDecorator/styles.d.ts +1 -1
- package/esm/components/workflow/components/LineDecorator/styles.js +4 -1
- package/esm/components/workflow/{components/AttributesChanges/constants → constants}/operations.d.ts +0 -0
- package/esm/components/workflow/{components/AttributesChanges/constants → constants}/operations.js +0 -0
- package/esm/components/workflow/helpers/dcrHelpers.d.ts +7 -0
- package/esm/components/workflow/helpers/dcrHelpers.js +43 -0
- package/esm/components/workflow/hooks/useChangeRequest.d.ts +5 -0
- package/esm/components/workflow/hooks/useChangeRequest.js +54 -0
- package/{cjs/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts → esm/components/workflow/types/dcrTypes.d.ts} +22 -16
- package/esm/components/workflow/types/dcrTypes.js +1 -0
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Metadata } from '@reltio/mdm-sdk';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { Diff } from '../types/diffTypes';
|
|
3
|
+
import { DCRChanges, EntityInfo, RelationInfo } from '../../../types/dcrTypes';
|
|
4
|
+
declare const mergeChanges: (metadata: Metadata, changes: DCRChanges, entityInfo: EntityInfo, relationsInfo: RelationInfo[]) => [Diff[], Diff[]];
|
|
4
5
|
export { mergeChanges };
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.mergeChanges = void 0;
|
|
4
15
|
var ramda_1 = require("ramda");
|
|
5
16
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
6
|
-
var operations_1 = require("
|
|
17
|
+
var operations_1 = require("../../../constants/operations");
|
|
7
18
|
var attributesHelpers_1 = require("./attributesHelpers");
|
|
8
19
|
var ATTRIBUTE_DELIMITER = '/';
|
|
9
20
|
var SPECIAL_ATTRIBUTES_NAMES = [
|
|
@@ -15,31 +26,37 @@ var SPECIAL_ATTRIBUTES_NAMES = [
|
|
|
15
26
|
];
|
|
16
27
|
var prepareStartOrEndDate = function (_a) {
|
|
17
28
|
var newValue = _a.newValue, oldValue = _a.oldValue;
|
|
18
|
-
var parseValue = function (value) { return (
|
|
29
|
+
var parseValue = function (value) { return (isNaN(value) ? value : parseInt(value)); };
|
|
19
30
|
var isExistedValue = function (value) { return (value === null || value === void 0 ? void 0 : value.length) && !mdm_sdk_1.isEmptyValue(value); };
|
|
20
31
|
var isExistNewValue = isExistedValue(newValue);
|
|
21
32
|
var isExistOldValue = isExistedValue(oldValue);
|
|
22
33
|
if (isExistNewValue && isExistOldValue) {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
type: operations_1.DCRTypes.UPDATE_ATTRIBUTE,
|
|
37
|
+
oldValue: { value: parseValue(oldValue[0]) },
|
|
38
|
+
newValue: { value: parseValue(newValue[0]) }
|
|
39
|
+
}
|
|
40
|
+
];
|
|
28
41
|
}
|
|
29
42
|
else if (isExistNewValue) {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
46
|
+
newValue: { value: parseValue(newValue[0]) }
|
|
47
|
+
}
|
|
48
|
+
];
|
|
34
49
|
}
|
|
35
50
|
else if (isExistOldValue) {
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
type: operations_1.DCRTypes.DELETE_ATTRIBUTE,
|
|
54
|
+
oldValue: { value: parseValue(oldValue[0]) }
|
|
55
|
+
}
|
|
56
|
+
];
|
|
40
57
|
}
|
|
41
58
|
};
|
|
42
|
-
var prepareRolesOrTags = function (
|
|
59
|
+
var prepareRolesOrTags = function (metadata, change) {
|
|
43
60
|
var _a = change.newValue, newValue = _a === void 0 ? [] : _a, _b = change.oldValue, oldValue = _b === void 0 ? [] : _b, type = change.type;
|
|
44
61
|
var getLabel = type === operations_1.DCRTypes.UPDATE_ROLES ? mdm_sdk_1.getRoleLabel(metadata) : ramda_1.identity;
|
|
45
62
|
var diffNewValue = ramda_1.difference(newValue, oldValue);
|
|
@@ -91,6 +108,47 @@ var prepareAttribute = function (container, change) {
|
|
|
91
108
|
}
|
|
92
109
|
return container;
|
|
93
110
|
};
|
|
111
|
+
var createEntityOrRelation = function (metadata, value) {
|
|
112
|
+
var _a = value.attributes, attributes = _a === void 0 ? {} : _a, startDate = value.startDate, endDate = value.endDate;
|
|
113
|
+
var _b = value, roles = _b.roles, tags = _b.tags, defaultProfilePicValue = _b.defaultProfilePicValue;
|
|
114
|
+
var newObject = __assign({}, attributes);
|
|
115
|
+
if (defaultProfilePicValue) {
|
|
116
|
+
newObject['defaultProfilePicValue'] = [defaultProfilePicValue];
|
|
117
|
+
}
|
|
118
|
+
if (roles) {
|
|
119
|
+
newObject[mdm_sdk_1.EntityAttrTypes.roles.name] = [
|
|
120
|
+
{
|
|
121
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
122
|
+
newValue: { value: roles.map(mdm_sdk_1.getRoleLabel(metadata)).join(', ') }
|
|
123
|
+
}
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
if (tags) {
|
|
127
|
+
newObject[mdm_sdk_1.EntityAttrTypes.tags.name] = [
|
|
128
|
+
{
|
|
129
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
130
|
+
newValue: { value: tags.join(', ') }
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
if (startDate) {
|
|
135
|
+
newObject[mdm_sdk_1.EntityAttrTypes.startDate.name] = [
|
|
136
|
+
{
|
|
137
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
138
|
+
newValue: { value: startDate }
|
|
139
|
+
}
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
if (endDate) {
|
|
143
|
+
newObject[mdm_sdk_1.EntityAttrTypes.endDate.name] = [
|
|
144
|
+
{
|
|
145
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
146
|
+
newValue: { value: endDate }
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
return newObject;
|
|
151
|
+
};
|
|
94
152
|
var mergeAttributesInChange = function (metadata, objectInfo, change, container) {
|
|
95
153
|
if (container === void 0) { container = {}; }
|
|
96
154
|
var type = change.type;
|
|
@@ -99,39 +157,62 @@ var mergeAttributesInChange = function (metadata, objectInfo, change, container)
|
|
|
99
157
|
container['defaultProfilePicValue'] = [change.newValue];
|
|
100
158
|
break;
|
|
101
159
|
case operations_1.DCRTypes.UPDATE_TAGS:
|
|
102
|
-
container[mdm_sdk_1.EntityAttrTypes.tags.name] = prepareRolesOrTags(
|
|
160
|
+
container[mdm_sdk_1.EntityAttrTypes.tags.name] = prepareRolesOrTags(metadata, change);
|
|
103
161
|
break;
|
|
104
162
|
case operations_1.DCRTypes.UPDATE_ROLES: {
|
|
105
|
-
container[mdm_sdk_1.EntityAttrTypes.roles.name] = prepareRolesOrTags(
|
|
163
|
+
container[mdm_sdk_1.EntityAttrTypes.roles.name] = prepareRolesOrTags(metadata, change);
|
|
106
164
|
break;
|
|
107
165
|
}
|
|
108
166
|
case operations_1.DCRTypes.UPDATE_START_DATE:
|
|
109
|
-
container[mdm_sdk_1.EntityAttrTypes.startDate.name] =
|
|
167
|
+
container[mdm_sdk_1.EntityAttrTypes.startDate.name] = prepareStartOrEndDate(change);
|
|
110
168
|
break;
|
|
111
169
|
case operations_1.DCRTypes.UPDATE_END_DATE:
|
|
112
|
-
container[mdm_sdk_1.EntityAttrTypes.endDate.name] =
|
|
170
|
+
container[mdm_sdk_1.EntityAttrTypes.endDate.name] = prepareStartOrEndDate(change);
|
|
113
171
|
break;
|
|
114
|
-
|
|
172
|
+
case operations_1.DCRTypes.CREATE_RELATIONSHIP:
|
|
173
|
+
case operations_1.DCRTypes.CREATE_ENTITY: {
|
|
174
|
+
return __assign(__assign({}, container), createEntityOrRelation(metadata, change.newValue));
|
|
175
|
+
}
|
|
176
|
+
case operations_1.DCRTypes.INSERT_ATTRIBUTE:
|
|
177
|
+
case operations_1.DCRTypes.UPDATE_ATTRIBUTE:
|
|
178
|
+
case operations_1.DCRTypes.DELETE_ATTRIBUTE:
|
|
179
|
+
case operations_1.DCRTypes.PIN_ATTRIBUTE:
|
|
180
|
+
case operations_1.DCRTypes.IGNORE_ATTRIBUTE:
|
|
115
181
|
prepareAttribute(container, change);
|
|
116
182
|
break;
|
|
117
|
-
|
|
183
|
+
default:
|
|
184
|
+
break;
|
|
118
185
|
}
|
|
119
186
|
return container;
|
|
120
187
|
};
|
|
121
|
-
var
|
|
122
|
-
var
|
|
188
|
+
var updateRelation = function (metadata, changes, relationInfo) {
|
|
189
|
+
var relationChanges = ramda_1.propOr([], relationInfo.uri)(changes);
|
|
190
|
+
return relationChanges.reduce(function (result, change) {
|
|
191
|
+
return mergeAttributesInChange(metadata, relationInfo, change, result);
|
|
192
|
+
}, {});
|
|
193
|
+
};
|
|
194
|
+
var mergeChanges = function (metadata, changes, entityInfo, relationsInfo) {
|
|
195
|
+
var getAttributeChanges = function (attributeName) {
|
|
196
|
+
return ramda_1.pipe(ramda_1.pick([attributeName]), attributesHelpers_1.getEntityChanges(metadata, entityInfo));
|
|
197
|
+
};
|
|
123
198
|
var concatChanges = ramda_1.curry(function (getters, attributesTree) {
|
|
124
199
|
return ramda_1.reduce(function (acc, getter) { return ramda_1.concat(acc, getter(attributesTree)); }, [], getters);
|
|
125
200
|
});
|
|
126
|
-
var
|
|
127
|
-
|
|
201
|
+
var entityInfoChanges = ramda_1.propOr([], entityInfo.uri)(changes);
|
|
202
|
+
var changesTree = entityInfoChanges.reduce(function (result, change) {
|
|
203
|
+
return mergeAttributesInChange(metadata, entityInfo, change, result);
|
|
128
204
|
}, {});
|
|
129
|
-
return
|
|
130
|
-
|
|
205
|
+
var relationsTrees = relationsInfo.map(function (relationInfo) { return updateRelation(metadata, changes, relationInfo); });
|
|
206
|
+
var entityChanges = concatChanges([
|
|
207
|
+
ramda_1.pipe(ramda_1.omit(SPECIAL_ATTRIBUTES_NAMES), attributesHelpers_1.getEntityChanges(metadata, entityInfo)),
|
|
131
208
|
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.roles.name),
|
|
132
209
|
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.tags.name),
|
|
133
210
|
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.startDate.name),
|
|
134
211
|
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.endDate.name)
|
|
135
212
|
], changesTree);
|
|
213
|
+
var relationsChanges = ramda_1.flatten(relationsInfo.map(function (relationInfo, index) {
|
|
214
|
+
return attributesHelpers_1.getRelationChanges(metadata, relationInfo, relationsTrees[index]);
|
|
215
|
+
}));
|
|
216
|
+
return [entityChanges, relationsChanges];
|
|
136
217
|
};
|
|
137
218
|
exports.mergeChanges = mergeChanges;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Diff, Title } from '../types/diffTypes';
|
|
2
|
+
export declare const useCollapsibleList: (items: (Diff | Title)[], limit?: number) => {
|
|
2
3
|
isExpanded: boolean;
|
|
3
4
|
onToggle: () => void;
|
|
4
|
-
itemsToShow:
|
|
5
|
+
itemsToShow: (Diff | Title)[];
|
|
5
6
|
collapsedSuggestionsCount: number;
|
|
6
7
|
};
|
|
@@ -4,14 +4,14 @@ exports.useCollapsibleList = void 0;
|
|
|
4
4
|
var react_1 = require("react");
|
|
5
5
|
var contextHelpers_1 = require("../helpers/contextHelpers");
|
|
6
6
|
var DEFAULT_VISIBLE_ITEMS_COUNT = 3;
|
|
7
|
-
var useCollapsibleList = function (
|
|
7
|
+
var useCollapsibleList = function (items, limit) {
|
|
8
8
|
if (limit === void 0) { limit = DEFAULT_VISIBLE_ITEMS_COUNT; }
|
|
9
9
|
var _a = react_1.useState(false), isExpanded = _a[0], setIsExpanded = _a[1];
|
|
10
10
|
var onToggle = react_1.useCallback(function () { return setIsExpanded(function (value) { return !value; }); }, []);
|
|
11
|
-
var collapsedItems = react_1.useMemo(function () { return
|
|
12
|
-
var suggestionsCount = react_1.useMemo(function () { return contextHelpers_1.getSuggestionsCount(
|
|
11
|
+
var collapsedItems = react_1.useMemo(function () { return items.slice(0, limit); }, [items, limit]);
|
|
12
|
+
var suggestionsCount = react_1.useMemo(function () { return contextHelpers_1.getSuggestionsCount(items); }, [items]);
|
|
13
13
|
var visibleSuggestionsCount = react_1.useMemo(function () { return contextHelpers_1.getSuggestionsCount(collapsedItems); }, [collapsedItems]);
|
|
14
|
-
var itemsToShow = isExpanded ?
|
|
14
|
+
var itemsToShow = isExpanded ? items : collapsedItems;
|
|
15
15
|
var collapsedSuggestionsCount = suggestionsCount - visibleSuggestionsCount;
|
|
16
16
|
return { isExpanded: isExpanded, onToggle: onToggle, itemsToShow: itemsToShow, collapsedSuggestionsCount: collapsedSuggestionsCount };
|
|
17
17
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
2
|
+
import { ChangeValue, DCRAttributeValue, RelationInfo } from '../../../types/dcrTypes';
|
|
3
|
+
import { OperationTypes } from '../../../constants/operations';
|
|
4
|
+
export declare type RelationAttributeValue = DCRAttributeValue & RelationInfo;
|
|
5
|
+
export declare type Diff = {
|
|
6
|
+
level: number;
|
|
7
|
+
label: string;
|
|
8
|
+
attributeType: AttributeType;
|
|
9
|
+
attributeValue?: DCRAttributeValue | RelationAttributeValue;
|
|
10
|
+
newValue?: ChangeValue;
|
|
11
|
+
oldValue?: ChangeValue;
|
|
12
|
+
operation?: OperationTypes;
|
|
13
|
+
};
|
|
14
|
+
export declare type Title = {
|
|
15
|
+
label: string;
|
|
16
|
+
};
|
package/cjs/components/workflow/components/AttributesChanges/types/{DCRTypes.js → diffTypes.js}
RENAMED
|
File without changes
|
|
@@ -6,6 +6,7 @@ declare type Props = {
|
|
|
6
6
|
first?: boolean;
|
|
7
7
|
last?: boolean;
|
|
8
8
|
transparent?: boolean;
|
|
9
|
+
divider?: boolean;
|
|
9
10
|
};
|
|
10
|
-
declare const LineDecorator: ({ className, children, plain, first, last, transparent }: Props) => JSX.Element;
|
|
11
|
+
declare const LineDecorator: ({ className, children, plain, first, last, transparent, divider }: Props) => JSX.Element;
|
|
11
12
|
export default LineDecorator;
|
|
@@ -6,14 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var classnames_1 = __importDefault(require("classnames"));
|
|
8
8
|
var styles_1 = require("./styles");
|
|
9
|
+
var Divider_1 = __importDefault(require("@material-ui/core/Divider"));
|
|
9
10
|
var LineDecorator = function (_a) {
|
|
10
11
|
var _b, _c, _d;
|
|
11
|
-
var className = _a.className, children = _a.children, plain = _a.plain, first = _a.first, last = _a.last, transparent = _a.transparent;
|
|
12
|
+
var className = _a.className, children = _a.children, plain = _a.plain, first = _a.first, last = _a.last, transparent = _a.transparent, divider = _a.divider;
|
|
12
13
|
var styles = styles_1.useStyles();
|
|
13
14
|
return (react_1.default.createElement("div", { className: classnames_1.default(className, styles.decorator) },
|
|
14
15
|
react_1.default.createElement("div", { className: classnames_1.default(styles.lineBlock, (_b = {}, _b[styles.withLinePadding] = first, _b)) }, !transparent && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
16
|
react_1.default.createElement("div", { className: styles.noLine }),
|
|
16
17
|
react_1.default.createElement("div", { className: classnames_1.default(styles.line, (_c = {}, _c[styles.plain] = plain, _c), (_d = {}, _d[styles.last] = last, _d)) })))),
|
|
17
|
-
react_1.default.createElement("div", { className: styles.content },
|
|
18
|
+
react_1.default.createElement("div", { className: styles.content },
|
|
19
|
+
children,
|
|
20
|
+
divider && react_1.default.createElement(Divider_1.default, { className: styles.rowDivider, light: true, variant: "inset" }))));
|
|
18
21
|
};
|
|
19
22
|
exports.default = LineDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "last" | "line" | "decorator" | "plain" | "lineBlock" | "withLinePadding" | "noLine">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "last" | "line" | "rowDivider" | "decorator" | "plain" | "lineBlock" | "withLinePadding" | "noLine">;
|
package/cjs/components/workflow/{components/AttributesChanges/constants → constants}/operations.d.ts
RENAMED
|
File without changes
|
package/cjs/components/workflow/{components/AttributesChanges/constants → constants}/operations.js
RENAMED
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GroupedObjectsInfo, DCRChanges, DCRObjectInfo, DCRObjectsInfo } from '../types/dcrTypes';
|
|
2
|
+
export declare const getEntitiesObjects: any;
|
|
3
|
+
export declare const getRelationsObjects: any;
|
|
4
|
+
export declare const extractObjectsFromChangeRequest: (changes: DCRChanges, objectsInfo: DCRObjectsInfo) => DCRObjectInfo[];
|
|
5
|
+
export declare const createEntityRelationsObjectByEntity: any;
|
|
6
|
+
export declare const createEntityRelationsObjectByRelation: any;
|
|
7
|
+
export declare const concatEntityRelationsObjects: (acc: Record<string, GroupedObjectsInfo>, object: GroupedObjectsInfo) => Record<string, GroupedObjectsInfo>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.concatEntityRelationsObjects = exports.createEntityRelationsObjectByRelation = exports.createEntityRelationsObjectByEntity = exports.extractObjectsFromChangeRequest = exports.getRelationsObjects = exports.getEntitiesObjects = void 0;
|
|
15
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
16
|
+
var ramda_1 = require("ramda");
|
|
17
|
+
exports.getEntitiesObjects = ramda_1.filter(ramda_1.pipe(ramda_1.prop('uri'), mdm_sdk_1.isEntityUri));
|
|
18
|
+
exports.getRelationsObjects = ramda_1.filter(ramda_1.pipe(ramda_1.prop('uri'), mdm_sdk_1.isRelationUri));
|
|
19
|
+
var getRelations = function (objectsWithChanges, entityUri) {
|
|
20
|
+
return ramda_1.filter(ramda_1.allPass([ramda_1.pipe(ramda_1.prop('uri'), mdm_sdk_1.isRelationUri), ramda_1.pipe(ramda_1.prop('startObjectUri'), ramda_1.equals(entityUri))]))(objectsWithChanges);
|
|
21
|
+
};
|
|
22
|
+
var extractObjectsFromChangeRequest = function (changes, objectsInfo) {
|
|
23
|
+
var getChange = function (key) { return ramda_1.prop([key], changes); };
|
|
24
|
+
return ramda_1.pipe(ramda_1.keys, ramda_1.filter(getChange), ramda_1.map(function (key) { return (__assign(__assign({}, objectsInfo[key]), { uri: key })); }))(objectsInfo);
|
|
25
|
+
};
|
|
26
|
+
exports.extractObjectsFromChangeRequest = extractObjectsFromChangeRequest;
|
|
27
|
+
exports.createEntityRelationsObjectByEntity = ramda_1.curry(function (objectsWithChanges, entity) {
|
|
28
|
+
return {
|
|
29
|
+
entity: entity,
|
|
30
|
+
relations: getRelations(objectsWithChanges, entity.uri)
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
exports.createEntityRelationsObjectByRelation = ramda_1.curry(function (objectsInfo, relation) {
|
|
34
|
+
var entity = objectsInfo[relation.startObjectUri];
|
|
35
|
+
var relations = [relation];
|
|
36
|
+
return entity ? { entity: __assign(__assign({}, entity), { uri: relation.startObjectUri }), relations: relations } : { relations: relations };
|
|
37
|
+
});
|
|
38
|
+
var concatEntityRelationsObjects = function (acc, object) {
|
|
39
|
+
var entity = object.entity, relations = object.relations;
|
|
40
|
+
var entityUri = entity.uri;
|
|
41
|
+
var mergedRelations = ramda_1.pipe(ramda_1.pathOr([], [entityUri, 'relations']), ramda_1.concat(relations), ramda_1.uniq)(acc);
|
|
42
|
+
acc[entityUri] = {
|
|
43
|
+
entity: entity,
|
|
44
|
+
relations: mergedRelations
|
|
45
|
+
};
|
|
46
|
+
return acc;
|
|
47
|
+
};
|
|
48
|
+
exports.concatEntityRelationsObjects = concatEntityRelationsObjects;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useChangeRequest = void 0;
|
|
15
|
+
var react_1 = require("react");
|
|
16
|
+
var ramda_1 = require("ramda");
|
|
17
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
18
|
+
var hooks_1 = require("../../../hooks");
|
|
19
|
+
var dcrHelpers_1 = require("../helpers/dcrHelpers");
|
|
20
|
+
var errors_1 = require("../helpers/errors");
|
|
21
|
+
var useChangeRequest = function (dcrUri) {
|
|
22
|
+
var _a = react_1.useState([]), groupedObjects = _a[0], setGroupedObjects = _a[1];
|
|
23
|
+
var _b = react_1.useState(null), dcr = _b[0], setDcr = _b[1];
|
|
24
|
+
var safePromise = hooks_1.useSafePromise();
|
|
25
|
+
var requestEntities = react_1.useCallback(function (entityUris) {
|
|
26
|
+
if (ramda_1.isEmpty(entityUris)) {
|
|
27
|
+
return Promise.resolve([]);
|
|
28
|
+
}
|
|
29
|
+
return safePromise(mdm_sdk_1.getEntitiesByUris(entityUris, { searchOptions: 'ovOnly', defaultMaxValues: 1 }));
|
|
30
|
+
}, []); // eslint-disable-line
|
|
31
|
+
react_1.useEffect(function () {
|
|
32
|
+
mdm_sdk_1.getDataChangeRequest(dcrUri)
|
|
33
|
+
.then(function (dcr) {
|
|
34
|
+
var changes = dcr.changes, objectsInfo = dcr.objectsInfo;
|
|
35
|
+
var objectsWithChanges = dcrHelpers_1.extractObjectsFromChangeRequest(changes, objectsInfo);
|
|
36
|
+
var entityObjectsWithRelations = ramda_1.pipe(dcrHelpers_1.getEntitiesObjects, ramda_1.map(dcrHelpers_1.createEntityRelationsObjectByEntity(objectsWithChanges)))(objectsWithChanges);
|
|
37
|
+
var relationsObjects = ramda_1.pipe(dcrHelpers_1.getRelationsObjects, ramda_1.map(dcrHelpers_1.createEntityRelationsObjectByRelation(objectsInfo)))(objectsWithChanges);
|
|
38
|
+
var _a = ramda_1.partition(ramda_1.has('entity'), relationsObjects), relationsObjectsWithEntity = _a[0], relationsObjectsWithoutEntity = _a[1];
|
|
39
|
+
var entityUris = relationsObjectsWithoutEntity.map(ramda_1.path(['relations', 0, 'startObjectUri']));
|
|
40
|
+
requestEntities(entityUris)
|
|
41
|
+
.then(function (entities) {
|
|
42
|
+
var relationsObjectsWithRequestedEntities = relationsObjectsWithoutEntity.map(function (relationsObject, index) {
|
|
43
|
+
return __assign(__assign({}, relationsObject), { entity: entities[index] });
|
|
44
|
+
});
|
|
45
|
+
ramda_1.pipe(ramda_1.flatten, ramda_1.reduce(dcrHelpers_1.concatEntityRelationsObjects, {}), ramda_1.values, setGroupedObjects)([
|
|
46
|
+
entityObjectsWithRelations,
|
|
47
|
+
relationsObjectsWithEntity,
|
|
48
|
+
relationsObjectsWithRequestedEntities
|
|
49
|
+
]);
|
|
50
|
+
})
|
|
51
|
+
.catch(errors_1.showWorkflowError);
|
|
52
|
+
setDcr(dcr);
|
|
53
|
+
})
|
|
54
|
+
.catch(errors_1.showWorkflowError);
|
|
55
|
+
}, [dcrUri, requestEntities]);
|
|
56
|
+
return { dcr: dcr, groupedObjects: groupedObjects };
|
|
57
|
+
};
|
|
58
|
+
exports.useChangeRequest = useChangeRequest;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { Crosswalk, NestedAttributeValue, ReferenceAttributeValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
1
|
+
import { Crosswalk, Entity, NestedAttributeValue, ReferenceAttributeValue, Relation, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
2
|
import { DCRTypes } from '../constants/operations';
|
|
3
|
+
export declare type ChangeRequest = {
|
|
4
|
+
changes: DCRChanges;
|
|
5
|
+
createdBy: string;
|
|
6
|
+
createdTime: number;
|
|
7
|
+
objectsInfo: DCRObjectsInfo;
|
|
8
|
+
state: string;
|
|
9
|
+
type: string;
|
|
10
|
+
updatedBy: string;
|
|
11
|
+
updatedTime: number;
|
|
12
|
+
uri: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type GroupedObjectsInfo = {
|
|
15
|
+
entity: EntityInfo;
|
|
16
|
+
relations: RelationInfo[];
|
|
17
|
+
};
|
|
3
18
|
export declare type EntityInfo = {
|
|
4
19
|
isExist: boolean;
|
|
5
20
|
label: string;
|
|
6
21
|
secondaryLabel: string;
|
|
7
22
|
type: string;
|
|
23
|
+
uri?: string;
|
|
8
24
|
};
|
|
9
25
|
export declare type RelationInfo = {
|
|
10
26
|
type: string;
|
|
@@ -13,11 +29,15 @@ export declare type RelationInfo = {
|
|
|
13
29
|
endObjectLabel: string;
|
|
14
30
|
endObjectUri: string;
|
|
15
31
|
isExist: boolean;
|
|
32
|
+
uri?: string;
|
|
16
33
|
};
|
|
17
34
|
export declare type DCRObjectInfo = EntityInfo | RelationInfo;
|
|
18
35
|
export declare type DCRObjectsInfo = {
|
|
19
36
|
[key: string]: DCRObjectInfo;
|
|
20
37
|
};
|
|
38
|
+
export declare type DCRAttributes = {
|
|
39
|
+
[attributeName: string]: (ChangeValue | DCRChange)[];
|
|
40
|
+
};
|
|
21
41
|
export declare type Value = DCRAttributes | DCRChange | string | boolean | number;
|
|
22
42
|
export declare type DCRAttributeValue = Omit<SimpleAttributeValue | NestedAttributeValue | ReferenceAttributeValue, 'uri' | 'value'> & {
|
|
23
43
|
value: Value;
|
|
@@ -27,10 +47,7 @@ export declare type DCRAttributeValue = Omit<SimpleAttributeValue | NestedAttrib
|
|
|
27
47
|
};
|
|
28
48
|
uri?: string;
|
|
29
49
|
};
|
|
30
|
-
export declare type
|
|
31
|
-
[attributeName: string]: DCRAttributeValue[];
|
|
32
|
-
};
|
|
33
|
-
export declare type ChangeValue = DCRAttributeValue | string[];
|
|
50
|
+
export declare type ChangeValue = DCRAttributeValue | string[] | Entity | Relation;
|
|
34
51
|
export declare type DCRChange = {
|
|
35
52
|
attributePath?: string;
|
|
36
53
|
attributeType?: string;
|
|
@@ -50,14 +67,3 @@ export declare type DCRChange = {
|
|
|
50
67
|
export declare type DCRChanges = {
|
|
51
68
|
[key: string]: DCRChange[];
|
|
52
69
|
};
|
|
53
|
-
export declare type ChangeRequest = {
|
|
54
|
-
changes: DCRChanges;
|
|
55
|
-
createdBy: string;
|
|
56
|
-
createdTime: number;
|
|
57
|
-
objectsInfo: DCRObjectsInfo;
|
|
58
|
-
state: string;
|
|
59
|
-
type: string;
|
|
60
|
-
updatedBy: string;
|
|
61
|
-
updatedTime: number;
|
|
62
|
-
uri: string;
|
|
63
|
-
};
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import i18n from 'ui-i18n';
|
|
2
4
|
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
5
|
+
import mdmModule, { HistoryMode, profile } from '@reltio/mdm-module';
|
|
3
6
|
import { SmallIconButton } from '../../SmallIconButton';
|
|
7
|
+
import DropDownMenuButton from '../../DropDownMenuButton/DropDownMenuButton';
|
|
8
|
+
import MenuItemRenderer from './MenuItemRenderer';
|
|
4
9
|
import { useStyles } from './styles';
|
|
5
10
|
var HistoryMenuButton = function () {
|
|
6
11
|
var styles = useStyles();
|
|
7
|
-
|
|
12
|
+
var mode = useSelector(mdmModule.selectors.getHistoryMode);
|
|
13
|
+
var dispatch = useDispatch();
|
|
14
|
+
var handleModeChange = function (selectedMode) {
|
|
15
|
+
dispatch(profile.history.actions.setHistoryMode(selectedMode));
|
|
16
|
+
};
|
|
17
|
+
var menuItems = [
|
|
18
|
+
{
|
|
19
|
+
text: i18n.text('Compare to Current view'),
|
|
20
|
+
selected: mode === HistoryMode.Current,
|
|
21
|
+
onClick: function () { return handleModeChange(HistoryMode.Current); }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
text: i18n.text('Compare to Previous view'),
|
|
25
|
+
selected: mode === HistoryMode.Previous,
|
|
26
|
+
onClick: function () { return handleModeChange(HistoryMode.Previous); }
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
return (React.createElement(DropDownMenuButton, { MenuItemRenderer: MenuItemRenderer, buttonComponent: SmallIconButton, buttonProps: {
|
|
30
|
+
icon: MoreVertIcon,
|
|
31
|
+
size: 'L',
|
|
32
|
+
className: styles.icon
|
|
33
|
+
}, menuId: 'history-menu', menuItems: menuItems }));
|
|
8
34
|
};
|
|
9
35
|
export default HistoryMenuButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Item = {
|
|
3
|
+
text: string;
|
|
4
|
+
selected: boolean;
|
|
5
|
+
onClick: (e: any) => void;
|
|
6
|
+
};
|
|
7
|
+
declare type Props = {
|
|
8
|
+
item: Item;
|
|
9
|
+
onMenuClose?: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const MenuItemRenderer: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
|
|
12
|
+
export default MenuItemRenderer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
3
|
+
import Typography from '@material-ui/core/Typography';
|
|
4
|
+
import CheckIcon from '@material-ui/icons/Check';
|
|
5
|
+
import { noop } from '../../../core';
|
|
6
|
+
import { useStyles } from './styles';
|
|
7
|
+
var MenuItemRenderer = forwardRef(function (_a, ref) {
|
|
8
|
+
var item = _a.item, _b = _a.onMenuClose, onMenuClose = _b === void 0 ? noop : _b;
|
|
9
|
+
var styles = useStyles();
|
|
10
|
+
var text = item.text, selected = item.selected, onClick = item.onClick;
|
|
11
|
+
var handleClick = function (e) {
|
|
12
|
+
onMenuClose();
|
|
13
|
+
onClick(e);
|
|
14
|
+
};
|
|
15
|
+
return (React.createElement(MenuItem, { classes: { root: styles.menuItem }, onClick: handleClick, ref: ref },
|
|
16
|
+
selected && React.createElement(CheckIcon, { className: styles.checkIcon }),
|
|
17
|
+
React.createElement(Typography, { classes: { root: styles.menuText } }, text)));
|
|
18
|
+
});
|
|
19
|
+
MenuItemRenderer.displayName = 'MenuItemRenderer';
|
|
20
|
+
export default MenuItemRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "menuItem" | "menuText" | "checkIcon">;
|
|
@@ -2,5 +2,18 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
2
2
|
export var useStyles = makeStyles({
|
|
3
3
|
icon: {
|
|
4
4
|
margin: 5
|
|
5
|
+
},
|
|
6
|
+
menuItem: {
|
|
7
|
+
minHeight: '32px'
|
|
8
|
+
},
|
|
9
|
+
menuText: {
|
|
10
|
+
fontSize: '13px',
|
|
11
|
+
lineHeight: '15px',
|
|
12
|
+
letterSpacing: 0,
|
|
13
|
+
marginLeft: '30px'
|
|
14
|
+
},
|
|
15
|
+
checkIcon: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
color: 'rgba(0, 0, 0, 0.54)'
|
|
5
18
|
}
|
|
6
19
|
});
|
package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { getDataChangeRequest } from '@reltio/mdm-sdk';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';
|
|
4
3
|
import LineDecorator from '../../components/LineDecorator/LineDecorator';
|
|
5
4
|
import { getDCRUri } from '../../helpers';
|
|
6
5
|
import DcrTaskIcon from '../../../../icons/DcrTaskIcon';
|
|
7
|
-
import { AttributesChangesContext } from '../../components/AttributesChanges/contexts/AttributesChangesContext';
|
|
8
|
-
import { extractObjectsFromChangeRequest } from '../../components/AttributesChanges/helpers/helpers';
|
|
9
6
|
import AttributesChanges from '../../components/AttributesChanges/AttributesChanges';
|
|
7
|
+
import { useChangeRequest } from '../../hooks/useChangeRequest';
|
|
10
8
|
var DataChangeRequestTaskCard = function (_a) {
|
|
11
9
|
var task = _a.task;
|
|
12
10
|
var objectURIs = task.objectURIs;
|
|
13
11
|
var dcrUri = getDCRUri(objectURIs);
|
|
14
|
-
var _b =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var objectsWithChanges = useMemo(function () { return (dcr ? extractObjectsFromChangeRequest(dcr) : []); }, [dcr]);
|
|
19
|
-
return (React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DcrTaskIcon }, dcr && (React.createElement(AttributesChangesContext.Provider, { value: dcr.objectsInfo },
|
|
20
|
-
React.createElement(LineDecorator, { last: true }, objectsWithChanges.map(function (object) { return (React.createElement(AttributesChanges, { key: object.uri, changes: dcr.changes[object.uri], objectInfo: object })); }))))));
|
|
12
|
+
var _b = useChangeRequest(dcrUri), dcr = _b.dcr, groupedObjects = _b.groupedObjects;
|
|
13
|
+
return (React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DcrTaskIcon }, dcr &&
|
|
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 }))); })));
|
|
21
16
|
};
|
|
22
17
|
export default DataChangeRequestTaskCard;
|