@reltio/components 1.4.1861 → 1.4.1863
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ConnectionEditor/ConnectionEditor.js +1 -1
- package/cjs/EntitySelector/EntitySelector.d.ts +1 -1
- package/cjs/EntitySelector/EntitySelector.js +3 -2
- package/cjs/EntitySelector/EntitySelector.test.js +19 -0
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.d.ts +1 -1
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.js +15 -4
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +98 -42
- package/cjs/InlineSimpleAttribute/styles.d.ts +2 -1
- package/cjs/InlineSimpleAttribute/styles.js +14 -5
- package/cjs/MaskingSwitcher/MaskingSwitcher.d.ts +2 -1
- package/cjs/MaskingSwitcher/MaskingSwitcher.js +5 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.js +1 -1
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +1 -2
- package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
- package/cjs/components/RelationEditor/RelationEditor.js +1 -1
- package/cjs/contexts/MaskedAttributesContext/context.d.ts +18 -0
- package/cjs/contexts/MaskedAttributesContext/context.js +141 -0
- package/cjs/contexts/MaskedAttributesContext/hooks.d.ts +7 -3
- package/cjs/contexts/MaskedAttributesContext/hooks.js +18 -9
- package/cjs/contexts/MaskedAttributesContext/index.d.ts +2 -13
- package/cjs/contexts/MaskedAttributesContext/index.js +7 -104
- package/cjs/contexts/index.d.ts +1 -1
- package/cjs/contexts/index.js +2 -3
- package/cjs/hooks/useMaskedAttribute.d.ts +1 -0
- package/cjs/hooks/useMaskedAttribute.js +19 -17
- package/esm/ConnectionEditor/ConnectionEditor.js +1 -1
- package/esm/EntitySelector/EntitySelector.d.ts +1 -1
- package/esm/EntitySelector/EntitySelector.js +3 -2
- package/esm/EntitySelector/EntitySelector.test.js +19 -0
- package/esm/InlineSimpleAttribute/InlineSimpleAttribute.d.ts +1 -1
- package/esm/InlineSimpleAttribute/InlineSimpleAttribute.js +15 -4
- package/esm/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +98 -42
- package/esm/InlineSimpleAttribute/styles.d.ts +2 -1
- package/esm/InlineSimpleAttribute/styles.js +14 -5
- package/esm/MaskingSwitcher/MaskingSwitcher.d.ts +2 -1
- package/esm/MaskingSwitcher/MaskingSwitcher.js +5 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.js +1 -1
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +1 -2
- package/esm/SimpleAttribute/SimpleAttribute.js +1 -1
- package/esm/components/RelationEditor/RelationEditor.js +1 -1
- package/esm/contexts/MaskedAttributesContext/context.d.ts +18 -0
- package/esm/contexts/MaskedAttributesContext/context.js +114 -0
- package/esm/contexts/MaskedAttributesContext/hooks.d.ts +7 -3
- package/esm/contexts/MaskedAttributesContext/hooks.js +14 -6
- package/esm/contexts/MaskedAttributesContext/index.d.ts +2 -13
- package/esm/contexts/MaskedAttributesContext/index.js +2 -79
- package/esm/contexts/index.d.ts +1 -1
- package/esm/contexts/index.js +1 -1
- package/esm/hooks/useMaskedAttribute.d.ts +1 -0
- package/esm/hooks/useMaskedAttribute.js +20 -18
- package/package.json +1 -1
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type UnmaskedAttributesValues = Record<string, SimpleAttributeValue>;
|
|
4
|
-
export type MaskedAttributesContextType = {
|
|
5
|
-
unmaskedAttributesValues: UnmaskedAttributesValues;
|
|
6
|
-
addUnmaskedAttributeValue: (attributeValue: SimpleAttributeValue) => Promise<void>;
|
|
7
|
-
};
|
|
8
|
-
export declare const MaskedAttributesContext: import("@fluentui/react-context-selector").Context<MaskedAttributesContextType>;
|
|
9
|
-
type Props = {
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
};
|
|
12
|
-
export declare const MaskedAttributesProvider: ({ children }: Props) => JSX.Element;
|
|
13
|
-
export {};
|
|
1
|
+
export { MaskedAttributesProvider } from './context';
|
|
2
|
+
export { useUnmaskedAttributeValue, useUnmaskAttributeValue, useMaskAttributeValue } from './hooks';
|
|
@@ -1,106 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
-
exports.
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
exports
|
|
79
|
-
|
|
80
|
-
var children = _a.children;
|
|
81
|
-
var _b = (0, react_1.useState)({}), unmaskedAttributesValues = _b[0], setUnmaskedAttributesValues = _b[1];
|
|
82
|
-
var addUnmaskedAttributeValue = (0, react_1.useCallback)(function (attributeValue) { return __awaiter(void 0, void 0, void 0, function () {
|
|
83
|
-
var unmaskedAttributeValue_1, error_1;
|
|
84
|
-
return __generator(this, function (_a) {
|
|
85
|
-
switch (_a.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
_a.trys.push([0, 2, , 3]);
|
|
88
|
-
return [4 /*yield*/, (0, mdm_sdk_1.getUnmaskedAttributeValue)(attributeValue.uri)];
|
|
89
|
-
case 1:
|
|
90
|
-
unmaskedAttributeValue_1 = _a.sent();
|
|
91
|
-
setUnmaskedAttributesValues(function (prev) {
|
|
92
|
-
var _a;
|
|
93
|
-
return (__assign(__assign({}, prev), (_a = {}, _a[attributeValue.uri] = unmaskedAttributeValue_1, _a)));
|
|
94
|
-
});
|
|
95
|
-
return [3 /*break*/, 3];
|
|
96
|
-
case 2:
|
|
97
|
-
error_1 = _a.sent();
|
|
98
|
-
(0, errors_1.showErrorMessage)(error_1);
|
|
99
|
-
return [3 /*break*/, 3];
|
|
100
|
-
case 3: return [2 /*return*/];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}); }, []);
|
|
104
|
-
return (react_1.default.createElement(exports.MaskedAttributesContext.Provider, { value: { unmaskedAttributesValues: unmaskedAttributesValues, addUnmaskedAttributeValue: addUnmaskedAttributeValue } }, children));
|
|
105
|
-
};
|
|
106
|
-
exports.MaskedAttributesProvider = MaskedAttributesProvider;
|
|
3
|
+
exports.useMaskAttributeValue = exports.useUnmaskAttributeValue = exports.useUnmaskedAttributeValue = exports.MaskedAttributesProvider = void 0;
|
|
4
|
+
var context_1 = require("./context");
|
|
5
|
+
Object.defineProperty(exports, "MaskedAttributesProvider", { enumerable: true, get: function () { return context_1.MaskedAttributesProvider; } });
|
|
6
|
+
var hooks_1 = require("./hooks");
|
|
7
|
+
Object.defineProperty(exports, "useUnmaskedAttributeValue", { enumerable: true, get: function () { return hooks_1.useUnmaskedAttributeValue; } });
|
|
8
|
+
Object.defineProperty(exports, "useUnmaskAttributeValue", { enumerable: true, get: function () { return hooks_1.useUnmaskAttributeValue; } });
|
|
9
|
+
Object.defineProperty(exports, "useMaskAttributeValue", { enumerable: true, get: function () { return hooks_1.useMaskAttributeValue; } });
|
package/cjs/contexts/index.d.ts
CHANGED
|
@@ -34,4 +34,4 @@ export { ConfigPermissionsContext, ConfigPermissionsContextProvider, useAttribut
|
|
|
34
34
|
export * from './MdmModuleContext';
|
|
35
35
|
export { ReloadDataProvider, useReloadData } from './ReloadDataContext';
|
|
36
36
|
export { SegmentationContext } from './SegmentationContext';
|
|
37
|
-
export
|
|
37
|
+
export * from './MaskedAttributesContext';
|
package/cjs/contexts/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.useAttributeValueConfigPermissions = exports.ConfigPermissionsContextProvider = exports.ConfigPermissionsContext = exports.useActionsHook = exports.ActionsHookProvider = exports.PageRequestsAbortingContext = exports.DependentLookupAutopopulationContext = exports.FeaturesContext = exports.LabelsContext = exports.UrlGeneratorsContext = exports.isHighlightedAttributeType = exports.isHighlightedErrorType = exports.ScrollType = exports.ScrollToElementProvider = exports.ScrollToElementContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.SandboxAPIContext = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.useEntityLoadingIndication = exports.EntityLoadingIndicationProvider = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.usePerspectivesSettings = exports.PerspectivesSettingsContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
18
|
-
exports.
|
|
18
|
+
exports.SegmentationContext = exports.useReloadData = exports.ReloadDataProvider = void 0;
|
|
19
19
|
var AsyncMountContext_1 = require("./AsyncMountContext");
|
|
20
20
|
Object.defineProperty(exports, "AsyncMountContext", { enumerable: true, get: function () { return AsyncMountContext_1.AsyncMountContext; } });
|
|
21
21
|
var HistoryAppearanceContext_1 = require("./HistoryAppearanceContext");
|
|
@@ -105,5 +105,4 @@ Object.defineProperty(exports, "ReloadDataProvider", { enumerable: true, get: fu
|
|
|
105
105
|
Object.defineProperty(exports, "useReloadData", { enumerable: true, get: function () { return ReloadDataContext_1.useReloadData; } });
|
|
106
106
|
var SegmentationContext_1 = require("./SegmentationContext");
|
|
107
107
|
Object.defineProperty(exports, "SegmentationContext", { enumerable: true, get: function () { return SegmentationContext_1.SegmentationContext; } });
|
|
108
|
-
|
|
109
|
-
Object.defineProperty(exports, "MaskedAttributesProvider", { enumerable: true, get: function () { return MaskedAttributesContext_1.MaskedAttributesProvider; } });
|
|
108
|
+
__exportStar(require("./MaskedAttributesContext"), exports);
|
|
@@ -8,6 +8,7 @@ declare const useMaskedAttribute: ({ attributeType, attributeValue }: Props) =>
|
|
|
8
8
|
isMasked: boolean;
|
|
9
9
|
toggleMasking: () => void;
|
|
10
10
|
isUnmasking: boolean;
|
|
11
|
+
unmask: () => Promise<void> | Promise<SimpleAttributeValue>;
|
|
11
12
|
attributeValue: SimpleAttributeValue;
|
|
12
13
|
};
|
|
13
14
|
export default useMaskedAttribute;
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var react_1 = require("react");
|
|
4
|
-
var
|
|
4
|
+
var MaskedAttributesContext_1 = require("../contexts/MaskedAttributesContext");
|
|
5
5
|
var useMaskedAttribute = function (_a) {
|
|
6
6
|
var attributeType = _a.attributeType, attributeValue = _a.attributeValue;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setIsUnmasking(true);
|
|
15
|
-
addUnmaskedAttributeValue(attributeValue).finally(function () { return setIsUnmasking(false); });
|
|
16
|
-
}
|
|
17
|
-
}, [isUnmaskingNeeded, isMasked, addUnmaskedAttributeValue, attributeValue, unmaskedAttributeValue]);
|
|
7
|
+
var unmaskAttributeValue = (0, MaskedAttributesContext_1.useUnmaskAttributeValue)();
|
|
8
|
+
var maskAttributeValue = (0, MaskedAttributesContext_1.useMaskAttributeValue)();
|
|
9
|
+
var _b = (0, MaskedAttributesContext_1.useUnmaskedAttributeValue)(attributeValue.uri) || {}, unmaskedAttributeValue = _b.attributeValue, _c = _b.isUnmasked, isUnmasked = _c === void 0 ? false : _c, _d = _b.loading, loading = _d === void 0 ? false : _d;
|
|
10
|
+
var isUnmaskingNeeded = unmaskAttributeValue && maskAttributeValue && !!attributeType.masking;
|
|
11
|
+
var unmask = (0, react_1.useCallback)(function () {
|
|
12
|
+
return isUnmaskingNeeded ? unmaskAttributeValue(attributeValue.uri) : Promise.resolve();
|
|
13
|
+
}, [unmaskAttributeValue, attributeValue.uri, isUnmaskingNeeded]);
|
|
18
14
|
var toggleMasking = (0, react_1.useCallback)(function () {
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (isUnmasked) {
|
|
16
|
+
maskAttributeValue(attributeValue.uri);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
unmask();
|
|
20
|
+
}
|
|
21
|
+
}, [attributeValue.uri, isUnmasked, maskAttributeValue, unmask]);
|
|
21
22
|
return {
|
|
22
23
|
isUnmaskingNeeded: isUnmaskingNeeded,
|
|
23
|
-
isMasked:
|
|
24
|
+
isMasked: !isUnmasked,
|
|
24
25
|
toggleMasking: toggleMasking,
|
|
25
|
-
isUnmasking:
|
|
26
|
-
|
|
26
|
+
isUnmasking: loading,
|
|
27
|
+
unmask: unmask,
|
|
28
|
+
attributeValue: isUnmaskingNeeded && isUnmasked ? unmaskedAttributeValue || attributeValue : attributeValue
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
exports.default = useMaskedAttribute;
|
|
@@ -84,6 +84,6 @@ export var ConnectionEditor = function (_a) {
|
|
|
84
84
|
return (React.createElement(React.Fragment, null,
|
|
85
85
|
onChangeRelationType && (React.createElement(ConnectionRelationTypeSelector, { className: styles.item, relation: selectorCompatibleRelation, metadata: metadata, inRelationTypes: inRelationTypes, outRelationTypes: outRelationTypes, onChange: handleChangeRelationType })),
|
|
86
86
|
onChangeEntity && (React.createElement(ErrorWrapper, { errorMessage: entityErrorMessage, className: styles.item },
|
|
87
|
-
React.createElement(EntitySelector, { key: relationTypeUri, className: classnames((_b = {}, _b[styles.dense] = entityErrorMessage, _b)), entity: selectorCompatibleEntity || {}, entityTypesUris: availableEntityTypeUris,
|
|
87
|
+
React.createElement(EntitySelector, { key: relationTypeUri, className: classnames((_b = {}, _b[styles.dense] = entityErrorMessage, _b)), entity: selectorCompatibleEntity || {}, entityTypesUris: availableEntityTypeUris, globalSearchRequestOptions: globalSearchRequestOptions, mode: Mode.Editing, onChange: onChangeEntity, onCreate: undefined, metadata: metadata, attributeTypesSelectionStrategy: undefined }))),
|
|
88
88
|
relationTypeUri && (React.createElement(EditModeAttributesList, { attrTypes: relationAttrTypes, entity: attributeListEntity, showEmptyEditors: showEmptyEditors, mode: Mode.Editing, parentUri: relationUri, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onRemoveAttribute }))));
|
|
89
89
|
};
|
|
@@ -33,10 +33,11 @@ import { Group } from './components/Group';
|
|
|
33
33
|
import { EntityCreator } from '../EntityCreator';
|
|
34
34
|
import { buildEntityOptions } from './helpers';
|
|
35
35
|
import { useStyles } from './styles';
|
|
36
|
+
var DEFAULT_MAX_TYPEAHEAD_SEARCH_OPTION = 20;
|
|
36
37
|
export var EntitySelector = function (_a) {
|
|
37
|
-
var _b = _a.entity, entity = _b === void 0 ? {} : _b, _c = _a.entityTypesUris, entityTypesUris = _c === void 0 ? [] : _c, mode = _a.mode,
|
|
38
|
+
var _b = _a.entity, entity = _b === void 0 ? {} : _b, _c = _a.entityTypesUris, entityTypesUris = _c === void 0 ? [] : _c, mode = _a.mode, _d = _a.max, max = _d === void 0 ? DEFAULT_MAX_TYPEAHEAD_SEARCH_OPTION : _d, onChange = _a.onChange, onCreate = _a.onCreate, metadata = _a.metadata, globalSearchRequestOptions = _a.globalSearchRequestOptions, attributeTypesSelectionStrategy = _a.attributeTypesSelectionStrategy, _e = _a.disableLinkClick, disableLinkClick = _e === void 0 ? false : _e, otherProps = __rest(_a, ["entity", "entityTypesUris", "mode", "max", "onChange", "onCreate", "metadata", "globalSearchRequestOptions", "attributeTypesSelectionStrategy", "disableLinkClick"]);
|
|
38
39
|
var styles = useStyles();
|
|
39
|
-
var
|
|
40
|
+
var _f = useState(''), inputValue = _f[0], setInputValue = _f[1];
|
|
40
41
|
var entityTypes = useMemo(function () { return entityTypesUris.map(function (type) { return getEntityType(metadata, type); }).filter(isAvailableEntityType); }, [entityTypesUris, metadata]);
|
|
41
42
|
var options = __assign(__assign({}, globalSearchRequestOptions), { max: max });
|
|
42
43
|
var handleCreate = onCreate
|
|
@@ -138,6 +138,25 @@ describe('EntitySelector', function () {
|
|
|
138
138
|
done();
|
|
139
139
|
});
|
|
140
140
|
});
|
|
141
|
+
it('should call typeAheadSearch on DropDownSelector "getOptions" prop calling with default max param', function (done) {
|
|
142
|
+
var entityTypesUris = ['configuration/entityTypes/HCP'];
|
|
143
|
+
var tempEntity = {
|
|
144
|
+
entityUri: 'entities/uri$$12345',
|
|
145
|
+
entityType: entityTypesUris[0]
|
|
146
|
+
};
|
|
147
|
+
var wrapper = shallow(React.createElement(EntitySelector, { entity: tempEntity, onChange: mockOnChange, entityTypesUris: entityTypesUris, metadata: metadata }));
|
|
148
|
+
wrapper
|
|
149
|
+
.find('DropDownSelector')
|
|
150
|
+
.prop('getOptions')()
|
|
151
|
+
.then(function () {
|
|
152
|
+
var entityTypes = [metadata.entityTypes[0]];
|
|
153
|
+
var options = {
|
|
154
|
+
max: 20
|
|
155
|
+
};
|
|
156
|
+
expect(typeAheadSearchSpy).toHaveBeenCalledWith(entityTypes, undefined, options);
|
|
157
|
+
done();
|
|
158
|
+
});
|
|
159
|
+
});
|
|
141
160
|
it('should render EntityCreator in case temp entity', function () {
|
|
142
161
|
var mdmValues = { modifiedEntities: {} };
|
|
143
162
|
var entityTypesUris = ['configuration/entityTypes/HCP'];
|
|
@@ -14,5 +14,5 @@ type Props = {
|
|
|
14
14
|
onIgnore: (event: IgnoreInlineAttributeEvent) => void;
|
|
15
15
|
isEmpty: boolean;
|
|
16
16
|
};
|
|
17
|
-
export declare const InlineSimpleAttribute: ({ className, dataReltioId, attributeType, attributeValue, crosswalk, disableEdit, disableDelete, onIgnore, onEdit, onPin, onDelete, isEmpty }: Props) => JSX.Element;
|
|
17
|
+
export declare const InlineSimpleAttribute: ({ className, dataReltioId, attributeType, attributeValue: rawAttributeValue, crosswalk, disableEdit, disableDelete, onIgnore, onEdit, onPin, onDelete, isEmpty }: Props) => JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -14,10 +14,16 @@ import { PinButton } from '../PinButton';
|
|
|
14
14
|
import { CrosswalkMenuItem } from './components/CrosswalkMenuItem';
|
|
15
15
|
import { useAttributeState } from '../hooks/useAttributeState';
|
|
16
16
|
import { useCrosswalkColor, useCrosswalkHighlight } from '../contexts/CrosswalksDisplayContext';
|
|
17
|
+
import useMaskedAttribute from '../hooks/useMaskedAttribute';
|
|
18
|
+
import { MaskingSwitcher } from '../MaskingSwitcher';
|
|
17
19
|
import { useStyles } from './styles';
|
|
18
20
|
export var InlineSimpleAttribute = function (_a) {
|
|
19
|
-
var className = _a.className, dataReltioId = _a.dataReltioId, _b = _a.attributeType, attributeType = _b === void 0 ? null : _b,
|
|
21
|
+
var className = _a.className, dataReltioId = _a.dataReltioId, _b = _a.attributeType, attributeType = _b === void 0 ? null : _b, rawAttributeValue = _a.attributeValue, crosswalk = _a.crosswalk, disableEdit = _a.disableEdit, disableDelete = _a.disableDelete, onIgnore = _a.onIgnore, onEdit = _a.onEdit, onPin = _a.onPin, onDelete = _a.onDelete, isEmpty = _a.isEmpty;
|
|
20
22
|
var _c = useAttributeState(), isReadingMode = _c.isReadingMode, isEditingMode = _c.isEditingMode, isHovered = _c.isHovered, onMouseEnter = _c.onMouseEnter, onMouseLeave = _c.onMouseLeave, setReadingMode = _c.setReadingMode, setEditingMode = _c.setEditingMode;
|
|
23
|
+
var _d = useMaskedAttribute({
|
|
24
|
+
attributeType: attributeType,
|
|
25
|
+
attributeValue: rawAttributeValue
|
|
26
|
+
}), isUnmaskingNeeded = _d.isUnmaskingNeeded, isMasked = _d.isMasked, toggleMasking = _d.toggleMasking, attributeValue = _d.attributeValue, isUnmasking = _d.isUnmasking, unmask = _d.unmask;
|
|
21
27
|
var containerRef = useRef();
|
|
22
28
|
var id = getLastUriPart(attributeValue.uri);
|
|
23
29
|
var crosswalkDisabled = isCrosswalkDisabled(crosswalk);
|
|
@@ -28,18 +34,20 @@ export var InlineSimpleAttribute = function (_a) {
|
|
|
28
34
|
var hasBasicPermission = checkBasicMetadataPermission(MetadataPermissions.UPDATE, attributeType) && !disableEdit && canModifyAttribute;
|
|
29
35
|
var showPin = !isTemporary && ((!isReadingMode && hasBasicPermission) || attributeValue.pin);
|
|
30
36
|
var showIgnore = !isTemporary && ((!isReadingMode && hasBasicPermission) || attributeValue.ignored);
|
|
37
|
+
var showMaskingSwitcher = (isUnmaskingNeeded && !isTemporary && !isReadingMode) || isUnmasking;
|
|
31
38
|
useEffect(function () {
|
|
32
39
|
if (isTemporary && !isEmpty) {
|
|
33
40
|
setEditingMode();
|
|
34
41
|
}
|
|
35
42
|
}, [isEmpty]);
|
|
36
43
|
var color = useCrosswalkColor(crosswalk);
|
|
37
|
-
var
|
|
44
|
+
var _e = useCrosswalkHighlight(crosswalk), isHighlighted = _e.isHighlighted, isDimmed = _e.isDimmed, highlightCrosswalk = _e.highlightCrosswalk, removeHighlight = _e.removeHighlight;
|
|
38
45
|
var styles = useStyles({
|
|
39
46
|
variant: crosswalkDisabled ? 'outlined' : 'filled',
|
|
40
47
|
opaque: !isDimmed,
|
|
41
48
|
fullyColored: isHighlighted,
|
|
42
|
-
color: isDimmed ? 'rgba(0, 0, 0, 0.12)' : color
|
|
49
|
+
color: isDimmed ? 'rgba(0, 0, 0, 0.12)' : color,
|
|
50
|
+
hasMasking: isUnmaskingNeeded
|
|
43
51
|
});
|
|
44
52
|
var actions = [
|
|
45
53
|
{
|
|
@@ -51,7 +59,9 @@ export var InlineSimpleAttribute = function (_a) {
|
|
|
51
59
|
text: i18n.text('Edit'),
|
|
52
60
|
icon: React.createElement(EditIcon, null),
|
|
53
61
|
tooltip: canEdit ? null : i18n.text("You don't have permissions to edit"),
|
|
54
|
-
onClick: function () {
|
|
62
|
+
onClick: function () {
|
|
63
|
+
unmask().then(setEditingMode);
|
|
64
|
+
},
|
|
55
65
|
id: 'edit'
|
|
56
66
|
},
|
|
57
67
|
{
|
|
@@ -85,6 +95,7 @@ export var InlineSimpleAttribute = function (_a) {
|
|
|
85
95
|
React.createElement("div", { className: styles.actions },
|
|
86
96
|
showPin && (React.createElement(PinButton, { isPinned: attributeValue.pin, onClick: function () { return onPin({ attributeValue: attributeValue }); }, disabled: !hasBasicPermission })),
|
|
87
97
|
showIgnore && (React.createElement(IgnoreButton, { isIgnored: attributeValue.ignored, onClick: function () { return onIgnore({ attributeValue: attributeValue }); }, disabled: !hasBasicPermission })),
|
|
98
|
+
showMaskingSwitcher && (React.createElement(MaskingSwitcher, { className: styles.maskingControl, isMasked: isMasked, onToggleMasking: toggleMasking, isUnmasking: isUnmasking })),
|
|
88
99
|
isHovered && !isAutoGeneratedAttribute(attributeType) && (React.createElement(DropDownMenuButton, { MenuItemRenderer: CrosswalkMenuItem, menuId: "simple-attribute-additional-actions-".concat(id), buttonComponent: SmallIconButtonWithTooltip, buttonProps: {
|
|
89
100
|
icon: MoreVertIcon,
|
|
90
101
|
size: 'XS',
|
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
import React from 'react';
|
|
13
49
|
import { mount } from 'enzyme';
|
|
14
50
|
import { act } from 'react-dom/test-utils';
|
|
@@ -287,48 +323,68 @@ describe('Inline simple attribute tests', function () {
|
|
|
287
323
|
attributeValue: value
|
|
288
324
|
});
|
|
289
325
|
});
|
|
290
|
-
it('should render InlineSimpleAttributeEditor on Edit menu item click', function () {
|
|
291
|
-
var props
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
326
|
+
it('should render InlineSimpleAttributeEditor on Edit menu item click', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
327
|
+
var props, wrapper, onMouseEnter, actionItems;
|
|
328
|
+
return __generator(this, function (_a) {
|
|
329
|
+
switch (_a.label) {
|
|
330
|
+
case 0:
|
|
331
|
+
props = __assign({ attributeValue: value, attributeType: attributeType, crosswalk: crosswalk, className: 'simpleAttribute' }, actions);
|
|
332
|
+
wrapper = setUp(props);
|
|
333
|
+
onMouseEnter = wrapper.find('.simpleAttribute').at(2).prop('onMouseEnter');
|
|
334
|
+
act(function () {
|
|
335
|
+
onMouseEnter();
|
|
336
|
+
});
|
|
337
|
+
wrapper.update();
|
|
338
|
+
actionItems = wrapper.find(DropDownMenuButton).prop('menuItems');
|
|
339
|
+
act(function () {
|
|
340
|
+
var _a, _b;
|
|
341
|
+
(_b = (_a = actionItems[1]).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
342
|
+
});
|
|
343
|
+
return [4 /*yield*/, Promise.resolve()];
|
|
344
|
+
case 1:
|
|
345
|
+
_a.sent();
|
|
346
|
+
wrapper.update();
|
|
347
|
+
expect(wrapper.find(InlineSimpleAttributeEditor)).toHaveLength(1);
|
|
348
|
+
return [2 /*return*/];
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}); });
|
|
352
|
+
it('should call props.onEdit when call onEdit prop of InlineSimpleAttributeEditor', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
353
|
+
var props, wrapper, event, actionItems, newAttributeValue;
|
|
354
|
+
return __generator(this, function (_a) {
|
|
355
|
+
switch (_a.label) {
|
|
356
|
+
case 0:
|
|
357
|
+
props = __assign({ attributeValue: value, attributeType: attributeType, crosswalk: crosswalk, className: 'simpleAttribute' }, actions);
|
|
358
|
+
wrapper = setUp(props);
|
|
359
|
+
event = {};
|
|
360
|
+
act(function () {
|
|
361
|
+
var _a;
|
|
362
|
+
(_a = wrapper.find('.simpleAttribute').at(2).prop('onMouseEnter')) === null || _a === void 0 ? void 0 : _a(event);
|
|
363
|
+
});
|
|
364
|
+
wrapper.update();
|
|
365
|
+
actionItems = wrapper.find(DropDownMenuButton).prop('menuItems');
|
|
366
|
+
act(function () {
|
|
367
|
+
var _a, _b;
|
|
368
|
+
(_b = (_a = actionItems[1]).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
369
|
+
});
|
|
370
|
+
return [4 /*yield*/, Promise.resolve()];
|
|
371
|
+
case 1:
|
|
372
|
+
_a.sent();
|
|
373
|
+
wrapper.update();
|
|
374
|
+
newAttributeValue = {
|
|
375
|
+
uri: 'entities/123/attributes/String/123',
|
|
376
|
+
value: 'Test update'
|
|
377
|
+
};
|
|
378
|
+
wrapper.find(InlineSimpleAttributeEditor).prop('onEdit')(newAttributeValue);
|
|
379
|
+
expect(actions.onEdit).toBeCalledWith({
|
|
380
|
+
attributeType: attributeType,
|
|
381
|
+
attributeValue: newAttributeValue,
|
|
382
|
+
crosswalk: crosswalk
|
|
383
|
+
});
|
|
384
|
+
return [2 /*return*/];
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}); });
|
|
332
388
|
it('should disable edit, pin, delete and ignore actions if it is system attribute', function () {
|
|
333
389
|
var props = __assign({ attributeValue: value, attributeType: __assign(__assign({}, attributeType), { system: true }), crosswalk: crosswalk, className: 'simpleAttribute' }, actions);
|
|
334
390
|
var wrapper = setUp(props);
|
|
@@ -3,6 +3,7 @@ type StylesProps = {
|
|
|
3
3
|
fullyColored: boolean;
|
|
4
4
|
opaque: boolean;
|
|
5
5
|
color: string;
|
|
6
|
+
hasMasking: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"attributeValue" | "root" | "actions">;
|
|
8
|
+
export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"attributeValue" | "root" | "actions" | "maskingControl">;
|
|
8
9
|
export {};
|
|
@@ -44,10 +44,19 @@ export var useStyles = makeStyles(function () { return ({
|
|
|
44
44
|
lineHeight: '14px',
|
|
45
45
|
width: 'calc(100% - 71px)'
|
|
46
46
|
},
|
|
47
|
-
actions: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
actions: function (_a) {
|
|
48
|
+
var hasMasking = _a.hasMasking;
|
|
49
|
+
return ({
|
|
50
|
+
display: 'flex',
|
|
51
|
+
width: "".concat(71 + (hasMasking ? 20 : 0), "px"),
|
|
52
|
+
justifyContent: 'flex-end',
|
|
53
|
+
marginRight: '4px'
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
maskingControl: {
|
|
57
|
+
flexShrink: 0,
|
|
58
|
+
marginLeft: '2px',
|
|
59
|
+
height: '20px !important', // important to override inline circular progress styles
|
|
60
|
+
width: '20px !important'
|
|
52
61
|
}
|
|
53
62
|
}); });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
type MaskingSwitcherProps = {
|
|
2
|
+
className?: string;
|
|
2
3
|
isMasked: boolean;
|
|
3
4
|
isUnmasking?: boolean;
|
|
4
5
|
onToggleMasking: () => void;
|
|
5
6
|
};
|
|
6
|
-
export declare const MaskingSwitcher: ({ isMasked, isUnmasking, onToggleMasking }: MaskingSwitcherProps) => JSX.Element;
|
|
7
|
+
export declare const MaskingSwitcher: ({ className, isMasked, isUnmasking, onToggleMasking }: MaskingSwitcherProps) => JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
2
3
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
3
4
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
4
5
|
import Tooltip from '@mui/material/Tooltip';
|
|
@@ -7,7 +8,9 @@ import CircularProgress from '@mui/material/CircularProgress';
|
|
|
7
8
|
import i18n from 'ui-i18n';
|
|
8
9
|
import { useStyles } from './styles';
|
|
9
10
|
export var MaskingSwitcher = function (_a) {
|
|
10
|
-
var isMasked = _a.isMasked, isUnmasking = _a.isUnmasking, onToggleMasking = _a.onToggleMasking;
|
|
11
|
+
var className = _a.className, isMasked = _a.isMasked, isUnmasking = _a.isUnmasking, onToggleMasking = _a.onToggleMasking;
|
|
11
12
|
var styles = useStyles();
|
|
12
|
-
|
|
13
|
+
var tooltipTitle = isMasked ? i18n.text('Show') : i18n.text('Hide');
|
|
14
|
+
return isUnmasking ? (React.createElement(CircularProgress, { size: 16, className: classnames(className, styles.switcherWrapper) })) : (React.createElement(Tooltip, { key: String(isMasked), title: tooltipTitle },
|
|
15
|
+
React.createElement(IconButton, { "aria-label": tooltipTitle, onClick: onToggleMasking, className: classnames(className, styles.switcherWrapper) }, isMasked ? React.createElement(VisibilityIcon, { className: styles.icon }) : React.createElement(VisibilityOffIcon, { className: styles.icon }))));
|
|
13
16
|
};
|
|
@@ -122,7 +122,7 @@ var ReferenceAttributeEditor = function (props) {
|
|
|
122
122
|
React.createElement(ErrorWrapper, { errorMessage: errorMessage },
|
|
123
123
|
React.createElement(EntitySelector, { className: classnames(styles.item, (_a = {},
|
|
124
124
|
_a[styles.dense] = errorMessage || (selectedEntity && isTempUri(selectedEntity.entityUri)),
|
|
125
|
-
_a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris,
|
|
125
|
+
_a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, isDisabled: !canChangeReferencedEntity, onChange: onChangeEntity, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy })))));
|
|
126
126
|
};
|
|
127
127
|
export default withContext(ScrollToElementContext, function (contextValue, _a) {
|
|
128
128
|
var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
@@ -267,11 +267,10 @@ describe('ReferenceAttributeEditor', function () {
|
|
|
267
267
|
entityType: 'refEntityType'
|
|
268
268
|
});
|
|
269
269
|
});
|
|
270
|
-
it('should has correct
|
|
270
|
+
it('should has correct mode and metadata props', function () {
|
|
271
271
|
var props = __assign(__assign({}, defaultProps), { mode: Mode.Suggesting });
|
|
272
272
|
var component = setUp({ props: props });
|
|
273
273
|
var entitySelector = component.find(EntitySelector);
|
|
274
|
-
expect(entitySelector.prop('max')).toBe(20);
|
|
275
274
|
expect(entitySelector.prop('mode')).toBe(props.mode);
|
|
276
275
|
expect(entitySelector.prop('metadata')).toBe(defaultMdmValues.metadata);
|
|
277
276
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { getAttrDataTypeDefinition, getHistoryAppearanceByUri, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris, isOv, getHistoryAttributeClassName, isRelationUri } from '@reltio/mdm-sdk';
|
|
3
|
-
import { MaskingSwitcher } from '../MaskingSwitcher';
|
|
4
3
|
import classnames from 'classnames';
|
|
5
4
|
import useMaskedAttribute from '../hooks/useMaskedAttribute';
|
|
6
5
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../constants/classnames';
|
|
@@ -10,6 +9,7 @@ import { CommentsContainer } from '../CommentsContainer';
|
|
|
10
9
|
import { DataTypeValue } from '../DataTypeValue';
|
|
11
10
|
import { PivotingTooltip } from '../PivotingTooltip';
|
|
12
11
|
import { useStyles } from './styles';
|
|
12
|
+
import { MaskingSwitcher } from '../MaskingSwitcher';
|
|
13
13
|
export var SimpleAttribute = function (_a) {
|
|
14
14
|
var _b, _c, _d, _e, _f;
|
|
15
15
|
var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, rawAttributeValue = _a.attributeValue, inlined = _a.inlined;
|