@reltio/components 1.4.2133 → 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/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +2 -2
- package/AttributesFiltersButton/AttributesFiltersButton.d.ts +2 -2
- package/HOCs/withFilter/components/ColumnFilter/ColumnFilter.js +3 -2
- 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/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +2 -2
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.d.ts +2 -2
- package/cjs/HOCs/withFilter/components/ColumnFilter/ColumnFilter.js +2 -1
- 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/helpers/attributesSelector.d.ts +1 -1
- package/cjs/helpers/attributesSelector.js +1 -1
- 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/helpers/attributesSelector.d.ts +1 -1
- package/helpers/attributesSelector.js +1 -1
- 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
|
@@ -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
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AttributeType, Metadata } from '@reltio/mdm-sdk';
|
|
2
2
|
import { AttributeSelectorItemsGroup, AttributesTypesGroup } from '../types';
|
|
3
3
|
export declare const getOperationalTypeUriFromAttrTypes: (attributeTypes: AttributeType[]) => any;
|
|
4
|
-
export declare const getAttributeSelectorItems: (metadata: Metadata, attributesTypesGroups: AttributesTypesGroup[], attributesTypesGroupFilter: (
|
|
4
|
+
export declare const getAttributeSelectorItems: (metadata: Metadata, attributesTypesGroups: AttributesTypesGroup[], attributesTypesGroupFilter: (attributeSelectorItemsGroup: AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[];
|
|
@@ -73,7 +73,7 @@ var getAttributeSelectorItems = function (metadata, attributesTypesGroups, attri
|
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
75
|
return attributesTypesGroupFilter
|
|
76
|
-
? attributesTypesGroupFilter(
|
|
76
|
+
? attributesTypesGroupFilter(attributeSelectorItemsGroup)
|
|
77
77
|
: attributeSelectorItemsGroup;
|
|
78
78
|
};
|
|
79
79
|
exports.getAttributeSelectorItems = getAttributeSelectorItems;
|
|
@@ -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
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AttributeType, Metadata } from '@reltio/mdm-sdk';
|
|
2
2
|
import { AttributeSelectorItemsGroup, AttributesTypesGroup } from '../types';
|
|
3
3
|
export declare const getOperationalTypeUriFromAttrTypes: (attributeTypes: AttributeType[]) => any;
|
|
4
|
-
export declare const getAttributeSelectorItems: (metadata: Metadata, attributesTypesGroups: AttributesTypesGroup[], attributesTypesGroupFilter: (
|
|
4
|
+
export declare const getAttributeSelectorItems: (metadata: Metadata, attributesTypesGroups: AttributesTypesGroup[], attributesTypesGroupFilter: (attributeSelectorItemsGroup: AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[]) => AttributeSelectorItemsGroup[];
|
|
@@ -69,6 +69,6 @@ export var getAttributeSelectorItems = function (metadata, attributesTypesGroups
|
|
|
69
69
|
};
|
|
70
70
|
});
|
|
71
71
|
return attributesTypesGroupFilter
|
|
72
|
-
? attributesTypesGroupFilter(
|
|
72
|
+
? attributesTypesGroupFilter(attributeSelectorItemsGroup)
|
|
73
73
|
: attributeSelectorItemsGroup;
|
|
74
74
|
};
|
|
@@ -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",
|