@reltio/components 1.4.1084 → 1.4.1085
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/components/CollaborationItem/CommentTarget/CommentTarget.js +9 -0
- package/cjs/components/attributes/readMode/AttributesPager/OneLineRenderer.js +5 -2
- package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.d.ts +10 -7
- package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +8 -4
- package/cjs/components/attributes/readMode/NestedAttribute/NestedAttribute.js +1 -1
- package/cjs/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.js +1 -1
- package/cjs/components/attributes/readMode/SimpleAttribute/SimpleAttribute.js +5 -2
- package/esm/components/CollaborationItem/CommentTarget/CommentTarget.js +9 -0
- package/esm/components/attributes/readMode/AttributesPager/OneLineRenderer.js +6 -3
- package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.d.ts +10 -7
- package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +9 -5
- package/esm/components/attributes/readMode/NestedAttribute/NestedAttribute.js +1 -1
- package/esm/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.js +1 -1
- package/esm/components/attributes/readMode/SimpleAttribute/SimpleAttribute.js +6 -3
- package/package.json +3 -3
|
@@ -27,6 +27,7 @@ var react_1 = __importStar(require("react"));
|
|
|
27
27
|
var react_redux_1 = require("react-redux");
|
|
28
28
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
29
29
|
var classnames_1 = __importDefault(require("classnames"));
|
|
30
|
+
var ramda_1 = require("ramda");
|
|
30
31
|
var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
31
32
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
32
33
|
var mdm_sdk_2 = require("@reltio/mdm-sdk");
|
|
@@ -52,6 +53,14 @@ var CommentTarget = function (_a) {
|
|
|
52
53
|
react_1.default.createElement(Typography_1.default, { className: styles.title }, ui_i18n_1.default.text('Selected attribute:')),
|
|
53
54
|
react_1.default.createElement(Typography_1.default, { className: styles.label }, attributeType === null || attributeType === void 0 ? void 0 : attributeType.label)));
|
|
54
55
|
}
|
|
56
|
+
case mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE: {
|
|
57
|
+
var relationTypeUri = comment.relatedObjectUris.find(ramda_1.startsWith('configuration/relationTypes'));
|
|
58
|
+
var attributeTypeUri = mdm_sdk_2.getAttributeTypeUriByValueUri(comment.objectId, relationTypeUri);
|
|
59
|
+
var attributeType = mdm_sdk_2.findAttributeTypeByUri(metadata, attributeTypeUri);
|
|
60
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
61
|
+
react_1.default.createElement(Typography_1.default, { className: styles.title }, ui_i18n_1.default.text('Selected attribute:')),
|
|
62
|
+
react_1.default.createElement(Typography_1.default, { className: styles.label }, attributeType === null || attributeType === void 0 ? void 0 : attributeType.label)));
|
|
63
|
+
}
|
|
55
64
|
case mdm_sdk_1.CollaborationObjectTypes.ENTITY: {
|
|
56
65
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
57
66
|
react_1.default.createElement(Typography_1.default, { className: styles.title }, ui_i18n_1.default.text('Selected profile:')),
|
|
@@ -16,13 +16,16 @@ var OneLineRenderer = function (_a) {
|
|
|
16
16
|
var value = _a.value, nonVisibleValues = _a.nonVisibleValues, attributeType = _a.attributeType, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
17
17
|
var styles = styles_1.useOneLineStyles();
|
|
18
18
|
var label = attributeType.label;
|
|
19
|
+
var objectType = mdm_sdk_1.isRelationAttrType(attributeType)
|
|
20
|
+
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
21
|
+
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
19
22
|
return (react_1.default.createElement("div", { className: classnames_1.default(styles.collaborationWrapper, constants_1.COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
20
23
|
react_1.default.createElement("div", { className: classnames_1.default(styles.titleRow, styles.wrapper) },
|
|
21
24
|
react_1.default.createElement(Title_1.default, { label: label, className: classnames_1.default(styles.title, titleClassName), "data-reltio-id": "reltio-attribute-label" }),
|
|
22
25
|
react_1.default.createElement(OvIcon_1.default, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues }),
|
|
23
26
|
react_1.default.createElement(Attribute_1.default, { className: classnames_1.default(styles.attribute, contentClassName), attributeValue: value, attributeType: attributeType, showNonOv: showNonOv, inlined: true })),
|
|
24
|
-
react_1.default.createElement(CommentsContainer_1.default, { uri: value.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(
|
|
27
|
+
react_1.default.createElement(CommentsContainer_1.default, { uri: value.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(objectType, {
|
|
25
28
|
uri: value.uri
|
|
26
|
-
}), objectType:
|
|
29
|
+
}), objectType: objectType })));
|
|
27
30
|
};
|
|
28
31
|
exports.default = OneLineRenderer;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export default ComplexAttribute;
|
|
2
|
-
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv }: {
|
|
2
|
+
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType }: {
|
|
3
3
|
attributeTypesList: any;
|
|
4
4
|
attributeValue: any;
|
|
5
5
|
label: any;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
children: any;
|
|
8
8
|
showNonOv: any;
|
|
9
|
+
attributeType: any;
|
|
9
10
|
}): JSX.Element;
|
|
10
11
|
declare namespace ComplexAttribute {
|
|
11
12
|
namespace propTypes {
|
|
12
|
-
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
-
const label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
14
|
-
const attributeTypesList: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
+
export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
14
|
+
export const label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
|
+
export const attributeTypesList: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
16
|
label: PropTypes.Requireable<string>;
|
|
16
17
|
name: PropTypes.Requireable<string>;
|
|
17
18
|
description: PropTypes.Requireable<string>;
|
|
@@ -26,14 +27,16 @@ declare namespace ComplexAttribute {
|
|
|
26
27
|
maxValue: PropTypes.Requireable<number>;
|
|
27
28
|
}>>;
|
|
28
29
|
}>[]>;
|
|
29
|
-
const attributeValue: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
|
+
export const attributeValue: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
31
|
value: PropTypes.Requireable<object>;
|
|
31
32
|
ov: PropTypes.Requireable<boolean>;
|
|
32
33
|
type: PropTypes.Requireable<string>;
|
|
33
34
|
uri: PropTypes.Requireable<string>;
|
|
34
35
|
}>>;
|
|
35
|
-
const expanded: PropTypes.Requireable<boolean>;
|
|
36
|
-
const showNonOv: PropTypes.Requireable<boolean>;
|
|
36
|
+
export const expanded: PropTypes.Requireable<boolean>;
|
|
37
|
+
export const showNonOv: PropTypes.Requireable<boolean>;
|
|
38
|
+
export { AttributeTypeType as attributeType };
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
import PropTypes from "prop-types";
|
|
42
|
+
import { AttributeTypeType } from "@reltio/mdm-sdk/src/constants";
|
|
@@ -33,7 +33,7 @@ var CommentsContainer_1 = __importDefault(require("../../../CommentsContainer/Co
|
|
|
33
33
|
var classnames_2 = require("../../../../constants/classnames");
|
|
34
34
|
var styles_1 = require("./styles");
|
|
35
35
|
var ComplexAttribute = function (_a) {
|
|
36
|
-
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _b = _a.expanded, expandedProp = _b === void 0 ? false : _b, children = _a.children, showNonOv = _a.showNonOv;
|
|
36
|
+
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _b = _a.expanded, expandedProp = _b === void 0 ? false : _b, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType;
|
|
37
37
|
var styles = styles_1.useStyles();
|
|
38
38
|
var uri = attributeValue.uri;
|
|
39
39
|
var _c = react_1.useState(false), expanded = _c[0], setExpanded = _c[1];
|
|
@@ -45,14 +45,17 @@ var ComplexAttribute = function (_a) {
|
|
|
45
45
|
attributes: hasAnalyticValue ? null : attributeValue.value,
|
|
46
46
|
analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
|
|
47
47
|
}); }, [attributeValue, hasAnalyticValue]);
|
|
48
|
+
var objectType = mdm_sdk_1.isRelationAttrType(attributeType)
|
|
49
|
+
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
50
|
+
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
48
51
|
return (react_1.default.createElement("div", { className: styles.complexContainer },
|
|
49
52
|
react_1.default.createElement("div", { className: classnames_1.default(styles.labelContainer, classnames_2.COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
50
53
|
react_1.default.createElement(ArrowExpandButton_1.default, { onClick: function () { return setExpanded(function (value) { return !value; }); }, expanded: expanded }),
|
|
51
54
|
react_1.default.createElement(Typography_1.default, { component: "span", variant: "body2", classes: { body2: styles.label }, "data-reltio-id": "reltio-attribute-complex-label" }, label),
|
|
52
55
|
react_1.default.createElement("div", { className: styles.spacer }),
|
|
53
|
-
react_1.default.createElement(CommentsContainer_1.default, { uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(
|
|
56
|
+
react_1.default.createElement(CommentsContainer_1.default, { uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(objectType, {
|
|
54
57
|
uri: attributeValue.uri
|
|
55
|
-
}), objectType:
|
|
58
|
+
}), objectType: objectType })),
|
|
56
59
|
expanded && (react_1.default.createElement(AttributesList_1.default, { attrTypes: attributeTypesList, entity: attributeListEntity, drawLines: true, parentUri: uri, showNonOv: showNonOv }, children))));
|
|
57
60
|
};
|
|
58
61
|
ComplexAttribute.propTypes = {
|
|
@@ -61,6 +64,7 @@ ComplexAttribute.propTypes = {
|
|
|
61
64
|
attributeTypesList: prop_types_1.default.arrayOf(mdm_sdk_1.AttributeTypeType),
|
|
62
65
|
attributeValue: prop_types_1.default.oneOfType([mdm_sdk_1.NestedAttributeValueType, mdm_sdk_1.ReferenceAttributeValueType]),
|
|
63
66
|
expanded: prop_types_1.default.bool,
|
|
64
|
-
showNonOv: prop_types_1.default.bool
|
|
67
|
+
showNonOv: prop_types_1.default.bool,
|
|
68
|
+
attributeType: mdm_sdk_1.AttributeTypeType
|
|
65
69
|
};
|
|
66
70
|
exports.default = ComplexAttribute;
|
|
@@ -66,7 +66,7 @@ var NestedAttribute = function (_a) {
|
|
|
66
66
|
return (react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { className: styles.pivotingTooltip, value: attributeValue, attributeType: attributeType },
|
|
67
67
|
react_1.default.createElement(Box_1.default, { component: "span", className: classnames_1.default(styles[historyAttributesClassName], styles.label) }, mdm_sdk_1.getLabel(label))));
|
|
68
68
|
}, [appearance, styles, attributeValue, attributeType]);
|
|
69
|
-
return (react_1.default.createElement(ComplexAttribute_1.default, __assign({ label: attributeLabel, attributeValue: attributeValue, attributeTypesList: mdm_sdk_1.getAttributeTypeSubAttributes({}, attributeType) }, otherProps)));
|
|
69
|
+
return (react_1.default.createElement(ComplexAttribute_1.default, __assign({ label: attributeLabel, attributeValue: attributeValue, attributeTypesList: mdm_sdk_1.getAttributeTypeSubAttributes({}, attributeType), attributeType: attributeType }, otherProps)));
|
|
70
70
|
};
|
|
71
71
|
NestedAttribute.propTypes = mdm_sdk_1.NestedAttributeType;
|
|
72
72
|
exports.default = react_1.memo(NestedAttribute);
|
|
@@ -75,7 +75,7 @@ var ReferenceAttribute = function (_a) {
|
|
|
75
75
|
styles,
|
|
76
76
|
uiPath
|
|
77
77
|
]);
|
|
78
|
-
return (react_1.default.createElement(ComplexAttribute_1.default, __assign({ attributeTypesList: attributeTypeList, attributeValue: attributeValue, label: entityLabel }, otherProps)));
|
|
78
|
+
return (react_1.default.createElement(ComplexAttribute_1.default, __assign({ attributeTypesList: attributeTypeList, attributeValue: attributeValue, label: entityLabel, attributeType: attributeType }, otherProps)));
|
|
79
79
|
};
|
|
80
80
|
ReferenceAttribute.propTypes = mdm_sdk_1.ReferenceAttributeType;
|
|
81
81
|
exports.default = react_1.memo(ReferenceAttribute);
|
|
@@ -40,13 +40,16 @@ var SimpleAttribute = function (_a) {
|
|
|
40
40
|
var attributeAppearance = historyAppearance_1.getHistoryAppearanceByUri(attributeValue.uri, appearance);
|
|
41
41
|
var historyClassName = historyAppearance_1.getHistoryAttributeClassName(attributeAppearance);
|
|
42
42
|
var dataTypeValue = (react_1.default.createElement(DataTypeValue_1.default, { value: mdm_sdk_1.getAttributeValue(attributeValue), dataTypeDefinition: mdm_sdk_1.getAttrDataTypeDefinition(attributeType) }));
|
|
43
|
+
var objectType = mdm_sdk_1.isRelationAttrType(attributeType)
|
|
44
|
+
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
45
|
+
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
43
46
|
return inlined || historyClassName ? (react_1.default.createElement("div", { className: className },
|
|
44
47
|
react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: classnames_1.default((_b = {}, _b[styles.multilineAttribute] = !inlined, _b)) },
|
|
45
48
|
react_1.default.createElement("span", { className: styles[historyClassName], "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)))) : (react_1.default.createElement("div", { className: classnames_1.default(className, styles.root, classnames_2.COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
46
49
|
react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri },
|
|
47
50
|
react_1.default.createElement("span", { className: styles.attributeValue, "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)),
|
|
48
|
-
react_1.default.createElement(CommentsContainer_1.default, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(
|
|
51
|
+
react_1.default.createElement(CommentsContainer_1.default, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(objectType, {
|
|
49
52
|
uri: attributeValue.uri
|
|
50
|
-
}), objectType:
|
|
53
|
+
}), objectType: objectType })));
|
|
51
54
|
};
|
|
52
55
|
exports.default = SimpleAttribute;
|
|
@@ -2,6 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import i18n from 'ui-i18n';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
+
import { startsWith } from 'ramda';
|
|
5
6
|
import mdm from '@reltio/mdm-module';
|
|
6
7
|
import { CollaborationObjectTypes } from '@reltio/mdm-sdk';
|
|
7
8
|
import { findAttributeTypeByUri, getLabel, getEntityUriForLink, getEntityId, getAttributeTypeUriByValueUri } from '@reltio/mdm-sdk';
|
|
@@ -27,6 +28,14 @@ export var CommentTarget = function (_a) {
|
|
|
27
28
|
React.createElement(Typography, { className: styles.title }, i18n.text('Selected attribute:')),
|
|
28
29
|
React.createElement(Typography, { className: styles.label }, attributeType === null || attributeType === void 0 ? void 0 : attributeType.label)));
|
|
29
30
|
}
|
|
31
|
+
case CollaborationObjectTypes.RELATION_ATTRIBUTE: {
|
|
32
|
+
var relationTypeUri = comment.relatedObjectUris.find(startsWith('configuration/relationTypes'));
|
|
33
|
+
var attributeTypeUri = getAttributeTypeUriByValueUri(comment.objectId, relationTypeUri);
|
|
34
|
+
var attributeType = findAttributeTypeByUri(metadata, attributeTypeUri);
|
|
35
|
+
return (React.createElement(React.Fragment, null,
|
|
36
|
+
React.createElement(Typography, { className: styles.title }, i18n.text('Selected attribute:')),
|
|
37
|
+
React.createElement(Typography, { className: styles.label }, attributeType === null || attributeType === void 0 ? void 0 : attributeType.label)));
|
|
38
|
+
}
|
|
30
39
|
case CollaborationObjectTypes.ENTITY: {
|
|
31
40
|
return (React.createElement(React.Fragment, null,
|
|
32
41
|
React.createElement(Typography, { className: styles.title }, i18n.text('Selected profile:')),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CollaborationObjectTypes, createRelatedObjectUris } from '@reltio/mdm-sdk';
|
|
2
|
+
import { CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType } from '@reltio/mdm-sdk';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../../constants';
|
|
5
5
|
import CommentsContainer from '../../../CommentsContainer/CommentsContainer';
|
|
@@ -11,13 +11,16 @@ var OneLineRenderer = function (_a) {
|
|
|
11
11
|
var value = _a.value, nonVisibleValues = _a.nonVisibleValues, attributeType = _a.attributeType, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
12
12
|
var styles = useOneLineStyles();
|
|
13
13
|
var label = attributeType.label;
|
|
14
|
+
var objectType = isRelationAttrType(attributeType)
|
|
15
|
+
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
16
|
+
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
14
17
|
return (React.createElement("div", { className: classnames(styles.collaborationWrapper, COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
15
18
|
React.createElement("div", { className: classnames(styles.titleRow, styles.wrapper) },
|
|
16
19
|
React.createElement(Title, { label: label, className: classnames(styles.title, titleClassName), "data-reltio-id": "reltio-attribute-label" }),
|
|
17
20
|
React.createElement(OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues }),
|
|
18
21
|
React.createElement(Attribute, { className: classnames(styles.attribute, contentClassName), attributeValue: value, attributeType: attributeType, showNonOv: showNonOv, inlined: true })),
|
|
19
|
-
React.createElement(CommentsContainer, { uri: value.uri, relatedObjectUris: createRelatedObjectUris(
|
|
22
|
+
React.createElement(CommentsContainer, { uri: value.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
20
23
|
uri: value.uri
|
|
21
|
-
}), objectType:
|
|
24
|
+
}), objectType: objectType })));
|
|
22
25
|
};
|
|
23
26
|
export default OneLineRenderer;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export default ComplexAttribute;
|
|
2
|
-
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv }: {
|
|
2
|
+
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType }: {
|
|
3
3
|
attributeTypesList: any;
|
|
4
4
|
attributeValue: any;
|
|
5
5
|
label: any;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
children: any;
|
|
8
8
|
showNonOv: any;
|
|
9
|
+
attributeType: any;
|
|
9
10
|
}): JSX.Element;
|
|
10
11
|
declare namespace ComplexAttribute {
|
|
11
12
|
namespace propTypes {
|
|
12
|
-
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
-
const label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
14
|
-
const attributeTypesList: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
+
export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
14
|
+
export const label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
|
+
export const attributeTypesList: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
16
|
label: PropTypes.Requireable<string>;
|
|
16
17
|
name: PropTypes.Requireable<string>;
|
|
17
18
|
description: PropTypes.Requireable<string>;
|
|
@@ -26,14 +27,16 @@ declare namespace ComplexAttribute {
|
|
|
26
27
|
maxValue: PropTypes.Requireable<number>;
|
|
27
28
|
}>>;
|
|
28
29
|
}>[]>;
|
|
29
|
-
const attributeValue: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
|
+
export const attributeValue: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
31
|
value: PropTypes.Requireable<object>;
|
|
31
32
|
ov: PropTypes.Requireable<boolean>;
|
|
32
33
|
type: PropTypes.Requireable<string>;
|
|
33
34
|
uri: PropTypes.Requireable<string>;
|
|
34
35
|
}>>;
|
|
35
|
-
const expanded: PropTypes.Requireable<boolean>;
|
|
36
|
-
const showNonOv: PropTypes.Requireable<boolean>;
|
|
36
|
+
export const expanded: PropTypes.Requireable<boolean>;
|
|
37
|
+
export const showNonOv: PropTypes.Requireable<boolean>;
|
|
38
|
+
export { AttributeTypeType as attributeType };
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
import PropTypes from "prop-types";
|
|
42
|
+
import { AttributeTypeType } from "@reltio/mdm-sdk/src/constants";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import { AttributeTypeType, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris } from '@reltio/mdm-sdk';
|
|
4
|
+
import { AttributeTypeType, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType } from '@reltio/mdm-sdk';
|
|
5
5
|
import Typography from '@material-ui/core/Typography';
|
|
6
6
|
import AttributesList from '../AttributesList/AttributesList';
|
|
7
7
|
import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
|
|
@@ -9,7 +9,7 @@ import CommentsContainer from '../../../CommentsContainer/CommentsContainer';
|
|
|
9
9
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../../constants/classnames';
|
|
10
10
|
import { useStyles } from './styles';
|
|
11
11
|
var ComplexAttribute = function (_a) {
|
|
12
|
-
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _b = _a.expanded, expandedProp = _b === void 0 ? false : _b, children = _a.children, showNonOv = _a.showNonOv;
|
|
12
|
+
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _b = _a.expanded, expandedProp = _b === void 0 ? false : _b, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType;
|
|
13
13
|
var styles = useStyles();
|
|
14
14
|
var uri = attributeValue.uri;
|
|
15
15
|
var _c = useState(false), expanded = _c[0], setExpanded = _c[1];
|
|
@@ -21,14 +21,17 @@ var ComplexAttribute = function (_a) {
|
|
|
21
21
|
attributes: hasAnalyticValue ? null : attributeValue.value,
|
|
22
22
|
analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
|
|
23
23
|
}); }, [attributeValue, hasAnalyticValue]);
|
|
24
|
+
var objectType = isRelationAttrType(attributeType)
|
|
25
|
+
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
26
|
+
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
24
27
|
return (React.createElement("div", { className: styles.complexContainer },
|
|
25
28
|
React.createElement("div", { className: classnames(styles.labelContainer, COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
26
29
|
React.createElement(ArrowExpandButton, { onClick: function () { return setExpanded(function (value) { return !value; }); }, expanded: expanded }),
|
|
27
30
|
React.createElement(Typography, { component: "span", variant: "body2", classes: { body2: styles.label }, "data-reltio-id": "reltio-attribute-complex-label" }, label),
|
|
28
31
|
React.createElement("div", { className: styles.spacer }),
|
|
29
|
-
React.createElement(CommentsContainer, { uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(
|
|
32
|
+
React.createElement(CommentsContainer, { uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
30
33
|
uri: attributeValue.uri
|
|
31
|
-
}), objectType:
|
|
34
|
+
}), objectType: objectType })),
|
|
32
35
|
expanded && (React.createElement(AttributesList, { attrTypes: attributeTypesList, entity: attributeListEntity, drawLines: true, parentUri: uri, showNonOv: showNonOv }, children))));
|
|
33
36
|
};
|
|
34
37
|
ComplexAttribute.propTypes = {
|
|
@@ -37,6 +40,7 @@ ComplexAttribute.propTypes = {
|
|
|
37
40
|
attributeTypesList: PropTypes.arrayOf(AttributeTypeType),
|
|
38
41
|
attributeValue: PropTypes.oneOfType([NestedAttributeValueType, ReferenceAttributeValueType]),
|
|
39
42
|
expanded: PropTypes.bool,
|
|
40
|
-
showNonOv: PropTypes.bool
|
|
43
|
+
showNonOv: PropTypes.bool,
|
|
44
|
+
attributeType: AttributeTypeType
|
|
41
45
|
};
|
|
42
46
|
export default ComplexAttribute;
|
|
@@ -42,7 +42,7 @@ var NestedAttribute = function (_a) {
|
|
|
42
42
|
return (React.createElement(PivotingTooltip, { className: styles.pivotingTooltip, value: attributeValue, attributeType: attributeType },
|
|
43
43
|
React.createElement(Box, { component: "span", className: classnames(styles[historyAttributesClassName], styles.label) }, getLabel(label))));
|
|
44
44
|
}, [appearance, styles, attributeValue, attributeType]);
|
|
45
|
-
return (React.createElement(ComplexAttribute, __assign({ label: attributeLabel, attributeValue: attributeValue, attributeTypesList: getAttributeTypeSubAttributes({}, attributeType) }, otherProps)));
|
|
45
|
+
return (React.createElement(ComplexAttribute, __assign({ label: attributeLabel, attributeValue: attributeValue, attributeTypesList: getAttributeTypeSubAttributes({}, attributeType), attributeType: attributeType }, otherProps)));
|
|
46
46
|
};
|
|
47
47
|
NestedAttribute.propTypes = NestedAttributeType;
|
|
48
48
|
export default memo(NestedAttribute);
|
|
@@ -51,7 +51,7 @@ var ReferenceAttribute = function (_a) {
|
|
|
51
51
|
styles,
|
|
52
52
|
uiPath
|
|
53
53
|
]);
|
|
54
|
-
return (React.createElement(ComplexAttribute, __assign({ attributeTypesList: attributeTypeList, attributeValue: attributeValue, label: entityLabel }, otherProps)));
|
|
54
|
+
return (React.createElement(ComplexAttribute, __assign({ attributeTypesList: attributeTypeList, attributeValue: attributeValue, label: entityLabel, attributeType: attributeType }, otherProps)));
|
|
55
55
|
};
|
|
56
56
|
ReferenceAttribute.propTypes = ReferenceAttributeType;
|
|
57
57
|
export default memo(ReferenceAttribute);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { getAttrDataTypeDefinition, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris } from '@reltio/mdm-sdk';
|
|
2
|
+
import { getAttrDataTypeDefinition, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType } from '@reltio/mdm-sdk';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../../constants/classnames';
|
|
5
5
|
import { HistoryDiffContext } from '../../../../contexts/HistoryAppearanceContext';
|
|
@@ -16,13 +16,16 @@ var SimpleAttribute = function (_a) {
|
|
|
16
16
|
var attributeAppearance = getHistoryAppearanceByUri(attributeValue.uri, appearance);
|
|
17
17
|
var historyClassName = getHistoryAttributeClassName(attributeAppearance);
|
|
18
18
|
var dataTypeValue = (React.createElement(DataTypeValue, { value: getAttributeValue(attributeValue), dataTypeDefinition: getAttrDataTypeDefinition(attributeType) }));
|
|
19
|
+
var objectType = isRelationAttrType(attributeType)
|
|
20
|
+
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
21
|
+
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
19
22
|
return inlined || historyClassName ? (React.createElement("div", { className: className },
|
|
20
23
|
React.createElement(PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: classnames((_b = {}, _b[styles.multilineAttribute] = !inlined, _b)) },
|
|
21
24
|
React.createElement("span", { className: styles[historyClassName], "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)))) : (React.createElement("div", { className: classnames(className, styles.root, COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
22
25
|
React.createElement(PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri },
|
|
23
26
|
React.createElement("span", { className: styles.attributeValue, "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)),
|
|
24
|
-
React.createElement(CommentsContainer, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(
|
|
27
|
+
React.createElement(CommentsContainer, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
25
28
|
uri: attributeValue.uri
|
|
26
|
-
}), objectType:
|
|
29
|
+
}), objectType: objectType })));
|
|
27
30
|
};
|
|
28
31
|
export default SimpleAttribute;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1085",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1085",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1085",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|