@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
|
@@ -10,7 +10,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { clone, has, isNil } from 'ramda';
|
|
13
|
-
import { DCROperationTypes, DCRTypes, isRelationTypeUri, MetadataPermissions, checkMetadataPermission, isRoleAttrType, isTagAttrType, checkSubAttributesPermissions } from '@reltio/mdm-sdk';
|
|
13
|
+
import { DCROperationTypes, DCRTypes, isComplexAttribute, isImage, isRelationTypeUri, MetadataPermissions, checkMetadataPermission, isRoleAttrType, isTagAttrType, checkSubAttributesPermissions } from '@reltio/mdm-sdk';
|
|
14
|
+
export var isSimpleAttributeValue = function (value) {
|
|
15
|
+
return value !== null && typeof value === 'object' && 'value' in value;
|
|
16
|
+
};
|
|
14
17
|
export var isEditableChange = function (change, entityInfo) {
|
|
15
18
|
var _a;
|
|
16
19
|
var currentAttributeTypeUri = (_a = change.attributeType) === null || _a === void 0 ? void 0 : _a.uri;
|
|
@@ -66,7 +69,7 @@ var addLineIdToChangeValue = function (container, basePath, type) {
|
|
|
66
69
|
if (Array.isArray(container)) {
|
|
67
70
|
return { value: container, lineIds: [basePath] };
|
|
68
71
|
}
|
|
69
|
-
if (
|
|
72
|
+
if (isSimpleAttributeValue(container)) {
|
|
70
73
|
var containerValue = container.value;
|
|
71
74
|
return __assign(__assign({}, container), { lineIds: [basePath], value: isPrimitiveValue(containerValue)
|
|
72
75
|
? containerValue
|
|
@@ -75,7 +78,7 @@ var addLineIdToChangeValue = function (container, basePath, type) {
|
|
|
75
78
|
return container;
|
|
76
79
|
};
|
|
77
80
|
export var addLineIdToValue = function (data) {
|
|
78
|
-
var enrichedData =
|
|
81
|
+
var enrichedData = data;
|
|
79
82
|
for (var entityOrRelationKey in enrichedData) {
|
|
80
83
|
var entityOrRelationId = entityOrRelationKey.split('/')[1];
|
|
81
84
|
var changeList = enrichedData[entityOrRelationKey];
|
|
@@ -101,6 +104,19 @@ export var addLineIdToValue = function (data) {
|
|
|
101
104
|
export var isDiffChange = function (change) {
|
|
102
105
|
return has('level', change);
|
|
103
106
|
};
|
|
107
|
+
export var isRelationRow = function (change) { return Boolean(change.relationType); };
|
|
108
|
+
export var isNestedOrReferenceParent = function (change) {
|
|
109
|
+
var _a;
|
|
110
|
+
if (!change.attributeType)
|
|
111
|
+
return false;
|
|
112
|
+
if (isImage(change.attributeType))
|
|
113
|
+
return false;
|
|
114
|
+
if (!isComplexAttribute(change.attributeType))
|
|
115
|
+
return false;
|
|
116
|
+
var value = (_a = change.attributeValue) === null || _a === void 0 ? void 0 : _a.value;
|
|
117
|
+
var isDeleted = (value === null || value === void 0 ? void 0 : value.type) === DCRTypes.DELETE_ATTRIBUTE;
|
|
118
|
+
return !isDeleted;
|
|
119
|
+
};
|
|
104
120
|
export var checkCanInitiateChangeRequest = function (metadata, entityType, change) {
|
|
105
121
|
if (change.relationType) {
|
|
106
122
|
return checkCanInitChangeRequestForRelation(metadata, change.attributeValue, change.relationType);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type DCRChanges, type EnrichedDCRChanges } from '@reltio/mdm-sdk';
|
|
2
|
+
import type { AddedAttribute } from '../../contexts/AddedAttributesContext';
|
|
3
|
+
export declare const mergeAddedAttributesWithDCRChanges: (changes: DCRChanges, addedAttributes: AddedAttribute[], enrich?: boolean) => EnrichedDCRChanges | DCRChanges;
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { clone, path } from 'ramda';
|
|
13
|
+
import { DCRTypes, EntityAttrTypes, getBaseUri, isReference, isActivenessAttrType, isComplexAttribute, isImage, isRoleAttrType, isTagAttrType } from '@reltio/mdm-sdk';
|
|
14
|
+
import { addLineIdToValue } from './helpers';
|
|
15
|
+
var findNodeByLineId = function (changes, objectUri, lineId) {
|
|
16
|
+
var _a;
|
|
17
|
+
var changeList = changes[objectUri];
|
|
18
|
+
if (!Array.isArray(changeList))
|
|
19
|
+
return null;
|
|
20
|
+
var lineIdParts = lineId.split('/');
|
|
21
|
+
if (lineIdParts.length < 3)
|
|
22
|
+
return null;
|
|
23
|
+
var changeId = lineIdParts[1];
|
|
24
|
+
var change = changeList.find(function (c) { return c.id === changeId; });
|
|
25
|
+
if (!(change === null || change === void 0 ? void 0 : change.newValue))
|
|
26
|
+
return null;
|
|
27
|
+
return (_a = path(lineIdParts.slice(2), change)) !== null && _a !== void 0 ? _a : null;
|
|
28
|
+
};
|
|
29
|
+
var addChildToNode = function (parentNode, attrName, addedId, attributeType, initialValue) {
|
|
30
|
+
var containerKey = 'attributes' in parentNode && typeof parentNode.attributes === 'object' ? 'attributes' : 'value';
|
|
31
|
+
if (!parentNode[containerKey] ||
|
|
32
|
+
typeof parentNode[containerKey] !== 'object' ||
|
|
33
|
+
Array.isArray(parentNode[containerKey])) {
|
|
34
|
+
parentNode[containerKey] = {};
|
|
35
|
+
}
|
|
36
|
+
var container = parentNode[containerKey];
|
|
37
|
+
if (!Array.isArray(container[attrName])) {
|
|
38
|
+
container[attrName] = [];
|
|
39
|
+
}
|
|
40
|
+
var isComplex = attributeType && (isComplexAttribute(attributeType) || isImage(attributeType));
|
|
41
|
+
var value = isComplex ? {} : initialValue === null || initialValue === void 0 ? void 0 : initialValue.value;
|
|
42
|
+
var childNode = __assign(__assign({ value: value }, ((initialValue === null || initialValue === void 0 ? void 0 : initialValue.lookupCode) && { lookupCode: initialValue.lookupCode })), (addedId && { addedId: addedId }));
|
|
43
|
+
container[attrName].push(childNode);
|
|
44
|
+
return childNode;
|
|
45
|
+
};
|
|
46
|
+
var createNewValue = function (attributeType, enrich, id, refEntityUri, initialValue) {
|
|
47
|
+
var isComplex = isComplexAttribute(attributeType) || isImage(attributeType);
|
|
48
|
+
var value = isComplex ? {} : initialValue === null || initialValue === void 0 ? void 0 : initialValue.value;
|
|
49
|
+
var base = __assign(__assign({ value: value }, ((initialValue === null || initialValue === void 0 ? void 0 : initialValue.lookupCode) && { lookupCode: initialValue.lookupCode })), (enrich && id && { addedId: id }));
|
|
50
|
+
if (isReference(attributeType)) {
|
|
51
|
+
base.refEntity = { objectURI: refEntityUri || '' };
|
|
52
|
+
}
|
|
53
|
+
return base;
|
|
54
|
+
};
|
|
55
|
+
var createFakeInsertAttributeChange = function (id, attributeType, newValue, changeOverrides) {
|
|
56
|
+
return __assign({ id: id, type: DCRTypes.INSERT_ATTRIBUTE, attributePath: attributeType.name, attributeType: attributeType.uri, newValue: newValue }, changeOverrides);
|
|
57
|
+
};
|
|
58
|
+
var createFakeRolesOrTagsChange = function (id, attributeType, enrich) { return ({
|
|
59
|
+
id: id,
|
|
60
|
+
type: isTagAttrType(attributeType) ? DCRTypes.UPDATE_TAGS : DCRTypes.UPDATE_ROLES,
|
|
61
|
+
newValue: (enrich ? { value: [], addedId: id } : [])
|
|
62
|
+
}); };
|
|
63
|
+
var createFakeActivenessDateChange = function (id, attributeType, enrich) { return ({
|
|
64
|
+
id: id,
|
|
65
|
+
type: attributeType.uri === EntityAttrTypes.startDate.uri ? DCRTypes.UPDATE_START_DATE : DCRTypes.UPDATE_END_DATE,
|
|
66
|
+
objectType: getBaseUri(attributeType.uri),
|
|
67
|
+
newValue: (enrich ? { value: undefined, addedId: id } : [])
|
|
68
|
+
}); };
|
|
69
|
+
var createEmptyChangeValue = function (enrich, id) {
|
|
70
|
+
return (enrich ? { value: undefined, addedId: id } : []);
|
|
71
|
+
};
|
|
72
|
+
var upsertSpecialAttributeChange = function (_a) {
|
|
73
|
+
var changesList = _a.changesList, changeType = _a.changeType, change = _a.change, enrich = _a.enrich, id = _a.id;
|
|
74
|
+
var existingChange = changesList.find(function (c) { return c.type === changeType; });
|
|
75
|
+
if (existingChange && !existingChange.newValue) {
|
|
76
|
+
existingChange.newValue = createEmptyChangeValue(enrich, id);
|
|
77
|
+
}
|
|
78
|
+
else if (!existingChange) {
|
|
79
|
+
changesList.push(change);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var resolveObjectUri = function (objectUriOrId, changes) {
|
|
83
|
+
if (!objectUriOrId)
|
|
84
|
+
return undefined;
|
|
85
|
+
if (changes[objectUriOrId])
|
|
86
|
+
return objectUriOrId;
|
|
87
|
+
return Object.keys(changes).find(function (uri) { return uri.endsWith("/".concat(objectUriOrId)); }) || objectUriOrId;
|
|
88
|
+
};
|
|
89
|
+
var getObjectUriFromLineId = function (lineId, changes) {
|
|
90
|
+
var objectId = lineId.split('/')[0];
|
|
91
|
+
return resolveObjectUri(objectId, changes);
|
|
92
|
+
};
|
|
93
|
+
export var mergeAddedAttributesWithDCRChanges = function (changes, addedAttributes, enrich) {
|
|
94
|
+
var _a, _b, _c, _d;
|
|
95
|
+
if (enrich === void 0) { enrich = true; }
|
|
96
|
+
var merged = clone(changes);
|
|
97
|
+
if (addedAttributes.length === 0) {
|
|
98
|
+
return enrich ? addLineIdToValue(merged) : merged;
|
|
99
|
+
}
|
|
100
|
+
var nodeById = new Map();
|
|
101
|
+
for (var _i = 0, addedAttributes_1 = addedAttributes; _i < addedAttributes_1.length; _i++) {
|
|
102
|
+
var addedAttribute = addedAttributes_1[_i];
|
|
103
|
+
var id = addedAttribute.id, objectUriFromAddedAttribute = addedAttribute.objectUri, parentLineId = addedAttribute.parentLineId, parentId = addedAttribute.parentId, changeOverrides = addedAttribute.changeOverrides, attributeType = addedAttribute.attributeType;
|
|
104
|
+
var objectUri = resolveObjectUri(objectUriFromAddedAttribute, merged) ||
|
|
105
|
+
(parentLineId ? getObjectUriFromLineId(parentLineId, merged) : undefined);
|
|
106
|
+
var attrName = (_a = attributeType === null || attributeType === void 0 ? void 0 : attributeType.name) !== null && _a !== void 0 ? _a : '';
|
|
107
|
+
if (parentId && !objectUri) {
|
|
108
|
+
var parentNode = (_b = nodeById.get(parentId)) !== null && _b !== void 0 ? _b : null;
|
|
109
|
+
if (!parentNode)
|
|
110
|
+
continue;
|
|
111
|
+
var childNode = addChildToNode(parentNode, attrName, enrich ? id : undefined, attributeType, addedAttribute.initialValue);
|
|
112
|
+
nodeById.set(id, childNode);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (!objectUri)
|
|
116
|
+
continue;
|
|
117
|
+
if (!merged[objectUri]) {
|
|
118
|
+
merged[objectUri] = [];
|
|
119
|
+
}
|
|
120
|
+
var createChange = !parentLineId && !parentId
|
|
121
|
+
? merged[objectUri].find(function (c) { return c.type === DCRTypes.CREATE_ENTITY || c.type === DCRTypes.CREATE_RELATIONSHIP; })
|
|
122
|
+
: undefined;
|
|
123
|
+
if ((createChange === null || createChange === void 0 ? void 0 : createChange.newValue) && (isRoleAttrType(attributeType) || isTagAttrType(attributeType))) {
|
|
124
|
+
var parentNode = createChange.newValue;
|
|
125
|
+
parentNode[attrName] = enrich ? { value: [], addedId: id } : [];
|
|
126
|
+
}
|
|
127
|
+
else if ((createChange === null || createChange === void 0 ? void 0 : createChange.newValue) && isActivenessAttrType(attributeType)) {
|
|
128
|
+
var parentNode = createChange.newValue;
|
|
129
|
+
parentNode[attributeType.uri] = enrich ? { addedId: id } : null;
|
|
130
|
+
}
|
|
131
|
+
else if (createChange === null || createChange === void 0 ? void 0 : createChange.newValue) {
|
|
132
|
+
var parentNode = createChange.newValue;
|
|
133
|
+
var childNode = addChildToNode(parentNode, attrName, enrich ? id : undefined, attributeType, addedAttribute.initialValue);
|
|
134
|
+
nodeById.set(id, childNode);
|
|
135
|
+
}
|
|
136
|
+
else if (isActivenessAttrType(attributeType)) {
|
|
137
|
+
var createRelOrEntityChange = merged[objectUri].find(function (c) { return c.type === DCRTypes.CREATE_RELATIONSHIP || c.type === DCRTypes.CREATE_ENTITY; });
|
|
138
|
+
if (createRelOrEntityChange === null || createRelOrEntityChange === void 0 ? void 0 : createRelOrEntityChange.newValue) {
|
|
139
|
+
var parentNode = createRelOrEntityChange.newValue;
|
|
140
|
+
parentNode[attributeType.uri] = enrich ? { addedId: id } : null;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
var changeType = attributeType.uri === EntityAttrTypes.startDate.uri
|
|
144
|
+
? DCRTypes.UPDATE_START_DATE
|
|
145
|
+
: DCRTypes.UPDATE_END_DATE;
|
|
146
|
+
upsertSpecialAttributeChange({
|
|
147
|
+
changesList: merged[objectUri],
|
|
148
|
+
changeType: changeType,
|
|
149
|
+
change: createFakeActivenessDateChange(id, attributeType, enrich),
|
|
150
|
+
enrich: enrich,
|
|
151
|
+
id: id
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (isTagAttrType(attributeType) || isRoleAttrType(attributeType)) {
|
|
156
|
+
var changeType = isTagAttrType(attributeType) ? DCRTypes.UPDATE_TAGS : DCRTypes.UPDATE_ROLES;
|
|
157
|
+
upsertSpecialAttributeChange({
|
|
158
|
+
changesList: merged[objectUri],
|
|
159
|
+
changeType: changeType,
|
|
160
|
+
change: createFakeRolesOrTagsChange(id, attributeType, enrich),
|
|
161
|
+
enrich: enrich,
|
|
162
|
+
id: id
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
else if (!parentLineId && !parentId) {
|
|
166
|
+
var newValue = createNewValue(attributeType, enrich, id, (_c = addedAttribute.refEntity) === null || _c === void 0 ? void 0 : _c.entityUri, addedAttribute.initialValue);
|
|
167
|
+
nodeById.set(id, newValue);
|
|
168
|
+
var newChange = createFakeInsertAttributeChange(id, attributeType, newValue, changeOverrides);
|
|
169
|
+
merged[objectUri].push(newChange);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
var parentNode = null;
|
|
173
|
+
if (parentLineId) {
|
|
174
|
+
parentNode = findNodeByLineId(merged, objectUri, parentLineId);
|
|
175
|
+
}
|
|
176
|
+
else if (parentId) {
|
|
177
|
+
parentNode = (_d = nodeById.get(parentId)) !== null && _d !== void 0 ? _d : null;
|
|
178
|
+
}
|
|
179
|
+
if (!parentNode)
|
|
180
|
+
continue;
|
|
181
|
+
var childNode = addChildToNode(parentNode, attrName, enrich ? id : undefined, attributeType, addedAttribute.initialValue);
|
|
182
|
+
nodeById.set(id, childNode);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return enrich ? addLineIdToValue(merged) : merged;
|
|
186
|
+
};
|
package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|