@reltio/components 1.4.2211 → 1.4.2213
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/AttributesErrorsPanel/AttributesErrorsPanel.d.ts +2 -1
- package/AttributesErrorsPanel/AttributesErrorsPanel.js +5 -5
- package/AttributesErrorsPanel/components/Error/AttributeErrorItem.d.ts +8 -0
- package/AttributesErrorsPanel/components/Error/{Error.js → AttributeErrorItem.js} +4 -4
- package/AttributesErrorsPanel/components/Error/{Error.test.js → AttributeErrorItem.test.js} +3 -3
- package/AttributesErrorsPanel/components/Error/index.d.ts +1 -1
- package/AttributesErrorsPanel/components/Error/index.js +1 -1
- package/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.d.ts +2 -1
- package/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.js +3 -2
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +30 -11
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +10 -2
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +9 -2
- package/cjs/AttributesErrorsPanel/AttributesErrorsPanel.d.ts +2 -1
- package/cjs/AttributesErrorsPanel/AttributesErrorsPanel.js +4 -4
- package/cjs/AttributesErrorsPanel/components/Error/AttributeErrorItem.d.ts +8 -0
- package/cjs/AttributesErrorsPanel/components/Error/{Error.js → AttributeErrorItem.js} +5 -5
- package/cjs/AttributesErrorsPanel/components/Error/{Error.test.js → AttributeErrorItem.test.js} +3 -3
- package/cjs/AttributesErrorsPanel/components/Error/index.d.ts +1 -1
- package/cjs/AttributesErrorsPanel/components/Error/index.js +3 -3
- package/cjs/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.d.ts +2 -1
- package/cjs/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.js +3 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +30 -11
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +9 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +9 -2
- package/cjs/features/workflow/ReviewDCRDialog/DCRErrorsPanel/DCRErrorsPanel.js +1 -1
- package/cjs/features/workflow/helpers/attributes.test.js +22 -18
- package/cjs/features/workflow/helpers/merge.test.js +26 -20
- package/cjs/features/workflow/helpers/metadata.test-data.d.ts +1 -1
- package/cjs/features/workflow/helpers/metadata.test-data.js +149 -3
- package/cjs/features/workflow/helpers/validation.js +0 -1
- package/cjs/features/workflow/helpers/validation.test-data.d.ts +14 -0
- package/cjs/features/workflow/helpers/validation.test-data.js +508 -0
- package/cjs/features/workflow/helpers/validation.test.d.ts +1 -0
- package/cjs/features/workflow/helpers/validation.test.js +257 -0
- package/cjs/features/workflow/hooks/useDCRValidation.js +1 -1
- package/features/workflow/ReviewDCRDialog/DCRErrorsPanel/DCRErrorsPanel.js +1 -1
- package/features/workflow/helpers/attributes.test.js +5 -1
- package/features/workflow/helpers/merge.test.js +7 -1
- package/features/workflow/helpers/metadata.test-data.d.ts +1 -1
- package/features/workflow/helpers/metadata.test-data.js +147 -2
- package/features/workflow/helpers/validation.js +0 -1
- package/features/workflow/helpers/validation.test-data.d.ts +14 -0
- package/features/workflow/helpers/validation.test-data.js +498 -0
- package/features/workflow/helpers/validation.test.d.ts +1 -0
- package/features/workflow/helpers/validation.test.js +255 -0
- package/features/workflow/hooks/useDCRValidation.js +1 -1
- package/package.json +2 -2
- package/AttributesErrorsPanel/components/Error/Error.d.ts +0 -7
- package/cjs/AttributesErrorsPanel/components/Error/Error.d.ts +0 -7
- /package/AttributesErrorsPanel/components/Error/{Error.test.d.ts → AttributeErrorItem.test.d.ts} +0 -0
- /package/cjs/AttributesErrorsPanel/components/Error/{Error.test.d.ts → AttributeErrorItem.test.d.ts} +0 -0
|
@@ -59,6 +59,7 @@ var nestedAttrType_test_data_1 = require("./nestedAttrType.test-data");
|
|
|
59
59
|
var nestedAttrValue_test_data_1 = require("./nestedAttrValue.test-data");
|
|
60
60
|
var HighlightedValuesContext_1 = require("../contexts/HighlightedValuesContext");
|
|
61
61
|
var CollaborationContext_1 = require("../contexts/CollaborationContext");
|
|
62
|
+
var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
|
|
62
63
|
var collaboration = { commentsMap: {} };
|
|
63
64
|
var defaultHighlightedValues = {
|
|
64
65
|
highlightedValuesUris: [],
|
|
@@ -70,13 +71,19 @@ var defaultProps = {
|
|
|
70
71
|
attributeValue: nestedAttrValue_test_data_1.nestedAttributeValue,
|
|
71
72
|
attributeTypesList: nestedAttrType_test_data_1.nestedAttributeType.attributes
|
|
72
73
|
};
|
|
74
|
+
var defaultMdmValues = {
|
|
75
|
+
metadata: {
|
|
76
|
+
entityTypes: [{ uri: 'configuration/entityTypes/HCP', attributes: [nestedAttrType_test_data_1.nestedAttributeType] }]
|
|
77
|
+
}
|
|
78
|
+
};
|
|
73
79
|
var setUp = function (_a) {
|
|
74
80
|
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.highlightedValues, highlightedValues = _d === void 0 ? defaultHighlightedValues : _d;
|
|
75
81
|
var user = user_event_1.default.setup();
|
|
76
82
|
var Providers = function (_a) {
|
|
77
83
|
var children = _a.children;
|
|
78
|
-
return (react_1.default.createElement(
|
|
79
|
-
react_1.default.createElement(
|
|
84
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: defaultMdmValues },
|
|
85
|
+
react_1.default.createElement(HighlightedValuesContext_1.HighlightedValuesContext.Provider, { value: highlightedValues },
|
|
86
|
+
react_1.default.createElement(CollaborationContext_1.CollaborationContext.Provider, { value: collaboration }, children))));
|
|
80
87
|
};
|
|
81
88
|
return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(ReadOnlyComplexAttribute_1.ReadOnlyComplexAttribute, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
82
89
|
};
|
|
@@ -39,6 +39,6 @@ var DCRErrorsPanel = function () {
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
return (react_1.default.createElement("div", { className: DCRErrorsPanel_module_css_1.default.DCRErrorsPanel },
|
|
42
|
-
react_1.default.createElement(AttributesErrorsPanel_1.AttributesErrorsPanel, { attributesWithErrors: validationErrors })));
|
|
42
|
+
react_1.default.createElement(AttributesErrorsPanel_1.AttributesErrorsPanel, { attributesWithErrors: validationErrors, alwaysShowLink: true })));
|
|
43
43
|
};
|
|
44
44
|
exports.DCRErrorsPanel = DCRErrorsPanel;
|
|
@@ -16,6 +16,7 @@ var metadata_test_data_1 = require("./metadata.test-data");
|
|
|
16
16
|
var attributes_1 = require("./attributes");
|
|
17
17
|
describe('attributes helpers tests', function () {
|
|
18
18
|
it('getEntityChanges behaviour', function () {
|
|
19
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
19
20
|
var objectInfo = {
|
|
20
21
|
isExist: true,
|
|
21
22
|
label: '12345 - Address Line 1 City',
|
|
@@ -88,9 +89,9 @@ describe('attributes helpers tests', function () {
|
|
|
88
89
|
}
|
|
89
90
|
]
|
|
90
91
|
};
|
|
91
|
-
expect((0, attributes_1.getEntityChanges)(
|
|
92
|
+
expect((0, attributes_1.getEntityChanges)(metadata, objectInfo, changes)).toEqual([
|
|
92
93
|
{
|
|
93
|
-
attributeType:
|
|
94
|
+
attributeType: metadata.entityTypes[0].attributes[1],
|
|
94
95
|
label: 'Country Code',
|
|
95
96
|
level: 0,
|
|
96
97
|
newValue: __assign(__assign({}, changes.CountryCode[0].value.newValue), { lineIds: ['3AqlrpfGa/value/oldValue'] }),
|
|
@@ -98,7 +99,7 @@ describe('attributes helpers tests', function () {
|
|
|
98
99
|
isReferenceSubAttribute: false
|
|
99
100
|
},
|
|
100
101
|
{
|
|
101
|
-
attributeType:
|
|
102
|
+
attributeType: metadata.entityTypes[0].attributes[1],
|
|
102
103
|
label: 'Country Code',
|
|
103
104
|
level: 0,
|
|
104
105
|
newValue: changes.CountryCode[1].value.newValue,
|
|
@@ -106,13 +107,13 @@ describe('attributes helpers tests', function () {
|
|
|
106
107
|
isReferenceSubAttribute: false
|
|
107
108
|
},
|
|
108
109
|
{
|
|
109
|
-
attributeType:
|
|
110
|
+
attributeType: metadata.entityTypes[0].attributes[3],
|
|
110
111
|
attributeValue: changes.Identifiers[0],
|
|
111
112
|
label: 'Customer Identity',
|
|
112
113
|
level: 0
|
|
113
114
|
},
|
|
114
115
|
{
|
|
115
|
-
attributeType:
|
|
116
|
+
attributeType: metadata.entityTypes[0].attributes[3].attributes[0],
|
|
116
117
|
label: 'Identity Type',
|
|
117
118
|
level: 1,
|
|
118
119
|
newValue: changes.Identifiers[0].value.Type[0].value.newValue,
|
|
@@ -141,12 +142,13 @@ describe('attributes helpers tests', function () {
|
|
|
141
142
|
]
|
|
142
143
|
};
|
|
143
144
|
it('should not show operation for relation title', function () {
|
|
144
|
-
|
|
145
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
146
|
+
expect((0, attributes_1.getRelationChanges)(metadata, relationInfo, changes, mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE, ['lineIds'])).toEqual([
|
|
145
147
|
{
|
|
146
148
|
attributeType: null,
|
|
147
|
-
relationType:
|
|
149
|
+
relationType: metadata.relationTypes[1],
|
|
148
150
|
attributeValue: __assign(__assign({}, relationInfo), changes),
|
|
149
|
-
label:
|
|
151
|
+
label: metadata.relationTypes[1].label,
|
|
150
152
|
level: 1,
|
|
151
153
|
lineIds: ['lineIds']
|
|
152
154
|
},
|
|
@@ -159,8 +161,8 @@ describe('attributes helpers tests', function () {
|
|
|
159
161
|
isReferenceSubAttribute: false
|
|
160
162
|
},
|
|
161
163
|
{
|
|
162
|
-
attributeType:
|
|
163
|
-
label:
|
|
164
|
+
attributeType: metadata.relationTypes[1].attributes[0],
|
|
165
|
+
label: metadata.relationTypes[1].attributes[0].label,
|
|
164
166
|
level: 2,
|
|
165
167
|
newValue: '123',
|
|
166
168
|
operation: mdm_sdk_1.DCROperationTypes.ADDED,
|
|
@@ -169,12 +171,13 @@ describe('attributes helpers tests', function () {
|
|
|
169
171
|
]);
|
|
170
172
|
});
|
|
171
173
|
it('should show operation for relation title if it is new', function () {
|
|
172
|
-
|
|
174
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
175
|
+
expect((0, attributes_1.getRelationChanges)(metadata, relationInfo, changes, mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP, ['lineIds'])).toEqual([
|
|
173
176
|
{
|
|
174
177
|
attributeType: null,
|
|
175
|
-
relationType:
|
|
178
|
+
relationType: metadata.relationTypes[1],
|
|
176
179
|
attributeValue: __assign(__assign({}, relationInfo), changes),
|
|
177
|
-
label:
|
|
180
|
+
label: metadata.relationTypes[1].label,
|
|
178
181
|
level: 1,
|
|
179
182
|
operation: mdm_sdk_1.DCROperationTypes.ADDED,
|
|
180
183
|
lineIds: ['lineIds']
|
|
@@ -188,8 +191,8 @@ describe('attributes helpers tests', function () {
|
|
|
188
191
|
isReferenceSubAttribute: false
|
|
189
192
|
},
|
|
190
193
|
{
|
|
191
|
-
attributeType:
|
|
192
|
-
label:
|
|
194
|
+
attributeType: metadata.relationTypes[1].attributes[0],
|
|
195
|
+
label: metadata.relationTypes[1].attributes[0].label,
|
|
193
196
|
isReferenceSubAttribute: false,
|
|
194
197
|
level: 2,
|
|
195
198
|
newValue: '123',
|
|
@@ -198,12 +201,13 @@ describe('attributes helpers tests', function () {
|
|
|
198
201
|
]);
|
|
199
202
|
});
|
|
200
203
|
it('should show operation for relation title if it was deleted and changes are empty', function () {
|
|
201
|
-
|
|
204
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
205
|
+
expect((0, attributes_1.getRelationChanges)(metadata, relationInfo, {}, mdm_sdk_1.DCRTypes.DELETE_RELATIONSHIP, ['lineIds'])).toEqual([
|
|
202
206
|
{
|
|
203
207
|
attributeType: null,
|
|
204
|
-
relationType:
|
|
208
|
+
relationType: metadata.relationTypes[1],
|
|
205
209
|
attributeValue: relationInfo,
|
|
206
|
-
label:
|
|
210
|
+
label: metadata.relationTypes[1].label,
|
|
207
211
|
level: 1,
|
|
208
212
|
operation: mdm_sdk_1.DCROperationTypes.DELETED,
|
|
209
213
|
lineIds: ['lineIds']
|
|
@@ -25,6 +25,7 @@ describe('mergeChanges tests', function () {
|
|
|
25
25
|
};
|
|
26
26
|
it('should create path to change', function () {
|
|
27
27
|
var _a;
|
|
28
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
28
29
|
var changes = (_a = {},
|
|
29
30
|
_a[entityUri] = [
|
|
30
31
|
{
|
|
@@ -38,10 +39,10 @@ describe('mergeChanges tests', function () {
|
|
|
38
39
|
}
|
|
39
40
|
],
|
|
40
41
|
_a);
|
|
41
|
-
expect((0, merge_1.mergeChanges)(
|
|
42
|
+
expect((0, merge_1.mergeChanges)(metadata, changes, objectInfo, [])).toEqual([
|
|
42
43
|
[
|
|
43
44
|
{
|
|
44
|
-
attributeType:
|
|
45
|
+
attributeType: metadata.entityTypes[0].attributes[3],
|
|
45
46
|
attributeValue: {
|
|
46
47
|
id: '45uypcuAz',
|
|
47
48
|
value: {
|
|
@@ -57,7 +58,7 @@ describe('mergeChanges tests', function () {
|
|
|
57
58
|
level: 0
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
|
-
attributeType:
|
|
61
|
+
attributeType: metadata.entityTypes[0].attributes[3].attributes[0],
|
|
61
62
|
label: 'Identity Type',
|
|
62
63
|
level: 1,
|
|
63
64
|
newValue: changes[entityUri][0].newValue,
|
|
@@ -70,6 +71,7 @@ describe('mergeChanges tests', function () {
|
|
|
70
71
|
});
|
|
71
72
|
it('should merge changes with the same paths', function () {
|
|
72
73
|
var _a;
|
|
74
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
73
75
|
var changes = (_a = {},
|
|
74
76
|
_a[entityUri] = [
|
|
75
77
|
{
|
|
@@ -98,7 +100,7 @@ describe('mergeChanges tests', function () {
|
|
|
98
100
|
{
|
|
99
101
|
level: 0,
|
|
100
102
|
label: 'Address',
|
|
101
|
-
attributeType:
|
|
103
|
+
attributeType: metadata.entityTypes[0].attributes[4],
|
|
102
104
|
attributeValue: {
|
|
103
105
|
id: '138xt4Lu',
|
|
104
106
|
refObjectURI: 'relations/138xt4Lu',
|
|
@@ -117,18 +119,18 @@ describe('mergeChanges tests', function () {
|
|
|
117
119
|
{
|
|
118
120
|
level: 1,
|
|
119
121
|
label: 'Additional Attributes',
|
|
120
|
-
attributeType:
|
|
122
|
+
attributeType: metadata.relationTypes[0].attributes[0],
|
|
121
123
|
attributeValue: { value: changes[entityUri][0] }
|
|
122
124
|
},
|
|
123
125
|
{
|
|
124
|
-
attributeType:
|
|
126
|
+
attributeType: metadata.relationTypes[0].attributes[0].attributes[0],
|
|
125
127
|
newValue: { value: 'testType1' },
|
|
126
128
|
operation: 'added',
|
|
127
129
|
label: 'Attribute Type',
|
|
128
130
|
level: 2
|
|
129
131
|
},
|
|
130
132
|
{
|
|
131
|
-
attributeType:
|
|
133
|
+
attributeType: metadata.relationTypes[0].attributes[0].attributes[1],
|
|
132
134
|
newValue: { value: 'testValue1' },
|
|
133
135
|
operation: 'added',
|
|
134
136
|
label: 'Attribute Value',
|
|
@@ -137,28 +139,29 @@ describe('mergeChanges tests', function () {
|
|
|
137
139
|
{
|
|
138
140
|
level: 1,
|
|
139
141
|
label: 'Additional Attributes',
|
|
140
|
-
attributeType:
|
|
142
|
+
attributeType: metadata.relationTypes[0].attributes[0],
|
|
141
143
|
attributeValue: { value: changes[entityUri][1] }
|
|
142
144
|
},
|
|
143
145
|
{
|
|
144
|
-
attributeType:
|
|
146
|
+
attributeType: metadata.relationTypes[0].attributes[0].attributes[0],
|
|
145
147
|
newValue: { value: 'testType2' },
|
|
146
148
|
operation: 'added',
|
|
147
149
|
label: 'Attribute Type',
|
|
148
150
|
level: 2
|
|
149
151
|
},
|
|
150
152
|
{
|
|
151
|
-
attributeType:
|
|
153
|
+
attributeType: metadata.relationTypes[0].attributes[0].attributes[1],
|
|
152
154
|
newValue: { value: 'testValue2' },
|
|
153
155
|
operation: 'added',
|
|
154
156
|
label: 'Attribute Value',
|
|
155
157
|
level: 2
|
|
156
158
|
}
|
|
157
159
|
];
|
|
158
|
-
expect((0, merge_1.mergeChanges)(
|
|
160
|
+
expect((0, merge_1.mergeChanges)(metadata, changes, objectInfo, [])).toMatchObject([mergedChanges, []]);
|
|
159
161
|
});
|
|
160
162
|
it('should not merge changes with the same paths, but different types', function () {
|
|
161
163
|
var _a;
|
|
164
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
162
165
|
var changes = (_a = {},
|
|
163
166
|
_a[entityUri] = [
|
|
164
167
|
{
|
|
@@ -193,7 +196,7 @@ describe('mergeChanges tests', function () {
|
|
|
193
196
|
{
|
|
194
197
|
level: 0,
|
|
195
198
|
label: 'Customer Identity',
|
|
196
|
-
attributeType:
|
|
199
|
+
attributeType: metadata.entityTypes[0].attributes[3],
|
|
197
200
|
attributeValue: {
|
|
198
201
|
id: '2BNyTheu',
|
|
199
202
|
value: {
|
|
@@ -211,7 +214,7 @@ describe('mergeChanges tests', function () {
|
|
|
211
214
|
}
|
|
212
215
|
},
|
|
213
216
|
{
|
|
214
|
-
attributeType:
|
|
217
|
+
attributeType: metadata.entityTypes[0].attributes[3].attributes[0],
|
|
215
218
|
newValue: {
|
|
216
219
|
value: 'ValueNew'
|
|
217
220
|
},
|
|
@@ -224,7 +227,7 @@ describe('mergeChanges tests', function () {
|
|
|
224
227
|
isReferenceSubAttribute: false
|
|
225
228
|
},
|
|
226
229
|
{
|
|
227
|
-
attributeType:
|
|
230
|
+
attributeType: metadata.entityTypes[0].attributes[3].attributes[0],
|
|
228
231
|
newValue: {
|
|
229
232
|
value: 'ValueOld'
|
|
230
233
|
},
|
|
@@ -234,10 +237,11 @@ describe('mergeChanges tests', function () {
|
|
|
234
237
|
isReferenceSubAttribute: false
|
|
235
238
|
}
|
|
236
239
|
];
|
|
237
|
-
expect((0, merge_1.mergeChanges)(
|
|
240
|
+
expect((0, merge_1.mergeChanges)(metadata, changes, objectInfo, [])).toMatchObject([mergedChanges, []]);
|
|
238
241
|
});
|
|
239
242
|
it('should merge special attributes', function () {
|
|
240
243
|
var _a;
|
|
244
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
241
245
|
var changes = (_a = {},
|
|
242
246
|
_a[entityUri] = [
|
|
243
247
|
{
|
|
@@ -271,10 +275,11 @@ describe('mergeChanges tests', function () {
|
|
|
271
275
|
operation: mdm_sdk_1.DCROperationTypes.EDITED
|
|
272
276
|
}
|
|
273
277
|
];
|
|
274
|
-
expect((0, merge_1.mergeChanges)(
|
|
278
|
+
expect((0, merge_1.mergeChanges)(metadata, changes, objectInfo, [])).toMatchObject([mergedChanges, []]);
|
|
275
279
|
});
|
|
276
280
|
it('should merge relations', function () {
|
|
277
281
|
var _a;
|
|
282
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
278
283
|
var changes = {
|
|
279
284
|
'relations/1EvCRmwC': [
|
|
280
285
|
{
|
|
@@ -310,14 +315,14 @@ describe('mergeChanges tests', function () {
|
|
|
310
315
|
var mergedRelations = [
|
|
311
316
|
{
|
|
312
317
|
attributeType: null,
|
|
313
|
-
relationType:
|
|
318
|
+
relationType: metadata.relationTypes[1],
|
|
314
319
|
attributeValue: __assign(__assign({}, relationsInfo[0]), (_a = {}, _a[mdm_sdk_1.EntityAttrTypes.startDate.name] = [
|
|
315
320
|
{
|
|
316
321
|
newValue: { value: 1643742000000 },
|
|
317
322
|
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE
|
|
318
323
|
}
|
|
319
324
|
], _a)),
|
|
320
|
-
label:
|
|
325
|
+
label: metadata.relationTypes[1].label,
|
|
321
326
|
lineIds: ['relations/1EvCRmwC/BpiR2Vqh/newValue'],
|
|
322
327
|
level: 1
|
|
323
328
|
},
|
|
@@ -332,11 +337,12 @@ describe('mergeChanges tests', function () {
|
|
|
332
337
|
operation: mdm_sdk_1.DCROperationTypes.ADDED
|
|
333
338
|
}
|
|
334
339
|
];
|
|
335
|
-
expect((0, merge_1.mergeChanges)(
|
|
340
|
+
expect((0, merge_1.mergeChanges)(metadata, changes, objectInfo, relationsInfo)).toMatchObject([[], mergedRelations]);
|
|
336
341
|
});
|
|
337
342
|
it('should merge lineIds when multiple changes have the same attributePath', function () {
|
|
338
343
|
var _a;
|
|
339
344
|
var _b, _c;
|
|
345
|
+
var metadata = (0, metadata_test_data_1.getMetadata)();
|
|
340
346
|
var changes = (_a = {},
|
|
341
347
|
_a[entityUri] = [
|
|
342
348
|
{
|
|
@@ -381,7 +387,7 @@ describe('mergeChanges tests', function () {
|
|
|
381
387
|
}
|
|
382
388
|
],
|
|
383
389
|
_a);
|
|
384
|
-
var mergedChanges = (0, merge_1.mergeChanges)(
|
|
390
|
+
var mergedChanges = (0, merge_1.mergeChanges)(metadata, changes, objectInfo, [])[0];
|
|
385
391
|
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']);
|
|
386
392
|
});
|
|
387
393
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Metadata } from '@reltio/mdm-sdk';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getMetadata: () => Metadata;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getMetadata = void 0;
|
|
4
4
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
5
|
-
|
|
5
|
+
var getMetadata = function () { return ({
|
|
6
6
|
entityTypes: [
|
|
7
7
|
{
|
|
8
8
|
uri: 'configuration/entityTypes/HCA',
|
|
@@ -55,14 +55,125 @@ exports.metadata = {
|
|
|
55
55
|
}
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
uri: 'configuration/entityTypes/HCP',
|
|
60
|
+
label: 'HCP',
|
|
61
|
+
attributes: [
|
|
62
|
+
{
|
|
63
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstName',
|
|
64
|
+
label: 'First Name',
|
|
65
|
+
name: 'FirstName',
|
|
66
|
+
type: 'String',
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
uri: 'configuration/entityTypes/HCP/attributes/Boolean',
|
|
71
|
+
label: 'Boolean',
|
|
72
|
+
name: 'Boolean',
|
|
73
|
+
type: 'Boolean',
|
|
74
|
+
required: true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
uri: 'configuration/entityTypes/HCP/attributes/Specialities',
|
|
78
|
+
label: 'Specialities',
|
|
79
|
+
name: 'Specialities',
|
|
80
|
+
type: 'Nested',
|
|
81
|
+
required: true,
|
|
82
|
+
attributes: [
|
|
83
|
+
{
|
|
84
|
+
uri: 'configuration/entityTypes/HCP/attributes/Specialities/attributes/SpecialityStatus',
|
|
85
|
+
label: 'Speciality Status',
|
|
86
|
+
name: 'SpecialityStatus',
|
|
87
|
+
type: 'String'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
uri: 'configuration/entityTypes/HCP/attributes/Specialities/attributes/PrimarySpecialityInd',
|
|
91
|
+
label: 'Primary Speciality Ind',
|
|
92
|
+
name: 'PrimarySpecialityInd',
|
|
93
|
+
type: 'Boolean',
|
|
94
|
+
required: true
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
uri: 'configuration/entityTypes/HCP/attributes/NestedAttr',
|
|
100
|
+
label: 'Nested Attr',
|
|
101
|
+
name: 'NestedAttr',
|
|
102
|
+
type: 'Nested',
|
|
103
|
+
attributes: [
|
|
104
|
+
{
|
|
105
|
+
uri: 'configuration/entityTypes/HCP/attributes/NestedAttr/attributes/Int',
|
|
106
|
+
label: 'Int',
|
|
107
|
+
name: 'Int',
|
|
108
|
+
type: 'String',
|
|
109
|
+
required: true
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
uri: 'configuration/entityTypes/HCP/attributes/Address',
|
|
115
|
+
label: 'Address',
|
|
116
|
+
name: 'Address',
|
|
117
|
+
type: 'Reference',
|
|
118
|
+
referencedAttributeURIs: ['configuration/relationTypes/HasAddress/attributes/InternalPostCode'],
|
|
119
|
+
referencedEntityTypeURI: 'configuration/entityTypes/Location',
|
|
120
|
+
relationshipTypeURI: 'configuration/relationTypes/HasAddress'
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
uri: 'configuration/entityTypes/Location',
|
|
126
|
+
label: 'Location',
|
|
127
|
+
attributes: [
|
|
128
|
+
{
|
|
129
|
+
uri: 'configuration/entityTypes/Location/attributes/AddressLine1',
|
|
130
|
+
label: 'AddressLine1',
|
|
131
|
+
name: 'AddressLine1',
|
|
132
|
+
type: 'String'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
uri: 'configuration/entityTypes/Location/attributes/City',
|
|
136
|
+
label: 'City',
|
|
137
|
+
name: 'City',
|
|
138
|
+
type: 'String'
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
58
142
|
{
|
|
59
143
|
label: 'HCO',
|
|
60
144
|
uri: 'configuration/entityTypes/HCO',
|
|
61
145
|
attributes: [
|
|
146
|
+
{
|
|
147
|
+
uri: 'configuration/entityTypes/HCO/attributes/Name',
|
|
148
|
+
name: 'Name',
|
|
149
|
+
type: 'String',
|
|
150
|
+
required: true
|
|
151
|
+
},
|
|
62
152
|
{
|
|
63
153
|
uri: 'configuration/entityTypes/HCO/attributes/WebsiteURL',
|
|
64
154
|
name: 'WebsiteURL',
|
|
65
155
|
type: 'String'
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
uri: 'configuration/entityTypes/HCO/attributes/ContactInfo',
|
|
159
|
+
label: 'Contact Info',
|
|
160
|
+
name: 'ContactInfo',
|
|
161
|
+
type: 'Nested',
|
|
162
|
+
attributes: [
|
|
163
|
+
{
|
|
164
|
+
uri: 'configuration/entityTypes/HCO/attributes/ContactInfo/attributes/Email',
|
|
165
|
+
label: 'Email',
|
|
166
|
+
name: 'Email',
|
|
167
|
+
type: 'String',
|
|
168
|
+
required: true
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
uri: 'configuration/entityTypes/HCO/attributes/ContactInfo/attributes/Phone',
|
|
172
|
+
label: 'Phone',
|
|
173
|
+
name: 'Phone',
|
|
174
|
+
type: 'String'
|
|
175
|
+
}
|
|
176
|
+
]
|
|
66
177
|
}
|
|
67
178
|
]
|
|
68
179
|
}
|
|
@@ -100,6 +211,13 @@ exports.metadata = {
|
|
|
100
211
|
uri: 'configuration/relationTypes/HasAddress/attributes/AdditionalAttributes/attributes/AttributeValue'
|
|
101
212
|
}
|
|
102
213
|
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
uri: 'configuration/relationTypes/HasAddress/attributes/InternalPostCode',
|
|
217
|
+
label: 'Internal Post Code',
|
|
218
|
+
name: 'InternalPostCode',
|
|
219
|
+
type: 'String',
|
|
220
|
+
required: true
|
|
103
221
|
}
|
|
104
222
|
]
|
|
105
223
|
},
|
|
@@ -118,6 +236,34 @@ exports.metadata = {
|
|
|
118
236
|
uri: 'configuration/relationTypes/Assistant/attributes/TestAttribute'
|
|
119
237
|
}
|
|
120
238
|
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
uri: 'configuration/relationTypes/HCPtoHCA',
|
|
242
|
+
label: 'HCP to HCA',
|
|
243
|
+
attributes: [
|
|
244
|
+
{
|
|
245
|
+
uri: 'configuration/relationTypes/HCPtoHCA/attributes/Status',
|
|
246
|
+
label: 'Status',
|
|
247
|
+
name: 'Status',
|
|
248
|
+
type: 'String'
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
uri: 'configuration/relationTypes/HCPtoHCA/attributes/NestedAttr',
|
|
252
|
+
label: 'Nested Attr',
|
|
253
|
+
name: 'NestedAttr',
|
|
254
|
+
type: 'Nested',
|
|
255
|
+
required: true,
|
|
256
|
+
attributes: [
|
|
257
|
+
{
|
|
258
|
+
uri: 'configuration/relationTypes/HCPtoHCA/attributes/NestedAttr/attributes/SubAttr',
|
|
259
|
+
label: 'Sub Attr',
|
|
260
|
+
name: 'SubAttr',
|
|
261
|
+
type: 'String'
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
]
|
|
121
266
|
}
|
|
122
267
|
]
|
|
123
|
-
};
|
|
268
|
+
}); };
|
|
269
|
+
exports.getMetadata = getMetadata;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DCRChanges, Entity, Relation } from '@reltio/mdm-sdk';
|
|
2
|
+
import { LineData } from '../types';
|
|
3
|
+
type UserChange = {
|
|
4
|
+
lineId: string;
|
|
5
|
+
data: LineData;
|
|
6
|
+
};
|
|
7
|
+
export declare const getChanges: () => DCRChanges;
|
|
8
|
+
export declare const getEntitiesOrRelations: () => Record<string, Entity | Relation>;
|
|
9
|
+
export declare const getUserChanges: () => UserChange[];
|
|
10
|
+
export declare const getUserChangesRejectSubnestedAttributes: () => UserChange[];
|
|
11
|
+
export declare const getUserChangesRejectSubnestedRelationAttributes: () => UserChange[];
|
|
12
|
+
export declare const getUserChangesSubnestedEmpty: () => UserChange[];
|
|
13
|
+
export declare const getUserChangesNewEntity: () => UserChange[];
|
|
14
|
+
export {};
|