@reltio/components 1.4.1870 → 1.4.1872
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/ControlAttributeIcon/ControlAttributeIcon.d.ts +1 -0
- package/cjs/ControlAttributeIcon/ControlAttributeIcon.js +56 -0
- package/cjs/ControlAttributeIcon/index.d.ts +1 -0
- package/cjs/ControlAttributeIcon/index.js +5 -0
- package/cjs/ControlAttributeIcon/styles.d.ts +1 -0
- package/cjs/ControlAttributeIcon/styles.js +11 -0
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +5 -0
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +5 -0
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +29 -1
- package/cjs/contexts/MdmModuleContext/context.d.ts +6 -2
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +3 -1
- package/cjs/contexts/MdmModuleContext/hooks.js +9 -3
- package/cjs/contexts/MdmModuleContext/index.d.ts +1 -1
- package/cjs/contexts/MdmModuleContext/index.js +2 -1
- package/cjs/contexts/MdmModuleContext/selectors/dependentLookupEditorContext.d.ts +2 -1
- package/cjs/contexts/MdmModuleContext/selectors/dependentLookupEditorContext.js +12 -8
- package/cjs/hooks/useHiddenAttributes/useHiddenAttributes.js +6 -2
- package/cjs/icons/ControlAttribute.d.ts +3 -0
- package/cjs/icons/ControlAttribute.js +25 -0
- package/cjs/icons/index.d.ts +1 -0
- package/cjs/icons/index.js +4 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +5 -3
- package/esm/ControlAttributeIcon/ControlAttributeIcon.d.ts +1 -0
- package/esm/ControlAttributeIcon/ControlAttributeIcon.js +26 -0
- package/esm/ControlAttributeIcon/index.d.ts +1 -0
- package/esm/ControlAttributeIcon/index.js +1 -0
- package/esm/ControlAttributeIcon/styles.d.ts +1 -0
- package/esm/ControlAttributeIcon/styles.js +8 -0
- package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +5 -0
- package/esm/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +6 -1
- package/esm/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +6 -1
- package/esm/contexts/MdmModuleContext/context.d.ts +6 -2
- package/esm/contexts/MdmModuleContext/hooks.d.ts +3 -1
- package/esm/contexts/MdmModuleContext/hooks.js +7 -2
- package/esm/contexts/MdmModuleContext/index.d.ts +1 -1
- package/esm/contexts/MdmModuleContext/index.js +1 -1
- package/esm/contexts/MdmModuleContext/selectors/dependentLookupEditorContext.d.ts +2 -1
- package/esm/contexts/MdmModuleContext/selectors/dependentLookupEditorContext.js +12 -8
- package/esm/hooks/useHiddenAttributes/useHiddenAttributes.js +6 -2
- package/esm/icons/ControlAttribute.d.ts +3 -0
- package/esm/icons/ControlAttribute.js +20 -0
- package/esm/icons/index.d.ts +1 -0
- package/esm/icons/index.js +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ControlAttributeIcon: () => JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.ControlAttributeIcon = void 0;
|
|
41
|
+
var react_1 = __importStar(require("react"));
|
|
42
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
43
|
+
var ControlAttribute_1 = __importDefault(require("../icons/ControlAttribute"));
|
|
44
|
+
var withTooltip_1 = require("../HOCs/withTooltip");
|
|
45
|
+
var styles_1 = require("./styles");
|
|
46
|
+
var ControlAttributeForwarded = (0, react_1.forwardRef)(function (props, ref) {
|
|
47
|
+
return (react_1.default.createElement("span", __assign({}, props, { ref: ref }),
|
|
48
|
+
react_1.default.createElement(ControlAttribute_1.default, null)));
|
|
49
|
+
});
|
|
50
|
+
ControlAttributeForwarded.displayName = 'ControlAttributeForwarded';
|
|
51
|
+
var ControlAttributeWithTooltip = (0, withTooltip_1.withTooltip)(ControlAttributeForwarded);
|
|
52
|
+
var ControlAttributeIcon = function () {
|
|
53
|
+
var styles = (0, styles_1.useStyles)();
|
|
54
|
+
return (react_1.default.createElement(ControlAttributeWithTooltip, { "data-reltio-id": "reltio-control-attribute-icon", tooltipTitle: ui_i18n_1.default.text('This is a control attribute. Changing this value will affect availability of other dynamic attributes.'), className: styles.icon }));
|
|
55
|
+
};
|
|
56
|
+
exports.ControlAttributeIcon = ControlAttributeIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ControlAttributeIcon } from './ControlAttributeIcon';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ControlAttributeIcon = void 0;
|
|
4
|
+
var ControlAttributeIcon_1 = require("./ControlAttributeIcon");
|
|
5
|
+
Object.defineProperty(exports, "ControlAttributeIcon", { enumerable: true, get: function () { return ControlAttributeIcon_1.ControlAttributeIcon; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon">;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@mui/styles");
|
|
5
|
+
exports.useStyles = (0, styles_1.makeStyles)({
|
|
6
|
+
icon: {
|
|
7
|
+
display: 'inline-flex',
|
|
8
|
+
marginLeft: '8px',
|
|
9
|
+
verticalAlign: 'middle'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -40,9 +40,11 @@ var EditModeAttributesFactory_1 = require("../../../EditModeAttributesFactory");
|
|
|
40
40
|
var CardinalityMessage_1 = require("../../../CardinalityMessage");
|
|
41
41
|
var PinnedAttributesContext_1 = require("../../../contexts/PinnedAttributesContext");
|
|
42
42
|
var DescriptionIcon_1 = require("../../../DescriptionIcon");
|
|
43
|
+
var ControlAttributeIcon_1 = require("../../../ControlAttributeIcon");
|
|
43
44
|
var useScrollToAttribute_1 = require("../../../hooks/useScrollToAttribute/useScrollToAttribute");
|
|
44
45
|
var useScrollToAttributeError_1 = require("../../../hooks/useScrollToAttributeError/useScrollToAttributeError");
|
|
45
46
|
var helpers_1 = require("../../helpers");
|
|
47
|
+
var contexts_1 = require("../../../contexts");
|
|
46
48
|
var styles_1 = require("../../styles");
|
|
47
49
|
var AttributeRenderer = function (_a) {
|
|
48
50
|
var max = _a.max, values = _a.values, attributeType = _a.attributeType, parentUri = _a.parentUri, mode = _a.mode, drawLines = _a.drawLines, showEmptyEditors = _a.showEmptyEditors, errorMessage = _a.errorMessage, errors = _a.errors, paging = _a.paging, crosswalks = _a.crosswalks, showNonOv = _a.showNonOv, nonVisibleValues = _a.nonVisibleValues, highlightedError = _a.highlightedError, highlightedAttribute = _a.highlightedAttribute, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, onDeactivateError = _a.onDeactivateError, additionalControlsRenderer = _a.additionalControlsRenderer, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues;
|
|
@@ -57,6 +59,8 @@ var AttributeRenderer = function (_a) {
|
|
|
57
59
|
var isPinned = (0, react_1.useMemo)(function () { return pinnedAttributes === null || pinnedAttributes === void 0 ? void 0 : pinnedAttributes.includes(attributeTypeUri); }, [attributeTypeUri, pinnedAttributes]);
|
|
58
60
|
var isEmptyValues = (0, mdm_sdk_1.isEmptyValue)(values);
|
|
59
61
|
var showEmpty = ((!hadDeletions && showEmptyEditors) || isRequired || isPinned) && isEmptyValues;
|
|
62
|
+
var controlAttributes = (0, contexts_1.useMdmControlAttributes)();
|
|
63
|
+
var isControlAttribute = (0, react_1.useMemo)(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
60
64
|
var emptyEditorValue = (0, react_1.useRef)((0, mdm_sdk_1.createNewAttribute)({
|
|
61
65
|
parentUri: parentUri,
|
|
62
66
|
attributeType: (0, ramda_1.omit)(['defaultValue'], attributeType)
|
|
@@ -116,6 +120,7 @@ var AttributeRenderer = function (_a) {
|
|
|
116
120
|
react_1.default.createElement("div", { className: styles.titleWrapper },
|
|
117
121
|
react_1.default.createElement(Title_1.default, { label: label, isRequired: isRequired, className: styles.title, "data-reltio-id": "reltio-attribute-label" }),
|
|
118
122
|
react_1.default.createElement(DescriptionIcon_1.DescriptionIcon, { description: description }),
|
|
123
|
+
isControlAttribute && react_1.default.createElement(ControlAttributeIcon_1.ControlAttributeIcon, null),
|
|
119
124
|
react_1.default.createElement(OvIcon_1.OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues })),
|
|
120
125
|
isEditableMode && react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality }),
|
|
121
126
|
isEditableMode && react_1.default.createElement(ErrorMessage_1.ErrorMessage, { message: errorMessage, className: styles.typeError }),
|
|
@@ -36,11 +36,15 @@ var ShowMore_1 = require("../../../ShowMore");
|
|
|
36
36
|
var ShowLess_1 = require("../../../ShowLess");
|
|
37
37
|
var OvIcon_1 = require("../../../OvIcon");
|
|
38
38
|
var DescriptionIcon_1 = require("../../../DescriptionIcon");
|
|
39
|
+
var ControlAttributeIcon_1 = require("../../../ControlAttributeIcon");
|
|
40
|
+
var contexts_1 = require("../../../contexts");
|
|
39
41
|
var styles_1 = require("../../styles");
|
|
40
42
|
var MultiLineRenderer = function (_a) {
|
|
41
43
|
var max = _a.max, values = _a.values, nonVisibleValues = _a.nonVisibleValues, totalVisibleValues = _a.totalVisibleValues, attributeType = _a.attributeType, parentUri = _a.parentUri, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
42
44
|
var styles = (0, styles_1.useMultiLineStyles)();
|
|
43
45
|
var _b = (0, react_1.useState)(max), visibleValuesCount = _b[0], setVisibleValuesCount = _b[1];
|
|
46
|
+
var controlAttributes = (0, contexts_1.useMdmControlAttributes)();
|
|
47
|
+
var isControlAttribute = (0, react_1.useMemo)(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
44
48
|
var hasPaging = max < totalVisibleValues;
|
|
45
49
|
var showMore = hasPaging && visibleValuesCount < totalVisibleValues;
|
|
46
50
|
var showLess = hasPaging && visibleValuesCount >= totalVisibleValues;
|
|
@@ -66,6 +70,7 @@ var MultiLineRenderer = function (_a) {
|
|
|
66
70
|
react_1.default.createElement("div", { className: styles.titleRow },
|
|
67
71
|
react_1.default.createElement(Title_1.default, { label: label, className: (0, classnames_1.default)(styles.title, titleClassName), "data-reltio-id": "reltio-attribute-label" }),
|
|
68
72
|
react_1.default.createElement(DescriptionIcon_1.DescriptionIcon, { description: description }),
|
|
73
|
+
isControlAttribute && react_1.default.createElement(ControlAttributeIcon_1.ControlAttributeIcon, null),
|
|
69
74
|
react_1.default.createElement(OvIcon_1.OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues })),
|
|
70
75
|
react_1.default.createElement("div", { className: styles.attributes }, shownValues.map(function (value) { return (react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, { key: value.uri, className: (0, classnames_1.default)(styles.attribute, contentClassName), attributeValue: value, attributeType: attributeType, showNonOv: showNonOv })); })),
|
|
71
76
|
showMore && (react_1.default.createElement(ShowMore_1.ShowMore, { moreNumber: (0, ramda_1.min)(max, hiddenValuesCount), valueNumber: hiddenValuesCount, onClick: onShowMore })),
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.OneLineRenderer = void 0;
|
|
7
|
-
var react_1 =
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
8
31
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
9
32
|
var classnames_1 = __importDefault(require("classnames"));
|
|
10
33
|
var constants_1 = require("../../../constants");
|
|
@@ -13,11 +36,15 @@ var Title_1 = __importDefault(require("../../../components/Title/Title"));
|
|
|
13
36
|
var OvIcon_1 = require("../../../OvIcon");
|
|
14
37
|
var DescriptionIcon_1 = require("../../../DescriptionIcon");
|
|
15
38
|
var ReadOnlyAttributesFactory_1 = require("../../../ReadOnlyAttributesFactory");
|
|
39
|
+
var ControlAttributeIcon_1 = require("../../../ControlAttributeIcon");
|
|
40
|
+
var contexts_1 = require("../../../contexts");
|
|
16
41
|
var styles_1 = require("../../styles");
|
|
17
42
|
var OneLineRenderer = function (_a) {
|
|
18
43
|
var value = _a.value, nonVisibleValues = _a.nonVisibleValues, attributeType = _a.attributeType, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
19
44
|
var styles = (0, styles_1.useOneLineStyles)();
|
|
20
45
|
var label = attributeType.label, description = attributeType.description;
|
|
46
|
+
var controlAttributes = (0, contexts_1.useMdmControlAttributes)();
|
|
47
|
+
var isControlAttribute = (0, react_1.useMemo)(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
21
48
|
var objectType = (0, mdm_sdk_1.isRelationUri)(value.uri)
|
|
22
49
|
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
23
50
|
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
@@ -25,6 +52,7 @@ var OneLineRenderer = function (_a) {
|
|
|
25
52
|
react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.titleRow, styles.wrapper) },
|
|
26
53
|
react_1.default.createElement(Title_1.default, { label: label, className: (0, classnames_1.default)(styles.title, titleClassName), "data-reltio-id": "reltio-attribute-label" }),
|
|
27
54
|
react_1.default.createElement(DescriptionIcon_1.DescriptionIcon, { description: description, className: styles.descriptionIcon }),
|
|
55
|
+
isControlAttribute && react_1.default.createElement(ControlAttributeIcon_1.ControlAttributeIcon, null),
|
|
28
56
|
react_1.default.createElement(OvIcon_1.OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues }),
|
|
29
57
|
react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, { className: (0, classnames_1.default)(styles.attribute, contentClassName), attributeValue: value, attributeType: attributeType, showNonOv: showNonOv, inlined: true })),
|
|
30
58
|
react_1.default.createElement(CommentsContainer_1.CommentsContainer, { uri: value.uri, relatedObjectUris: (0, mdm_sdk_1.createRelatedObjectUris)(objectType, {
|
|
@@ -32,7 +32,8 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
32
32
|
mode: Mode;
|
|
33
33
|
isViewMode: boolean;
|
|
34
34
|
isEditableMode: boolean;
|
|
35
|
-
hiddenAttributes: string[]
|
|
35
|
+
hiddenAttributes: Record<string, string[]>;
|
|
36
|
+
controlAttributes: string[];
|
|
36
37
|
historyDiff: HistoryDiff;
|
|
37
38
|
historyMode: HistoryMode;
|
|
38
39
|
historySlice: HistorySlice;
|
|
@@ -117,6 +118,7 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
117
118
|
editRelation: (id: string, connection: Connection) => void;
|
|
118
119
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
119
120
|
resetHiddenAttributes: (uri: string) => void;
|
|
121
|
+
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
120
122
|
}>;
|
|
121
123
|
export type MdmModuleListenersContextProps = Partial<{
|
|
122
124
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -185,6 +187,7 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
185
187
|
editRelation: (id: string, connection: Connection) => void;
|
|
186
188
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
187
189
|
resetHiddenAttributes: (uri: string) => void;
|
|
190
|
+
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
188
191
|
}>>;
|
|
189
192
|
export declare const MdmModuleValuesContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
190
193
|
autoCloseInterval: number;
|
|
@@ -218,7 +221,8 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
218
221
|
mode: Mode;
|
|
219
222
|
isViewMode: boolean;
|
|
220
223
|
isEditableMode: boolean;
|
|
221
|
-
hiddenAttributes: string[]
|
|
224
|
+
hiddenAttributes: Record<string, string[]>;
|
|
225
|
+
controlAttributes: string[];
|
|
222
226
|
historyDiff: HistoryDiff;
|
|
223
227
|
historyMode: HistoryMode;
|
|
224
228
|
historySlice: HistorySlice;
|
|
@@ -71,7 +71,7 @@ export declare const useMdmDependentLookupEditorContext: (attributeValue: Simple
|
|
|
71
71
|
};
|
|
72
72
|
export declare const useMdmGlobalSearchRequestOptions: (omittingFields?: string[]) => import("@reltio/mdm-sdk").GlobalSearchRequestOptions;
|
|
73
73
|
export declare const useMdmAuthoringItemsByEntityType: (entityTypeUri: string) => import("@reltio/mdm-sdk").AuthoringItem[];
|
|
74
|
-
export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent" | "openConsoleApp" | "addAttributes" | "modifyAttribute" | "removeAttribute" | "entityDeleted" | "entityCreated" | "errorDeactivated" | "requestNextPageOfAttributeValues" | "openEntity" | "setDefaultProfilePicForModifiedEntity" | "setDefaultProfilePicForEntity" | "dependentLookupsEditorTouched" | "openPivotingPerspective" | "lookupsLoaded" | "lookupsForTypeResolved" | "errorSet" | "setHistoryMode" | "modeUpdated" | "setHistoryEvent" | "clearHistoryEvent" | "clearHistoryDiff" | "setHistoryDiff" | "setHistorySlice" | "updateSearchNavigationDataFields" | "openPerspective" | "entityDeletionFinished" | "loadEntity" | "updateSearchNavigationDataOnMerge" | "lookupsListResolved" | "relationsLoaded" | "setInitialInfo" | "setRelationType" | "closeRelationEditor" | "openRelationEditor" | "setRelationEntity" | "errorsSet" | "addRelation" | "editRelation" | "updateHiddenAttributes" | "resetHiddenAttributes">(action: T) => Partial<{
|
|
74
|
+
export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent" | "openConsoleApp" | "addAttributes" | "modifyAttribute" | "removeAttribute" | "entityDeleted" | "entityCreated" | "errorDeactivated" | "requestNextPageOfAttributeValues" | "openEntity" | "setDefaultProfilePicForModifiedEntity" | "setDefaultProfilePicForEntity" | "dependentLookupsEditorTouched" | "openPivotingPerspective" | "lookupsLoaded" | "lookupsForTypeResolved" | "errorSet" | "setHistoryMode" | "modeUpdated" | "setHistoryEvent" | "clearHistoryEvent" | "clearHistoryDiff" | "setHistoryDiff" | "setHistorySlice" | "updateSearchNavigationDataFields" | "openPerspective" | "entityDeletionFinished" | "loadEntity" | "updateSearchNavigationDataOnMerge" | "lookupsListResolved" | "relationsLoaded" | "setInitialInfo" | "setRelationType" | "closeRelationEditor" | "openRelationEditor" | "setRelationEntity" | "errorsSet" | "addRelation" | "editRelation" | "updateHiddenAttributes" | "resetHiddenAttributes" | "updateControlAttributes">(action: T) => Partial<{
|
|
75
75
|
openSearch: (payload: import("@reltio/mdm-sdk").SearchState) => void;
|
|
76
76
|
openHistoryEvent: (payload: {
|
|
77
77
|
entityUri: string;
|
|
@@ -133,6 +133,7 @@ export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent"
|
|
|
133
133
|
editRelation: (id: string, connection: import("@reltio/mdm-sdk").Connection) => void;
|
|
134
134
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
135
135
|
resetHiddenAttributes: (uri: string) => void;
|
|
136
|
+
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
136
137
|
}>[T];
|
|
137
138
|
export declare const useMdmListener: <T extends "expandInvalidRelatonsListener" | "cleanseLoadingListener" | "searchNavigationListener">(listener: T) => Partial<{
|
|
138
139
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -140,3 +141,4 @@ export declare const useMdmListener: <T extends "expandInvalidRelatonsListener"
|
|
|
140
141
|
searchNavigationListener: (action: import("../..").AnyAction, state: any, dispatch: (action: import("../..").AnyAction) => void) => void;
|
|
141
142
|
}>[T];
|
|
142
143
|
export declare const useMdmHiddenAttributes: () => {};
|
|
144
|
+
export declare const useMdmControlAttributes: () => any[];
|
|
@@ -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.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.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");
|
|
@@ -182,7 +182,7 @@ var useMdmRelationsDrafts = function (viewId) {
|
|
|
182
182
|
exports.useMdmRelationsDrafts = useMdmRelationsDrafts;
|
|
183
183
|
var useMdmDependentLookupEditorContext = function (attributeValue, attributeType) {
|
|
184
184
|
var value = useMdmModuleValuesContext(function (context) {
|
|
185
|
-
var _a;
|
|
185
|
+
var _a, _b, _c;
|
|
186
186
|
return (0, dependentLookupEditorContext_1.getDependentLookupEditorContext)({
|
|
187
187
|
dependentLookups: context.dependentLookups,
|
|
188
188
|
metadata: context.metadata,
|
|
@@ -190,7 +190,8 @@ var useMdmDependentLookupEditorContext = function (attributeValue, attributeType
|
|
|
190
190
|
modifiedEntities: context.modifiedEntities,
|
|
191
191
|
entityUri: (_a = context.entity) === null || _a === void 0 ? void 0 : _a.uri,
|
|
192
192
|
attributeValue: attributeValue,
|
|
193
|
-
attributeType: attributeType
|
|
193
|
+
attributeType: attributeType,
|
|
194
|
+
hiddenAttributes: (_b = context.hiddenAttributes) === null || _b === void 0 ? void 0 : _b[(_c = context.entity) === null || _c === void 0 ? void 0 : _c.uri]
|
|
194
195
|
});
|
|
195
196
|
});
|
|
196
197
|
return value;
|
|
@@ -225,3 +226,8 @@ var useMdmHiddenAttributes = function () {
|
|
|
225
226
|
return useMdmModuleValuesContext(function (context) { return context.hiddenAttributes || emptyHiddenAttributesObject; });
|
|
226
227
|
};
|
|
227
228
|
exports.useMdmHiddenAttributes = useMdmHiddenAttributes;
|
|
229
|
+
var emptyControlAttributes = [];
|
|
230
|
+
var useMdmControlAttributes = function () {
|
|
231
|
+
return useMdmModuleValuesContext(function (context) { return context.controlAttributes || emptyControlAttributes; });
|
|
232
|
+
};
|
|
233
|
+
exports.useMdmControlAttributes = useMdmControlAttributes;
|
|
@@ -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 } 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 } 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.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.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");
|
|
@@ -72,3 +72,4 @@ Object.defineProperty(exports, "useMdmAction", { enumerable: true, get: function
|
|
|
72
72
|
Object.defineProperty(exports, "useMdmListener", { enumerable: true, get: function () { return hooks_1.useMdmListener; } });
|
|
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
|
+
Object.defineProperty(exports, "useMdmControlAttributes", { enumerable: true, get: function () { return hooks_1.useMdmControlAttributes; } });
|
|
@@ -17,6 +17,7 @@ type CommonProps = {
|
|
|
17
17
|
type GetDependentLookupEditorContextProps = CommonProps & {
|
|
18
18
|
attributeValue: SimpleAttributeValue;
|
|
19
19
|
attributeType: AttributeType;
|
|
20
|
+
hiddenAttributes?: string[];
|
|
20
21
|
};
|
|
21
|
-
export declare const getDependentLookupEditorContext: ({ dependentLookups, metadata, modifiedEntities, entityUri, relations, attributeValue, attributeType }: GetDependentLookupEditorContextProps) => DependentLookupEditorContext;
|
|
22
|
+
export declare const getDependentLookupEditorContext: ({ dependentLookups, metadata, modifiedEntities, entityUri, relations, attributeValue, attributeType, hiddenAttributes }: GetDependentLookupEditorContextProps) => DependentLookupEditorContext;
|
|
22
23
|
export {};
|
|
@@ -57,8 +57,10 @@ exports.buildMissedParentsMessage = buildMissedParentsMessage;
|
|
|
57
57
|
var getTypesMapKey = function (parent) { return "".concat(parent.type, "_").concat((0, mdm_sdk_1.getParentUri)(parent.uri)); };
|
|
58
58
|
var getParents = function (_a) {
|
|
59
59
|
var _b;
|
|
60
|
-
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, node = _a.node, valueUri = _a.valueUri;
|
|
61
|
-
var parentNodesValues = node.parents
|
|
60
|
+
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, node = _a.node, valueUri = _a.valueUri, hiddenAttributes = _a.hiddenAttributes;
|
|
61
|
+
var parentNodesValues = node.parents
|
|
62
|
+
.filter(function (type) { return !hiddenAttributes.includes(type); })
|
|
63
|
+
.flatMap(function (type) {
|
|
62
64
|
var parentNode = (0, mdm_sdk_1.getDependentLookupsStructureNode)(dependentLookups, type);
|
|
63
65
|
return parentNode.values.map(function (value) { return (__assign(__assign({}, value), { type: type, dependentLookupCode: parentNode.attrType.dependentLookupCode })); });
|
|
64
66
|
});
|
|
@@ -72,6 +74,7 @@ var getParents = function (_a) {
|
|
|
72
74
|
});
|
|
73
75
|
var possibleParentBaseTypeUris = (0, ramda_1.pipe)(mdm_sdk_1.getAttributeValuePath, (0, ramda_1.defaultTo)([]), (0, ramda_1.map)((0, ramda_1.pipe)((0, ramda_1.path)(['valueType', 'uri']), mdm_sdk_1.getBaseUri)), (0, ramda_1.prepend)((_b = modifiedEntities[entityUri]) === null || _b === void 0 ? void 0 : _b.type), (0, ramda_1.reject)(ramda_1.isNil), ramda_1.uniq)({ entityUri: entityUri, entitiesMap: modifiedEntities, connections: connections, metadata: metadata }, valueUri);
|
|
74
76
|
var neededParentsAttributeTypes = node.parents
|
|
77
|
+
.filter(function (type) { return !hiddenAttributes.includes(type); })
|
|
75
78
|
.filter(function (typeUri) { return possibleParentBaseTypeUris.some((0, mdm_sdk_1.areOneHierarchyUris)(typeUri)); })
|
|
76
79
|
.map(function (typeUri) {
|
|
77
80
|
var parentNode = (0, mdm_sdk_1.getDependentLookupsStructureNode)(dependentLookups, typeUri);
|
|
@@ -95,24 +98,25 @@ var getParents = function (_a) {
|
|
|
95
98
|
return { parents: parents, missedParentsAttributeTypes: missedParentsAttributeTypes };
|
|
96
99
|
};
|
|
97
100
|
var getDependentLookupEditorContext = function (_a) {
|
|
98
|
-
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
99
|
-
if (!(0, mdm_sdk_1.isDependentLookupAttrType)(attributeType)) {
|
|
101
|
+
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, attributeValue = _a.attributeValue, attributeType = _a.attributeType, _b = _a.hiddenAttributes, hiddenAttributes = _b === void 0 ? [] : _b;
|
|
102
|
+
if (!(0, mdm_sdk_1.isDependentLookupAttrType)(attributeType) || hiddenAttributes.includes(attributeType.uri)) {
|
|
100
103
|
return null;
|
|
101
104
|
}
|
|
102
105
|
var attributeTypeUri = attributeType.uri;
|
|
103
106
|
var node = (0, mdm_sdk_1.getDependentLookupsStructureNode)(dependentLookups, attributeTypeUri);
|
|
104
107
|
if (node) {
|
|
105
108
|
var valueUri = attributeValue.uri;
|
|
106
|
-
var
|
|
109
|
+
var _c = getParents({
|
|
107
110
|
dependentLookups: dependentLookups,
|
|
108
111
|
metadata: metadata,
|
|
109
112
|
modifiedEntities: modifiedEntities,
|
|
110
113
|
entityUri: entityUri,
|
|
111
114
|
relations: relations,
|
|
112
115
|
valueUri: valueUri,
|
|
113
|
-
node: node
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
node: node,
|
|
117
|
+
hiddenAttributes: hiddenAttributes
|
|
118
|
+
}), parents = _c.parents, missedParentsAttributeTypes = _c.missedParentsAttributeTypes;
|
|
119
|
+
var _d = ((0, mdm_sdk_1.getDependentLookupEditorState)(dependentLookups, valueUri) || {}).isBlocked, isBlocked = _d === void 0 ? false : _d;
|
|
116
120
|
var missedParentsMessage = (0, exports.buildMissedParentsMessage)(missedParentsAttributeTypes);
|
|
117
121
|
var isEmptyValue = !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.lookupCode) && !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value);
|
|
118
122
|
var placeholder = (isEmptyValue && isBlocked && ui_i18n_1.default.text('Populating values...')) ||
|
|
@@ -29,6 +29,7 @@ var useHiddenAttributes = function () {
|
|
|
29
29
|
var resetHiddenAttributes = (0, hooks_1.useMdmAction)('resetHiddenAttributes');
|
|
30
30
|
var hiddenAttributes = (0, hooks_1.useMdmHiddenAttributes)();
|
|
31
31
|
var currentEntityHiddenAttributes = (0, react_1.useMemo)(function () { return hiddenAttributes[entityUri] || []; }, [hiddenAttributes, entityUri]);
|
|
32
|
+
var updateControlAttributes = (0, hooks_1.useMdmAction)('updateControlAttributes');
|
|
32
33
|
var ruleBasedAttributes = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.getRuleBasedAttributes)(metadata, entity === null || entity === void 0 ? void 0 : entity.type); }, [metadata, entity === null || entity === void 0 ? void 0 : entity.type]);
|
|
33
34
|
var parsedRuleBasedAttributes = (0, react_1.useMemo)(function () {
|
|
34
35
|
return ruleBasedAttributes.map(function (rule) {
|
|
@@ -36,8 +37,8 @@ var useHiddenAttributes = function () {
|
|
|
36
37
|
return (__assign(__assign({}, (0, mdm_sdk_1.parseRuleBasedAttribute)(rule)), { showAttributeURIs: ((_a = rule === null || rule === void 0 ? void 0 : rule.controlFunction) === null || _a === void 0 ? void 0 : _a.showAttributeURI) || [] }));
|
|
37
38
|
});
|
|
38
39
|
}, [ruleBasedAttributes]);
|
|
39
|
-
var
|
|
40
|
-
var changedAttributes = (0, useChangedAttributes_1.useChangedAttributes)(entity === null || entity === void 0 ? void 0 : entity.attributes,
|
|
40
|
+
var newControlAttributes = (0, react_1.useMemo)(function () { return (0, ramda_1.pipe)((0, ramda_1.pluck)('controlAttributes'), ramda_1.flatten, ramda_1.uniq)(parsedRuleBasedAttributes); }, [parsedRuleBasedAttributes]);
|
|
41
|
+
var changedAttributes = (0, useChangedAttributes_1.useChangedAttributes)(entity === null || entity === void 0 ? void 0 : entity.attributes, newControlAttributes);
|
|
41
42
|
var showAttributeURIs = (0, react_1.useMemo)(function () {
|
|
42
43
|
return changedAttributes.length ? (0, helpers_1.findShowAttributeURIs)(changedAttributes, parsedRuleBasedAttributes) : [];
|
|
43
44
|
}, [parsedRuleBasedAttributes, changedAttributes]);
|
|
@@ -57,6 +58,9 @@ var useHiddenAttributes = function () {
|
|
|
57
58
|
updateHiddenAttributes(entityUri, (0, ramda_1.without)(showAttributeURIs, currentEntityHiddenAttributes).concat(addedHiddenAttributes));
|
|
58
59
|
}
|
|
59
60
|
}, [addedHiddenAttributes, showAttributeURIs, entityUri]);
|
|
61
|
+
(0, react_1.useEffect)(function () {
|
|
62
|
+
updateControlAttributes(newControlAttributes);
|
|
63
|
+
}, [newControlAttributes]);
|
|
60
64
|
(0, react_1.useEffect)(function () { return function () { return resetHiddenAttributes(entityUri); }; }, [entityUri]);
|
|
61
65
|
};
|
|
62
66
|
exports.useHiddenAttributes = useHiddenAttributes;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var SvgControlAttribute = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ width: 12, height: 12, viewBox: "2 2 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
20
|
+
react_1.default.createElement("mask", { id: "path-1-inside-1_1184_29788", fill: "white" },
|
|
21
|
+
react_1.default.createElement("path", { d: "M10.9656 9.20314C10.6874 9.8892 10.1798 10.4576 9.52953 10.8114C8.87921 11.1652 8.12633 11.2826 7.39917 11.1435C6.67201 11.0045 6.01556 10.6176 5.54167 10.0488C5.06778 9.48 4.80577 8.76449 4.80029 8.02417C4.79481 7.28385 5.04619 6.56454 5.5116 5.98879C5.97702 5.41304 6.62767 5.01647 7.35269 4.86667C8.07771 4.71686 8.83225 4.82308 9.48773 5.16723C10.1432 5.51138 10.6591 6.07216 10.9475 6.75403L9.57285 7.33537C9.41898 6.97153 9.14371 6.6723 8.79394 6.48867C8.44418 6.30503 8.04156 6.24835 7.65469 6.32829C7.26782 6.40822 6.92064 6.61983 6.67229 6.92704C6.42395 7.23426 6.28981 7.61809 6.29274 8.01312C6.29566 8.40815 6.43547 8.78994 6.68833 9.09345C6.9412 9.39696 7.29148 9.6034 7.67949 9.67759C8.0675 9.75179 8.46924 9.68916 8.81624 9.50036C9.16325 9.31157 9.43406 9.00829 9.58253 8.64221L10.9656 9.20314Z" })),
|
|
22
|
+
react_1.default.createElement("path", { d: "M10.9656 9.20314C10.6874 9.8892 10.1798 10.4576 9.52953 10.8114C8.87921 11.1652 8.12633 11.2826 7.39917 11.1435C6.67201 11.0045 6.01556 10.6176 5.54167 10.0488C5.06778 9.48 4.80577 8.76449 4.80029 8.02417C4.79481 7.28385 5.04619 6.56454 5.5116 5.98879C5.97702 5.41304 6.62767 5.01647 7.35269 4.86667C8.07771 4.71686 8.83225 4.82308 9.48773 5.16723C10.1432 5.51138 10.6591 6.07216 10.9475 6.75403L9.57285 7.33537C9.41898 6.97153 9.14371 6.6723 8.79394 6.48867C8.44418 6.30503 8.04156 6.24835 7.65469 6.32829C7.26782 6.40822 6.92064 6.61983 6.67229 6.92704C6.42395 7.23426 6.28981 7.61809 6.29274 8.01312C6.29566 8.40815 6.43547 8.78994 6.68833 9.09345C6.9412 9.39696 7.29148 9.6034 7.67949 9.67759C8.0675 9.75179 8.46924 9.68916 8.81624 9.50036C9.16325 9.31157 9.43406 9.00829 9.58253 8.64221L10.9656 9.20314Z", stroke: "#72828B", strokeWidth: "4", mask: "url(#path-1-inside-1_1184_29788)" }),
|
|
23
|
+
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.29694 8.96529C3.70237 10.9507 5.33344 12.4899 7.36532 12.7582V14.3687C4.44846 14.0817 2.10658 11.8364 1.67215 8.96529H3.29694ZM7.36532 3.24137C5.22186 3.52443 3.52444 5.22184 3.24137 7.36529H1.63086C1.92888 4.33725 4.33727 1.92886 7.36532 1.63086V3.24137ZM12.7582 7.36529C12.4899 5.33344 10.9507 3.70239 8.96532 3.29694V1.67216C11.8364 2.10659 14.0817 4.44845 14.3687 7.36529H12.7582ZM12.7027 8.96529C12.3195 10.8416 10.8416 12.3195 8.96532 12.7027V14.3275C11.7269 13.9096 13.9096 11.7269 14.3275 8.96529H12.7027Z", fill: "#72828B" })));
|
|
24
|
+
};
|
|
25
|
+
exports.default = SvgControlAttribute;
|
package/cjs/icons/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as Calendar } from './Calendar';
|
|
|
5
5
|
export { default as CollaborationIcon } from './CollaborationIcon';
|
|
6
6
|
export { default as Comment } from './Comment';
|
|
7
7
|
export { default as CommentBubble } from './CommentBubble';
|
|
8
|
+
export { default as ControlAttribute } from './ControlAttribute';
|
|
8
9
|
export { default as Copy } from './Copy';
|
|
9
10
|
export { default as Create } from './Create';
|
|
10
11
|
export { default as DcrTaskIcon } from './DcrTaskIcon';
|
package/cjs/icons/index.js
CHANGED
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.UploadIcon = exports.UnMerge = exports.Tenant = exports.Table = exports.SimpleAttribute = exports.SelectAttributes = exports.Search = exports.ResizeIconInline = exports.Remove = exports.ReferenceAttribute = void 0;
|
|
6
|
+
exports.Reassign = exports.ReadOnlyError = exports.Radius = exports.Profile = exports.PotentialMatch = exports.Polygon = exports.PmTaskIcon = exports.PmIcon = exports.PivotingIcon = exports.PinOutlined = exports.Pin = exports.NotMatchRule = exports.NotMatchDark = exports.NoMatches = exports.NoDataSearch = exports.NoData = exports.NestedAttribute = exports.NegativeRuleTooltipIcon = exports.NegativeRuleIcon = exports.MlMatch = exports.MergeDark = exports.Merge = exports.LogOut = exports.LogIn = exports.IgnoredOutlined = exports.Ignored = exports.Hyperlink = exports.Filter = exports.Error = exports.EmptySearchResults = exports.EmptyLoading = exports.Duplicate = exports.Draw = exports.Download = exports.Details = exports.Description = exports.DeleteRequestTaskIcon = exports.DefaultTaskIcon = exports.DefaultImage = exports.DcrTaskIcon = exports.Create = exports.Copy = exports.ControlAttribute = exports.CommentBubble = exports.Comment = exports.CollaborationIcon = exports.Calendar = exports.AttributesList = exports.AddComment = exports.Add = void 0;
|
|
7
|
+
exports.UploadIcon = exports.UnMerge = exports.Tenant = exports.Table = exports.SimpleAttribute = exports.SelectAttributes = exports.Search = exports.ResizeIconInline = exports.Remove = exports.ReferenceAttribute = exports.Recommended = void 0;
|
|
8
8
|
var Add_1 = require("./Add");
|
|
9
9
|
Object.defineProperty(exports, "Add", { enumerable: true, get: function () { return __importDefault(Add_1).default; } });
|
|
10
10
|
var AddComment_1 = require("./AddComment");
|
|
@@ -19,6 +19,8 @@ var Comment_1 = require("./Comment");
|
|
|
19
19
|
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return __importDefault(Comment_1).default; } });
|
|
20
20
|
var CommentBubble_1 = require("./CommentBubble");
|
|
21
21
|
Object.defineProperty(exports, "CommentBubble", { enumerable: true, get: function () { return __importDefault(CommentBubble_1).default; } });
|
|
22
|
+
var ControlAttribute_1 = require("./ControlAttribute");
|
|
23
|
+
Object.defineProperty(exports, "ControlAttribute", { enumerable: true, get: function () { return __importDefault(ControlAttribute_1).default; } });
|
|
22
24
|
var Copy_1 = require("./Copy");
|
|
23
25
|
Object.defineProperty(exports, "Copy", { enumerable: true, get: function () { return __importDefault(Copy_1).default; } });
|
|
24
26
|
var Create_1 = require("./Create");
|
package/cjs/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { ChartsFactory } from './ChartsFactory';
|
|
|
31
31
|
export { CollapseRowButton } from './CollapseRowButton';
|
|
32
32
|
export { ColorBar } from './ColorBar';
|
|
33
33
|
export { ColumnsSettings, ColumnsSettingsPopup } from './ColumnsSettings';
|
|
34
|
+
export { ControlAttributeIcon } from './ControlAttributeIcon';
|
|
34
35
|
export { DefaultCellValueRenderer } from './DefaultCellValueRenderer';
|
|
35
36
|
export { DescriptionIcon } from './DescriptionIcon';
|
|
36
37
|
export { DropDownMenuButton } from './DropDownMenuButton';
|
package/cjs/index.js
CHANGED
|
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.CrosswalkType = exports.AttributesTable = exports.CrosswalkDragLayer = exports.SourceCrosswalksRow = exports.CrosswalkEditor = exports.useModifiedEntity = exports.useCrosswalkActions = exports.groupCrosswalksByTypesAndSources = exports.ActivityTypes = exports.useProfileActivitiesLoader = exports.useActivitiesLoader = exports.ActivityLogFilter = exports.ActivityLog = exports.rerenderWrapper = exports.mockElementSizes = exports.mockBasicTableSizing = exports.getMuiIconByName = exports.delayPromise = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsFilter = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.SaveSegmentDialog = exports.MaskingSwitcher = exports.FileTypeEditor = exports.EmptySearchResult = exports.DropDownEditor = exports.FilterValueEditor = exports.MultiValueChip = exports.TextEditor = exports.DateRangeEditor = exports.NumberEditor = exports.DataTypeValueEditor = exports.DateEditor = void 0;
|
|
17
|
+
exports.PieChart = exports.OvIcon = exports.NestedAttributeEditor = exports.NestedAttribute = exports.MoreAttributesButton = exports.InlineReferenceAttribute = exports.InlineNestedAttribute = exports.InlineImageAttribute = exports.InlineAttributesPager = exports.EditableImageAttributesLine = exports.FilterButton = exports.FacetViewHeader = exports.ExpandedValueTooltip = exports.EntitySelector = exports.EntityCreator = exports.AttributesPager = exports.AttributesList = exports.EditableAttribute = exports.DropDownMenuButton = exports.DescriptionIcon = exports.DefaultCellValueRenderer = exports.ControlAttributeIcon = exports.ColumnsSettingsPopup = exports.ColumnsSettings = exports.ColorBar = exports.CollapseRowButton = exports.ChartsFactory = exports.CardinalityMessage = exports.BranchDecorator = exports.BasicViewHeader = exports.BasicViewContent = exports.BasicView = exports.BasicTablePagination = exports.basicTableViewState = exports.BasicTable = exports.BasicAttributeSelector = exports.BarChart = exports.AvatarWithFallback = exports.AutoSizeList = exports.AttributesView = exports.AttributesValuesEditor = exports.AttributesFiltersButton = exports.AttributesFiltersBuilder = exports.AttributesFilterSelector = exports.AttributesErrorsPanel = exports.AttributeListItem = exports.AttributeGroupIcon = exports.ArrowExpandButton = exports.ActionsPanel = exports.ActionButton = void 0;
|
|
18
|
+
exports.ErrorMessage = exports.ConfigureColumnsPopup = exports.ConnectionEditor = exports.DropDownSelector = exports.ReactSelectOptionWithCheckIcon = exports.ReactSelectMenuWithPopper = exports.ReactSelectMenuList = exports.ReactSelectLoadMoreButton = exports.ReactSelectDropdownIndicatorWithIconButton = exports.ReactSelectDropdownIndicator = exports.Highlighter = exports.HierarchyNodeTitle = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.ExpandableSearchInput = exports.ErrorPopup = exports.ErrorBoundary = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.Drawer = exports.DataTypeValue = exports.DataTenantBadge = exports.ConnectionRelationTypeSelector = exports.CollaborationItem = exports.ConfirmationDialog = exports.CommentsContainer = exports.ColoredSourceIcon = exports.CollapseButton = exports.TreeChart = exports.TableWithBars = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleAttributeEditor = exports.SimpleAttribute = exports.RowCellAutoSizer = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.ReferenceAttribute = exports.ImageAttributesLine = exports.ReadOnlyAttributesPager = exports.ReadOnlyAttributesList = exports.ReadOnlyAttribute = exports.ReadOnlyAttributeValuesBlock = void 0;
|
|
19
|
+
exports.CrosswalkType = exports.AttributesTable = exports.CrosswalkDragLayer = exports.SourceCrosswalksRow = exports.CrosswalkEditor = exports.useModifiedEntity = exports.useCrosswalkActions = exports.groupCrosswalksByTypesAndSources = exports.ActivityTypes = exports.useProfileActivitiesLoader = exports.useActivitiesLoader = exports.ActivityLogFilter = exports.ActivityLog = exports.rerenderWrapper = exports.mockElementSizes = exports.mockBasicTableSizing = exports.getMuiIconByName = exports.delayPromise = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsFilter = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.SaveSegmentDialog = exports.MaskingSwitcher = exports.FileTypeEditor = exports.EmptySearchResult = exports.DropDownEditor = exports.FilterValueEditor = exports.MultiValueChip = exports.TextEditor = exports.DateRangeEditor = exports.NumberEditor = exports.DataTypeValueEditor = exports.DateEditor = exports.ErrorWrapper = void 0;
|
|
20
20
|
__exportStar(require("./HOCs"), exports);
|
|
21
21
|
__exportStar(require("./components"), exports);
|
|
22
22
|
__exportStar(require("./constants"), exports);
|
|
@@ -79,6 +79,8 @@ Object.defineProperty(exports, "ColorBar", { enumerable: true, get: function ()
|
|
|
79
79
|
var ColumnsSettings_1 = require("./ColumnsSettings");
|
|
80
80
|
Object.defineProperty(exports, "ColumnsSettings", { enumerable: true, get: function () { return ColumnsSettings_1.ColumnsSettings; } });
|
|
81
81
|
Object.defineProperty(exports, "ColumnsSettingsPopup", { enumerable: true, get: function () { return ColumnsSettings_1.ColumnsSettingsPopup; } });
|
|
82
|
+
var ControlAttributeIcon_1 = require("./ControlAttributeIcon");
|
|
83
|
+
Object.defineProperty(exports, "ControlAttributeIcon", { enumerable: true, get: function () { return ControlAttributeIcon_1.ControlAttributeIcon; } });
|
|
82
84
|
var DefaultCellValueRenderer_1 = require("./DefaultCellValueRenderer");
|
|
83
85
|
Object.defineProperty(exports, "DefaultCellValueRenderer", { enumerable: true, get: function () { return DefaultCellValueRenderer_1.DefaultCellValueRenderer; } });
|
|
84
86
|
var DescriptionIcon_1 = require("./DescriptionIcon");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ControlAttributeIcon: () => JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
13
|
+
import i18n from 'ui-i18n';
|
|
14
|
+
import ControlAttribute from '../icons/ControlAttribute';
|
|
15
|
+
import { withTooltip } from '../HOCs/withTooltip';
|
|
16
|
+
import { useStyles } from './styles';
|
|
17
|
+
var ControlAttributeForwarded = forwardRef(function (props, ref) {
|
|
18
|
+
return (React.createElement("span", __assign({}, props, { ref: ref }),
|
|
19
|
+
React.createElement(ControlAttribute, null)));
|
|
20
|
+
});
|
|
21
|
+
ControlAttributeForwarded.displayName = 'ControlAttributeForwarded';
|
|
22
|
+
var ControlAttributeWithTooltip = withTooltip(ControlAttributeForwarded);
|
|
23
|
+
export var ControlAttributeIcon = function () {
|
|
24
|
+
var styles = useStyles();
|
|
25
|
+
return (React.createElement(ControlAttributeWithTooltip, { "data-reltio-id": "reltio-control-attribute-icon", tooltipTitle: i18n.text('This is a control attribute. Changing this value will affect availability of other dynamic attributes.'), className: styles.icon }));
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ControlAttributeIcon } from './ControlAttributeIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ControlAttributeIcon } from './ControlAttributeIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon">;
|
|
@@ -12,9 +12,11 @@ import { EditModeAttribute } from '../../../EditModeAttributesFactory';
|
|
|
12
12
|
import { CardinalityMessage } from '../../../CardinalityMessage';
|
|
13
13
|
import { PinnedAttributesContext } from '../../../contexts/PinnedAttributesContext';
|
|
14
14
|
import { DescriptionIcon } from '../../../DescriptionIcon';
|
|
15
|
+
import { ControlAttributeIcon } from '../../../ControlAttributeIcon';
|
|
15
16
|
import { useScrollToAttribute } from '../../../hooks/useScrollToAttribute/useScrollToAttribute';
|
|
16
17
|
import { useScrollToAttributeError } from '../../../hooks/useScrollToAttributeError/useScrollToAttributeError';
|
|
17
18
|
import { filterNewValues } from '../../helpers';
|
|
19
|
+
import { useMdmControlAttributes } from '../../../contexts';
|
|
18
20
|
import { useStyles } from '../../styles';
|
|
19
21
|
var AttributeRenderer = function (_a) {
|
|
20
22
|
var max = _a.max, values = _a.values, attributeType = _a.attributeType, parentUri = _a.parentUri, mode = _a.mode, drawLines = _a.drawLines, showEmptyEditors = _a.showEmptyEditors, errorMessage = _a.errorMessage, errors = _a.errors, paging = _a.paging, crosswalks = _a.crosswalks, showNonOv = _a.showNonOv, nonVisibleValues = _a.nonVisibleValues, highlightedError = _a.highlightedError, highlightedAttribute = _a.highlightedAttribute, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, onDeactivateError = _a.onDeactivateError, additionalControlsRenderer = _a.additionalControlsRenderer, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues;
|
|
@@ -29,6 +31,8 @@ var AttributeRenderer = function (_a) {
|
|
|
29
31
|
var isPinned = useMemo(function () { return pinnedAttributes === null || pinnedAttributes === void 0 ? void 0 : pinnedAttributes.includes(attributeTypeUri); }, [attributeTypeUri, pinnedAttributes]);
|
|
30
32
|
var isEmptyValues = isEmptyValue(values);
|
|
31
33
|
var showEmpty = ((!hadDeletions && showEmptyEditors) || isRequired || isPinned) && isEmptyValues;
|
|
34
|
+
var controlAttributes = useMdmControlAttributes();
|
|
35
|
+
var isControlAttribute = useMemo(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
32
36
|
var emptyEditorValue = useRef(createNewAttribute({
|
|
33
37
|
parentUri: parentUri,
|
|
34
38
|
attributeType: omit(['defaultValue'], attributeType)
|
|
@@ -88,6 +92,7 @@ var AttributeRenderer = function (_a) {
|
|
|
88
92
|
React.createElement("div", { className: styles.titleWrapper },
|
|
89
93
|
React.createElement(Title, { label: label, isRequired: isRequired, className: styles.title, "data-reltio-id": "reltio-attribute-label" }),
|
|
90
94
|
React.createElement(DescriptionIcon, { description: description }),
|
|
95
|
+
isControlAttribute && React.createElement(ControlAttributeIcon, null),
|
|
91
96
|
React.createElement(OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues })),
|
|
92
97
|
isEditableMode && React.createElement(CardinalityMessage, { cardinality: cardinality }),
|
|
93
98
|
isEditableMode && React.createElement(ErrorMessage, { message: errorMessage, className: styles.typeError }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import { min } from 'ramda';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { ReadOnlyAttribute } from '../../../ReadOnlyAttributesFactory';
|
|
@@ -7,11 +7,15 @@ import { ShowMore } from '../../../ShowMore';
|
|
|
7
7
|
import { ShowLess } from '../../../ShowLess';
|
|
8
8
|
import { OvIcon } from '../../../OvIcon';
|
|
9
9
|
import { DescriptionIcon } from '../../../DescriptionIcon';
|
|
10
|
+
import { ControlAttributeIcon } from '../../../ControlAttributeIcon';
|
|
11
|
+
import { useMdmControlAttributes } from '../../../contexts';
|
|
10
12
|
import { useMultiLineStyles } from '../../styles';
|
|
11
13
|
export var MultiLineRenderer = function (_a) {
|
|
12
14
|
var max = _a.max, values = _a.values, nonVisibleValues = _a.nonVisibleValues, totalVisibleValues = _a.totalVisibleValues, attributeType = _a.attributeType, parentUri = _a.parentUri, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
13
15
|
var styles = useMultiLineStyles();
|
|
14
16
|
var _b = useState(max), visibleValuesCount = _b[0], setVisibleValuesCount = _b[1];
|
|
17
|
+
var controlAttributes = useMdmControlAttributes();
|
|
18
|
+
var isControlAttribute = useMemo(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
15
19
|
var hasPaging = max < totalVisibleValues;
|
|
16
20
|
var showMore = hasPaging && visibleValuesCount < totalVisibleValues;
|
|
17
21
|
var showLess = hasPaging && visibleValuesCount >= totalVisibleValues;
|
|
@@ -37,6 +41,7 @@ export var MultiLineRenderer = function (_a) {
|
|
|
37
41
|
React.createElement("div", { className: styles.titleRow },
|
|
38
42
|
React.createElement(Title, { label: label, className: classnames(styles.title, titleClassName), "data-reltio-id": "reltio-attribute-label" }),
|
|
39
43
|
React.createElement(DescriptionIcon, { description: description }),
|
|
44
|
+
isControlAttribute && React.createElement(ControlAttributeIcon, null),
|
|
40
45
|
React.createElement(OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues })),
|
|
41
46
|
React.createElement("div", { className: styles.attributes }, shownValues.map(function (value) { return (React.createElement(ReadOnlyAttribute, { key: value.uri, className: classnames(styles.attribute, contentClassName), attributeValue: value, attributeType: attributeType, showNonOv: showNonOv })); })),
|
|
42
47
|
showMore && (React.createElement(ShowMore, { moreNumber: min(max, hiddenValuesCount), valueNumber: hiddenValuesCount, onClick: onShowMore })),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { CollaborationObjectTypes, createRelatedObjectUris, isRelationUri } from '@reltio/mdm-sdk';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../constants';
|
|
@@ -7,11 +7,15 @@ import Title from '../../../components/Title/Title';
|
|
|
7
7
|
import { OvIcon } from '../../../OvIcon';
|
|
8
8
|
import { DescriptionIcon } from '../../../DescriptionIcon';
|
|
9
9
|
import { ReadOnlyAttribute } from '../../../ReadOnlyAttributesFactory';
|
|
10
|
+
import { ControlAttributeIcon } from '../../../ControlAttributeIcon';
|
|
11
|
+
import { useMdmControlAttributes } from '../../../contexts';
|
|
10
12
|
import { useOneLineStyles } from '../../styles';
|
|
11
13
|
export var OneLineRenderer = function (_a) {
|
|
12
14
|
var value = _a.value, nonVisibleValues = _a.nonVisibleValues, attributeType = _a.attributeType, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
13
15
|
var styles = useOneLineStyles();
|
|
14
16
|
var label = attributeType.label, description = attributeType.description;
|
|
17
|
+
var controlAttributes = useMdmControlAttributes();
|
|
18
|
+
var isControlAttribute = useMemo(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
15
19
|
var objectType = isRelationUri(value.uri)
|
|
16
20
|
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
17
21
|
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
@@ -19,6 +23,7 @@ export var OneLineRenderer = function (_a) {
|
|
|
19
23
|
React.createElement("div", { className: classnames(styles.titleRow, styles.wrapper) },
|
|
20
24
|
React.createElement(Title, { label: label, className: classnames(styles.title, titleClassName), "data-reltio-id": "reltio-attribute-label" }),
|
|
21
25
|
React.createElement(DescriptionIcon, { description: description, className: styles.descriptionIcon }),
|
|
26
|
+
isControlAttribute && React.createElement(ControlAttributeIcon, null),
|
|
22
27
|
React.createElement(OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues }),
|
|
23
28
|
React.createElement(ReadOnlyAttribute, { className: classnames(styles.attribute, contentClassName), attributeValue: value, attributeType: attributeType, showNonOv: showNonOv, inlined: true })),
|
|
24
29
|
React.createElement(CommentsContainer, { uri: value.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
@@ -32,7 +32,8 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
32
32
|
mode: Mode;
|
|
33
33
|
isViewMode: boolean;
|
|
34
34
|
isEditableMode: boolean;
|
|
35
|
-
hiddenAttributes: string[]
|
|
35
|
+
hiddenAttributes: Record<string, string[]>;
|
|
36
|
+
controlAttributes: string[];
|
|
36
37
|
historyDiff: HistoryDiff;
|
|
37
38
|
historyMode: HistoryMode;
|
|
38
39
|
historySlice: HistorySlice;
|
|
@@ -117,6 +118,7 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
117
118
|
editRelation: (id: string, connection: Connection) => void;
|
|
118
119
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
119
120
|
resetHiddenAttributes: (uri: string) => void;
|
|
121
|
+
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
120
122
|
}>;
|
|
121
123
|
export type MdmModuleListenersContextProps = Partial<{
|
|
122
124
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -185,6 +187,7 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
185
187
|
editRelation: (id: string, connection: Connection) => void;
|
|
186
188
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
187
189
|
resetHiddenAttributes: (uri: string) => void;
|
|
190
|
+
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
188
191
|
}>>;
|
|
189
192
|
export declare const MdmModuleValuesContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
190
193
|
autoCloseInterval: number;
|
|
@@ -218,7 +221,8 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
218
221
|
mode: Mode;
|
|
219
222
|
isViewMode: boolean;
|
|
220
223
|
isEditableMode: boolean;
|
|
221
|
-
hiddenAttributes: string[]
|
|
224
|
+
hiddenAttributes: Record<string, string[]>;
|
|
225
|
+
controlAttributes: string[];
|
|
222
226
|
historyDiff: HistoryDiff;
|
|
223
227
|
historyMode: HistoryMode;
|
|
224
228
|
historySlice: HistorySlice;
|
|
@@ -71,7 +71,7 @@ export declare const useMdmDependentLookupEditorContext: (attributeValue: Simple
|
|
|
71
71
|
};
|
|
72
72
|
export declare const useMdmGlobalSearchRequestOptions: (omittingFields?: string[]) => import("@reltio/mdm-sdk").GlobalSearchRequestOptions;
|
|
73
73
|
export declare const useMdmAuthoringItemsByEntityType: (entityTypeUri: string) => import("@reltio/mdm-sdk").AuthoringItem[];
|
|
74
|
-
export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent" | "openConsoleApp" | "addAttributes" | "modifyAttribute" | "removeAttribute" | "entityDeleted" | "entityCreated" | "errorDeactivated" | "requestNextPageOfAttributeValues" | "openEntity" | "setDefaultProfilePicForModifiedEntity" | "setDefaultProfilePicForEntity" | "dependentLookupsEditorTouched" | "openPivotingPerspective" | "lookupsLoaded" | "lookupsForTypeResolved" | "errorSet" | "setHistoryMode" | "modeUpdated" | "setHistoryEvent" | "clearHistoryEvent" | "clearHistoryDiff" | "setHistoryDiff" | "setHistorySlice" | "updateSearchNavigationDataFields" | "openPerspective" | "entityDeletionFinished" | "loadEntity" | "updateSearchNavigationDataOnMerge" | "lookupsListResolved" | "relationsLoaded" | "setInitialInfo" | "setRelationType" | "closeRelationEditor" | "openRelationEditor" | "setRelationEntity" | "errorsSet" | "addRelation" | "editRelation" | "updateHiddenAttributes" | "resetHiddenAttributes">(action: T) => Partial<{
|
|
74
|
+
export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent" | "openConsoleApp" | "addAttributes" | "modifyAttribute" | "removeAttribute" | "entityDeleted" | "entityCreated" | "errorDeactivated" | "requestNextPageOfAttributeValues" | "openEntity" | "setDefaultProfilePicForModifiedEntity" | "setDefaultProfilePicForEntity" | "dependentLookupsEditorTouched" | "openPivotingPerspective" | "lookupsLoaded" | "lookupsForTypeResolved" | "errorSet" | "setHistoryMode" | "modeUpdated" | "setHistoryEvent" | "clearHistoryEvent" | "clearHistoryDiff" | "setHistoryDiff" | "setHistorySlice" | "updateSearchNavigationDataFields" | "openPerspective" | "entityDeletionFinished" | "loadEntity" | "updateSearchNavigationDataOnMerge" | "lookupsListResolved" | "relationsLoaded" | "setInitialInfo" | "setRelationType" | "closeRelationEditor" | "openRelationEditor" | "setRelationEntity" | "errorsSet" | "addRelation" | "editRelation" | "updateHiddenAttributes" | "resetHiddenAttributes" | "updateControlAttributes">(action: T) => Partial<{
|
|
75
75
|
openSearch: (payload: import("@reltio/mdm-sdk").SearchState) => void;
|
|
76
76
|
openHistoryEvent: (payload: {
|
|
77
77
|
entityUri: string;
|
|
@@ -133,6 +133,7 @@ export declare const useMdmAction: <T extends "openSearch" | "openHistoryEvent"
|
|
|
133
133
|
editRelation: (id: string, connection: import("@reltio/mdm-sdk").Connection) => void;
|
|
134
134
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
135
135
|
resetHiddenAttributes: (uri: string) => void;
|
|
136
|
+
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
136
137
|
}>[T];
|
|
137
138
|
export declare const useMdmListener: <T extends "expandInvalidRelatonsListener" | "cleanseLoadingListener" | "searchNavigationListener">(listener: T) => Partial<{
|
|
138
139
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -140,3 +141,4 @@ export declare const useMdmListener: <T extends "expandInvalidRelatonsListener"
|
|
|
140
141
|
searchNavigationListener: (action: import("../..").AnyAction, state: any, dispatch: (action: import("../..").AnyAction) => void) => void;
|
|
141
142
|
}>[T];
|
|
142
143
|
export declare const useMdmHiddenAttributes: () => {};
|
|
144
|
+
export declare const useMdmControlAttributes: () => any[];
|
|
@@ -117,7 +117,7 @@ export var useMdmRelationsDrafts = function (viewId) {
|
|
|
117
117
|
};
|
|
118
118
|
export var useMdmDependentLookupEditorContext = function (attributeValue, attributeType) {
|
|
119
119
|
var value = useMdmModuleValuesContext(function (context) {
|
|
120
|
-
var _a;
|
|
120
|
+
var _a, _b, _c;
|
|
121
121
|
return getDependentLookupEditorContext({
|
|
122
122
|
dependentLookups: context.dependentLookups,
|
|
123
123
|
metadata: context.metadata,
|
|
@@ -125,7 +125,8 @@ export var useMdmDependentLookupEditorContext = function (attributeValue, attrib
|
|
|
125
125
|
modifiedEntities: context.modifiedEntities,
|
|
126
126
|
entityUri: (_a = context.entity) === null || _a === void 0 ? void 0 : _a.uri,
|
|
127
127
|
attributeValue: attributeValue,
|
|
128
|
-
attributeType: attributeType
|
|
128
|
+
attributeType: attributeType,
|
|
129
|
+
hiddenAttributes: (_b = context.hiddenAttributes) === null || _b === void 0 ? void 0 : _b[(_c = context.entity) === null || _c === void 0 ? void 0 : _c.uri]
|
|
129
130
|
});
|
|
130
131
|
});
|
|
131
132
|
return value;
|
|
@@ -154,3 +155,7 @@ var emptyHiddenAttributesObject = {};
|
|
|
154
155
|
export var useMdmHiddenAttributes = function () {
|
|
155
156
|
return useMdmModuleValuesContext(function (context) { return context.hiddenAttributes || emptyHiddenAttributesObject; });
|
|
156
157
|
};
|
|
158
|
+
var emptyControlAttributes = [];
|
|
159
|
+
export var useMdmControlAttributes = function () {
|
|
160
|
+
return useMdmModuleValuesContext(function (context) { return context.controlAttributes || emptyControlAttributes; });
|
|
161
|
+
};
|
|
@@ -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 } 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 } 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 } 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 } from './hooks';
|
|
@@ -17,6 +17,7 @@ type CommonProps = {
|
|
|
17
17
|
type GetDependentLookupEditorContextProps = CommonProps & {
|
|
18
18
|
attributeValue: SimpleAttributeValue;
|
|
19
19
|
attributeType: AttributeType;
|
|
20
|
+
hiddenAttributes?: string[];
|
|
20
21
|
};
|
|
21
|
-
export declare const getDependentLookupEditorContext: ({ dependentLookups, metadata, modifiedEntities, entityUri, relations, attributeValue, attributeType }: GetDependentLookupEditorContextProps) => DependentLookupEditorContext;
|
|
22
|
+
export declare const getDependentLookupEditorContext: ({ dependentLookups, metadata, modifiedEntities, entityUri, relations, attributeValue, attributeType, hiddenAttributes }: GetDependentLookupEditorContextProps) => DependentLookupEditorContext;
|
|
22
23
|
export {};
|
|
@@ -49,8 +49,10 @@ export var buildMissedParentsMessage = function (missedAttributeTypes) {
|
|
|
49
49
|
var getTypesMapKey = function (parent) { return "".concat(parent.type, "_").concat(getParentUri(parent.uri)); };
|
|
50
50
|
var getParents = function (_a) {
|
|
51
51
|
var _b;
|
|
52
|
-
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, node = _a.node, valueUri = _a.valueUri;
|
|
53
|
-
var parentNodesValues = node.parents
|
|
52
|
+
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, node = _a.node, valueUri = _a.valueUri, hiddenAttributes = _a.hiddenAttributes;
|
|
53
|
+
var parentNodesValues = node.parents
|
|
54
|
+
.filter(function (type) { return !hiddenAttributes.includes(type); })
|
|
55
|
+
.flatMap(function (type) {
|
|
54
56
|
var parentNode = getDependentLookupsStructureNode(dependentLookups, type);
|
|
55
57
|
return parentNode.values.map(function (value) { return (__assign(__assign({}, value), { type: type, dependentLookupCode: parentNode.attrType.dependentLookupCode })); });
|
|
56
58
|
});
|
|
@@ -64,6 +66,7 @@ var getParents = function (_a) {
|
|
|
64
66
|
});
|
|
65
67
|
var possibleParentBaseTypeUris = pipe(getAttributeValuePath, defaultTo([]), map(pipe(path(['valueType', 'uri']), getBaseUri)), prepend((_b = modifiedEntities[entityUri]) === null || _b === void 0 ? void 0 : _b.type), reject(isNil), uniq)({ entityUri: entityUri, entitiesMap: modifiedEntities, connections: connections, metadata: metadata }, valueUri);
|
|
66
68
|
var neededParentsAttributeTypes = node.parents
|
|
69
|
+
.filter(function (type) { return !hiddenAttributes.includes(type); })
|
|
67
70
|
.filter(function (typeUri) { return possibleParentBaseTypeUris.some(areOneHierarchyUris(typeUri)); })
|
|
68
71
|
.map(function (typeUri) {
|
|
69
72
|
var parentNode = getDependentLookupsStructureNode(dependentLookups, typeUri);
|
|
@@ -87,24 +90,25 @@ var getParents = function (_a) {
|
|
|
87
90
|
return { parents: parents, missedParentsAttributeTypes: missedParentsAttributeTypes };
|
|
88
91
|
};
|
|
89
92
|
export var getDependentLookupEditorContext = function (_a) {
|
|
90
|
-
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
91
|
-
if (!isDependentLookupAttrType(attributeType)) {
|
|
93
|
+
var dependentLookups = _a.dependentLookups, metadata = _a.metadata, modifiedEntities = _a.modifiedEntities, entityUri = _a.entityUri, relations = _a.relations, attributeValue = _a.attributeValue, attributeType = _a.attributeType, _b = _a.hiddenAttributes, hiddenAttributes = _b === void 0 ? [] : _b;
|
|
94
|
+
if (!isDependentLookupAttrType(attributeType) || hiddenAttributes.includes(attributeType.uri)) {
|
|
92
95
|
return null;
|
|
93
96
|
}
|
|
94
97
|
var attributeTypeUri = attributeType.uri;
|
|
95
98
|
var node = getDependentLookupsStructureNode(dependentLookups, attributeTypeUri);
|
|
96
99
|
if (node) {
|
|
97
100
|
var valueUri = attributeValue.uri;
|
|
98
|
-
var
|
|
101
|
+
var _c = getParents({
|
|
99
102
|
dependentLookups: dependentLookups,
|
|
100
103
|
metadata: metadata,
|
|
101
104
|
modifiedEntities: modifiedEntities,
|
|
102
105
|
entityUri: entityUri,
|
|
103
106
|
relations: relations,
|
|
104
107
|
valueUri: valueUri,
|
|
105
|
-
node: node
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
node: node,
|
|
109
|
+
hiddenAttributes: hiddenAttributes
|
|
110
|
+
}), parents = _c.parents, missedParentsAttributeTypes = _c.missedParentsAttributeTypes;
|
|
111
|
+
var _d = (getDependentLookupEditorState(dependentLookups, valueUri) || {}).isBlocked, isBlocked = _d === void 0 ? false : _d;
|
|
108
112
|
var missedParentsMessage = buildMissedParentsMessage(missedParentsAttributeTypes);
|
|
109
113
|
var isEmptyValue = !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.lookupCode) && !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value);
|
|
110
114
|
var placeholder = (isEmptyValue && isBlocked && i18n.text('Populating values...')) ||
|
|
@@ -26,6 +26,7 @@ export var useHiddenAttributes = function () {
|
|
|
26
26
|
var resetHiddenAttributes = useMdmAction('resetHiddenAttributes');
|
|
27
27
|
var hiddenAttributes = useMdmHiddenAttributes();
|
|
28
28
|
var currentEntityHiddenAttributes = useMemo(function () { return hiddenAttributes[entityUri] || []; }, [hiddenAttributes, entityUri]);
|
|
29
|
+
var updateControlAttributes = useMdmAction('updateControlAttributes');
|
|
29
30
|
var ruleBasedAttributes = useMemo(function () { return getRuleBasedAttributes(metadata, entity === null || entity === void 0 ? void 0 : entity.type); }, [metadata, entity === null || entity === void 0 ? void 0 : entity.type]);
|
|
30
31
|
var parsedRuleBasedAttributes = useMemo(function () {
|
|
31
32
|
return ruleBasedAttributes.map(function (rule) {
|
|
@@ -33,8 +34,8 @@ export var useHiddenAttributes = function () {
|
|
|
33
34
|
return (__assign(__assign({}, parseRuleBasedAttribute(rule)), { showAttributeURIs: ((_a = rule === null || rule === void 0 ? void 0 : rule.controlFunction) === null || _a === void 0 ? void 0 : _a.showAttributeURI) || [] }));
|
|
34
35
|
});
|
|
35
36
|
}, [ruleBasedAttributes]);
|
|
36
|
-
var
|
|
37
|
-
var changedAttributes = useChangedAttributes(entity === null || entity === void 0 ? void 0 : entity.attributes,
|
|
37
|
+
var newControlAttributes = useMemo(function () { return pipe(pluck('controlAttributes'), flatten, uniq)(parsedRuleBasedAttributes); }, [parsedRuleBasedAttributes]);
|
|
38
|
+
var changedAttributes = useChangedAttributes(entity === null || entity === void 0 ? void 0 : entity.attributes, newControlAttributes);
|
|
38
39
|
var showAttributeURIs = useMemo(function () {
|
|
39
40
|
return changedAttributes.length ? findShowAttributeURIs(changedAttributes, parsedRuleBasedAttributes) : [];
|
|
40
41
|
}, [parsedRuleBasedAttributes, changedAttributes]);
|
|
@@ -54,5 +55,8 @@ export var useHiddenAttributes = function () {
|
|
|
54
55
|
updateHiddenAttributes(entityUri, without(showAttributeURIs, currentEntityHiddenAttributes).concat(addedHiddenAttributes));
|
|
55
56
|
}
|
|
56
57
|
}, [addedHiddenAttributes, showAttributeURIs, entityUri]);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
updateControlAttributes(newControlAttributes);
|
|
60
|
+
}, [newControlAttributes]);
|
|
57
61
|
useEffect(function () { return function () { return resetHiddenAttributes(entityUri); }; }, [entityUri]);
|
|
58
62
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
var SvgControlAttribute = function (props) {
|
|
14
|
+
return (React.createElement("svg", __assign({ width: 12, height: 12, viewBox: "2 2 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
15
|
+
React.createElement("mask", { id: "path-1-inside-1_1184_29788", fill: "white" },
|
|
16
|
+
React.createElement("path", { d: "M10.9656 9.20314C10.6874 9.8892 10.1798 10.4576 9.52953 10.8114C8.87921 11.1652 8.12633 11.2826 7.39917 11.1435C6.67201 11.0045 6.01556 10.6176 5.54167 10.0488C5.06778 9.48 4.80577 8.76449 4.80029 8.02417C4.79481 7.28385 5.04619 6.56454 5.5116 5.98879C5.97702 5.41304 6.62767 5.01647 7.35269 4.86667C8.07771 4.71686 8.83225 4.82308 9.48773 5.16723C10.1432 5.51138 10.6591 6.07216 10.9475 6.75403L9.57285 7.33537C9.41898 6.97153 9.14371 6.6723 8.79394 6.48867C8.44418 6.30503 8.04156 6.24835 7.65469 6.32829C7.26782 6.40822 6.92064 6.61983 6.67229 6.92704C6.42395 7.23426 6.28981 7.61809 6.29274 8.01312C6.29566 8.40815 6.43547 8.78994 6.68833 9.09345C6.9412 9.39696 7.29148 9.6034 7.67949 9.67759C8.0675 9.75179 8.46924 9.68916 8.81624 9.50036C9.16325 9.31157 9.43406 9.00829 9.58253 8.64221L10.9656 9.20314Z" })),
|
|
17
|
+
React.createElement("path", { d: "M10.9656 9.20314C10.6874 9.8892 10.1798 10.4576 9.52953 10.8114C8.87921 11.1652 8.12633 11.2826 7.39917 11.1435C6.67201 11.0045 6.01556 10.6176 5.54167 10.0488C5.06778 9.48 4.80577 8.76449 4.80029 8.02417C4.79481 7.28385 5.04619 6.56454 5.5116 5.98879C5.97702 5.41304 6.62767 5.01647 7.35269 4.86667C8.07771 4.71686 8.83225 4.82308 9.48773 5.16723C10.1432 5.51138 10.6591 6.07216 10.9475 6.75403L9.57285 7.33537C9.41898 6.97153 9.14371 6.6723 8.79394 6.48867C8.44418 6.30503 8.04156 6.24835 7.65469 6.32829C7.26782 6.40822 6.92064 6.61983 6.67229 6.92704C6.42395 7.23426 6.28981 7.61809 6.29274 8.01312C6.29566 8.40815 6.43547 8.78994 6.68833 9.09345C6.9412 9.39696 7.29148 9.6034 7.67949 9.67759C8.0675 9.75179 8.46924 9.68916 8.81624 9.50036C9.16325 9.31157 9.43406 9.00829 9.58253 8.64221L10.9656 9.20314Z", stroke: "#72828B", strokeWidth: "4", mask: "url(#path-1-inside-1_1184_29788)" }),
|
|
18
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.29694 8.96529C3.70237 10.9507 5.33344 12.4899 7.36532 12.7582V14.3687C4.44846 14.0817 2.10658 11.8364 1.67215 8.96529H3.29694ZM7.36532 3.24137C5.22186 3.52443 3.52444 5.22184 3.24137 7.36529H1.63086C1.92888 4.33725 4.33727 1.92886 7.36532 1.63086V3.24137ZM12.7582 7.36529C12.4899 5.33344 10.9507 3.70239 8.96532 3.29694V1.67216C11.8364 2.10659 14.0817 4.44845 14.3687 7.36529H12.7582ZM12.7027 8.96529C12.3195 10.8416 10.8416 12.3195 8.96532 12.7027V14.3275C11.7269 13.9096 13.9096 11.7269 14.3275 8.96529H12.7027Z", fill: "#72828B" })));
|
|
19
|
+
};
|
|
20
|
+
export default SvgControlAttribute;
|
package/esm/icons/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as Calendar } from './Calendar';
|
|
|
5
5
|
export { default as CollaborationIcon } from './CollaborationIcon';
|
|
6
6
|
export { default as Comment } from './Comment';
|
|
7
7
|
export { default as CommentBubble } from './CommentBubble';
|
|
8
|
+
export { default as ControlAttribute } from './ControlAttribute';
|
|
8
9
|
export { default as Copy } from './Copy';
|
|
9
10
|
export { default as Create } from './Create';
|
|
10
11
|
export { default as DcrTaskIcon } from './DcrTaskIcon';
|
package/esm/icons/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { default as Calendar } from './Calendar';
|
|
|
5
5
|
export { default as CollaborationIcon } from './CollaborationIcon';
|
|
6
6
|
export { default as Comment } from './Comment';
|
|
7
7
|
export { default as CommentBubble } from './CommentBubble';
|
|
8
|
+
export { default as ControlAttribute } from './ControlAttribute';
|
|
8
9
|
export { default as Copy } from './Copy';
|
|
9
10
|
export { default as Create } from './Create';
|
|
10
11
|
export { default as DcrTaskIcon } from './DcrTaskIcon';
|
package/esm/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { ChartsFactory } from './ChartsFactory';
|
|
|
31
31
|
export { CollapseRowButton } from './CollapseRowButton';
|
|
32
32
|
export { ColorBar } from './ColorBar';
|
|
33
33
|
export { ColumnsSettings, ColumnsSettingsPopup } from './ColumnsSettings';
|
|
34
|
+
export { ControlAttributeIcon } from './ControlAttributeIcon';
|
|
34
35
|
export { DefaultCellValueRenderer } from './DefaultCellValueRenderer';
|
|
35
36
|
export { DescriptionIcon } from './DescriptionIcon';
|
|
36
37
|
export { DropDownMenuButton } from './DropDownMenuButton';
|
package/esm/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { ChartsFactory } from './ChartsFactory';
|
|
|
32
32
|
export { CollapseRowButton } from './CollapseRowButton';
|
|
33
33
|
export { ColorBar } from './ColorBar';
|
|
34
34
|
export { ColumnsSettings, ColumnsSettingsPopup } from './ColumnsSettings';
|
|
35
|
+
export { ControlAttributeIcon } from './ControlAttributeIcon';
|
|
35
36
|
export { DefaultCellValueRenderer } from './DefaultCellValueRenderer';
|
|
36
37
|
export { DescriptionIcon } from './DescriptionIcon';
|
|
37
38
|
export { DropDownMenuButton } from './DropDownMenuButton';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1872",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
10
|
"@react-sigma/core": "3.4.0",
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1812",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|