@reltio/components 1.4.2243 → 1.4.2245
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/ActivenessDateControl/ActivenessDateControl.d.ts +9 -0
- package/ActivenessDateControl/ActivenessDateControl.js +11 -0
- package/ActivenessDateControl/index.d.ts +1 -0
- package/ActivenessDateControl/index.js +1 -0
- package/EntitySelector/EntitySelector.d.ts +2 -1
- package/EntitySelector/EntitySelector.js +2 -2
- package/EntitySelector/index.d.ts +1 -0
- package/MoreAttributesButton/MoreAttributesButton.d.ts +3 -2
- package/MoreAttributesButton/MoreAttributesButton.js +8 -8
- package/MoreAttributesButton/useMoreAttributesItems.d.ts +4 -4
- package/cjs/ActivenessDateControl/ActivenessDateControl.d.ts +9 -0
- package/cjs/ActivenessDateControl/ActivenessDateControl.js +18 -0
- package/cjs/ActivenessDateControl/index.d.ts +1 -0
- package/cjs/ActivenessDateControl/index.js +5 -0
- package/cjs/EntitySelector/EntitySelector.d.ts +2 -1
- package/cjs/EntitySelector/EntitySelector.js +2 -2
- package/cjs/EntitySelector/index.d.ts +1 -0
- package/cjs/MoreAttributesButton/MoreAttributesButton.d.ts +3 -2
- package/cjs/MoreAttributesButton/MoreAttributesButton.js +8 -8
- package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +4 -4
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +28 -0
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.js +22 -11
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.module.css.js +9 -0
- package/cjs/features/activity-log/ActivityLog/constants.d.ts +17 -0
- package/cjs/features/activity-log/ActivityLog/constants.js +20 -0
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +20 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.d.ts +7 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.js +67 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.js +3 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +31 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.d.ts +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.js +79 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.d.ts +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.d.ts +11 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.js +41 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.js +6 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +134 -5
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/ChangeItemEditor.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.js +110 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.js +6 -5
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.d.ts +0 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.js +1 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.d.ts +8 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.js +89 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.js +12 -11
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/ChangeItemOldValue.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.d.ts +11 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.js +34 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/editors.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/index.d.ts +4 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/index.js +12 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/addedAttributes.d.ts +11 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/addedAttributes.js +74 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.d.ts +2 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.js +157 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.test.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.test.js +203 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +6 -3
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.js +22 -3
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.d.ts +3 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.js +190 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.js +768 -0
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.d.ts +4 -3
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.js +9 -1
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.d.ts +18 -0
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.js +65 -0
- package/cjs/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +7 -3
- package/cjs/features/workflow/contexts/AddedAttributesContext/index.d.ts +39 -0
- package/cjs/features/workflow/contexts/AddedAttributesContext/index.js +152 -0
- package/cjs/features/workflow/contexts/ChangeRequestEditorContext/index.d.ts +3 -2
- package/cjs/features/workflow/contexts/ChangeRequestEditorContext/index.js +47 -7
- package/cjs/features/workflow/contexts/ScrollToAddedAttributeContext/index.d.ts +11 -0
- package/cjs/features/workflow/contexts/ScrollToAddedAttributeContext/index.js +78 -0
- package/cjs/features/workflow/helpers/attributes.js +16 -13
- package/cjs/features/workflow/helpers/attributes.test.js +6 -3
- package/cjs/features/workflow/helpers/dcr.d.ts +6 -1
- package/cjs/features/workflow/helpers/dcr.js +123 -19
- package/cjs/features/workflow/helpers/dcr.test.js +171 -0
- package/cjs/features/workflow/helpers/merge.d.ts +3 -0
- package/cjs/features/workflow/helpers/merge.js +32 -20
- package/cjs/features/workflow/helpers/merge.test.js +2 -1
- package/cjs/features/workflow/helpers/moreAttributesScope.d.ts +4 -0
- package/cjs/features/workflow/helpers/moreAttributesScope.js +20 -0
- package/cjs/features/workflow/helpers/validation.js +31 -6
- package/cjs/features/workflow/hooks/useApplyDcrChanges.d.ts +2 -2
- package/cjs/features/workflow/hooks/useApplyDcrChanges.js +80 -63
- package/cjs/features/workflow/types.d.ts +12 -2
- package/features/activity-log/ActivityLog/ActivityLog.test.js +28 -0
- package/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.js +15 -4
- package/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.module.css.js +9 -0
- package/features/activity-log/ActivityLog/constants.d.ts +17 -0
- package/features/activity-log/ActivityLog/constants.js +17 -0
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +20 -9
- package/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.d.ts +7 -0
- package/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.js +37 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.js +3 -1
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -2
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +32 -10
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.d.ts +9 -0
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.js +49 -0
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.d.ts +2 -2
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.d.ts +11 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.js +34 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +112 -6
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +1 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/ChangeItemEditor.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.js +80 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.js +6 -5
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.d.ts +0 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.js +0 -1
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.d.ts +8 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.js +59 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.js +10 -9
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/ChangeItemOldValue.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.d.ts +11 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.js +27 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/editors.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/editors/index.d.ts +4 -0
- package/features/workflow/ChangeRequestEditor/components/editors/index.js +4 -0
- package/features/workflow/ChangeRequestEditor/helpers/addedAttributes.d.ts +11 -0
- package/features/workflow/ChangeRequestEditor/helpers/addedAttributes.js +62 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.d.ts +2 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.js +153 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.test.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.test.js +201 -0
- package/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +6 -3
- package/features/workflow/ChangeRequestEditor/helpers/helpers.js +19 -3
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.d.ts +3 -0
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.js +186 -0
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.js +766 -0
- package/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.d.ts +4 -3
- package/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.js +9 -1
- package/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.d.ts +18 -0
- package/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.js +61 -0
- package/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +7 -3
- package/features/workflow/contexts/AddedAttributesContext/index.d.ts +39 -0
- package/features/workflow/contexts/AddedAttributesContext/index.js +125 -0
- package/features/workflow/contexts/ChangeRequestEditorContext/index.d.ts +3 -2
- package/features/workflow/contexts/ChangeRequestEditorContext/index.js +47 -7
- package/features/workflow/contexts/ScrollToAddedAttributeContext/index.d.ts +11 -0
- package/features/workflow/contexts/ScrollToAddedAttributeContext/index.js +51 -0
- package/features/workflow/helpers/attributes.js +16 -13
- package/features/workflow/helpers/attributes.test.js +6 -3
- package/features/workflow/helpers/dcr.d.ts +6 -1
- package/features/workflow/helpers/dcr.js +122 -19
- package/features/workflow/helpers/dcr.test.js +172 -1
- package/features/workflow/helpers/merge.d.ts +3 -0
- package/features/workflow/helpers/merge.js +30 -19
- package/features/workflow/helpers/merge.test.js +2 -1
- package/features/workflow/helpers/moreAttributesScope.d.ts +4 -0
- package/features/workflow/helpers/moreAttributesScope.js +14 -0
- package/features/workflow/helpers/validation.js +31 -6
- package/features/workflow/hooks/useApplyDcrChanges.d.ts +2 -2
- package/features/workflow/hooks/useApplyDcrChanges.js +83 -66
- package/features/workflow/types.d.ts +12 -2
- package/package.json +2 -2
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/styles.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/styles.js +0 -57
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +0 -95
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +0 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.d.ts +0 -7
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.js +0 -21
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js +0 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/index.d.ts +0 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/index.js +0 -5
- package/features/activity-log/ActivityLog/components/ActivityItem/styles.d.ts +0 -1
- package/features/activity-log/ActivityLog/components/ActivityItem/styles.js +0 -54
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +0 -65
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +0 -9
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.d.ts +0 -7
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.js +0 -14
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js +0 -9
- package/features/workflow/ChangeRequestEditor/components/StatusChips/index.d.ts +0 -1
- package/features/workflow/ChangeRequestEditor/components/StatusChips/index.js +0 -1
- /package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.d.ts +0 -0
- /package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.d.ts +0 -0
|
@@ -233,13 +233,13 @@ var getRequiredAttributeUris = function (metadata, typeUri) {
|
|
|
233
233
|
return requiredAttrTypes.map(function (attr) { return attr.uri; });
|
|
234
234
|
};
|
|
235
235
|
var createRequiredError = function (_a) {
|
|
236
|
-
var attributeType = _a.attributeType, attributeTypeUri = _a.attributeTypeUri, parentUri = _a.parentUri, lineIds = _a.lineIds, metadata = _a.metadata, entityUri = _a.entityUri, entitiesMap = _a.entitiesMap, valueUri = _a.valueUri;
|
|
236
|
+
var attributeType = _a.attributeType, attributeTypeUri = _a.attributeTypeUri, parentUri = _a.parentUri, lineIds = _a.lineIds, metadata = _a.metadata, entityUri = _a.entityUri, entitiesMap = _a.entitiesMap, valueUri = _a.valueUri, _b = _a.errorType, errorType = _b === void 0 ? mdm_sdk_1.ErrorType.missed : _b, _c = _a.message, message = _c === void 0 ? ui_i18n_1.default.text('Attribute is required') : _c;
|
|
237
237
|
var error = (0, mdm_sdk_1.buildError)({
|
|
238
|
-
type:
|
|
238
|
+
type: errorType,
|
|
239
239
|
attributeType: attributeType,
|
|
240
240
|
attributeTypeUri: attributeTypeUri,
|
|
241
241
|
parentUri: parentUri,
|
|
242
|
-
message:
|
|
242
|
+
message: message,
|
|
243
243
|
source: mdm_sdk_1.ErrorSource.local,
|
|
244
244
|
uri: lineIds[0]
|
|
245
245
|
});
|
|
@@ -259,27 +259,37 @@ var createRequiredError = function (_a) {
|
|
|
259
259
|
var validateRequiredComplexAttributes = function (_a) {
|
|
260
260
|
var _b;
|
|
261
261
|
var metadata = _a.metadata, change = _a.change, userChanges = _a.userChanges, entityUri = _a.entityUri;
|
|
262
|
-
if (
|
|
262
|
+
if (change.type === mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE) {
|
|
263
263
|
return [];
|
|
264
264
|
}
|
|
265
265
|
var valueHolder = change.type === mdm_sdk_1.DCRTypes.CREATE_ENTITY || change.type === mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP ? 'attributes' : 'value';
|
|
266
266
|
var rootAttributeTypeUri = change.refAttributeType || change.attributeType || change.objectType;
|
|
267
|
+
if (!rootAttributeTypeUri) {
|
|
268
|
+
return [];
|
|
269
|
+
}
|
|
267
270
|
var attributeType = (0, mdm_sdk_1.findAttributeTypeByUri)(metadata, rootAttributeTypeUri);
|
|
268
271
|
var isReferenceType = (0, mdm_sdk_1.isReference)(attributeType);
|
|
269
|
-
var entityTypeUri = isReferenceType ? attributeType.relationshipTypeURI : getEntityTypeUriFromChange(change);
|
|
270
|
-
var requiredAttributeUris = getRequiredAttributeUris(metadata, entityTypeUri);
|
|
271
272
|
var calculateLineIdFromPath = function (path) {
|
|
272
273
|
if (path === void 0) { path = ''; }
|
|
273
274
|
var entityId = entityUri.split('/').pop() || '';
|
|
274
275
|
return "".concat(entityId, "/").concat(change.id, "/newValue").concat(path ? "/".concat(path) : '');
|
|
275
276
|
};
|
|
277
|
+
var entityTypeUri = isReferenceType ? attributeType.relationshipTypeURI : getEntityTypeUriFromChange(change);
|
|
278
|
+
var requiredAttributeUris = getRequiredAttributeUris(metadata, entityTypeUri);
|
|
276
279
|
var checkIsChangeRejected = function (path) {
|
|
277
280
|
var _a, _b, _c;
|
|
278
281
|
var searchLineId = calculateLineIdFromPath(path);
|
|
279
282
|
var lineUserChanges = userChanges.find(function (userChange) { return userChange.lineId === searchLineId; });
|
|
280
283
|
return (((_a = lineUserChanges === null || lineUserChanges === void 0 ? void 0 : lineUserChanges.data) === null || _a === void 0 ? void 0 : _a.isRejected) || (lineUserChanges && (0, mdm_sdk_1.isEmptyValue)((_c = (_b = lineUserChanges === null || lineUserChanges === void 0 ? void 0 : lineUserChanges.data) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.value)));
|
|
281
284
|
};
|
|
285
|
+
var checkHasUserValue = function (path) {
|
|
286
|
+
var _a, _b;
|
|
287
|
+
var searchLineId = calculateLineIdFromPath(path);
|
|
288
|
+
var lineUserChange = userChanges.find(function (userChange) { return userChange.lineId === searchLineId; });
|
|
289
|
+
return Boolean(lineUserChange && !(0, mdm_sdk_1.isEmptyValue)((_b = (_a = lineUserChange.data) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value));
|
|
290
|
+
};
|
|
282
291
|
var collectErrors = function (attributes) {
|
|
292
|
+
var _a;
|
|
283
293
|
var errors = [];
|
|
284
294
|
var visitValue = function (value, path) {
|
|
285
295
|
var isRejected = checkIsChangeRejected(path.slice(0, -1).join('/'));
|
|
@@ -289,6 +299,9 @@ var validateRequiredComplexAttributes = function (_a) {
|
|
|
289
299
|
if (isRejected) {
|
|
290
300
|
return false;
|
|
291
301
|
}
|
|
302
|
+
if (value === undefined) {
|
|
303
|
+
return checkHasUserValue(path.slice(0, -1).join('/'));
|
|
304
|
+
}
|
|
292
305
|
var anyFieldHasValue = false;
|
|
293
306
|
Object.entries(value).forEach(function (_a) {
|
|
294
307
|
var fieldName = _a[0], subAttributes = _a[1];
|
|
@@ -326,6 +339,18 @@ var validateRequiredComplexAttributes = function (_a) {
|
|
|
326
339
|
lineIds: [calculateLineIdFromPath()]
|
|
327
340
|
}));
|
|
328
341
|
}
|
|
342
|
+
if (isReferenceType && change.type === mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE) {
|
|
343
|
+
var refEntity = (_a = change.newValue) === null || _a === void 0 ? void 0 : _a.refEntity;
|
|
344
|
+
if (!(refEntity === null || refEntity === void 0 ? void 0 : refEntity.objectURI)) {
|
|
345
|
+
errors.push(createRequiredError({
|
|
346
|
+
attributeType: attributeType,
|
|
347
|
+
attributeTypeUri: attributeType.uri,
|
|
348
|
+
lineIds: [calculateLineIdFromPath()],
|
|
349
|
+
errorType: mdm_sdk_1.ErrorType.missedRefEntity,
|
|
350
|
+
message: ui_i18n_1.default.text('Entity is required')
|
|
351
|
+
}));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
329
354
|
return errors;
|
|
330
355
|
};
|
|
331
356
|
return collectErrors((_b = change.newValue) === null || _b === void 0 ? void 0 : _b[valueHolder]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ChangeRequest } from '@reltio/mdm-sdk';
|
|
2
|
-
import { BeforeActionOutcome } from '../types';
|
|
1
|
+
import { type ChangeRequest } from '@reltio/mdm-sdk';
|
|
2
|
+
import type { BeforeActionOutcome } from '../types';
|
|
3
3
|
export declare const useApplyDcrChanges: (dcr: ChangeRequest) => () => Promise<BeforeActionOutcome>;
|
|
@@ -1,4 +1,15 @@
|
|
|
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
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -43,21 +54,47 @@ var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
|
43
54
|
var ramda_1 = require("ramda");
|
|
44
55
|
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
45
56
|
var ChangeRequestEditorContext_1 = require("../contexts/ChangeRequestEditorContext");
|
|
57
|
+
var AddedAttributesContext_1 = require("../contexts/AddedAttributesContext");
|
|
58
|
+
var mergeAddedAttributesWithDCRChanges_1 = require("../ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges");
|
|
46
59
|
var dcr_1 = require("../helpers/dcr");
|
|
47
60
|
var useDCRValidation_1 = require("./useDCRValidation");
|
|
48
61
|
var withChangeRequestId = function (dcrUri) { return function (url) {
|
|
49
62
|
return url + (url.includes('?') ? '&' : '?') + "changeRequestId=".concat(encodeURIComponent(dcrUri.split('/')[1]));
|
|
50
63
|
}; };
|
|
64
|
+
var executeBatch = function (promises, errorMessage) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
+
var results, failures;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
if (promises.length === 0)
|
|
70
|
+
return [2 /*return*/, null];
|
|
71
|
+
return [4 /*yield*/, (0, mdm_sdk_1.promiseAllSettled)(promises)];
|
|
72
|
+
case 1:
|
|
73
|
+
results = _a.sent();
|
|
74
|
+
failures = results.filter(function (result) { return result.status === 'rejected'; });
|
|
75
|
+
if (failures.length) {
|
|
76
|
+
return [2 /*return*/, {
|
|
77
|
+
proceed: false,
|
|
78
|
+
error: new Error("".concat(errorMessage, ": ").concat(failures.map(function (r) { return r.reason; }).join(', ')))
|
|
79
|
+
}];
|
|
80
|
+
}
|
|
81
|
+
return [2 /*return*/, null];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}); };
|
|
51
85
|
var useApplyDcrChanges = function (dcr) {
|
|
52
86
|
var getLinesByChangeId = (0, react_context_selector_1.useContextSelector)(ChangeRequestEditorContext_1.ChangeRequestEditorContext, function (context) { return context.getLinesByChangeId; });
|
|
87
|
+
var addedAttributes = (0, react_context_selector_1.useContextSelector)(AddedAttributesContext_1.AddedAttributesContext, function (ctx) { return ctx.getAddedAttributes(); });
|
|
53
88
|
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
54
|
-
var
|
|
89
|
+
var entity = (0, MdmModuleContext_1.useMdmEntity)();
|
|
90
|
+
var changes = (0, react_1.useMemo)(function () { var _a; return (0, mergeAddedAttributesWithDCRChanges_1.mergeAddedAttributesWithDCRChanges)((_a = dcr === null || dcr === void 0 ? void 0 : dcr.changes) !== null && _a !== void 0 ? _a : {}, addedAttributes, false); }, [dcr === null || dcr === void 0 ? void 0 : dcr.changes, addedAttributes]);
|
|
91
|
+
var getErrors = (0, useDCRValidation_1.useDCRValidation)(__assign(__assign({}, dcr), { changes: changes }));
|
|
55
92
|
var applyDcrChanges = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var errors, _a, rejectedChangeIds, updatedChanges, deleteEntityAttributes, deleteRelationAttributes,
|
|
93
|
+
var errors, _a, rejectedChangeIds, updatedChanges, deleteEntityAttributes, deleteRelationAttributes, insertEntityAttributes, insertRelationAttributes, uriPreprocessor_1, deleteChangesError, error_1, deleteEntityAttrsError, insertEntityAttrsError, deleteRelationAttrsError, insertRelationAttrsError;
|
|
57
94
|
return __generator(this, function (_b) {
|
|
58
95
|
switch (_b.label) {
|
|
59
96
|
case 0:
|
|
60
|
-
if (!(dcr === null || dcr === void 0 ? void 0 : dcr.
|
|
97
|
+
if (!(dcr === null || dcr === void 0 ? void 0 : dcr.uri)) return [3 /*break*/, 11];
|
|
61
98
|
return [4 /*yield*/, getErrors()];
|
|
62
99
|
case 1:
|
|
63
100
|
errors = _b.sent();
|
|
@@ -66,90 +103,70 @@ var useApplyDcrChanges = function (dcr) {
|
|
|
66
103
|
proceed: false
|
|
67
104
|
}];
|
|
68
105
|
}
|
|
69
|
-
_a = (0, dcr_1.buildDCRSavePlan)(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
deleteRelationAttributesResults = [];
|
|
73
|
-
if (!(rejectedChangeIds.length > 0)) return [3 /*break*/, 3];
|
|
74
|
-
return [4 /*yield*/, (0, mdm_sdk_1.promiseAllSettled)(rejectedChangeIds.map(function (changeId) {
|
|
75
|
-
return (0, mdm_sdk_1.deleteChangeRequestItem)({ dcrUri: dcr.uri, changeItemId: changeId });
|
|
76
|
-
}))];
|
|
106
|
+
_a = (0, dcr_1.buildDCRSavePlan)(changes, getLinesByChangeId, metadata), rejectedChangeIds = _a.rejectedChangeIds, updatedChanges = _a.updatedChanges, deleteEntityAttributes = _a.deleteEntityAttributes, deleteRelationAttributes = _a.deleteRelationAttributes, insertEntityAttributes = _a.insertEntityAttributes, insertRelationAttributes = _a.insertRelationAttributes;
|
|
107
|
+
uriPreprocessor_1 = withChangeRequestId(dcr.uri);
|
|
108
|
+
return [4 /*yield*/, executeBatch(rejectedChangeIds.map(function (changeId) { return (0, mdm_sdk_1.deleteChangeRequestItem)({ dcrUri: dcr.uri, changeItemId: changeId }); }), 'Failed to delete DCR change(s)')];
|
|
77
109
|
case 2:
|
|
78
|
-
|
|
110
|
+
deleteChangesError = _b.sent();
|
|
111
|
+
if (deleteChangesError)
|
|
112
|
+
return [2 /*return*/, deleteChangesError];
|
|
113
|
+
if (!!(0, ramda_1.isEmpty)(updatedChanges)) return [3 /*break*/, 6];
|
|
79
114
|
_b.label = 3;
|
|
80
115
|
case 3:
|
|
81
|
-
|
|
82
|
-
if (deleteChangeFailures.length) {
|
|
83
|
-
return [2 /*return*/, {
|
|
84
|
-
proceed: false,
|
|
85
|
-
error: new Error("Failed to delete DCR change(s): ".concat(deleteChangeFailures.map(function (result) { return result.reason; }).join(', ')))
|
|
86
|
-
}];
|
|
87
|
-
}
|
|
88
|
-
if (!!(0, ramda_1.isEmpty)(updatedChanges)) return [3 /*break*/, 7];
|
|
89
|
-
_b.label = 4;
|
|
90
|
-
case 4:
|
|
91
|
-
_b.trys.push([4, 6, , 7]);
|
|
116
|
+
_b.trys.push([3, 5, , 6]);
|
|
92
117
|
return [4 /*yield*/, (0, mdm_sdk_1.updateChangeRequest)({ dcrUri: dcr.uri, payload: updatedChanges })];
|
|
93
|
-
case
|
|
118
|
+
case 4:
|
|
94
119
|
_b.sent();
|
|
95
|
-
return [3 /*break*/,
|
|
96
|
-
case
|
|
120
|
+
return [3 /*break*/, 6];
|
|
121
|
+
case 5:
|
|
97
122
|
error_1 = _b.sent();
|
|
98
123
|
return [2 /*return*/, {
|
|
99
124
|
proceed: false,
|
|
100
125
|
error: error_1
|
|
101
126
|
}];
|
|
127
|
+
case 6: return [4 /*yield*/, executeBatch(Object.entries(deleteEntityAttributes).map(function (_a) {
|
|
128
|
+
var entityUri = _a[0], diff = _a[1];
|
|
129
|
+
return (0, mdm_sdk_1.entityCumulativeUpdate)({ uri: entityUri, diff: diff, uriPreprocessor: uriPreprocessor_1 });
|
|
130
|
+
}), 'Failed to delete entity attributes')];
|
|
102
131
|
case 7:
|
|
103
|
-
|
|
104
|
-
|
|
132
|
+
deleteEntityAttrsError = _b.sent();
|
|
133
|
+
if (deleteEntityAttrsError)
|
|
134
|
+
return [2 /*return*/, deleteEntityAttrsError];
|
|
135
|
+
return [4 /*yield*/, executeBatch(Object.entries(insertEntityAttributes).map(function (_a) {
|
|
105
136
|
var entityUri = _a[0], diff = _a[1];
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
uriPreprocessor: withChangeRequestId(dcr.uri)
|
|
110
|
-
});
|
|
111
|
-
}))];
|
|
137
|
+
var mergedDiff = entityUri === (entity === null || entity === void 0 ? void 0 : entity.uri) ? (0, dcr_1.mergeExistingRolesAndTags)(diff, entity) : diff;
|
|
138
|
+
return (0, mdm_sdk_1.entityCumulativeUpdate)({ uri: entityUri, diff: mergedDiff, uriPreprocessor: uriPreprocessor_1 });
|
|
139
|
+
}), 'Failed to insert entity attributes')];
|
|
112
140
|
case 8:
|
|
113
|
-
|
|
114
|
-
|
|
141
|
+
insertEntityAttrsError = _b.sent();
|
|
142
|
+
if (insertEntityAttrsError)
|
|
143
|
+
return [2 /*return*/, insertEntityAttrsError];
|
|
144
|
+
return [4 /*yield*/, executeBatch(Object.entries(deleteRelationAttributes).map(function (_a) {
|
|
145
|
+
var relationUri = _a[0], diff = _a[1];
|
|
146
|
+
return (0, mdm_sdk_1.updateRelationWithDiff)({ uri: relationUri, diff: diff, uriPreprocessor: uriPreprocessor_1 });
|
|
147
|
+
}), 'Failed to delete relation attributes')];
|
|
115
148
|
case 9:
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
return [2 /*return*/,
|
|
119
|
-
|
|
120
|
-
error: new Error("Failed to delete entity attributes: ".concat(deleteEntityAttributesFailures.map(function (result) { return result.reason; }).join(', ')))
|
|
121
|
-
}];
|
|
122
|
-
}
|
|
123
|
-
if (!!(0, ramda_1.isEmpty)(deleteRelationAttributes)) return [3 /*break*/, 11];
|
|
124
|
-
return [4 /*yield*/, (0, mdm_sdk_1.promiseAllSettled)(Object.entries(deleteRelationAttributes).map(function (_a) {
|
|
149
|
+
deleteRelationAttrsError = _b.sent();
|
|
150
|
+
if (deleteRelationAttrsError)
|
|
151
|
+
return [2 /*return*/, deleteRelationAttrsError];
|
|
152
|
+
return [4 /*yield*/, executeBatch(Object.entries(insertRelationAttributes).map(function (_a) {
|
|
125
153
|
var relationUri = _a[0], diff = _a[1];
|
|
126
|
-
return (0, mdm_sdk_1.updateRelationWithDiff)({
|
|
127
|
-
|
|
128
|
-
diff: diff,
|
|
129
|
-
uriPreprocessor: withChangeRequestId(dcr.uri)
|
|
130
|
-
});
|
|
131
|
-
}))];
|
|
154
|
+
return (0, mdm_sdk_1.updateRelationWithDiff)({ uri: relationUri, diff: diff, uriPreprocessor: uriPreprocessor_1 });
|
|
155
|
+
}), 'Failed to insert relation attributes')];
|
|
132
156
|
case 10:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
deleteRelationAttributesFailures = deleteRelationAttributesResults.filter(function (result) { return result.status === 'rejected'; });
|
|
137
|
-
if (deleteRelationAttributesFailures.length) {
|
|
138
|
-
return [2 /*return*/, {
|
|
139
|
-
proceed: false,
|
|
140
|
-
error: new Error("Failed to delete relation attributes: ".concat(deleteRelationAttributesFailures.map(function (result) { return result.reason; }).join(', ')))
|
|
141
|
-
}];
|
|
142
|
-
}
|
|
157
|
+
insertRelationAttrsError = _b.sent();
|
|
158
|
+
if (insertRelationAttrsError)
|
|
159
|
+
return [2 /*return*/, insertRelationAttrsError];
|
|
143
160
|
return [2 /*return*/, {
|
|
144
161
|
proceed: true
|
|
145
162
|
}];
|
|
146
|
-
case
|
|
163
|
+
case 11: return [2 /*return*/, {
|
|
147
164
|
proceed: false,
|
|
148
165
|
error: new Error('No changes to apply')
|
|
149
166
|
}];
|
|
150
167
|
}
|
|
151
168
|
});
|
|
152
|
-
}); }, [dcr, getLinesByChangeId, metadata, getErrors]);
|
|
169
|
+
}); }, [dcr === null || dcr === void 0 ? void 0 : dcr.uri, getLinesByChangeId, metadata, getErrors, changes, entity]);
|
|
153
170
|
return applyDcrChanges;
|
|
154
171
|
};
|
|
155
172
|
exports.useApplyDcrChanges = useApplyDcrChanges;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { AttributeType, DCRAttributeValue, DCROperationTypes, DCRRelationInfo, EnrichedChangeValue, TRelationType, ChangeValue, SimpleAttributeValue, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
1
|
+
import type { AttributeType, DCRAttributeValue, DCROperationTypes, DCRRelationInfo, EnrichedChangeValue, TRelationType, ChangeValue, SimpleAttributeValue, PrimitiveValue, RecordImageAttributeValue } from '@reltio/mdm-sdk';
|
|
2
2
|
export type TaskAction = {
|
|
3
3
|
text: string;
|
|
4
4
|
onClick: (comment: string) => void;
|
|
5
5
|
};
|
|
6
6
|
export type RelationAttributeValue = DCRAttributeValue & DCRRelationInfo;
|
|
7
|
+
export type DiffDisplayOptions = {
|
|
8
|
+
showLabel: boolean;
|
|
9
|
+
showAddButton: boolean;
|
|
10
|
+
hasSameAttributeSiblings: boolean;
|
|
11
|
+
};
|
|
7
12
|
export type Diff = {
|
|
8
13
|
level: number;
|
|
9
14
|
label: string;
|
|
@@ -15,6 +20,11 @@ export type Diff = {
|
|
|
15
20
|
operation?: DCROperationTypes;
|
|
16
21
|
isReferenceSubAttribute?: boolean;
|
|
17
22
|
lineIds?: string[];
|
|
23
|
+
addedId?: string;
|
|
24
|
+
displayOptions?: DiffDisplayOptions;
|
|
25
|
+
attributePath?: string;
|
|
26
|
+
refAttributeType?: string;
|
|
27
|
+
refObjectURI?: string;
|
|
18
28
|
};
|
|
19
29
|
export type Title = {
|
|
20
30
|
label: string;
|
|
@@ -24,7 +34,7 @@ export type BeforeActionOutcome = {
|
|
|
24
34
|
error?: unknown;
|
|
25
35
|
};
|
|
26
36
|
export type LineDataValue = SimpleAttributeValue | {
|
|
27
|
-
value: string[] | PrimitiveValue;
|
|
37
|
+
value: string[] | PrimitiveValue | RecordImageAttributeValue;
|
|
28
38
|
};
|
|
29
39
|
export type LineData = {
|
|
30
40
|
value?: LineDataValue;
|
|
@@ -52,6 +52,7 @@ import { render, screen, within } from '@testing-library/react';
|
|
|
52
52
|
import userEvent from '@testing-library/user-event';
|
|
53
53
|
import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
|
|
54
54
|
import { ActivityLog } from './ActivityLog';
|
|
55
|
+
import { CLIENT_TYPES } from './constants';
|
|
55
56
|
describe('Activity log tests', function () {
|
|
56
57
|
mockResizeObserver();
|
|
57
58
|
var activities = [
|
|
@@ -445,6 +446,33 @@ describe('Activity log tests', function () {
|
|
|
445
446
|
}
|
|
446
447
|
});
|
|
447
448
|
}); });
|
|
449
|
+
it('displays client type label when clientType is in CLIENT_TYPES', function () {
|
|
450
|
+
var activityWithKnownClientType = [
|
|
451
|
+
{
|
|
452
|
+
uri: 'activities/client-type-known',
|
|
453
|
+
user: 'agent.user',
|
|
454
|
+
label: 'USER_LOGIN',
|
|
455
|
+
description: 'User agent.user was logged in',
|
|
456
|
+
timestamp: 1622625987531,
|
|
457
|
+
items: [
|
|
458
|
+
{
|
|
459
|
+
id: 'client-type-item',
|
|
460
|
+
user: 'agent.user',
|
|
461
|
+
method: 'POST',
|
|
462
|
+
url: '/reltio/api/test/activities',
|
|
463
|
+
clientType: 'Match_Resolution_Agent',
|
|
464
|
+
timestamp: 1622625987531
|
|
465
|
+
}
|
|
466
|
+
],
|
|
467
|
+
itemsTotal: 1
|
|
468
|
+
}
|
|
469
|
+
];
|
|
470
|
+
setUp({ activities: activityWithKnownClientType });
|
|
471
|
+
var activityItem = screen.getAllByTestId('activity-log-item')[0];
|
|
472
|
+
expect(activityItem).toHaveTextContent(CLIENT_TYPES.Match_Resolution_Agent);
|
|
473
|
+
expect(activityItem).toHaveTextContent(i18n.text('via'));
|
|
474
|
+
expect(activityItem).toHaveTextContent(i18n.text('agent'));
|
|
475
|
+
});
|
|
448
476
|
it('should not fail for activities without items', function () {
|
|
449
477
|
var activitiesWithoutItems = [
|
|
450
478
|
{
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
2
3
|
import i18n from 'ui-i18n';
|
|
3
|
-
import { getActivityType, splitActivityByType } from '../../../utils/activities';
|
|
4
|
-
import { ActivitiesFactory } from '../../../ActivitiesFactory';
|
|
5
4
|
import { ErrorBoundary } from '../../../../../ErrorBoundary';
|
|
5
|
+
import { ActivitiesFactory } from '../../../ActivitiesFactory';
|
|
6
6
|
import { ActivityTitle } from '../../../ActivityTitle';
|
|
7
|
-
import {
|
|
7
|
+
import { getActivityType, splitActivityByType } from '../../../utils/activities';
|
|
8
|
+
import { CLIENT_TYPES } from '../../constants';
|
|
9
|
+
import styles from './ActivityItem.module.css';
|
|
8
10
|
export var ActivityItem = function (_a) {
|
|
11
|
+
var _b, _c;
|
|
9
12
|
var item = _a.item;
|
|
10
|
-
var styles = useStyles();
|
|
11
13
|
var type = getActivityType(item);
|
|
12
14
|
var activities = splitActivityByType(item);
|
|
15
|
+
var clientTypeName = CLIENT_TYPES[(_c = (_b = item.items) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.clientType];
|
|
13
16
|
return (React.createElement("div", { className: styles.activityItem, "data-reltio-id": "activity-log-item" },
|
|
14
17
|
React.createElement("div", { className: styles.activityIcon }, ActivitiesFactory.getIcon(type)),
|
|
15
18
|
React.createElement("div", { className: styles.activityInfo },
|
|
16
19
|
React.createElement("div", { className: styles.userContainer },
|
|
17
20
|
React.createElement("span", { className: styles.activityUser }, item.user),
|
|
21
|
+
clientTypeName ? (React.createElement("span", { className: classnames(styles.activityUser, styles.activityUserClient) },
|
|
22
|
+
"(",
|
|
23
|
+
i18n.text('via'),
|
|
24
|
+
" ",
|
|
25
|
+
clientTypeName,
|
|
26
|
+
" ",
|
|
27
|
+
i18n.text('agent'),
|
|
28
|
+
")")) : null,
|
|
18
29
|
React.createElement("span", { className: styles.date }, i18n.date(item.timestamp, 'LT'))),
|
|
19
30
|
activities.map(function (activity, index) {
|
|
20
31
|
var activityType = getActivityType(activity);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"activityItem":"ActivityItem-activityItem--c5xTq","activityIcon":"ActivityItem-activityIcon--rHySh","userContainer":"ActivityItem-userContainer--cEXoW","activityInfo":"ActivityItem-activityInfo--9s7Vx","activityUser":"ActivityItem-activityUser--NsEvM","activityUserClient":"ActivityItem-activityUserClient--Zirlu","activityEvent":"ActivityItem-activityEvent--6s1wq","date":"ActivityItem-date--fvRDG"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.ActivityItem-activityItem--c5xTq{box-sizing:border-box;display:flex;min-height:40px;padding:10px 16px 5px 0}.ActivityItem-activityIcon--rHySh{align-items:center;background:var(--mui-palette-primary-main);border:1px solid #fff;border-radius:50%;display:flex;flex-shrink:0;height:24px;justify-content:center;margin-left:-13px;margin-right:15px;width:24px}.ActivityItem-activityIcon--rHySh svg{fill:#fff;font-size:14px}.ActivityItem-userContainer--cEXoW{display:flex}.ActivityItem-activityInfo--9s7Vx{flex:1;overflow:hidden;position:relative}.ActivityItem-activityUser--NsEvM{color:var(--mui-palette-text-secondary);font-size:13px;line-height:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ActivityItem-activityUserClient--Zirlu{margin-left:.25em}.ActivityItem-activityEvent--6s1wq{margin-top:5px}.ActivityItem-date--fvRDG{color:var(--mui-palette-text-primary);flex-shrink:0;font-size:12px;line-height:16px;margin-left:auto;padding-left:8px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const CLIENT_TYPES: {
|
|
2
|
+
Match_Resolution_Agent: string;
|
|
3
|
+
Unmerge_Remediation_Agent: string;
|
|
4
|
+
Data_Exploration_Agent: string;
|
|
5
|
+
Intelligent_Workflow_Assignment_Agent: string;
|
|
6
|
+
Global_Menu_Item_Assignment_Agent: string;
|
|
7
|
+
Menu_Item_Characteristics_Enrichment_Agent: string;
|
|
8
|
+
Address_Enrichment_Agent: string;
|
|
9
|
+
Product_Recommendation_Agent: string;
|
|
10
|
+
Hierarchy_Management_Agent: string;
|
|
11
|
+
Data_Quality_Service_Agent: string;
|
|
12
|
+
Agent_Dev_Template: string;
|
|
13
|
+
Match_Explanation_Analyzer: string;
|
|
14
|
+
Reltio_On_Reltio_Agent: string;
|
|
15
|
+
External_Party_Resolution_Agent: string;
|
|
16
|
+
Segmentation_Agent: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export var CLIENT_TYPES = {
|
|
2
|
+
Match_Resolution_Agent: 'MRA',
|
|
3
|
+
Unmerge_Remediation_Agent: 'URA',
|
|
4
|
+
Data_Exploration_Agent: 'DEA',
|
|
5
|
+
Intelligent_Workflow_Assignment_Agent: 'IAWA',
|
|
6
|
+
Global_Menu_Item_Assignment_Agent: 'GMIAA',
|
|
7
|
+
Menu_Item_Characteristics_Enrichment_Agent: 'MICEA',
|
|
8
|
+
Address_Enrichment_Agent: 'AEA',
|
|
9
|
+
Product_Recommendation_Agent: 'PRA',
|
|
10
|
+
Hierarchy_Management_Agent: 'EHRA',
|
|
11
|
+
Data_Quality_Service_Agent: 'DQSA',
|
|
12
|
+
Agent_Dev_Template: 'DEV',
|
|
13
|
+
Match_Explanation_Analyzer: 'MEA',
|
|
14
|
+
Reltio_On_Reltio_Agent: 'RORA',
|
|
15
|
+
External_Party_Resolution_Agent: 'EPRA',
|
|
16
|
+
Segmentation_Agent: 'SA'
|
|
17
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChangeRequest, WorkflowTaskData, GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
2
|
+
import type { ChangeRequest, WorkflowTaskData, GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
3
3
|
type Props = {
|
|
4
4
|
dcr: ChangeRequest;
|
|
5
5
|
task: WorkflowTaskData;
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { clone } from 'ramda';
|
|
3
13
|
import i18n from 'ui-i18n';
|
|
4
14
|
import Typography from '@mui/material/Typography';
|
|
5
|
-
import {
|
|
15
|
+
import { useContextSelector } from '@fluentui/react-context-selector';
|
|
6
16
|
import SvgSuggestedChanges from '../../../icons/SuggestedChanges';
|
|
7
17
|
import { EntityChangesGroup, SkeletonEntityChangesGroupLoader } from './components/EntityChangesGroup';
|
|
18
|
+
import { mergeAddedAttributesWithDCRChanges } from './helpers/mergeAddedAttributesWithDCRChanges';
|
|
19
|
+
import { AddedAttributesContext } from '../contexts/AddedAttributesContext';
|
|
8
20
|
import styles from './ChangeRequestEditor.module.css';
|
|
9
21
|
export var ChangeRequestEditor = function (_a) {
|
|
10
22
|
var dcr = _a.dcr, task = _a.task, groupedObjects = _a.groupedObjects;
|
|
23
|
+
var addedAttributes = useContextSelector(AddedAttributesContext, function (ctx) { return ctx.getAddedAttributes(); });
|
|
11
24
|
var enrichedDCR = useMemo(function () {
|
|
12
|
-
if (dcr === null || dcr === void 0 ? void 0 : dcr.changes)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return null;
|
|
18
|
-
}, [dcr]);
|
|
25
|
+
if (!(dcr === null || dcr === void 0 ? void 0 : dcr.changes))
|
|
26
|
+
return null;
|
|
27
|
+
var enrichedChanges = mergeAddedAttributesWithDCRChanges(dcr.changes, addedAttributes);
|
|
28
|
+
return __assign(__assign({}, dcr), { changes: enrichedChanges });
|
|
29
|
+
}, [dcr, addedAttributes]);
|
|
19
30
|
var dcrLoaded = !!enrichedDCR && groupedObjects.length > 0;
|
|
20
31
|
return (React.createElement("div", { className: styles.container },
|
|
21
32
|
React.createElement("div", { className: styles.header },
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import i18n from 'ui-i18n';
|
|
3
|
+
import { useContextSelector } from '@fluentui/react-context-selector';
|
|
4
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
5
|
+
import { AddedAttributesContext } from '../../../contexts/AddedAttributesContext';
|
|
6
|
+
import { SmallIconButton } from '../../../../../SmallIconButton';
|
|
7
|
+
import { extractLineIds } from '../../../helpers/merge';
|
|
8
|
+
import { getAddedId, getObjectIdFromLineId, getParentAddedId, getParentChangeOverrides, getParentLineId, isRootAddedAttribute } from '../../helpers/addedAttributes';
|
|
9
|
+
export var AddSameAttributeButton = function (_a) {
|
|
10
|
+
var _b, _c;
|
|
11
|
+
var change = _a.change;
|
|
12
|
+
var attributeType = change.attributeType, lineIds = change.lineIds;
|
|
13
|
+
var lineId = (_b = lineIds === null || lineIds === void 0 ? void 0 : lineIds[0]) !== null && _b !== void 0 ? _b : (_c = extractLineIds(change === null || change === void 0 ? void 0 : change.newValue)) === null || _c === void 0 ? void 0 : _c[0];
|
|
14
|
+
var addedId = getAddedId(change);
|
|
15
|
+
var addAddedAttributes = useContextSelector(AddedAttributesContext, function (ctx) { return ctx.addAddedAttributes; });
|
|
16
|
+
var handleAdd = useCallback(function () {
|
|
17
|
+
if (!attributeType || !lineId)
|
|
18
|
+
return;
|
|
19
|
+
var changeOverrides = getParentChangeOverrides(change);
|
|
20
|
+
if (isRootAddedAttribute(lineId)) {
|
|
21
|
+
addAddedAttributes({
|
|
22
|
+
attributeTypes: [attributeType],
|
|
23
|
+
objectUri: getObjectIdFromLineId(lineId),
|
|
24
|
+
changeOverrides: changeOverrides
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
addAddedAttributes({
|
|
29
|
+
attributeTypes: [attributeType],
|
|
30
|
+
parentLineId: getParentLineId(lineId),
|
|
31
|
+
parentId: addedId ? getParentAddedId(addedId) : undefined,
|
|
32
|
+
changeOverrides: changeOverrides
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, [attributeType, lineId, addedId, change, addAddedAttributes]);
|
|
36
|
+
return React.createElement(SmallIconButton, { icon: AddIcon, onClick: handleAdd, title: i18n.text('Add'), size: "S" });
|
|
37
|
+
};
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { useCssVariableStyles } from '../../../../../hooks/useCssVariableStyles';
|
|
4
4
|
import { RequiredMark } from '../../../../../RequiredMark';
|
|
5
|
+
import { ExpandedValueTooltip } from '../../../../../ExpandedValueTooltip';
|
|
5
6
|
import styles from './ChangeItemLabel.module.css';
|
|
6
7
|
export var ChangeItemLabel = function (_a) {
|
|
7
8
|
var _b;
|
|
@@ -12,6 +13,7 @@ export var ChangeItemLabel = function (_a) {
|
|
|
12
13
|
'--level': level
|
|
13
14
|
});
|
|
14
15
|
return (React.createElement("div", { className: classnames(styles.changeLabel, className), style: variableStyles }, showLabel && (React.createElement(React.Fragment, null,
|
|
15
|
-
label,
|
|
16
|
+
React.createElement(ExpandedValueTooltip, { value: label },
|
|
17
|
+
React.createElement("div", { className: styles.labelText }, label)),
|
|
16
18
|
isRequired && React.createElement(RequiredMark, null)))));
|
|
17
19
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"changeLabel":"ChangeItemLabel-changeLabel--L-2ks"};
|
|
1
|
+
const styles = {"changeLabel":"ChangeItemLabel-changeLabel--L-2ks","labelText":"ChangeItemLabel-labelText--f3kcC"};
|
|
2
2
|
if (typeof document !== 'undefined') {
|
|
3
3
|
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
4
|
const style = document.createElement('style');
|
|
5
5
|
style.type = 'text/css'
|
|
6
|
-
style.innerHTML = `.ChangeItemLabel-changeLabel--L-2ks{color:var(--mui-palette-text-secondary);font-size:14px;font-weight:400;letter-spacing:.24px;padding-left:calc(var(--level, 0)*16px)}`;
|
|
6
|
+
style.innerHTML = `.ChangeItemLabel-changeLabel--L-2ks{align-items:center;color:var(--mui-palette-text-secondary);display:flex;font-size:14px;font-weight:400;letter-spacing:.24px;overflow:hidden;padding-left:calc(var(--level, 0)*16px)}.ChangeItemLabel-labelText--f3kcC{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
3
|
-
import { Diff } from '../../../types';
|
|
2
|
+
import { type GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
3
|
+
import type { Diff } from '../../../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
change: Diff;
|
|
6
6
|
entityInfo: GroupedObjectsInfo['entity'];
|