@reltio/components 1.4.2134 → 1.4.2135
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/ReferenceAttributeEditor/ReferenceAttributeEditor.js +4 -2
- package/RelationEditor/RelationEditor.js +4 -2
- package/RelationEditor/RelationEditor.test.js +63 -36
- package/SimpleAttribute/IntegrationSimpleAttribute.test.js +14 -3
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.js +3 -1
- package/cjs/RelationEditor/RelationEditor.js +3 -1
- package/cjs/RelationEditor/RelationEditor.test.js +63 -36
- package/cjs/SimpleAttribute/IntegrationSimpleAttribute.test.js +14 -3
- package/cjs/contexts/MdmModuleContext/context.d.ts +2 -0
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +1 -0
- package/cjs/contexts/MdmModuleContext/hooks.js +3 -1
- package/cjs/contexts/MdmModuleContext/index.d.ts +1 -1
- package/cjs/contexts/MdmModuleContext/index.js +2 -1
- package/cjs/features/activity-log/hooks/useActivitiesLoader.js +3 -2
- package/cjs/features/activity-log/hooks/useProfileActivitiesLoader.js +4 -3
- package/cjs/features/history/hooks/useHistorySlice.js +3 -2
- package/cjs/features/history/hooks/useHistorySlice.test.js +13 -0
- package/cjs/hooks/useMaskedAttribute/useMaskedAttribute.js +3 -1
- package/cjs/hooks/useMatchesLoader/useMatchesLoader.js +5 -3
- package/cjs/hooks/useMatchesLoader/useMatchesLoader.test.js +7 -0
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.js +9 -5
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.test.js +2 -1
- package/contexts/MdmModuleContext/context.d.ts +2 -0
- package/contexts/MdmModuleContext/hooks.d.ts +1 -0
- package/contexts/MdmModuleContext/hooks.js +1 -0
- package/contexts/MdmModuleContext/index.d.ts +1 -1
- package/contexts/MdmModuleContext/index.js +1 -1
- package/features/activity-log/hooks/useActivitiesLoader.js +5 -4
- package/features/activity-log/hooks/useProfileActivitiesLoader.js +6 -5
- package/features/history/hooks/useHistorySlice.js +5 -4
- package/features/history/hooks/useHistorySlice.test.js +13 -0
- package/hooks/useMaskedAttribute/useMaskedAttribute.js +4 -2
- package/hooks/useMatchesLoader/useMatchesLoader.js +7 -5
- package/hooks/useMatchesLoader/useMatchesLoader.test.js +7 -0
- package/hooks/useRelationsLoader/useRelationsLoader.js +10 -6
- package/hooks/useRelationsLoader/useRelationsLoader.test.js +2 -1
- package/package.json +2 -2
|
@@ -30,7 +30,7 @@ import { ErrorWrapper } from '../ErrorWrapper';
|
|
|
30
30
|
import { withContext } from '../HOCs/withContext';
|
|
31
31
|
import { useAttributeValueConfigPermissions } from '../contexts/ConfigPermissionsContext';
|
|
32
32
|
import { isHighlightedErrorType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
33
|
-
import { useMdmAction, useMdmGlobalSearchRequestOptions, useMdmMetadata, useMdmModifiedEntity } from '../contexts/MdmModuleContext';
|
|
33
|
+
import { useMdmAction, useMdmGlobalSearchRequestOptions, useMdmMetadata, useMdmModifiedEntity, useMdmShowMasking } from '../contexts/MdmModuleContext';
|
|
34
34
|
import { useScrollToAttributeError } from '../hooks/useScrollToAttributeError';
|
|
35
35
|
import { useStyles } from './styles';
|
|
36
36
|
var ReferenceAttributeEditor = function (props) {
|
|
@@ -48,6 +48,7 @@ var ReferenceAttributeEditor = function (props) {
|
|
|
48
48
|
var modifiedEntity = isTempUri(entityUri) ? mdmModifiedEntity : null;
|
|
49
49
|
var metadata = useMdmMetadata();
|
|
50
50
|
var globalSearchRequestOptions = useMdmGlobalSearchRequestOptions(['ovOnly']);
|
|
51
|
+
var showMasking = useMdmShowMasking();
|
|
51
52
|
var referencedEntity = getReferencedEntityFromAttrValue(attributeValue);
|
|
52
53
|
var referencedRelation = getReferencedRelationFromAttrValue(attributeValue);
|
|
53
54
|
var referencedEntityTypeUri = getReferencedEntityTypeUriFromAttrType(attributeType);
|
|
@@ -117,12 +118,13 @@ var ReferenceAttributeEditor = function (props) {
|
|
|
117
118
|
}, [attributeType, attributeValue, mode, crosswalks, configCanUpdate]);
|
|
118
119
|
var canCreateReferencedEntity = useMemo(function () { return configCanCreate && checkMetadataForCreate(mode, referencedEntityType); }, [mode, referencedEntityType, configCanCreate]);
|
|
119
120
|
var errorMessage = getErrorMessage(referencedEntityMissedError);
|
|
121
|
+
var isMasked = showMasking && isAttributeHasMaskedValue(attributeValue);
|
|
120
122
|
return (React.createElement(EditModeComplexAttribute, __assign({}, ownProps, { label: getLabel(label), attributeTypesList: editableAttrTypes, crosswalks: allCrosswalks, metadata: metadata }),
|
|
121
123
|
React.createElement("div", { ref: ref, className: errorClassName },
|
|
122
124
|
React.createElement(ErrorWrapper, { errorMessage: errorMessage },
|
|
123
125
|
React.createElement(EntitySelector, { className: classnames(styles.item, (_a = {},
|
|
124
126
|
_a[styles.dense] = errorMessage || (selectedEntity && isTempUri(selectedEntity.entityUri)),
|
|
125
|
-
_a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, isDisabled: !canChangeReferencedEntity || !!attributeValue.masked, onChange: onChangeEntity, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy, isMasked:
|
|
127
|
+
_a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, isDisabled: !canChangeReferencedEntity || !!attributeValue.masked, onChange: onChangeEntity, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy, isMasked: isMasked })))));
|
|
126
128
|
};
|
|
127
129
|
export default withContext(ScrollToElementContext, function (contextValue, _a) {
|
|
128
130
|
var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
@@ -23,7 +23,7 @@ import { EditModeAttributesList } from '../EditModeAttributesList';
|
|
|
23
23
|
import { withContext } from '../HOCs/withContext';
|
|
24
24
|
import { ConfigPermissionsContextProvider } from '../contexts/ConfigPermissionsContext';
|
|
25
25
|
import { ScrollToElementContext, isHighlightedErrorType } from '../contexts/ScrollToElementContext';
|
|
26
|
-
import { useMdmAction, useMdmAuthoringItemsByEntityType, useMdmEntity, useMdmGlobalSearchRequestOptions, useMdmInitialConnection, useMdmInitialConnectionTempEntity, useMdmModifiedEntities, useMdmModifiedEntity, useMdmProfileErrors, useMdmEntityUri } from '../contexts/MdmModuleContext';
|
|
26
|
+
import { useMdmAction, useMdmAuthoringItemsByEntityType, useMdmEntity, useMdmGlobalSearchRequestOptions, useMdmInitialConnection, useMdmInitialConnectionTempEntity, useMdmModifiedEntities, useMdmModifiedEntity, useMdmProfileErrors, useMdmEntityUri, useMdmShowMasking } from '../contexts/MdmModuleContext';
|
|
27
27
|
import { HiddenAttributesContext } from '../contexts/HiddenAttributesContext';
|
|
28
28
|
import { useScrollToAttributeError } from '../hooks/useScrollToAttributeError';
|
|
29
29
|
import { useStyles } from './styles';
|
|
@@ -63,6 +63,7 @@ var RelationEditor = function (_a) {
|
|
|
63
63
|
var profileErrors = useMdmProfileErrors();
|
|
64
64
|
var authoringItems = useMdmAuthoringItemsByEntityType(mainEntity === null || mainEntity === void 0 ? void 0 : mainEntity.type);
|
|
65
65
|
var mainEntityUri = useMdmEntityUri();
|
|
66
|
+
var showMasking = useMdmShowMasking();
|
|
66
67
|
var error = getRelationEditorActiveError(connection, profileErrors);
|
|
67
68
|
var allRelationEditorErrors = getAllRelationEditorActiveErrors(connection, profileErrors);
|
|
68
69
|
var modifiedEntity = isTempEntity ? mdmModifiedEntity : null;
|
|
@@ -189,6 +190,7 @@ var RelationEditor = function (_a) {
|
|
|
189
190
|
return content.entityTypes;
|
|
190
191
|
}, [config, connection.parentEntityUri]);
|
|
191
192
|
var isEntityHasMaskedAttrValue = pipe(values, flatten, any(isAttributeHasMaskedValue))(((_d = (_c = connection.entity) === null || _c === void 0 ? void 0 : _c.object) === null || _d === void 0 ? void 0 : _d.attributes) || {});
|
|
193
|
+
var isMasked = showMasking && isEntityHasMaskedAttrValue;
|
|
192
194
|
return (React.createElement(React.Fragment, null,
|
|
193
195
|
React.createElement("div", { className: styles.editor },
|
|
194
196
|
React.createElement(Typography, { className: styles.title }, isNew ? i18n.text('Add new item') : i18n.text('Edit item')),
|
|
@@ -199,7 +201,7 @@ var RelationEditor = function (_a) {
|
|
|
199
201
|
React.createElement(EntitySelector, { className: classnames(styles.item, (_b = {},
|
|
200
202
|
_b[styles.dense] = errorMessage ||
|
|
201
203
|
(connection.entity && isTempUri(connection.entity.entityUri)),
|
|
202
|
-
_b)), entity: connection.entity || {}, entityTypesUris: getEntityTypesUris() || [], globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, onChange: onChangeEntity, onCreate: canCreateNewEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: relationEditorAttributeTypesSelectionStrategy, isMasked:
|
|
204
|
+
_b)), entity: connection.entity || {}, entityTypesUris: getEntityTypesUris() || [], globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, onChange: onChangeEntity, onCreate: canCreateNewEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: relationEditorAttributeTypesSelectionStrategy, isMasked: isMasked }))),
|
|
203
205
|
React.createElement(HiddenAttributesContext.Provider, { value: emptyHiddenAttributes },
|
|
204
206
|
React.createElement(EditModeAttributesList, { className: styles.item, attrTypes: firstLevelRelationAttrTypes, entity: attributeListEntity, showEmptyEditors: true, mode: mode, parentUri: relationUri, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onDeleteAttribute }))))),
|
|
205
207
|
React.createElement("div", { className: styles.actionButtons },
|
|
@@ -97,7 +97,8 @@ var defaultMdmValues = {
|
|
|
97
97
|
dependentLookups: { editors: {}, structure: {}, initedTypeUris: [] },
|
|
98
98
|
uiConfigLayout: [],
|
|
99
99
|
uiConfigProfile: [],
|
|
100
|
-
profileErrors: []
|
|
100
|
+
profileErrors: [],
|
|
101
|
+
showMasking: true
|
|
101
102
|
};
|
|
102
103
|
var defaultProps = {
|
|
103
104
|
connection: { relation: defaultRelation, entity: {} },
|
|
@@ -198,6 +199,41 @@ var defaultProps = {
|
|
|
198
199
|
},
|
|
199
200
|
mode: Mode.Editing
|
|
200
201
|
};
|
|
202
|
+
var entityWithMasking = {
|
|
203
|
+
uri: 'entities/uri$$123',
|
|
204
|
+
type: 'configuration/entityTypes/HCP',
|
|
205
|
+
object: {
|
|
206
|
+
uri: 'entities/04B1CqH',
|
|
207
|
+
type: 'configuration/entityTypes/Location',
|
|
208
|
+
attributes: {
|
|
209
|
+
Address: [
|
|
210
|
+
{
|
|
211
|
+
label: 'AcOEvPaVqTfzZCE Josogaf VA',
|
|
212
|
+
relationshipLabel: '',
|
|
213
|
+
value: {
|
|
214
|
+
AddressLine1: [
|
|
215
|
+
{
|
|
216
|
+
type: 'configuration/entityTypes/Location/attributes/AddressLine1',
|
|
217
|
+
ov: true,
|
|
218
|
+
value: 'AcOEvPaVqTfzZCE',
|
|
219
|
+
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine1/1XFBcmPYm'
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
AddressLine2: [
|
|
223
|
+
{
|
|
224
|
+
type: 'configuration/entityTypes/Location/attributes/AddressLine2',
|
|
225
|
+
ov: true,
|
|
226
|
+
masked: true,
|
|
227
|
+
value: 'KBmiSMlqhElLHMH',
|
|
228
|
+
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine2/1XFBcmTp2'
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
201
237
|
var setUp = function (_a) {
|
|
202
238
|
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.error, error = _e === void 0 ? null : _e, _f = _b.hiddenAttributes, hiddenAttributes = _f === void 0 ? {} : _f;
|
|
203
239
|
var user = userEvent.setup();
|
|
@@ -530,41 +566,7 @@ describe('relation editor behaviour', function () {
|
|
|
530
566
|
case 0:
|
|
531
567
|
props = __assign(__assign({}, defaultProps), { connection: {
|
|
532
568
|
relation: defaultRelation,
|
|
533
|
-
entity:
|
|
534
|
-
uri: 'entities/uri$$123',
|
|
535
|
-
type: 'configuration/entityTypes/HCP',
|
|
536
|
-
object: {
|
|
537
|
-
uri: 'entities/04B1CqH',
|
|
538
|
-
type: 'configuration/entityTypes/Location',
|
|
539
|
-
attributes: {
|
|
540
|
-
Address: [
|
|
541
|
-
{
|
|
542
|
-
label: 'AcOEvPaVqTfzZCE Josogaf VA',
|
|
543
|
-
relationshipLabel: '',
|
|
544
|
-
value: {
|
|
545
|
-
AddressLine1: [
|
|
546
|
-
{
|
|
547
|
-
type: 'configuration/entityTypes/Location/attributes/AddressLine1',
|
|
548
|
-
ov: true,
|
|
549
|
-
value: 'AcOEvPaVqTfzZCE',
|
|
550
|
-
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine1/1XFBcmPYm'
|
|
551
|
-
}
|
|
552
|
-
],
|
|
553
|
-
AddressLine2: [
|
|
554
|
-
{
|
|
555
|
-
type: 'configuration/entityTypes/Location/attributes/AddressLine2',
|
|
556
|
-
ov: true,
|
|
557
|
-
masked: true,
|
|
558
|
-
value: 'KBmiSMlqhElLHMH',
|
|
559
|
-
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine2/1XFBcmTp2'
|
|
560
|
-
}
|
|
561
|
-
]
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
]
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
569
|
+
entity: entityWithMasking
|
|
568
570
|
} });
|
|
569
571
|
user = setUp({ props: props }).user;
|
|
570
572
|
inputs = screen.getAllByRole('textbox');
|
|
@@ -581,6 +583,31 @@ describe('relation editor behaviour', function () {
|
|
|
581
583
|
}
|
|
582
584
|
});
|
|
583
585
|
}); });
|
|
586
|
+
it('should not add sendMasked option if configuration showMasking property is false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
587
|
+
var props, mdmValues, user, inputs;
|
|
588
|
+
return __generator(this, function (_a) {
|
|
589
|
+
switch (_a.label) {
|
|
590
|
+
case 0:
|
|
591
|
+
props = __assign(__assign({}, defaultProps), { connection: {
|
|
592
|
+
relation: defaultRelation,
|
|
593
|
+
entity: entityWithMasking
|
|
594
|
+
} });
|
|
595
|
+
mdmValues = __assign(__assign({}, defaultMdmValues), { showMasking: false });
|
|
596
|
+
user = setUp({ props: props, mdmValues: mdmValues }).user;
|
|
597
|
+
inputs = screen.getAllByRole('textbox');
|
|
598
|
+
return [4 /*yield*/, user.click(inputs[0])];
|
|
599
|
+
case 1:
|
|
600
|
+
_a.sent();
|
|
601
|
+
expect(typeAheadSearch).toHaveBeenCalledWith([defaultProps.metadata.entityTypes[1]], '', {
|
|
602
|
+
globalFilter: '',
|
|
603
|
+
max: 20,
|
|
604
|
+
searchOptions: '',
|
|
605
|
+
sendMasked: false
|
|
606
|
+
});
|
|
607
|
+
return [2 /*return*/];
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
}); });
|
|
584
611
|
describe('apply button', function () {
|
|
585
612
|
var createRelation = function (value) { return (__assign(__assign({}, defaultProps.connection.relation), { object: __assign(__assign({}, defaultProps.connection.relation.object), { attributes: {
|
|
586
613
|
Name: [
|
|
@@ -67,7 +67,7 @@ describe('masking/unmasking behaviour', function () {
|
|
|
67
67
|
attributeType: defaultAttributeType,
|
|
68
68
|
attributeValue: defaultAttributeValue
|
|
69
69
|
};
|
|
70
|
-
var
|
|
70
|
+
var defaultMdmValues = {
|
|
71
71
|
entity: {
|
|
72
72
|
uri: 'entities/16U21B8f',
|
|
73
73
|
type: 'configuration/entityTypes/HCP',
|
|
@@ -102,13 +102,15 @@ describe('masking/unmasking behaviour', function () {
|
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
+
showMasking: true,
|
|
105
106
|
mode: Mode.Viewing
|
|
106
107
|
};
|
|
107
|
-
var setUp = function (props) {
|
|
108
|
+
var setUp = function (props, mdmValues) {
|
|
108
109
|
if (props === void 0) { props = defaultProps; }
|
|
110
|
+
if (mdmValues === void 0) { mdmValues = defaultMdmValues; }
|
|
109
111
|
var Providers = function (_a) {
|
|
110
112
|
var children = _a.children;
|
|
111
|
-
return (React.createElement(MdmModuleProvider, { values:
|
|
113
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
112
114
|
React.createElement(MaskedAttributesProvider, null, children)));
|
|
113
115
|
};
|
|
114
116
|
var user = userEvent.setup();
|
|
@@ -289,4 +291,13 @@ describe('masking/unmasking behaviour', function () {
|
|
|
289
291
|
}
|
|
290
292
|
});
|
|
291
293
|
}); });
|
|
294
|
+
it('should not render masking controls if showMasking configuration property is false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
295
|
+
var mdmValues, container;
|
|
296
|
+
return __generator(this, function (_a) {
|
|
297
|
+
mdmValues = __assign(__assign({}, defaultMdmValues), { showMasking: false });
|
|
298
|
+
container = setUp(defaultProps, mdmValues).container;
|
|
299
|
+
expect(container.querySelector('.switcherWrapper')).not.toBeInTheDocument();
|
|
300
|
+
return [2 /*return*/];
|
|
301
|
+
});
|
|
302
|
+
}); });
|
|
292
303
|
});
|
|
@@ -76,6 +76,7 @@ var ReferenceAttributeEditor = function (props) {
|
|
|
76
76
|
var modifiedEntity = (0, mdm_sdk_1.isTempUri)(entityUri) ? mdmModifiedEntity : null;
|
|
77
77
|
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
78
78
|
var globalSearchRequestOptions = (0, MdmModuleContext_1.useMdmGlobalSearchRequestOptions)(['ovOnly']);
|
|
79
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
79
80
|
var referencedEntity = (0, mdm_sdk_1.getReferencedEntityFromAttrValue)(attributeValue);
|
|
80
81
|
var referencedRelation = (0, mdm_sdk_1.getReferencedRelationFromAttrValue)(attributeValue);
|
|
81
82
|
var referencedEntityTypeUri = (0, mdm_sdk_1.getReferencedEntityTypeUriFromAttrType)(attributeType);
|
|
@@ -145,12 +146,13 @@ var ReferenceAttributeEditor = function (props) {
|
|
|
145
146
|
}, [attributeType, attributeValue, mode, crosswalks, configCanUpdate]);
|
|
146
147
|
var canCreateReferencedEntity = (0, react_1.useMemo)(function () { return configCanCreate && (0, mdm_sdk_1.checkMetadataForCreate)(mode, referencedEntityType); }, [mode, referencedEntityType, configCanCreate]);
|
|
147
148
|
var errorMessage = (0, mdm_sdk_1.getErrorMessage)(referencedEntityMissedError);
|
|
149
|
+
var isMasked = showMasking && (0, mdm_sdk_1.isAttributeHasMaskedValue)(attributeValue);
|
|
148
150
|
return (react_1.default.createElement(EditModeComplexAttribute_1.EditModeComplexAttribute, __assign({}, ownProps, { label: (0, mdm_sdk_1.getLabel)(label), attributeTypesList: editableAttrTypes, crosswalks: allCrosswalks, metadata: metadata }),
|
|
149
151
|
react_1.default.createElement("div", { ref: ref, className: errorClassName },
|
|
150
152
|
react_1.default.createElement(ErrorWrapper_1.ErrorWrapper, { errorMessage: errorMessage },
|
|
151
153
|
react_1.default.createElement(EntitySelector_1.EntitySelector, { className: (0, classnames_1.default)(styles.item, (_a = {},
|
|
152
154
|
_a[styles.dense] = errorMessage || (selectedEntity && (0, mdm_sdk_1.isTempUri)(selectedEntity.entityUri)),
|
|
153
|
-
_a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, isDisabled: !canChangeReferencedEntity || !!attributeValue.masked, onChange: onChangeEntity, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy, isMasked:
|
|
155
|
+
_a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, isDisabled: !canChangeReferencedEntity || !!attributeValue.masked, onChange: onChangeEntity, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy, isMasked: isMasked })))));
|
|
154
156
|
};
|
|
155
157
|
exports.default = (0, withContext_1.withContext)(ScrollToElementContext_1.ScrollToElementContext, function (contextValue, _a) {
|
|
156
158
|
var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
@@ -91,6 +91,7 @@ var RelationEditor = function (_a) {
|
|
|
91
91
|
var profileErrors = (0, MdmModuleContext_1.useMdmProfileErrors)();
|
|
92
92
|
var authoringItems = (0, MdmModuleContext_1.useMdmAuthoringItemsByEntityType)(mainEntity === null || mainEntity === void 0 ? void 0 : mainEntity.type);
|
|
93
93
|
var mainEntityUri = (0, MdmModuleContext_1.useMdmEntityUri)();
|
|
94
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
94
95
|
var error = (0, mdm_sdk_1.getRelationEditorActiveError)(connection, profileErrors);
|
|
95
96
|
var allRelationEditorErrors = (0, mdm_sdk_1.getAllRelationEditorActiveErrors)(connection, profileErrors);
|
|
96
97
|
var modifiedEntity = isTempEntity ? mdmModifiedEntity : null;
|
|
@@ -217,6 +218,7 @@ var RelationEditor = function (_a) {
|
|
|
217
218
|
return content.entityTypes;
|
|
218
219
|
}, [config, connection.parentEntityUri]);
|
|
219
220
|
var isEntityHasMaskedAttrValue = (0, ramda_1.pipe)(ramda_1.values, ramda_1.flatten, (0, ramda_1.any)(mdm_sdk_1.isAttributeHasMaskedValue))(((_d = (_c = connection.entity) === null || _c === void 0 ? void 0 : _c.object) === null || _d === void 0 ? void 0 : _d.attributes) || {});
|
|
221
|
+
var isMasked = showMasking && isEntityHasMaskedAttrValue;
|
|
220
222
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
221
223
|
react_1.default.createElement("div", { className: styles.editor },
|
|
222
224
|
react_1.default.createElement(Typography_1.default, { className: styles.title }, isNew ? ui_i18n_1.default.text('Add new item') : ui_i18n_1.default.text('Edit item')),
|
|
@@ -227,7 +229,7 @@ var RelationEditor = function (_a) {
|
|
|
227
229
|
react_1.default.createElement(EntitySelector_1.EntitySelector, { className: (0, classnames_1.default)(styles.item, (_b = {},
|
|
228
230
|
_b[styles.dense] = errorMessage ||
|
|
229
231
|
(connection.entity && (0, mdm_sdk_1.isTempUri)(connection.entity.entityUri)),
|
|
230
|
-
_b)), entity: connection.entity || {}, entityTypesUris: getEntityTypesUris() || [], globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, onChange: onChangeEntity, onCreate: canCreateNewEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: mdm_sdk_1.relationEditorAttributeTypesSelectionStrategy, isMasked:
|
|
232
|
+
_b)), entity: connection.entity || {}, entityTypesUris: getEntityTypesUris() || [], globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, onChange: onChangeEntity, onCreate: canCreateNewEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: mdm_sdk_1.relationEditorAttributeTypesSelectionStrategy, isMasked: isMasked }))),
|
|
231
233
|
react_1.default.createElement(HiddenAttributesContext_1.HiddenAttributesContext.Provider, { value: emptyHiddenAttributes },
|
|
232
234
|
react_1.default.createElement(EditModeAttributesList_1.EditModeAttributesList, { className: styles.item, attrTypes: firstLevelRelationAttrTypes, entity: attributeListEntity, showEmptyEditors: true, mode: mode, parentUri: relationUri, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onDeleteAttribute }))))),
|
|
233
235
|
react_1.default.createElement("div", { className: styles.actionButtons },
|
|
@@ -102,7 +102,8 @@ var defaultMdmValues = {
|
|
|
102
102
|
dependentLookups: { editors: {}, structure: {}, initedTypeUris: [] },
|
|
103
103
|
uiConfigLayout: [],
|
|
104
104
|
uiConfigProfile: [],
|
|
105
|
-
profileErrors: []
|
|
105
|
+
profileErrors: [],
|
|
106
|
+
showMasking: true
|
|
106
107
|
};
|
|
107
108
|
var defaultProps = {
|
|
108
109
|
connection: { relation: defaultRelation, entity: {} },
|
|
@@ -203,6 +204,41 @@ var defaultProps = {
|
|
|
203
204
|
},
|
|
204
205
|
mode: mdm_sdk_1.Mode.Editing
|
|
205
206
|
};
|
|
207
|
+
var entityWithMasking = {
|
|
208
|
+
uri: 'entities/uri$$123',
|
|
209
|
+
type: 'configuration/entityTypes/HCP',
|
|
210
|
+
object: {
|
|
211
|
+
uri: 'entities/04B1CqH',
|
|
212
|
+
type: 'configuration/entityTypes/Location',
|
|
213
|
+
attributes: {
|
|
214
|
+
Address: [
|
|
215
|
+
{
|
|
216
|
+
label: 'AcOEvPaVqTfzZCE Josogaf VA',
|
|
217
|
+
relationshipLabel: '',
|
|
218
|
+
value: {
|
|
219
|
+
AddressLine1: [
|
|
220
|
+
{
|
|
221
|
+
type: 'configuration/entityTypes/Location/attributes/AddressLine1',
|
|
222
|
+
ov: true,
|
|
223
|
+
value: 'AcOEvPaVqTfzZCE',
|
|
224
|
+
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine1/1XFBcmPYm'
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
AddressLine2: [
|
|
228
|
+
{
|
|
229
|
+
type: 'configuration/entityTypes/Location/attributes/AddressLine2',
|
|
230
|
+
ov: true,
|
|
231
|
+
masked: true,
|
|
232
|
+
value: 'KBmiSMlqhElLHMH',
|
|
233
|
+
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine2/1XFBcmTp2'
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
206
242
|
var setUp = function (_a) {
|
|
207
243
|
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.error, error = _e === void 0 ? null : _e, _f = _b.hiddenAttributes, hiddenAttributes = _f === void 0 ? {} : _f;
|
|
208
244
|
var user = user_event_1.default.setup();
|
|
@@ -535,41 +571,7 @@ describe('relation editor behaviour', function () {
|
|
|
535
571
|
case 0:
|
|
536
572
|
props = __assign(__assign({}, defaultProps), { connection: {
|
|
537
573
|
relation: defaultRelation,
|
|
538
|
-
entity:
|
|
539
|
-
uri: 'entities/uri$$123',
|
|
540
|
-
type: 'configuration/entityTypes/HCP',
|
|
541
|
-
object: {
|
|
542
|
-
uri: 'entities/04B1CqH',
|
|
543
|
-
type: 'configuration/entityTypes/Location',
|
|
544
|
-
attributes: {
|
|
545
|
-
Address: [
|
|
546
|
-
{
|
|
547
|
-
label: 'AcOEvPaVqTfzZCE Josogaf VA',
|
|
548
|
-
relationshipLabel: '',
|
|
549
|
-
value: {
|
|
550
|
-
AddressLine1: [
|
|
551
|
-
{
|
|
552
|
-
type: 'configuration/entityTypes/Location/attributes/AddressLine1',
|
|
553
|
-
ov: true,
|
|
554
|
-
value: 'AcOEvPaVqTfzZCE',
|
|
555
|
-
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine1/1XFBcmPYm'
|
|
556
|
-
}
|
|
557
|
-
],
|
|
558
|
-
AddressLine2: [
|
|
559
|
-
{
|
|
560
|
-
type: 'configuration/entityTypes/Location/attributes/AddressLine2',
|
|
561
|
-
ov: true,
|
|
562
|
-
masked: true,
|
|
563
|
-
value: 'KBmiSMlqhElLHMH',
|
|
564
|
-
uri: 'entities/04B1CqH/attributes/Address/03R51aT/AddressLine2/1XFBcmTp2'
|
|
565
|
-
}
|
|
566
|
-
]
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
]
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
574
|
+
entity: entityWithMasking
|
|
573
575
|
} });
|
|
574
576
|
user = setUp({ props: props }).user;
|
|
575
577
|
inputs = react_2.screen.getAllByRole('textbox');
|
|
@@ -586,6 +588,31 @@ describe('relation editor behaviour', function () {
|
|
|
586
588
|
}
|
|
587
589
|
});
|
|
588
590
|
}); });
|
|
591
|
+
it('should not add sendMasked option if configuration showMasking property is false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
592
|
+
var props, mdmValues, user, inputs;
|
|
593
|
+
return __generator(this, function (_a) {
|
|
594
|
+
switch (_a.label) {
|
|
595
|
+
case 0:
|
|
596
|
+
props = __assign(__assign({}, defaultProps), { connection: {
|
|
597
|
+
relation: defaultRelation,
|
|
598
|
+
entity: entityWithMasking
|
|
599
|
+
} });
|
|
600
|
+
mdmValues = __assign(__assign({}, defaultMdmValues), { showMasking: false });
|
|
601
|
+
user = setUp({ props: props, mdmValues: mdmValues }).user;
|
|
602
|
+
inputs = react_2.screen.getAllByRole('textbox');
|
|
603
|
+
return [4 /*yield*/, user.click(inputs[0])];
|
|
604
|
+
case 1:
|
|
605
|
+
_a.sent();
|
|
606
|
+
expect(mdm_sdk_1.typeAheadSearch).toHaveBeenCalledWith([defaultProps.metadata.entityTypes[1]], '', {
|
|
607
|
+
globalFilter: '',
|
|
608
|
+
max: 20,
|
|
609
|
+
searchOptions: '',
|
|
610
|
+
sendMasked: false
|
|
611
|
+
});
|
|
612
|
+
return [2 /*return*/];
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
}); });
|
|
589
616
|
describe('apply button', function () {
|
|
590
617
|
var createRelation = function (value) { return (__assign(__assign({}, defaultProps.connection.relation), { object: __assign(__assign({}, defaultProps.connection.relation.object), { attributes: {
|
|
591
618
|
Name: [
|
|
@@ -72,7 +72,7 @@ describe('masking/unmasking behaviour', function () {
|
|
|
72
72
|
attributeType: defaultAttributeType,
|
|
73
73
|
attributeValue: defaultAttributeValue
|
|
74
74
|
};
|
|
75
|
-
var
|
|
75
|
+
var defaultMdmValues = {
|
|
76
76
|
entity: {
|
|
77
77
|
uri: 'entities/16U21B8f',
|
|
78
78
|
type: 'configuration/entityTypes/HCP',
|
|
@@ -107,13 +107,15 @@ describe('masking/unmasking behaviour', function () {
|
|
|
107
107
|
}
|
|
108
108
|
]
|
|
109
109
|
},
|
|
110
|
+
showMasking: true,
|
|
110
111
|
mode: mdm_sdk_1.Mode.Viewing
|
|
111
112
|
};
|
|
112
|
-
var setUp = function (props) {
|
|
113
|
+
var setUp = function (props, mdmValues) {
|
|
113
114
|
if (props === void 0) { props = defaultProps; }
|
|
115
|
+
if (mdmValues === void 0) { mdmValues = defaultMdmValues; }
|
|
114
116
|
var Providers = function (_a) {
|
|
115
117
|
var children = _a.children;
|
|
116
|
-
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values:
|
|
118
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
117
119
|
react_1.default.createElement(MaskedAttributesContext_1.MaskedAttributesProvider, null, children)));
|
|
118
120
|
};
|
|
119
121
|
var user = user_event_1.default.setup();
|
|
@@ -294,4 +296,13 @@ describe('masking/unmasking behaviour', function () {
|
|
|
294
296
|
}
|
|
295
297
|
});
|
|
296
298
|
}); });
|
|
299
|
+
it('should not render masking controls if showMasking configuration property is false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
300
|
+
var mdmValues, container;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
mdmValues = __assign(__assign({}, defaultMdmValues), { showMasking: false });
|
|
303
|
+
container = setUp(defaultProps, mdmValues).container;
|
|
304
|
+
expect(container.querySelector('.switcherWrapper')).not.toBeInTheDocument();
|
|
305
|
+
return [2 /*return*/];
|
|
306
|
+
});
|
|
307
|
+
}); });
|
|
297
308
|
});
|
|
@@ -55,6 +55,7 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
55
55
|
isCollaborationEnabled: boolean;
|
|
56
56
|
uiConfigLayout: Layout;
|
|
57
57
|
uiConfigProfile: Profile;
|
|
58
|
+
showMasking: boolean;
|
|
58
59
|
}>;
|
|
59
60
|
export type MdmModuleActionsContextProps = Partial<{
|
|
60
61
|
openSearch: (payload: SearchState) => void;
|
|
@@ -256,6 +257,7 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
256
257
|
isCollaborationEnabled: boolean;
|
|
257
258
|
uiConfigLayout: Layout;
|
|
258
259
|
uiConfigProfile: Profile;
|
|
260
|
+
showMasking: boolean;
|
|
259
261
|
}>>;
|
|
260
262
|
export declare const MdmModuleListenersContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
261
263
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -149,3 +149,4 @@ export declare const useMdmListener: <T extends keyof MdmModuleListenersContextP
|
|
|
149
149
|
}>[T];
|
|
150
150
|
export declare const useMdmHiddenAttributes: () => Record<string, string[]>;
|
|
151
151
|
export declare const useMdmControlAttributes: () => string[];
|
|
152
|
+
export declare const useMdmShowMasking: () => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useMdmIsWorkflowEnabled = exports.useMdmIsCollaborationEnabled = exports.useMdmSearchProviderData = exports.useMdmSearchNavigationData = exports.useMdmDataTenants = exports.useMdmEnvironment = exports.useMdmTenantName = exports.useMdmTenant = exports.useMdmTenantObject = exports.useMdmUserRoles = exports.useMdmUsername = exports.useMdmUser = exports.useMdmMetadata = exports.useMdmDependentLookups = exports.useMdmLookups = exports.useMdmProfileLastLoadedTime = exports.useMdmHistoryEvent = exports.useMdmHistorySlice = exports.useMdmHistoryMode = exports.useMdmHistoryDiff = exports.useMdmIsEditableMode = exports.useMdmIsViewMode = exports.useMdmMode = exports.useMdmEntityUriWithDataTenant = exports.useMdmEntityWithDiff = exports.useMdmEntityUri = exports.useMdmEntity = exports.useMdmModifiedEntities = exports.useMdmLookupAutocomplete = exports.useMdmAttributesSortingStrategy = exports.useMdmMaxValuesInResponse = exports.useMdmAttributesPresentation = exports.useMdmDateTimeMask = exports.useMdmDateMask = exports.useMdmPivotingAttributes = exports.useMdmShowEntityId = exports.useMdmImageAttributesFieldsOrder = exports.useMdmCollaborationPath = exports.useMdmApiPath = exports.useMdmReltioPath = exports.useMdmImageServicePath = exports.useMdmWorkflowPath = exports.useMdmServicesPath = exports.useMdmDtssPath = exports.useMdmUiPath = exports.useMdmAbsoluteImagePath = exports.useMdmExportPath = exports.useMdmWorkflowEnvironmentUrl = exports.useMdmUiError = exports.useMdmAutoCloseInterval = void 0;
|
|
4
|
-
exports.useMdmControlAttributes = exports.useMdmHiddenAttributes = exports.useMdmListener = exports.useMdmAction = exports.useMdmAuthoringItemsByEntityType = exports.useMdmGlobalSearchRequestOptions = exports.useMdmDependentLookupEditorContext = exports.useMdmRelationsDrafts = exports.useMdmAllRelationsToAddAndEdit = exports.useMdmDependentLookupsStructureNode = exports.useMdmActiveErrorsForAttributesPager = exports.useMdmDependentLookupEditorState = exports.useMdmInitialConnection = exports.useMdmInitialConnectionTempEntity = exports.useMdmModifiedEntity = exports.useMdmModifiedEntityDefaultProfilePic = exports.useMdmIsSourcesScreenEnabled = exports.useMdmProfileErrors = void 0;
|
|
4
|
+
exports.useMdmShowMasking = exports.useMdmControlAttributes = exports.useMdmHiddenAttributes = exports.useMdmListener = exports.useMdmAction = exports.useMdmAuthoringItemsByEntityType = exports.useMdmGlobalSearchRequestOptions = exports.useMdmDependentLookupEditorContext = exports.useMdmRelationsDrafts = exports.useMdmAllRelationsToAddAndEdit = exports.useMdmDependentLookupsStructureNode = exports.useMdmActiveErrorsForAttributesPager = exports.useMdmDependentLookupEditorState = exports.useMdmInitialConnection = exports.useMdmInitialConnectionTempEntity = exports.useMdmModifiedEntity = exports.useMdmModifiedEntityDefaultProfilePic = exports.useMdmIsSourcesScreenEnabled = exports.useMdmProfileErrors = void 0;
|
|
5
5
|
var react_context_selector_1 = require("@fluentui/react-context-selector");
|
|
6
6
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
7
7
|
var context_1 = require("./context");
|
|
@@ -231,3 +231,5 @@ var useMdmControlAttributes = function () {
|
|
|
231
231
|
return useMdmModuleValuesContext(function (context) { return context.controlAttributes || emptyControlAttributes; });
|
|
232
232
|
};
|
|
233
233
|
exports.useMdmControlAttributes = useMdmControlAttributes;
|
|
234
|
+
var useMdmShowMasking = function () { return useMdmModuleValuesContext(function (context) { return context.showMasking; }); };
|
|
235
|
+
exports.useMdmShowMasking = useMdmShowMasking;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MdmModuleProvider } from './provider';
|
|
2
|
-
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes } from './hooks';
|
|
2
|
+
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking } from './hooks';
|
|
3
3
|
export type { MdmModuleActionsContextProps, MdmModuleValuesContextProps, MdmModuleListenersContextProps } from './context';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useMdmIsCollaborationEnabled = exports.useMdmSearchProviderData = exports.useMdmSearchNavigationData = exports.useMdmDataTenants = exports.useMdmEnvironment = exports.useMdmTenantName = exports.useMdmTenant = exports.useMdmTenantObject = exports.useMdmUserRoles = exports.useMdmUsername = exports.useMdmUser = exports.useMdmMetadata = exports.useMdmDependentLookups = exports.useMdmLookups = exports.useMdmProfileLastLoadedTime = exports.useMdmHistoryEvent = exports.useMdmHistorySlice = exports.useMdmHistoryMode = exports.useMdmHistoryDiff = exports.useMdmIsEditableMode = exports.useMdmIsViewMode = exports.useMdmMode = exports.useMdmEntityUriWithDataTenant = exports.useMdmEntityWithDiff = exports.useMdmEntityUri = exports.useMdmEntity = exports.useMdmModifiedEntities = exports.useMdmLookupAutocomplete = exports.useMdmAttributesSortingStrategy = exports.useMdmMaxValuesInResponse = exports.useMdmAttributesPresentation = exports.useMdmDateTimeMask = exports.useMdmDateMask = exports.useMdmPivotingAttributes = exports.useMdmShowEntityId = exports.useMdmImageAttributesFieldsOrder = exports.useMdmCollaborationPath = exports.useMdmApiPath = exports.useMdmReltioPath = exports.useMdmImageServicePath = exports.useMdmWorkflowPath = exports.useMdmServicesPath = exports.useMdmDtssPath = exports.useMdmUiPath = exports.useMdmAbsoluteImagePath = exports.useMdmExportPath = exports.useMdmWorkflowEnvironmentUrl = exports.useMdmUiError = exports.useMdmAutoCloseInterval = exports.MdmModuleProvider = void 0;
|
|
4
|
-
exports.useMdmControlAttributes = exports.useMdmHiddenAttributes = exports.useMdmIsSourcesScreenEnabled = exports.useMdmListener = exports.useMdmAction = exports.useMdmAuthoringItemsByEntityType = exports.useMdmGlobalSearchRequestOptions = exports.useMdmDependentLookupEditorContext = exports.useMdmAllRelationsToAddAndEdit = exports.useMdmDependentLookupsStructureNode = exports.useMdmActiveErrorsForAttributesPager = exports.useMdmDependentLookupEditorState = exports.useMdmInitialConnection = exports.useMdmInitialConnectionTempEntity = exports.useMdmModifiedEntity = exports.useMdmModifiedEntityDefaultProfilePic = exports.useMdmRelationsDrafts = exports.useMdmProfileErrors = exports.useMdmIsWorkflowEnabled = void 0;
|
|
4
|
+
exports.useMdmShowMasking = exports.useMdmControlAttributes = exports.useMdmHiddenAttributes = exports.useMdmIsSourcesScreenEnabled = exports.useMdmListener = exports.useMdmAction = exports.useMdmAuthoringItemsByEntityType = exports.useMdmGlobalSearchRequestOptions = exports.useMdmDependentLookupEditorContext = exports.useMdmAllRelationsToAddAndEdit = exports.useMdmDependentLookupsStructureNode = exports.useMdmActiveErrorsForAttributesPager = exports.useMdmDependentLookupEditorState = exports.useMdmInitialConnection = exports.useMdmInitialConnectionTempEntity = exports.useMdmModifiedEntity = exports.useMdmModifiedEntityDefaultProfilePic = exports.useMdmRelationsDrafts = exports.useMdmProfileErrors = exports.useMdmIsWorkflowEnabled = void 0;
|
|
5
5
|
var provider_1 = require("./provider");
|
|
6
6
|
Object.defineProperty(exports, "MdmModuleProvider", { enumerable: true, get: function () { return provider_1.MdmModuleProvider; } });
|
|
7
7
|
var hooks_1 = require("./hooks");
|
|
@@ -73,3 +73,4 @@ Object.defineProperty(exports, "useMdmListener", { enumerable: true, get: functi
|
|
|
73
73
|
Object.defineProperty(exports, "useMdmIsSourcesScreenEnabled", { enumerable: true, get: function () { return hooks_1.useMdmIsSourcesScreenEnabled; } });
|
|
74
74
|
Object.defineProperty(exports, "useMdmHiddenAttributes", { enumerable: true, get: function () { return hooks_1.useMdmHiddenAttributes; } });
|
|
75
75
|
Object.defineProperty(exports, "useMdmControlAttributes", { enumerable: true, get: function () { return hooks_1.useMdmControlAttributes; } });
|
|
76
|
+
Object.defineProperty(exports, "useMdmShowMasking", { enumerable: true, get: function () { return hooks_1.useMdmShowMasking; } });
|
|
@@ -46,13 +46,14 @@ var useActivitiesLoader = function (_a) {
|
|
|
46
46
|
var filter = _a.filter, max = _a.max, offset = _a.offset;
|
|
47
47
|
var signal = (0, react_1.useContext)(PageRequestsAbortingContext_1.PageRequestsAbortingContext);
|
|
48
48
|
var metadata = (0, hooks_1.useMdmMetadata)();
|
|
49
|
+
var showMasking = (0, hooks_1.useMdmShowMasking)();
|
|
49
50
|
return (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
51
|
var filterString, options, data, total;
|
|
51
52
|
return __generator(this, function (_a) {
|
|
52
53
|
switch (_a.label) {
|
|
53
54
|
case 0:
|
|
54
55
|
filterString = (0, filters_1.buildActivitiesFilterString)(filter);
|
|
55
|
-
options = (0, mdm_sdk_1.
|
|
56
|
+
options = (0, mdm_sdk_1.addGetActivitiesMaskingOptions)(metadata, { filter: filterString, max: max, offset: offset }, showMasking);
|
|
56
57
|
return [4 /*yield*/, (0, mdm_sdk_1.getActivities)(options, signal)];
|
|
57
58
|
case 1:
|
|
58
59
|
data = _a.sent();
|
|
@@ -62,6 +63,6 @@ var useActivitiesLoader = function (_a) {
|
|
|
62
63
|
return [2 /*return*/, { data: data, total: total }];
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
|
-
}); }, [filter, max, offset, signal]);
|
|
66
|
+
}); }, [filter, max, offset, signal, showMasking]);
|
|
66
67
|
};
|
|
67
68
|
exports.useActivitiesLoader = useActivitiesLoader;
|
|
@@ -44,18 +44,19 @@ var hooks_1 = require("../../../contexts/MdmModuleContext/hooks");
|
|
|
44
44
|
var useProfileActivitiesLoader = function (_a) {
|
|
45
45
|
var filter = _a.filter, max = _a.max, offset = _a.offset, entityUri = _a.entityUri;
|
|
46
46
|
var metadata = (0, hooks_1.useMdmMetadata)();
|
|
47
|
+
var showMasking = (0, hooks_1.useMdmShowMasking)();
|
|
47
48
|
return (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
49
|
var filterString, options, data, total;
|
|
49
50
|
return __generator(this, function (_a) {
|
|
50
51
|
switch (_a.label) {
|
|
51
52
|
case 0:
|
|
52
53
|
filterString = (0, filters_1.buildActivitiesFilterString)(filter);
|
|
53
|
-
options = (0, mdm_sdk_1.
|
|
54
|
+
options = (0, mdm_sdk_1.addGetProfileActivitiesMaskingOptions)(metadata, {
|
|
54
55
|
filter: filterString,
|
|
55
56
|
max: max,
|
|
56
57
|
offset: offset,
|
|
57
58
|
entityUri: entityUri
|
|
58
|
-
});
|
|
59
|
+
}, showMasking);
|
|
59
60
|
return [4 /*yield*/, (0, mdm_sdk_1.getProfileActivities)(options)];
|
|
60
61
|
case 1:
|
|
61
62
|
data = _a.sent();
|
|
@@ -65,6 +66,6 @@ var useProfileActivitiesLoader = function (_a) {
|
|
|
65
66
|
return [2 /*return*/, { data: data, total: total }];
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
|
-
}); }, [filter, max, offset, entityUri]);
|
|
69
|
+
}); }, [filter, max, offset, entityUri, showMasking]);
|
|
69
70
|
};
|
|
70
71
|
exports.useProfileActivitiesLoader = useProfileActivitiesLoader;
|
|
@@ -14,6 +14,7 @@ var useHistorySlice = function (_a) {
|
|
|
14
14
|
var historySlice = (0, MdmModuleContext_1.useMdmHistorySlice)();
|
|
15
15
|
var safePromise = (0, useSafePromise_1.useSafePromise)();
|
|
16
16
|
var mode = (0, MdmModuleContext_1.useMdmMode)();
|
|
17
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
17
18
|
var _c = historyEvent || {}, aStamp = _c.aStamp, bStamp = _c.bStamp, overrideUri = _c.overrideUri;
|
|
18
19
|
var entityUri = overrideUri || (entity === null || entity === void 0 ? void 0 : entity.uri);
|
|
19
20
|
(0, react_1.useEffect)(function () {
|
|
@@ -27,7 +28,7 @@ var useHistorySlice = function (_a) {
|
|
|
27
28
|
if (entityUri) {
|
|
28
29
|
if (historyEvent) {
|
|
29
30
|
setIsLoading(true);
|
|
30
|
-
var entityOptions = (0, mdm_sdk_1.
|
|
31
|
+
var entityOptions = (0, mdm_sdk_1.addGetEntityMaskingOptions)(metadata, showMasking);
|
|
31
32
|
safePromise(Promise.all([
|
|
32
33
|
(0, mdm_sdk_1.getEntityTimeSlice)(entityUri, aStamp, entityOptions),
|
|
33
34
|
bStamp && bStamp !== 1
|
|
@@ -50,7 +51,7 @@ var useHistorySlice = function (_a) {
|
|
|
50
51
|
setIsLoading(false);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
}, [aStamp, bStamp, entityUri]);
|
|
54
|
+
}, [aStamp, bStamp, entityUri, showMasking]);
|
|
54
55
|
return { isLoading: isLoading, historySlice: historySlice };
|
|
55
56
|
};
|
|
56
57
|
exports.useHistorySlice = useHistorySlice;
|
|
@@ -301,4 +301,17 @@ describe('useHistorySlice tests', function () {
|
|
|
301
301
|
expect(mdm_sdk_1.getEntityTimeSlice).toHaveBeenNthCalledWith(1, profileEntity.uri, aStamp, defaultGetEntityOptions);
|
|
302
302
|
expect(mdm_sdk_1.getEntityTimeSlice).toHaveBeenNthCalledWith(2, profileEntity.uri, bStamp, defaultGetEntityOptions);
|
|
303
303
|
});
|
|
304
|
+
it('should not call with sendMasked option if configuration showMasking attribute is false', function () {
|
|
305
|
+
var aStamp = 123;
|
|
306
|
+
var bStamp = 321;
|
|
307
|
+
var expectedOptions = { options: 'sendHidden,addRefAttrUriToCrosswalk' };
|
|
308
|
+
var props = { historyEvent: { aStamp: aStamp, bStamp: bStamp }, entity: profileEntity };
|
|
309
|
+
var metadata = createDefaultMetadata();
|
|
310
|
+
metadata.entityTypes[0].attributes[0].masking = { regexPattern: '***' };
|
|
311
|
+
var mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata, showMasking: false });
|
|
312
|
+
setUp(props, mdmValues);
|
|
313
|
+
expect(mdm_sdk_1.getEntityTimeSlice).toHaveBeenCalledTimes(2);
|
|
314
|
+
expect(mdm_sdk_1.getEntityTimeSlice).toHaveBeenNthCalledWith(1, profileEntity.uri, aStamp, expectedOptions);
|
|
315
|
+
expect(mdm_sdk_1.getEntityTimeSlice).toHaveBeenNthCalledWith(2, profileEntity.uri, bStamp, expectedOptions);
|
|
316
|
+
});
|
|
304
317
|
});
|
|
@@ -49,6 +49,7 @@ var useMaskedAttribute = function (_a) {
|
|
|
49
49
|
var unmaskAttributeValue = (0, MaskedAttributesContext_1.useUnmaskAttributeValue)();
|
|
50
50
|
var maskAttributeValue = (0, MaskedAttributesContext_1.useMaskAttributeValue)();
|
|
51
51
|
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
52
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
52
53
|
var entityFromContext = (0, react_1.useContext)(EntityContext_1.EntityContext);
|
|
53
54
|
var mainEntity = (0, MdmModuleContext_1.useMdmEntity)();
|
|
54
55
|
var entity = entityProp || entityFromContext || mainEntity;
|
|
@@ -61,7 +62,8 @@ var useMaskedAttribute = function (_a) {
|
|
|
61
62
|
!!attributeType.masking &&
|
|
62
63
|
isViewMode &&
|
|
63
64
|
canUnmaskAttribute &&
|
|
64
|
-
hasUnmaskDataPermissions
|
|
65
|
+
hasUnmaskDataPermissions &&
|
|
66
|
+
showMasking;
|
|
65
67
|
var unmask = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
68
|
return __generator(this, function (_a) {
|
|
67
69
|
switch (_a.label) {
|
|
@@ -27,6 +27,7 @@ var useMatchesLoader = function (_a) {
|
|
|
27
27
|
var tenant = (0, MdmModuleContext_1.useMdmTenant)();
|
|
28
28
|
var dtssPath = (0, MdmModuleContext_1.useMdmDtssPath)();
|
|
29
29
|
var dataTenants = (0, MdmModuleContext_1.useMdmDataTenants)();
|
|
30
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
30
31
|
var _f = (0, MdmModuleContext_1.useMdmGlobalSearchRequestOptions)() || {}, activityFilter = _f.activityFilter, globalFilter = _f.globalFilter;
|
|
31
32
|
var activeness = typeof options.showInactiveEntities === 'boolean'
|
|
32
33
|
? options.showInactiveEntities
|
|
@@ -68,7 +69,7 @@ var useMatchesLoader = function (_a) {
|
|
|
68
69
|
max: rowsPerPage,
|
|
69
70
|
force: force
|
|
70
71
|
})
|
|
71
|
-
: getTransitiveMatchesWithPaging(__assign(__assign({}, (0, mdm_sdk_1.
|
|
72
|
+
: getTransitiveMatchesWithPaging(__assign(__assign({}, (0, mdm_sdk_1.addGetTransitiveMatchesMaskingOptions)(metadata, {
|
|
72
73
|
entityUri: entityUri,
|
|
73
74
|
max: rowsPerPage,
|
|
74
75
|
filter: (0, mdm_sdk_1.addGlobalFilterToQuery)(globalFilter, filter) || '',
|
|
@@ -78,7 +79,7 @@ var useMatchesLoader = function (_a) {
|
|
|
78
79
|
markMatchedValues: markMatchedValues,
|
|
79
80
|
deep: options.showTransitiveMatches ? undefined : 1,
|
|
80
81
|
activeness: activeness
|
|
81
|
-
})), { offset: page * rowsPerPage, force: force })))
|
|
82
|
+
}, showMasking)), { offset: page * rowsPerPage, force: force })))
|
|
82
83
|
.then(function (result) {
|
|
83
84
|
var response = result.response, total = result.total, originalResponse = result.originalResponse;
|
|
84
85
|
setTotal(total);
|
|
@@ -117,7 +118,8 @@ var useMatchesLoader = function (_a) {
|
|
|
117
118
|
page,
|
|
118
119
|
rowsPerPage,
|
|
119
120
|
safePromise,
|
|
120
|
-
tenant
|
|
121
|
+
tenant,
|
|
122
|
+
showMasking
|
|
121
123
|
]);
|
|
122
124
|
(0, react_1.useEffect)(function () {
|
|
123
125
|
getMatches();
|
|
@@ -74,5 +74,12 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
74
74
|
expect(mdm_sdk_1.getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
75
75
|
expect(mdm_sdk_1.getTransitiveMatches).toHaveBeenCalledWith(expect.objectContaining({ options: 'sendMasked' }));
|
|
76
76
|
});
|
|
77
|
+
it('should not add sendMasked option if showMasking configuration property is false', function () {
|
|
78
|
+
var metadata = getMetadata();
|
|
79
|
+
metadata.entityTypes[0].attributes[0].masking = { regexPattern: '.{4}$' };
|
|
80
|
+
setUp({ mdmValues: { metadata: metadata, showMasking: false } });
|
|
81
|
+
expect(mdm_sdk_1.getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
82
|
+
expect(mdm_sdk_1.getTransitiveMatches).toHaveBeenCalledWith(expect.not.objectContaining({ options: 'sendMasked' }));
|
|
83
|
+
});
|
|
77
84
|
});
|
|
78
85
|
});
|
|
@@ -43,6 +43,7 @@ var useRelationsLoader = function (_a) {
|
|
|
43
43
|
var dtssPath = (0, MdmModuleContext_1.useMdmDtssPath)();
|
|
44
44
|
var _d = (0, MdmModuleContext_1.useMdmGlobalSearchRequestOptions)() || {}, activityFilter = _d.activityFilter, globalFilter = _d.globalFilter;
|
|
45
45
|
var lastLoadedTime = (0, MdmModuleContext_1.useMdmProfileLastLoadedTime)();
|
|
46
|
+
var showMasking = (0, MdmModuleContext_1.useMdmShowMasking)();
|
|
46
47
|
var safePromise = (0, useSafePromise_1.useSafePromise)();
|
|
47
48
|
var processContent = function (content) {
|
|
48
49
|
var filterRelation = (0, ramda_1.pipe)(mdm_sdk_1.getInOutRelationUri, (0, mdm_sdk_1.isAvailableRelationTypeUri)(metadata));
|
|
@@ -54,11 +55,14 @@ var useRelationsLoader = function (_a) {
|
|
|
54
55
|
})(content);
|
|
55
56
|
};
|
|
56
57
|
var suggested = config.suggested;
|
|
57
|
-
var options = (0, react_1.useMemo)(function () {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
var options = (0, react_1.useMemo)(function () {
|
|
59
|
+
var sendMasked = showMasking && (0, mdm_sdk_1.hasRelationMasking)(metadata) && mode === mdm_sdk_1.Mode.Viewing;
|
|
60
|
+
return {
|
|
61
|
+
searchByOv: searchByOv,
|
|
62
|
+
sendMasked: sendMasked,
|
|
63
|
+
searchRelationsWithFilter: searchRelationsWithFilter
|
|
64
|
+
};
|
|
65
|
+
}, [searchByOv, showMasking, metadata, mode, searchRelationsWithFilter]);
|
|
62
66
|
var filters = (0, react_1.useMemo)(function () {
|
|
63
67
|
var _a;
|
|
64
68
|
return (_a = {},
|
|
@@ -89,7 +89,8 @@ var defaultMdmValues = {
|
|
|
89
89
|
},
|
|
90
90
|
searchOptions: {},
|
|
91
91
|
activityFilter: mdm_sdk_1.ActivityFilter.ALL,
|
|
92
|
-
profileLastLoadedTime: 1674037143100
|
|
92
|
+
profileLastLoadedTime: 1674037143100,
|
|
93
|
+
showMasking: true
|
|
93
94
|
};
|
|
94
95
|
var defaultConfig = { id: 'id', content: { inRelations: [], outRelations: [] } };
|
|
95
96
|
var defaultEntity = { attributes: [], uri: '123' };
|
|
@@ -55,6 +55,7 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
55
55
|
isCollaborationEnabled: boolean;
|
|
56
56
|
uiConfigLayout: Layout;
|
|
57
57
|
uiConfigProfile: Profile;
|
|
58
|
+
showMasking: boolean;
|
|
58
59
|
}>;
|
|
59
60
|
export type MdmModuleActionsContextProps = Partial<{
|
|
60
61
|
openSearch: (payload: SearchState) => void;
|
|
@@ -256,6 +257,7 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
256
257
|
isCollaborationEnabled: boolean;
|
|
257
258
|
uiConfigLayout: Layout;
|
|
258
259
|
uiConfigProfile: Profile;
|
|
260
|
+
showMasking: boolean;
|
|
259
261
|
}>>;
|
|
260
262
|
export declare const MdmModuleListenersContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
261
263
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -149,3 +149,4 @@ export declare const useMdmListener: <T extends keyof MdmModuleListenersContextP
|
|
|
149
149
|
}>[T];
|
|
150
150
|
export declare const useMdmHiddenAttributes: () => Record<string, string[]>;
|
|
151
151
|
export declare const useMdmControlAttributes: () => string[];
|
|
152
|
+
export declare const useMdmShowMasking: () => boolean;
|
|
@@ -159,3 +159,4 @@ var emptyControlAttributes = [];
|
|
|
159
159
|
export var useMdmControlAttributes = function () {
|
|
160
160
|
return useMdmModuleValuesContext(function (context) { return context.controlAttributes || emptyControlAttributes; });
|
|
161
161
|
};
|
|
162
|
+
export var useMdmShowMasking = function () { return useMdmModuleValuesContext(function (context) { return context.showMasking; }); };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MdmModuleProvider } from './provider';
|
|
2
|
-
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes } from './hooks';
|
|
2
|
+
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking } from './hooks';
|
|
3
3
|
export type { MdmModuleActionsContextProps, MdmModuleValuesContextProps, MdmModuleListenersContextProps } from './context';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { MdmModuleProvider } from './provider';
|
|
2
|
-
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes } from './hooks';
|
|
2
|
+
export { useMdmAutoCloseInterval, useMdmUiError, useMdmWorkflowEnvironmentUrl, useMdmExportPath, useMdmAbsoluteImagePath, useMdmUiPath, useMdmDtssPath, useMdmServicesPath, useMdmWorkflowPath, useMdmImageServicePath, useMdmReltioPath, useMdmApiPath, useMdmCollaborationPath, useMdmImageAttributesFieldsOrder, useMdmShowEntityId, useMdmPivotingAttributes, useMdmDateMask, useMdmDateTimeMask, useMdmAttributesPresentation, useMdmMaxValuesInResponse, useMdmAttributesSortingStrategy, useMdmLookupAutocomplete, useMdmModifiedEntities, useMdmEntity, useMdmEntityUri, useMdmEntityWithDiff, useMdmEntityUriWithDataTenant, useMdmMode, useMdmIsViewMode, useMdmIsEditableMode, useMdmHistoryDiff, useMdmHistoryMode, useMdmHistorySlice, useMdmHistoryEvent, useMdmProfileLastLoadedTime, useMdmLookups, useMdmDependentLookups, useMdmMetadata, useMdmUser, useMdmUsername, useMdmUserRoles, useMdmTenantObject, useMdmTenant, useMdmTenantName, useMdmEnvironment, useMdmDataTenants, useMdmSearchNavigationData, useMdmSearchProviderData, useMdmIsCollaborationEnabled, useMdmIsWorkflowEnabled, useMdmProfileErrors, useMdmRelationsDrafts, useMdmModifiedEntityDefaultProfilePic, useMdmModifiedEntity, useMdmInitialConnectionTempEntity, useMdmInitialConnection, useMdmDependentLookupEditorState, useMdmActiveErrorsForAttributesPager, useMdmDependentLookupsStructureNode, useMdmAllRelationsToAddAndEdit, useMdmDependentLookupEditorContext, useMdmGlobalSearchRequestOptions, useMdmAuthoringItemsByEntityType, useMdmAction, useMdmListener, useMdmIsSourcesScreenEnabled, useMdmHiddenAttributes, useMdmControlAttributes, useMdmShowMasking } from './hooks';
|
|
@@ -35,21 +35,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { useCallback, useContext } from 'react';
|
|
38
|
-
import {
|
|
38
|
+
import { addGetActivitiesMaskingOptions, getActivities, getActivitiesTotal } from '@reltio/mdm-sdk';
|
|
39
39
|
import { buildActivitiesFilterString } from '../utils/filters';
|
|
40
40
|
import { PageRequestsAbortingContext } from '../../../contexts/PageRequestsAbortingContext';
|
|
41
|
-
import { useMdmMetadata } from '../../../contexts/MdmModuleContext/hooks';
|
|
41
|
+
import { useMdmMetadata, useMdmShowMasking } from '../../../contexts/MdmModuleContext/hooks';
|
|
42
42
|
export var useActivitiesLoader = function (_a) {
|
|
43
43
|
var filter = _a.filter, max = _a.max, offset = _a.offset;
|
|
44
44
|
var signal = useContext(PageRequestsAbortingContext);
|
|
45
45
|
var metadata = useMdmMetadata();
|
|
46
|
+
var showMasking = useMdmShowMasking();
|
|
46
47
|
return useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
48
|
var filterString, options, data, total;
|
|
48
49
|
return __generator(this, function (_a) {
|
|
49
50
|
switch (_a.label) {
|
|
50
51
|
case 0:
|
|
51
52
|
filterString = buildActivitiesFilterString(filter);
|
|
52
|
-
options =
|
|
53
|
+
options = addGetActivitiesMaskingOptions(metadata, { filter: filterString, max: max, offset: offset }, showMasking);
|
|
53
54
|
return [4 /*yield*/, getActivities(options, signal)];
|
|
54
55
|
case 1:
|
|
55
56
|
data = _a.sent();
|
|
@@ -59,5 +60,5 @@ export var useActivitiesLoader = function (_a) {
|
|
|
59
60
|
return [2 /*return*/, { data: data, total: total }];
|
|
60
61
|
}
|
|
61
62
|
});
|
|
62
|
-
}); }, [filter, max, offset, signal]);
|
|
63
|
+
}); }, [filter, max, offset, signal, showMasking]);
|
|
63
64
|
};
|
|
@@ -35,24 +35,25 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { useCallback } from 'react';
|
|
38
|
-
import {
|
|
38
|
+
import { addGetProfileActivitiesMaskingOptions, getProfileActivities, getProfileActivitiesTotal } from '@reltio/mdm-sdk';
|
|
39
39
|
import { buildActivitiesFilterString } from '../utils/filters';
|
|
40
|
-
import { useMdmMetadata } from '../../../contexts/MdmModuleContext/hooks';
|
|
40
|
+
import { useMdmMetadata, useMdmShowMasking } from '../../../contexts/MdmModuleContext/hooks';
|
|
41
41
|
export var useProfileActivitiesLoader = function (_a) {
|
|
42
42
|
var filter = _a.filter, max = _a.max, offset = _a.offset, entityUri = _a.entityUri;
|
|
43
43
|
var metadata = useMdmMetadata();
|
|
44
|
+
var showMasking = useMdmShowMasking();
|
|
44
45
|
return useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
46
|
var filterString, options, data, total;
|
|
46
47
|
return __generator(this, function (_a) {
|
|
47
48
|
switch (_a.label) {
|
|
48
49
|
case 0:
|
|
49
50
|
filterString = buildActivitiesFilterString(filter);
|
|
50
|
-
options =
|
|
51
|
+
options = addGetProfileActivitiesMaskingOptions(metadata, {
|
|
51
52
|
filter: filterString,
|
|
52
53
|
max: max,
|
|
53
54
|
offset: offset,
|
|
54
55
|
entityUri: entityUri
|
|
55
|
-
});
|
|
56
|
+
}, showMasking);
|
|
56
57
|
return [4 /*yield*/, getProfileActivities(options)];
|
|
57
58
|
case 1:
|
|
58
59
|
data = _a.sent();
|
|
@@ -62,5 +63,5 @@ export var useProfileActivitiesLoader = function (_a) {
|
|
|
62
63
|
return [2 /*return*/, { data: data, total: total }];
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
|
-
}); }, [filter, max, offset, entityUri]);
|
|
66
|
+
}); }, [filter, max, offset, entityUri, showMasking]);
|
|
66
67
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { addGetEntityMaskingOptions, getEntityTimeSlice, isEditableMode } from '@reltio/mdm-sdk';
|
|
3
3
|
import { useSafePromise } from '../../../hooks/useSafePromise';
|
|
4
|
-
import { useMdmAction, useMdmHistorySlice, useMdmMetadata, useMdmMode } from '../../../contexts/MdmModuleContext';
|
|
4
|
+
import { useMdmAction, useMdmHistorySlice, useMdmMetadata, useMdmMode, useMdmShowMasking } from '../../../contexts/MdmModuleContext';
|
|
5
5
|
export var useHistorySlice = function (_a) {
|
|
6
6
|
var entity = _a.entity, historyEvent = _a.historyEvent;
|
|
7
7
|
var _b = useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
@@ -11,6 +11,7 @@ export var useHistorySlice = function (_a) {
|
|
|
11
11
|
var historySlice = useMdmHistorySlice();
|
|
12
12
|
var safePromise = useSafePromise();
|
|
13
13
|
var mode = useMdmMode();
|
|
14
|
+
var showMasking = useMdmShowMasking();
|
|
14
15
|
var _c = historyEvent || {}, aStamp = _c.aStamp, bStamp = _c.bStamp, overrideUri = _c.overrideUri;
|
|
15
16
|
var entityUri = overrideUri || (entity === null || entity === void 0 ? void 0 : entity.uri);
|
|
16
17
|
useEffect(function () {
|
|
@@ -24,7 +25,7 @@ export var useHistorySlice = function (_a) {
|
|
|
24
25
|
if (entityUri) {
|
|
25
26
|
if (historyEvent) {
|
|
26
27
|
setIsLoading(true);
|
|
27
|
-
var entityOptions =
|
|
28
|
+
var entityOptions = addGetEntityMaskingOptions(metadata, showMasking);
|
|
28
29
|
safePromise(Promise.all([
|
|
29
30
|
getEntityTimeSlice(entityUri, aStamp, entityOptions),
|
|
30
31
|
bStamp && bStamp !== 1
|
|
@@ -47,6 +48,6 @@ export var useHistorySlice = function (_a) {
|
|
|
47
48
|
setIsLoading(false);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
}, [aStamp, bStamp, entityUri]);
|
|
51
|
+
}, [aStamp, bStamp, entityUri, showMasking]);
|
|
51
52
|
return { isLoading: isLoading, historySlice: historySlice };
|
|
52
53
|
};
|
|
@@ -296,4 +296,17 @@ describe('useHistorySlice tests', function () {
|
|
|
296
296
|
expect(getEntityTimeSlice).toHaveBeenNthCalledWith(1, profileEntity.uri, aStamp, defaultGetEntityOptions);
|
|
297
297
|
expect(getEntityTimeSlice).toHaveBeenNthCalledWith(2, profileEntity.uri, bStamp, defaultGetEntityOptions);
|
|
298
298
|
});
|
|
299
|
+
it('should not call with sendMasked option if configuration showMasking attribute is false', function () {
|
|
300
|
+
var aStamp = 123;
|
|
301
|
+
var bStamp = 321;
|
|
302
|
+
var expectedOptions = { options: 'sendHidden,addRefAttrUriToCrosswalk' };
|
|
303
|
+
var props = { historyEvent: { aStamp: aStamp, bStamp: bStamp }, entity: profileEntity };
|
|
304
|
+
var metadata = createDefaultMetadata();
|
|
305
|
+
metadata.entityTypes[0].attributes[0].masking = { regexPattern: '***' };
|
|
306
|
+
var mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata, showMasking: false });
|
|
307
|
+
setUp(props, mdmValues);
|
|
308
|
+
expect(getEntityTimeSlice).toHaveBeenCalledTimes(2);
|
|
309
|
+
expect(getEntityTimeSlice).toHaveBeenNthCalledWith(1, profileEntity.uri, aStamp, expectedOptions);
|
|
310
|
+
expect(getEntityTimeSlice).toHaveBeenNthCalledWith(2, profileEntity.uri, bStamp, expectedOptions);
|
|
311
|
+
});
|
|
299
312
|
});
|
|
@@ -35,7 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { useCallback, useContext } from 'react';
|
|
38
|
-
import { useMdmIsViewMode, useMdmEntity, useMdmMetadata } from '../../contexts/MdmModuleContext';
|
|
38
|
+
import { useMdmIsViewMode, useMdmEntity, useMdmMetadata, useMdmShowMasking } from '../../contexts/MdmModuleContext';
|
|
39
39
|
import { EntityContext } from '../../contexts/EntityContext';
|
|
40
40
|
import { checkCanUnmaskAttribute, checkDataPermissionsToUnmask, isRelationUri } from '@reltio/mdm-sdk';
|
|
41
41
|
import { useMaskAttributeValue, useUnmaskAttributeValue, useUnmaskedAttributeValue } from '../../contexts/MaskedAttributesContext';
|
|
@@ -46,6 +46,7 @@ export var useMaskedAttribute = function (_a) {
|
|
|
46
46
|
var unmaskAttributeValue = useUnmaskAttributeValue();
|
|
47
47
|
var maskAttributeValue = useMaskAttributeValue();
|
|
48
48
|
var metadata = useMdmMetadata();
|
|
49
|
+
var showMasking = useMdmShowMasking();
|
|
49
50
|
var entityFromContext = useContext(EntityContext);
|
|
50
51
|
var mainEntity = useMdmEntity();
|
|
51
52
|
var entity = entityProp || entityFromContext || mainEntity;
|
|
@@ -58,7 +59,8 @@ export var useMaskedAttribute = function (_a) {
|
|
|
58
59
|
!!attributeType.masking &&
|
|
59
60
|
isViewMode &&
|
|
60
61
|
canUnmaskAttribute &&
|
|
61
|
-
hasUnmaskDataPermissions
|
|
62
|
+
hasUnmaskDataPermissions &&
|
|
63
|
+
showMasking;
|
|
62
64
|
var unmask = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
63
65
|
return __generator(this, function (_a) {
|
|
64
66
|
switch (_a.label) {
|
|
@@ -10,10 +10,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13
|
-
import { ActivityFilter, collectAllTransitiveEntitiesUris, getEntitiesMapForTransitiveMatches, getMatchesForDataTenantEntity, getMatchesFromDataTenants, getTransitiveMatches, isDataTenantEntity, isTempUri, withDtssPotentialItems, addGlobalFilterToQuery,
|
|
13
|
+
import { ActivityFilter, collectAllTransitiveEntitiesUris, getEntitiesMapForTransitiveMatches, getMatchesForDataTenantEntity, getMatchesFromDataTenants, getTransitiveMatches, isDataTenantEntity, isTempUri, withDtssPotentialItems, addGlobalFilterToQuery, addGetTransitiveMatchesMaskingOptions } from '@reltio/mdm-sdk';
|
|
14
14
|
import { usePagingSimulator } from '../usePagingSimulator';
|
|
15
15
|
import { useSafePromise } from '../useSafePromise';
|
|
16
|
-
import { useMdmDataTenants, useMdmDtssPath, useMdmGlobalSearchRequestOptions, useMdmMetadata, useMdmTenant } from '../../contexts/MdmModuleContext';
|
|
16
|
+
import { useMdmDataTenants, useMdmDtssPath, useMdmGlobalSearchRequestOptions, useMdmMetadata, useMdmTenant, useMdmShowMasking } from '../../contexts/MdmModuleContext';
|
|
17
17
|
export var useMatchesLoader = function (_a) {
|
|
18
18
|
var enabled = _a.enabled, entity = _a.entity, filter = _a.filter, rules = _a.rules, onFinishLoading = _a.onFinishLoading, onStartLoading = _a.onStartLoading, options = _a.options, page = _a.page, rowsPerPage = _a.rowsPerPage, sorting = _a.sorting, markMatchedValues = _a.markMatchedValues;
|
|
19
19
|
var _b = sorting || {}, order = _b.order, field = _b.field;
|
|
@@ -24,6 +24,7 @@ export var useMatchesLoader = function (_a) {
|
|
|
24
24
|
var tenant = useMdmTenant();
|
|
25
25
|
var dtssPath = useMdmDtssPath();
|
|
26
26
|
var dataTenants = useMdmDataTenants();
|
|
27
|
+
var showMasking = useMdmShowMasking();
|
|
27
28
|
var _f = useMdmGlobalSearchRequestOptions() || {}, activityFilter = _f.activityFilter, globalFilter = _f.globalFilter;
|
|
28
29
|
var activeness = typeof options.showInactiveEntities === 'boolean'
|
|
29
30
|
? options.showInactiveEntities
|
|
@@ -65,7 +66,7 @@ export var useMatchesLoader = function (_a) {
|
|
|
65
66
|
max: rowsPerPage,
|
|
66
67
|
force: force
|
|
67
68
|
})
|
|
68
|
-
: getTransitiveMatchesWithPaging(__assign(__assign({},
|
|
69
|
+
: getTransitiveMatchesWithPaging(__assign(__assign({}, addGetTransitiveMatchesMaskingOptions(metadata, {
|
|
69
70
|
entityUri: entityUri,
|
|
70
71
|
max: rowsPerPage,
|
|
71
72
|
filter: addGlobalFilterToQuery(globalFilter, filter) || '',
|
|
@@ -75,7 +76,7 @@ export var useMatchesLoader = function (_a) {
|
|
|
75
76
|
markMatchedValues: markMatchedValues,
|
|
76
77
|
deep: options.showTransitiveMatches ? undefined : 1,
|
|
77
78
|
activeness: activeness
|
|
78
|
-
})), { offset: page * rowsPerPage, force: force })))
|
|
79
|
+
}, showMasking)), { offset: page * rowsPerPage, force: force })))
|
|
79
80
|
.then(function (result) {
|
|
80
81
|
var response = result.response, total = result.total, originalResponse = result.originalResponse;
|
|
81
82
|
setTotal(total);
|
|
@@ -114,7 +115,8 @@ export var useMatchesLoader = function (_a) {
|
|
|
114
115
|
page,
|
|
115
116
|
rowsPerPage,
|
|
116
117
|
safePromise,
|
|
117
|
-
tenant
|
|
118
|
+
tenant,
|
|
119
|
+
showMasking
|
|
118
120
|
]);
|
|
119
121
|
useEffect(function () {
|
|
120
122
|
getMatches();
|
|
@@ -69,5 +69,12 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
69
69
|
expect(getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
70
70
|
expect(getTransitiveMatches).toHaveBeenCalledWith(expect.objectContaining({ options: 'sendMasked' }));
|
|
71
71
|
});
|
|
72
|
+
it('should not add sendMasked option if showMasking configuration property is false', function () {
|
|
73
|
+
var metadata = getMetadata();
|
|
74
|
+
metadata.entityTypes[0].attributes[0].masking = { regexPattern: '.{4}$' };
|
|
75
|
+
setUp({ mdmValues: { metadata: metadata, showMasking: false } });
|
|
76
|
+
expect(getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
77
|
+
expect(getTransitiveMatches).toHaveBeenCalledWith(expect.not.objectContaining({ options: 'sendMasked' }));
|
|
78
|
+
});
|
|
72
79
|
});
|
|
73
80
|
});
|
|
@@ -15,7 +15,7 @@ import i18n from 'ui-i18n';
|
|
|
15
15
|
import { ActivityFilter, addGlobalFilterToQuery, getRelationsForDataTenantEntity, getRelationsForEntity, isAvailableEntityTypeUri, isAvailableRelationTypeUri, isDataTenantEntity, getInOutRelationUri, isTempUri, Mode, wrapInArrayIfNeeded, hasRelationMasking } from '@reltio/mdm-sdk';
|
|
16
16
|
import { useSafePromise } from '../useSafePromise';
|
|
17
17
|
import { usePrevious } from '../usePrevious';
|
|
18
|
-
import { useMdmAction, useMdmDtssPath, useMdmGlobalSearchRequestOptions, useMdmMetadata, useMdmProfileLastLoadedTime, useMdmTenant } from '../../contexts/MdmModuleContext';
|
|
18
|
+
import { useMdmAction, useMdmDtssPath, useMdmGlobalSearchRequestOptions, useMdmMetadata, useMdmProfileLastLoadedTime, useMdmShowMasking, useMdmTenant } from '../../contexts/MdmModuleContext';
|
|
19
19
|
var buildSuggestedIds = when(identity, pipe(wrapInArrayIfNeeded, length, times(function (n) { return n + 1; })));
|
|
20
20
|
var isValidRequestConfig = function (config) {
|
|
21
21
|
var _a;
|
|
@@ -37,6 +37,7 @@ export var useRelationsLoader = function (_a) {
|
|
|
37
37
|
var dtssPath = useMdmDtssPath();
|
|
38
38
|
var _d = useMdmGlobalSearchRequestOptions() || {}, activityFilter = _d.activityFilter, globalFilter = _d.globalFilter;
|
|
39
39
|
var lastLoadedTime = useMdmProfileLastLoadedTime();
|
|
40
|
+
var showMasking = useMdmShowMasking();
|
|
40
41
|
var safePromise = useSafePromise();
|
|
41
42
|
var processContent = function (content) {
|
|
42
43
|
var filterRelation = pipe(getInOutRelationUri, isAvailableRelationTypeUri(metadata));
|
|
@@ -48,11 +49,14 @@ export var useRelationsLoader = function (_a) {
|
|
|
48
49
|
})(content);
|
|
49
50
|
};
|
|
50
51
|
var suggested = config.suggested;
|
|
51
|
-
var options = useMemo(function () {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
var options = useMemo(function () {
|
|
53
|
+
var sendMasked = showMasking && hasRelationMasking(metadata) && mode === Mode.Viewing;
|
|
54
|
+
return {
|
|
55
|
+
searchByOv: searchByOv,
|
|
56
|
+
sendMasked: sendMasked,
|
|
57
|
+
searchRelationsWithFilter: searchRelationsWithFilter
|
|
58
|
+
};
|
|
59
|
+
}, [searchByOv, showMasking, metadata, mode, searchRelationsWithFilter]);
|
|
56
60
|
var filters = useMemo(function () {
|
|
57
61
|
var _a;
|
|
58
62
|
return (_a = {},
|
|
@@ -64,7 +64,8 @@ var defaultMdmValues = {
|
|
|
64
64
|
},
|
|
65
65
|
searchOptions: {},
|
|
66
66
|
activityFilter: ActivityFilter.ALL,
|
|
67
|
-
profileLastLoadedTime: 1674037143100
|
|
67
|
+
profileLastLoadedTime: 1674037143100,
|
|
68
|
+
showMasking: true
|
|
68
69
|
};
|
|
69
70
|
var defaultConfig = { id: 'id', content: { inRelations: [], outRelations: [] } };
|
|
70
71
|
var defaultEntity = { attributes: [], uri: '123' };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2135",
|
|
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.1963",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|