@reltio/components 1.4.2212 → 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/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +30 -11
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +10 -2
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +9 -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/package.json +2 -2
|
@@ -69,7 +69,8 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
69
69
|
type: 'String',
|
|
70
70
|
name: 'Simple',
|
|
71
71
|
label: 'Simple label',
|
|
72
|
-
description: 'Simple description'
|
|
72
|
+
description: 'Simple description',
|
|
73
|
+
masking: { regexPattern: '.*' }
|
|
73
74
|
};
|
|
74
75
|
var values = [
|
|
75
76
|
{ type: attributeType.uri, uri: 'entities/sIeHttl/attributes/Simple/u123', value: '123', ov: true },
|
|
@@ -86,8 +87,14 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
86
87
|
afterEach(function () {
|
|
87
88
|
jest.clearAllMocks();
|
|
88
89
|
});
|
|
90
|
+
var defaultMdmValues = {
|
|
91
|
+
metadata: {
|
|
92
|
+
entityTypes: [{ uri: 'configuration/entityTypes/HCP', attributes: [attributeType] }]
|
|
93
|
+
},
|
|
94
|
+
showMasking: true
|
|
95
|
+
};
|
|
89
96
|
var setUp = function (_a) {
|
|
90
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ?
|
|
97
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d, _e = _b.featuresContextValue, featuresContextValue = _e === void 0 ? { showDescription: true } : _e;
|
|
91
98
|
var user = userEvent.setup();
|
|
92
99
|
var Providers = function (_a) {
|
|
93
100
|
var children = _a.children;
|
|
@@ -156,7 +163,11 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
156
163
|
attributeTypeUri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
157
164
|
defaultMaxValues: 1,
|
|
158
165
|
parentUri: 'entities/sIeHttl',
|
|
159
|
-
values: ovValues
|
|
166
|
+
values: ovValues,
|
|
167
|
+
options: {
|
|
168
|
+
sendMasking: true,
|
|
169
|
+
ovOnly: true
|
|
170
|
+
}
|
|
160
171
|
});
|
|
161
172
|
labels = screen.getAllByTestId('reltio-attribute-complex-label');
|
|
162
173
|
expect(labels).toHaveLength(2);
|
|
@@ -170,7 +181,11 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
170
181
|
attributeTypeUri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
171
182
|
defaultMaxValues: 1,
|
|
172
183
|
parentUri: 'entities/sIeHttl',
|
|
173
|
-
values: ovValues
|
|
184
|
+
values: ovValues,
|
|
185
|
+
options: {
|
|
186
|
+
sendMasking: true,
|
|
187
|
+
ovOnly: true
|
|
188
|
+
}
|
|
174
189
|
});
|
|
175
190
|
labels = screen.getAllByTestId('reltio-attribute-complex-label');
|
|
176
191
|
expect(labels).toHaveLength(3);
|
|
@@ -219,9 +234,10 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
219
234
|
mdmValues: {
|
|
220
235
|
metadata: {
|
|
221
236
|
roles: [
|
|
222
|
-
{ uri: 'role1', label: 'Role1' },
|
|
223
|
-
{ uri: 'role2', label: 'Role2' }
|
|
224
|
-
]
|
|
237
|
+
{ uri: 'role1', label: 'Role1', description: 'Role1 description' },
|
|
238
|
+
{ uri: 'role2', label: 'Role2', description: 'Role2 description' }
|
|
239
|
+
],
|
|
240
|
+
entityTypes: defaultMdmValues.metadata.entityTypes
|
|
225
241
|
}
|
|
226
242
|
}
|
|
227
243
|
});
|
|
@@ -233,7 +249,10 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
233
249
|
});
|
|
234
250
|
it('should use SpecialRenderer for tags', function () {
|
|
235
251
|
var props = __assign(__assign({}, defaultProps), { attributeType: EntityAttrTypes.tags, values: ['tag1', 'tag2'] });
|
|
236
|
-
setUp({
|
|
252
|
+
setUp({
|
|
253
|
+
props: props,
|
|
254
|
+
mdmValues: __assign(__assign({}, defaultMdmValues), { entity: { uri: 'entities/sIeHttl', type: 'configuration/entityTypes/HCP' } })
|
|
255
|
+
});
|
|
237
256
|
expect(screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
238
257
|
expect(screen.getByTestId('special-renderer')).toBeInTheDocument();
|
|
239
258
|
expect(screen.getByText('Tags')).toBeInTheDocument();
|
|
@@ -279,7 +298,7 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
279
298
|
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
280
299
|
];
|
|
281
300
|
var props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false), max: 1 });
|
|
282
|
-
setUp({ props: props, mdmValues: { maxValuesInResponse: 20 } });
|
|
301
|
+
setUp({ props: props, mdmValues: __assign(__assign({}, defaultMdmValues), { maxValuesInResponse: 20 }) });
|
|
283
302
|
expect(screen.getByTestId('show-more')).toBeInTheDocument();
|
|
284
303
|
screen.getByText('Show 1 more of remaining 2 value');
|
|
285
304
|
});
|
|
@@ -290,7 +309,7 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
290
309
|
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
291
310
|
];
|
|
292
311
|
var props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false) });
|
|
293
|
-
setUp({ props: props, mdmValues: { maxValuesInResponse: 1 } });
|
|
312
|
+
setUp({ props: props, mdmValues: __assign(__assign({}, defaultMdmValues), { maxValuesInResponse: 1 }) });
|
|
294
313
|
expect(screen.getByTestId('show-more')).toBeInTheDocument();
|
|
295
314
|
screen.getByText('Show 1 more of remaining 2 value');
|
|
296
315
|
});
|
|
@@ -301,7 +320,7 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
301
320
|
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
302
321
|
];
|
|
303
322
|
var props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false) });
|
|
304
|
-
setUp({ props: props, mdmValues: { maxValuesInResponse: undefined } });
|
|
323
|
+
setUp({ props: props, mdmValues: __assign(__assign({}, defaultMdmValues), { maxValuesInResponse: undefined }) });
|
|
305
324
|
expect(screen.queryByTestId('show-more')).not.toBeInTheDocument();
|
|
306
325
|
});
|
|
307
326
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import { min } from 'ramda';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
+
import { checkHasMasking } from '@reltio/mdm-sdk';
|
|
4
5
|
import { ReadOnlyAttribute } from '../../../ReadOnlyAttributesFactory';
|
|
5
6
|
import { AttributeTitle } from '../../../AttributeTitle';
|
|
6
7
|
import { ShowMore } from '../../../ShowMore';
|
|
@@ -8,7 +9,7 @@ import { ShowLess } from '../../../ShowLess';
|
|
|
8
9
|
import { OvIcon } from '../../../OvIcon';
|
|
9
10
|
import { DescriptionIcon } from '../../../DescriptionIcon';
|
|
10
11
|
import { ControlAttributeIcon } from '../../../ControlAttributeIcon';
|
|
11
|
-
import { useMdmControlAttributes } from '../../../contexts/MdmModuleContext';
|
|
12
|
+
import { useMdmControlAttributes, useMdmMetadata, useMdmShowMasking } from '../../../contexts/MdmModuleContext';
|
|
12
13
|
import { useMultiLineStyles } from '../../styles';
|
|
13
14
|
export var MultiLineRenderer = function (_a) {
|
|
14
15
|
var max = _a.max, values = _a.values, nonVisibleValues = _a.nonVisibleValues, totalVisibleValues = _a.totalVisibleValues, attributeType = _a.attributeType, parentUri = _a.parentUri, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues, classes = _a.classes;
|
|
@@ -20,6 +21,9 @@ export var MultiLineRenderer = function (_a) {
|
|
|
20
21
|
var showMore = hasPaging && visibleValuesCount < totalVisibleValues;
|
|
21
22
|
var showLess = hasPaging && visibleValuesCount >= totalVisibleValues;
|
|
22
23
|
var label = attributeType.label, description = attributeType.description;
|
|
24
|
+
var metadata = useMdmMetadata();
|
|
25
|
+
var hasMasking = useMemo(function () { return checkHasMasking(metadata, attributeType); }, [metadata, attributeType]);
|
|
26
|
+
var showMasking = useMdmShowMasking();
|
|
23
27
|
var onShowMore = function () {
|
|
24
28
|
if (values.length < totalVisibleValues) {
|
|
25
29
|
requestNextPageOfAttributeValues({
|
|
@@ -27,7 +31,11 @@ export var MultiLineRenderer = function (_a) {
|
|
|
27
31
|
attributeTypeUri: attributeType.uri,
|
|
28
32
|
attributeTypeName: attributeType.name,
|
|
29
33
|
values: values,
|
|
30
|
-
defaultMaxValues: max
|
|
34
|
+
defaultMaxValues: max,
|
|
35
|
+
options: {
|
|
36
|
+
sendMasking: showMasking && hasMasking,
|
|
37
|
+
ovOnly: !showNonOv
|
|
38
|
+
}
|
|
31
39
|
});
|
|
32
40
|
}
|
|
33
41
|
setVisibleValuesCount(visibleValuesCount + max);
|
|
@@ -54,6 +54,7 @@ import { nestedAttributeType } from './nestedAttrType.test-data';
|
|
|
54
54
|
import { nestedAttributeValue } from './nestedAttrValue.test-data';
|
|
55
55
|
import { HighlightedValuesContext } from '../contexts/HighlightedValuesContext';
|
|
56
56
|
import { CollaborationContext } from '../contexts/CollaborationContext';
|
|
57
|
+
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
57
58
|
var collaboration = { commentsMap: {} };
|
|
58
59
|
var defaultHighlightedValues = {
|
|
59
60
|
highlightedValuesUris: [],
|
|
@@ -65,13 +66,19 @@ var defaultProps = {
|
|
|
65
66
|
attributeValue: nestedAttributeValue,
|
|
66
67
|
attributeTypesList: nestedAttributeType.attributes
|
|
67
68
|
};
|
|
69
|
+
var defaultMdmValues = {
|
|
70
|
+
metadata: {
|
|
71
|
+
entityTypes: [{ uri: 'configuration/entityTypes/HCP', attributes: [nestedAttributeType] }]
|
|
72
|
+
}
|
|
73
|
+
};
|
|
68
74
|
var setUp = function (_a) {
|
|
69
75
|
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.highlightedValues, highlightedValues = _d === void 0 ? defaultHighlightedValues : _d;
|
|
70
76
|
var user = userEvent.setup();
|
|
71
77
|
var Providers = function (_a) {
|
|
72
78
|
var children = _a.children;
|
|
73
|
-
return (React.createElement(
|
|
74
|
-
React.createElement(
|
|
79
|
+
return (React.createElement(MdmModuleProvider, { values: defaultMdmValues },
|
|
80
|
+
React.createElement(HighlightedValuesContext.Provider, { value: highlightedValues },
|
|
81
|
+
React.createElement(CollaborationContext.Provider, { value: collaboration }, children))));
|
|
75
82
|
};
|
|
76
83
|
return __assign(__assign({}, render(React.createElement(ReadOnlyComplexAttribute, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
77
84
|
};
|
|
@@ -74,7 +74,8 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
74
74
|
type: 'String',
|
|
75
75
|
name: 'Simple',
|
|
76
76
|
label: 'Simple label',
|
|
77
|
-
description: 'Simple description'
|
|
77
|
+
description: 'Simple description',
|
|
78
|
+
masking: { regexPattern: '.*' }
|
|
78
79
|
};
|
|
79
80
|
var values = [
|
|
80
81
|
{ type: attributeType.uri, uri: 'entities/sIeHttl/attributes/Simple/u123', value: '123', ov: true },
|
|
@@ -91,8 +92,14 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
91
92
|
afterEach(function () {
|
|
92
93
|
jest.clearAllMocks();
|
|
93
94
|
});
|
|
95
|
+
var defaultMdmValues = {
|
|
96
|
+
metadata: {
|
|
97
|
+
entityTypes: [{ uri: 'configuration/entityTypes/HCP', attributes: [attributeType] }]
|
|
98
|
+
},
|
|
99
|
+
showMasking: true
|
|
100
|
+
};
|
|
94
101
|
var setUp = function (_a) {
|
|
95
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ?
|
|
102
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d, _e = _b.featuresContextValue, featuresContextValue = _e === void 0 ? { showDescription: true } : _e;
|
|
96
103
|
var user = user_event_1.default.setup();
|
|
97
104
|
var Providers = function (_a) {
|
|
98
105
|
var children = _a.children;
|
|
@@ -161,7 +168,11 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
161
168
|
attributeTypeUri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
162
169
|
defaultMaxValues: 1,
|
|
163
170
|
parentUri: 'entities/sIeHttl',
|
|
164
|
-
values: ovValues
|
|
171
|
+
values: ovValues,
|
|
172
|
+
options: {
|
|
173
|
+
sendMasking: true,
|
|
174
|
+
ovOnly: true
|
|
175
|
+
}
|
|
165
176
|
});
|
|
166
177
|
labels = react_2.screen.getAllByTestId('reltio-attribute-complex-label');
|
|
167
178
|
expect(labels).toHaveLength(2);
|
|
@@ -175,7 +186,11 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
175
186
|
attributeTypeUri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
176
187
|
defaultMaxValues: 1,
|
|
177
188
|
parentUri: 'entities/sIeHttl',
|
|
178
|
-
values: ovValues
|
|
189
|
+
values: ovValues,
|
|
190
|
+
options: {
|
|
191
|
+
sendMasking: true,
|
|
192
|
+
ovOnly: true
|
|
193
|
+
}
|
|
179
194
|
});
|
|
180
195
|
labels = react_2.screen.getAllByTestId('reltio-attribute-complex-label');
|
|
181
196
|
expect(labels).toHaveLength(3);
|
|
@@ -224,9 +239,10 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
224
239
|
mdmValues: {
|
|
225
240
|
metadata: {
|
|
226
241
|
roles: [
|
|
227
|
-
{ uri: 'role1', label: 'Role1' },
|
|
228
|
-
{ uri: 'role2', label: 'Role2' }
|
|
229
|
-
]
|
|
242
|
+
{ uri: 'role1', label: 'Role1', description: 'Role1 description' },
|
|
243
|
+
{ uri: 'role2', label: 'Role2', description: 'Role2 description' }
|
|
244
|
+
],
|
|
245
|
+
entityTypes: defaultMdmValues.metadata.entityTypes
|
|
230
246
|
}
|
|
231
247
|
}
|
|
232
248
|
});
|
|
@@ -238,7 +254,10 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
238
254
|
});
|
|
239
255
|
it('should use SpecialRenderer for tags', function () {
|
|
240
256
|
var props = __assign(__assign({}, defaultProps), { attributeType: mdm_sdk_1.EntityAttrTypes.tags, values: ['tag1', 'tag2'] });
|
|
241
|
-
setUp({
|
|
257
|
+
setUp({
|
|
258
|
+
props: props,
|
|
259
|
+
mdmValues: __assign(__assign({}, defaultMdmValues), { entity: { uri: 'entities/sIeHttl', type: 'configuration/entityTypes/HCP' } })
|
|
260
|
+
});
|
|
242
261
|
expect(react_2.screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
243
262
|
expect(react_2.screen.getByTestId('special-renderer')).toBeInTheDocument();
|
|
244
263
|
expect(react_2.screen.getByText('Tags')).toBeInTheDocument();
|
|
@@ -284,7 +303,7 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
284
303
|
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
285
304
|
];
|
|
286
305
|
var props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false), max: 1 });
|
|
287
|
-
setUp({ props: props, mdmValues: { maxValuesInResponse: 20 } });
|
|
306
|
+
setUp({ props: props, mdmValues: __assign(__assign({}, defaultMdmValues), { maxValuesInResponse: 20 }) });
|
|
288
307
|
expect(react_2.screen.getByTestId('show-more')).toBeInTheDocument();
|
|
289
308
|
react_2.screen.getByText('Show 1 more of remaining 2 value');
|
|
290
309
|
});
|
|
@@ -295,7 +314,7 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
295
314
|
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
296
315
|
];
|
|
297
316
|
var props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false) });
|
|
298
|
-
setUp({ props: props, mdmValues: { maxValuesInResponse: 1 } });
|
|
317
|
+
setUp({ props: props, mdmValues: __assign(__assign({}, defaultMdmValues), { maxValuesInResponse: 1 }) });
|
|
299
318
|
expect(react_2.screen.getByTestId('show-more')).toBeInTheDocument();
|
|
300
319
|
react_2.screen.getByText('Show 1 more of remaining 2 value');
|
|
301
320
|
});
|
|
@@ -306,7 +325,7 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
306
325
|
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
307
326
|
];
|
|
308
327
|
var props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false) });
|
|
309
|
-
setUp({ props: props, mdmValues: { maxValuesInResponse: undefined } });
|
|
328
|
+
setUp({ props: props, mdmValues: __assign(__assign({}, defaultMdmValues), { maxValuesInResponse: undefined }) });
|
|
310
329
|
expect(react_2.screen.queryByTestId('show-more')).not.toBeInTheDocument();
|
|
311
330
|
});
|
|
312
331
|
});
|
|
@@ -30,6 +30,7 @@ exports.MultiLineRenderer = void 0;
|
|
|
30
30
|
var react_1 = __importStar(require("react"));
|
|
31
31
|
var ramda_1 = require("ramda");
|
|
32
32
|
var classnames_1 = __importDefault(require("classnames"));
|
|
33
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
33
34
|
var ReadOnlyAttributesFactory_1 = require("../../../ReadOnlyAttributesFactory");
|
|
34
35
|
var AttributeTitle_1 = require("../../../AttributeTitle");
|
|
35
36
|
var ShowMore_1 = require("../../../ShowMore");
|
|
@@ -49,6 +50,9 @@ var MultiLineRenderer = function (_a) {
|
|
|
49
50
|
var showMore = hasPaging && visibleValuesCount < totalVisibleValues;
|
|
50
51
|
var showLess = hasPaging && visibleValuesCount >= totalVisibleValues;
|
|
51
52
|
var label = attributeType.label, description = attributeType.description;
|
|
53
|
+
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
54
|
+
var hasMasking = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.checkHasMasking)(metadata, attributeType); }, [metadata, attributeType]);
|
|
55
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
52
56
|
var onShowMore = function () {
|
|
53
57
|
if (values.length < totalVisibleValues) {
|
|
54
58
|
requestNextPageOfAttributeValues({
|
|
@@ -56,7 +60,11 @@ var MultiLineRenderer = function (_a) {
|
|
|
56
60
|
attributeTypeUri: attributeType.uri,
|
|
57
61
|
attributeTypeName: attributeType.name,
|
|
58
62
|
values: values,
|
|
59
|
-
defaultMaxValues: max
|
|
63
|
+
defaultMaxValues: max,
|
|
64
|
+
options: {
|
|
65
|
+
sendMasking: showMasking && hasMasking,
|
|
66
|
+
ovOnly: !showNonOv
|
|
67
|
+
}
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
70
|
setVisibleValuesCount(visibleValuesCount + max);
|
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2213",
|
|
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.2013",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|