@reltio/components 1.4.2201 → 1.4.2202
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/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +36 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +1 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +15 -6
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +4 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +2 -28
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +4 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +11 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +5 -5
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +2 -28
- package/cjs/features/workflow/ChangeRequestEditor/context/index.d.ts +20 -0
- package/cjs/features/workflow/ChangeRequestEditor/context/index.js +76 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helper.test.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helper.test.js +237 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +4 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.js +105 -0
- package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +3 -1
- package/cjs/features/workflow/helpers/attributes.js +14 -3
- package/cjs/features/workflow/helpers/attributes.test.js +29 -7
- package/cjs/features/workflow/helpers/merge.d.ts +3 -2
- package/cjs/features/workflow/helpers/merge.js +62 -18
- package/cjs/features/workflow/helpers/merge.test.js +56 -2
- package/cjs/features/workflow/hooks/useChangesList.d.ts +2 -2
- package/cjs/features/workflow/types.d.ts +4 -3
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +13 -3
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +1 -3
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +15 -6
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +4 -3
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +2 -5
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +4 -3
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +13 -5
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -3
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +6 -6
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +2 -2
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +2 -5
- package/features/workflow/ChangeRequestEditor/context/index.d.ts +20 -0
- package/features/workflow/ChangeRequestEditor/context/index.js +49 -0
- package/features/workflow/ChangeRequestEditor/helpers/helper.test.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/helpers/helper.test.js +235 -0
- package/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +4 -0
- package/features/workflow/ChangeRequestEditor/helpers/helpers.js +100 -0
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +3 -1
- package/features/workflow/helpers/attributes.js +14 -3
- package/features/workflow/helpers/attributes.test.js +29 -7
- package/features/workflow/helpers/merge.d.ts +3 -2
- package/features/workflow/helpers/merge.js +60 -17
- package/features/workflow/helpers/merge.test.js +56 -2
- package/features/workflow/hooks/useChangesList.d.ts +2 -2
- package/features/workflow/types.d.ts +4 -3
- package/package.json +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/helpers.d.ts +0 -3
- package/cjs/features/workflow/ChangeRequestEditor/helpers.js +0 -16
- package/features/workflow/ChangeRequestEditor/helpers.d.ts +0 -3
- package/features/workflow/ChangeRequestEditor/helpers.js +0 -12
|
@@ -199,6 +199,7 @@ describe('mergeChanges tests', function () {
|
|
|
199
199
|
{
|
|
200
200
|
id: 'BpiR2Vqh',
|
|
201
201
|
type: DCRTypes.CREATE_RELATIONSHIP,
|
|
202
|
+
lineIds: ['relations/1EvCRmwC/BpiR2Vqh'],
|
|
202
203
|
newValue: {
|
|
203
204
|
uri: 'relations/1EvCRmwC',
|
|
204
205
|
type: 'configuration/relationTypes/Assistant',
|
|
@@ -208,7 +209,8 @@ describe('mergeChanges tests', function () {
|
|
|
208
209
|
endObject: {
|
|
209
210
|
objectURI: 'entities/1C2v7IRp'
|
|
210
211
|
},
|
|
211
|
-
startDate: 1643742000000
|
|
212
|
+
startDate: 1643742000000,
|
|
213
|
+
lineIds: ['relations/1EvCRmwC/BpiR2Vqh/newValue']
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
]
|
|
@@ -235,6 +237,7 @@ describe('mergeChanges tests', function () {
|
|
|
235
237
|
}
|
|
236
238
|
], _a)),
|
|
237
239
|
label: metadata.relationTypes[1].label,
|
|
240
|
+
lineIds: ['relations/1EvCRmwC/BpiR2Vqh/newValue'],
|
|
238
241
|
level: 1
|
|
239
242
|
},
|
|
240
243
|
{
|
|
@@ -242,11 +245,62 @@ describe('mergeChanges tests', function () {
|
|
|
242
245
|
label: 'Start date',
|
|
243
246
|
level: 2,
|
|
244
247
|
newValue: {
|
|
245
|
-
value: 1643742000000
|
|
248
|
+
value: 1643742000000,
|
|
249
|
+
lineIds: ["relations/1EvCRmwC/BpiR2Vqh/newValue/".concat(EntityAttrTypes.startDate.name)]
|
|
246
250
|
},
|
|
247
251
|
operation: DCROperationTypes.ADDED
|
|
248
252
|
}
|
|
249
253
|
];
|
|
250
254
|
expect(mergeChanges(metadata, changes, objectInfo, relationsInfo)).toMatchObject([[], mergedRelations]);
|
|
251
255
|
});
|
|
256
|
+
it('should merge lineIds when multiple changes have the same attributePath', function () {
|
|
257
|
+
var _a;
|
|
258
|
+
var _b, _c;
|
|
259
|
+
var changes = (_a = {},
|
|
260
|
+
_a[entityUri] = [
|
|
261
|
+
{
|
|
262
|
+
id: '0Kb5iws',
|
|
263
|
+
type: DCRTypes.UPDATE_ATTRIBUTE,
|
|
264
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
265
|
+
attributePath: 'CountryCode/2DEYF4Zg',
|
|
266
|
+
oldValue: {
|
|
267
|
+
value: 'American Samoa',
|
|
268
|
+
lookupCode: 'ASM',
|
|
269
|
+
lookupRawValue: 'ASM',
|
|
270
|
+
lineIds: ['line-1']
|
|
271
|
+
},
|
|
272
|
+
newValue: {
|
|
273
|
+
value: 'Algeria',
|
|
274
|
+
lookupCode: 'DZA',
|
|
275
|
+
lookupRawValue: 'DZA',
|
|
276
|
+
lineIds: ['line-2']
|
|
277
|
+
},
|
|
278
|
+
newPinOrIgnoreValue: false,
|
|
279
|
+
attributeType: 'configuration/entityTypes/HCP/attributes/CountryCode'
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: '0Kb5nD8',
|
|
283
|
+
type: DCRTypes.UPDATE_ATTRIBUTE,
|
|
284
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
285
|
+
attributePath: 'CountryCode/2DEYF4Zg',
|
|
286
|
+
oldValue: {
|
|
287
|
+
value: 'American Samoa',
|
|
288
|
+
lookupCode: 'ASM',
|
|
289
|
+
lookupRawValue: 'ASM',
|
|
290
|
+
lineIds: ['line-3']
|
|
291
|
+
},
|
|
292
|
+
newValue: {
|
|
293
|
+
value: 'Algeria',
|
|
294
|
+
lookupCode: 'DZA',
|
|
295
|
+
lookupRawValue: 'DZA',
|
|
296
|
+
lineIds: ['line-4']
|
|
297
|
+
},
|
|
298
|
+
newPinOrIgnoreValue: false,
|
|
299
|
+
attributeType: 'configuration/entityTypes/HCP/attributes/CountryCode'
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
_a);
|
|
303
|
+
var mergedChanges = mergeChanges(metadata, changes, objectInfo, [])[0];
|
|
304
|
+
expect((_c = (_b = mergedChanges[0]) === null || _b === void 0 ? void 0 : _b.newValue) === null || _c === void 0 ? void 0 : _c.lineIds).toEqual(['line-2', 'line-4']);
|
|
305
|
+
});
|
|
252
306
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnrichedDCRChanges, GroupedObjectsInfo, DCRChanges } from '@reltio/mdm-sdk';
|
|
2
2
|
import { Diff, Title } from '../types';
|
|
3
3
|
type Props = {
|
|
4
|
-
changes: DCRChanges;
|
|
4
|
+
changes: EnrichedDCRChanges | DCRChanges;
|
|
5
5
|
entityInfo: GroupedObjectsInfo['entity'];
|
|
6
6
|
relationsInfo: GroupedObjectsInfo['relations'];
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeType,
|
|
1
|
+
import { AttributeType, DCRAttributeValue, DCROperationTypes, DCRRelationInfo, EnrichedChangeValue, TRelationType, ChangeValue } from '@reltio/mdm-sdk';
|
|
2
2
|
export type TaskAction = {
|
|
3
3
|
text: string;
|
|
4
4
|
onClick: (comment: string) => void;
|
|
@@ -10,10 +10,11 @@ export type Diff = {
|
|
|
10
10
|
attributeType: AttributeType | null;
|
|
11
11
|
relationType?: TRelationType;
|
|
12
12
|
attributeValue?: DCRAttributeValue | RelationAttributeValue;
|
|
13
|
-
newValue?: ChangeValue;
|
|
14
|
-
oldValue?: ChangeValue;
|
|
13
|
+
newValue?: EnrichedChangeValue | ChangeValue;
|
|
14
|
+
oldValue?: EnrichedChangeValue | ChangeValue;
|
|
15
15
|
operation?: DCROperationTypes;
|
|
16
16
|
isReferenceSubAttribute?: boolean;
|
|
17
|
+
lineIds?: string[];
|
|
17
18
|
};
|
|
18
19
|
export type Title = {
|
|
19
20
|
label: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2202",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
12
12
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
13
13
|
"@react-sigma/core": "3.4.0",
|
|
14
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
14
|
+
"@reltio/mdm-sdk": "^1.4.2005",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEditableChange = void 0;
|
|
4
|
-
var ramda_1 = require("ramda");
|
|
5
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
6
|
-
var isEditableChange = function (change, entityInfo) {
|
|
7
|
-
var _a;
|
|
8
|
-
var currentAttributeTypeUri = (_a = change.attributeType) === null || _a === void 0 ? void 0 : _a.uri;
|
|
9
|
-
var isExistingReferenceEntityChange = entityInfo.isExist &&
|
|
10
|
-
currentAttributeTypeUri &&
|
|
11
|
-
change.isReferenceSubAttribute &&
|
|
12
|
-
change.operation === mdm_sdk_1.DCROperationTypes.ADDED &&
|
|
13
|
-
!(0, mdm_sdk_1.isRelationTypeUri)(currentAttributeTypeUri);
|
|
14
|
-
return !!currentAttributeTypeUri && !isExistingReferenceEntityChange && !(0, ramda_1.isNil)(change.newValue);
|
|
15
|
-
};
|
|
16
|
-
exports.isEditableChange = isEditableChange;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isNil } from 'ramda';
|
|
2
|
-
import { DCROperationTypes, isRelationTypeUri } from '@reltio/mdm-sdk';
|
|
3
|
-
export var isEditableChange = function (change, entityInfo) {
|
|
4
|
-
var _a;
|
|
5
|
-
var currentAttributeTypeUri = (_a = change.attributeType) === null || _a === void 0 ? void 0 : _a.uri;
|
|
6
|
-
var isExistingReferenceEntityChange = entityInfo.isExist &&
|
|
7
|
-
currentAttributeTypeUri &&
|
|
8
|
-
change.isReferenceSubAttribute &&
|
|
9
|
-
change.operation === DCROperationTypes.ADDED &&
|
|
10
|
-
!isRelationTypeUri(currentAttributeTypeUri);
|
|
11
|
-
return !!currentAttributeTypeUri && !isExistingReferenceEntityChange && !isNil(change.newValue);
|
|
12
|
-
};
|