@reltio/components 1.4.1796 → 1.4.1797
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/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +1 -1
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +6 -0
- package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.js +1 -1
- package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +1 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +1 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +6 -0
- package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
- package/cjs/SimpleAttribute/SimpleAttribute.test.js +6 -0
- package/cjs/components/CollaborationItem/CommentTarget/CommentTarget.js +2 -2
- package/cjs/components/SidePanel/SidePanel.d.ts +2 -2
- package/cjs/components/SidePanel/SidePanel.js +28 -1
- package/esm/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +2 -2
- package/esm/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +6 -0
- package/esm/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.js +1 -1
- package/esm/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +1 -1
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +2 -2
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +6 -0
- package/esm/SimpleAttribute/SimpleAttribute.js +2 -2
- package/esm/SimpleAttribute/SimpleAttribute.test.js +6 -0
- package/esm/components/CollaborationItem/CommentTarget/CommentTarget.js +2 -2
- package/esm/components/SidePanel/SidePanel.d.ts +2 -2
- package/esm/components/SidePanel/SidePanel.js +5 -1
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ var OneLineRenderer = function (_a) {
|
|
|
18
18
|
var value = _a.value, nonVisibleValues = _a.nonVisibleValues, attributeType = _a.attributeType, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
19
19
|
var styles = (0, styles_1.useOneLineStyles)();
|
|
20
20
|
var label = attributeType.label, description = attributeType.description;
|
|
21
|
-
var objectType = (0, mdm_sdk_1.
|
|
21
|
+
var objectType = (0, mdm_sdk_1.isRelationUri)(value.uri)
|
|
22
22
|
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
23
23
|
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
24
24
|
return (react_1.default.createElement("div", { "data-reltio-id": "one-line-renderer", className: (0, classnames_1.default)(styles.collaborationWrapper, constants_1.COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
@@ -102,5 +102,11 @@ describe('OneLineRenderer tests', function () {
|
|
|
102
102
|
var commentsContainer = component.find(CommentsContainer_1.default);
|
|
103
103
|
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/12rMNliU']);
|
|
104
104
|
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE);
|
|
105
|
+
component.setProps({
|
|
106
|
+
value: __assign(__assign({}, value), { uri: 'entities/sIeHttl/attributes/Reference/r123/Simple/u123' })
|
|
107
|
+
});
|
|
108
|
+
commentsContainer = component.find(CommentsContainer_1.default);
|
|
109
|
+
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/sIeHttl']);
|
|
110
|
+
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
105
111
|
});
|
|
106
112
|
});
|
|
@@ -29,7 +29,7 @@ var SpecialRenderer = function (_a) {
|
|
|
29
29
|
}
|
|
30
30
|
default: {
|
|
31
31
|
//startDate, endDate, "crosswalk" fake nested subattibutes
|
|
32
|
-
return (react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, { className: className, attributeValue: { value: values[0] }, attributeType: attributeType, inlined: true }));
|
|
32
|
+
return (react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, { className: className, attributeValue: { value: values[0], uri: '' }, attributeType: attributeType, inlined: true }));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
};
|
|
@@ -67,7 +67,7 @@ describe('SpecialRenderer tests', function () {
|
|
|
67
67
|
expect(component.find(Title_1.default).length).toBe(1);
|
|
68
68
|
var attribute = component.find(ReadOnlyAttributesFactory_1.ReadOnlyAttribute);
|
|
69
69
|
expect(attribute.length).toBe(1);
|
|
70
|
-
expect(attribute.prop('attributeValue')).toEqual({ value: props.values[0] });
|
|
70
|
+
expect(attribute.prop('attributeValue')).toEqual({ value: props.values[0], uri: '' });
|
|
71
71
|
expect(attribute.prop('attributeType')).toBe(props.attributeType);
|
|
72
72
|
expect(attribute.prop('className')).toBe('attribute');
|
|
73
73
|
expect(attribute.prop('inlined')).toBe(true);
|
|
@@ -61,7 +61,7 @@ var ReadOnlyComplexAttribute = function (_a) {
|
|
|
61
61
|
}, [expandedProp]);
|
|
62
62
|
var hasAnalyticValue = (attributeTypesList || []).some(function (attributeType) { return (0, mdm_sdk_1.isAnalyticAttribute)(attributeType); });
|
|
63
63
|
var attributeListEntity = (0, react_1.useMemo)(function () { return (__assign({ attributes: hasAnalyticValue ? null : attributeValue.value, analyticsAttributes: hasAnalyticValue ? attributeValue.value : null }, ((0, mdm_sdk_1.isSpecialAttribute)(attributeType) ? attributeValue.value : {}))); }, [attributeValue, hasAnalyticValue, attributeType]);
|
|
64
|
-
var objectType = (0, mdm_sdk_1.
|
|
64
|
+
var objectType = (0, mdm_sdk_1.isRelationUri)(attributeValue.uri)
|
|
65
65
|
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
66
66
|
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
67
67
|
return (react_1.default.createElement("div", { className: styles.complexContainer },
|
|
@@ -214,6 +214,12 @@ describe('ReadOnlyComplexAttribute', function () {
|
|
|
214
214
|
expect(commentsContainer.prop('uri')).toBe(nestedAttrValue_test_data_1.nestedAttributeValue.uri);
|
|
215
215
|
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/sIeHttl']);
|
|
216
216
|
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE);
|
|
217
|
+
component.setProps({
|
|
218
|
+
attributeValue: __assign(__assign({}, nestedAttrValue_test_data_1.nestedAttributeValue), { uri: 'entities/123/attributes/Reference/r123/AdditionalAttributes/2zoXFFwDl' })
|
|
219
|
+
});
|
|
220
|
+
commentsContainer = component.find(CommentsContainer_1.default);
|
|
221
|
+
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/123']);
|
|
222
|
+
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
217
223
|
});
|
|
218
224
|
it('should render LabelRenderer instead of label and CommentsContainer if "LabelRenderer" prop is defined', function () {
|
|
219
225
|
var LabelRenderer = function () { return react_1.default.createElement("span", null); };
|
|
@@ -46,7 +46,7 @@ var SimpleAttribute = function (_a) {
|
|
|
46
46
|
var attributeAppearance = (0, mdm_sdk_1.getHistoryAppearanceByUri)(attributeValue.uri, appearance);
|
|
47
47
|
var historyClassName = (0, mdm_sdk_1.getHistoryAttributeClassName)(attributeAppearance);
|
|
48
48
|
var dataTypeValue = (react_1.default.createElement(DataTypeValue_1.default, { value: (0, mdm_sdk_1.getAttributeValue)(attributeValue), dataTypeDefinition: (0, mdm_sdk_1.getAttrDataTypeDefinition)(attributeType) }));
|
|
49
|
-
var objectType = (0, mdm_sdk_1.
|
|
49
|
+
var objectType = (0, mdm_sdk_1.isRelationUri)(attributeValue.uri)
|
|
50
50
|
? mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
51
51
|
: mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
52
52
|
return inlined || historyClassName ? (react_1.default.createElement("div", { className: (0, classnames_1.default)(className, (_b = {},
|
|
@@ -109,6 +109,12 @@ describe('SimpleAttribute tests', function () {
|
|
|
109
109
|
var commentsContainer = component.find(CommentsContainer_1.default);
|
|
110
110
|
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/12rMNliU']);
|
|
111
111
|
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE);
|
|
112
|
+
component.setProps({
|
|
113
|
+
attributeValue: __assign(__assign({}, attributeValue), { uri: 'entities/sIeHttl/attributes/Reference/r123/Simple/u123' })
|
|
114
|
+
});
|
|
115
|
+
commentsContainer = component.find(CommentsContainer_1.default);
|
|
116
|
+
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/sIeHttl']);
|
|
117
|
+
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
112
118
|
});
|
|
113
119
|
it('should render highlighted label', function () {
|
|
114
120
|
var attributeType = { type: 'String', name: 'Name', uri: 'testAttributeUri', label: 'Affiliation Status' };
|
|
@@ -68,8 +68,8 @@ var CommentTarget = function (_a) {
|
|
|
68
68
|
}
|
|
69
69
|
case mdm_sdk_1.CollaborationObjectTypes.RELATION_ATTRIBUTE: {
|
|
70
70
|
var relationTypeUri = comment.relatedObjectUris.find((0, ramda_1.startsWith)('configuration/relationTypes'));
|
|
71
|
-
var attributeTypeUri = (0, mdm_sdk_2.getAttributeTypeUriByValueUri)(comment.objectId, relationTypeUri);
|
|
72
|
-
var attributeType = (0, mdm_sdk_2.findAttributeTypeByUri)(metadata, attributeTypeUri);
|
|
71
|
+
var attributeTypeUri = relationTypeUri && (0, mdm_sdk_2.getAttributeTypeUriByValueUri)(comment.objectId, relationTypeUri);
|
|
72
|
+
var attributeType = attributeTypeUri && (0, mdm_sdk_2.findAttributeTypeByUri)(metadata, attributeTypeUri);
|
|
73
73
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
74
74
|
react_1.default.createElement(Typography_1.default, { className: styles.title }, ui_i18n_1.default.text('Selected attribute:')),
|
|
75
75
|
react_1.default.createElement(Typography_1.default, { className: styles.label }, attributeType === null || attributeType === void 0 ? void 0 : attributeType.label)));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
type Props = {
|
|
3
3
|
width?: number;
|
|
4
4
|
open: boolean;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare const SidePanel:
|
|
7
|
+
export declare const SidePanel: ({ width, open, children }: Props) => JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,4 +1,27 @@
|
|
|
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
|
};
|
|
@@ -6,11 +29,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
29
|
exports.SidePanel = void 0;
|
|
7
30
|
var react_1 = __importDefault(require("react"));
|
|
8
31
|
var styles_1 = require("./styles");
|
|
32
|
+
var ErrorBoundary_1 = __importDefault(require("../ErrorBoundary/ErrorBoundary"));
|
|
33
|
+
var EmptyState_1 = __importStar(require("../EmptyState/EmptyState"));
|
|
34
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
9
35
|
var SidePanel = function (_a) {
|
|
10
36
|
var width = _a.width, open = _a.open, children = _a.children;
|
|
11
37
|
var styles = (0, styles_1.useStyles)();
|
|
12
38
|
return (react_1.default.createElement("div", { className: styles.contentWrapper, "data-reltio-id": "side-panel", style: {
|
|
13
39
|
width: width ? "".concat(open ? width : 0, "px") : '100%'
|
|
14
|
-
} },
|
|
40
|
+
} },
|
|
41
|
+
react_1.default.createElement(ErrorBoundary_1.default, { error: react_1.default.createElement(EmptyState_1.default, { LogoRenderer: EmptyState_1.EMPTY_STATE_ICONS.ERROR, text: ui_i18n_1.default.text('Something went wrong'), variant: EmptyState_1.EMPTY_STATE_VARIANTS.full }) }, open && children)));
|
|
15
42
|
};
|
|
16
43
|
exports.SidePanel = SidePanel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CollaborationObjectTypes, createRelatedObjectUris,
|
|
2
|
+
import { CollaborationObjectTypes, createRelatedObjectUris, isRelationUri } from '@reltio/mdm-sdk';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../constants';
|
|
5
5
|
import CommentsContainer from '../../../components/CommentsContainer/CommentsContainer';
|
|
@@ -12,7 +12,7 @@ export var OneLineRenderer = function (_a) {
|
|
|
12
12
|
var value = _a.value, nonVisibleValues = _a.nonVisibleValues, attributeType = _a.attributeType, titleClassName = _a.titleClassName, contentClassName = _a.contentClassName, showNonOv = _a.showNonOv, totalNonVisibleValues = _a.totalNonVisibleValues;
|
|
13
13
|
var styles = useOneLineStyles();
|
|
14
14
|
var label = attributeType.label, description = attributeType.description;
|
|
15
|
-
var objectType =
|
|
15
|
+
var objectType = isRelationUri(value.uri)
|
|
16
16
|
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
17
17
|
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
18
18
|
return (React.createElement("div", { "data-reltio-id": "one-line-renderer", className: classnames(styles.collaborationWrapper, COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
@@ -97,5 +97,11 @@ describe('OneLineRenderer tests', function () {
|
|
|
97
97
|
var commentsContainer = component.find(CommentsContainer);
|
|
98
98
|
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/12rMNliU']);
|
|
99
99
|
expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.RELATION_ATTRIBUTE);
|
|
100
|
+
component.setProps({
|
|
101
|
+
value: __assign(__assign({}, value), { uri: 'entities/sIeHttl/attributes/Reference/r123/Simple/u123' })
|
|
102
|
+
});
|
|
103
|
+
commentsContainer = component.find(CommentsContainer);
|
|
104
|
+
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/sIeHttl']);
|
|
105
|
+
expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
100
106
|
});
|
|
101
107
|
});
|
|
@@ -23,7 +23,7 @@ export var SpecialRenderer = function (_a) {
|
|
|
23
23
|
}
|
|
24
24
|
default: {
|
|
25
25
|
//startDate, endDate, "crosswalk" fake nested subattibutes
|
|
26
|
-
return (React.createElement(ReadOnlyAttribute, { className: className, attributeValue: { value: values[0] }, attributeType: attributeType, inlined: true }));
|
|
26
|
+
return (React.createElement(ReadOnlyAttribute, { className: className, attributeValue: { value: values[0], uri: '' }, attributeType: attributeType, inlined: true }));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
};
|
|
@@ -62,7 +62,7 @@ describe('SpecialRenderer tests', function () {
|
|
|
62
62
|
expect(component.find(Title).length).toBe(1);
|
|
63
63
|
var attribute = component.find(ReadOnlyAttribute);
|
|
64
64
|
expect(attribute.length).toBe(1);
|
|
65
|
-
expect(attribute.prop('attributeValue')).toEqual({ value: props.values[0] });
|
|
65
|
+
expect(attribute.prop('attributeValue')).toEqual({ value: props.values[0], uri: '' });
|
|
66
66
|
expect(attribute.prop('attributeType')).toBe(props.attributeType);
|
|
67
67
|
expect(attribute.prop('className')).toBe('attribute');
|
|
68
68
|
expect(attribute.prop('inlined')).toBe(true);
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import classnames from 'classnames';
|
|
15
|
-
import { AttributeTypeType, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isOv,
|
|
15
|
+
import { AttributeTypeType, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isOv, isSpecialAttribute, isRelationUri } from '@reltio/mdm-sdk';
|
|
16
16
|
import Typography from '@mui/material/Typography';
|
|
17
17
|
import { ReadOnlyAttributesList } from '../ReadOnlyAttributesList';
|
|
18
18
|
import { ArrowExpandButton } from '../ArrowExpandButton';
|
|
@@ -32,7 +32,7 @@ export var ReadOnlyComplexAttribute = function (_a) {
|
|
|
32
32
|
}, [expandedProp]);
|
|
33
33
|
var hasAnalyticValue = (attributeTypesList || []).some(function (attributeType) { return isAnalyticAttribute(attributeType); });
|
|
34
34
|
var attributeListEntity = useMemo(function () { return (__assign({ attributes: hasAnalyticValue ? null : attributeValue.value, analyticsAttributes: hasAnalyticValue ? attributeValue.value : null }, (isSpecialAttribute(attributeType) ? attributeValue.value : {}))); }, [attributeValue, hasAnalyticValue, attributeType]);
|
|
35
|
-
var objectType =
|
|
35
|
+
var objectType = isRelationUri(attributeValue.uri)
|
|
36
36
|
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
37
37
|
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
38
38
|
return (React.createElement("div", { className: styles.complexContainer },
|
|
@@ -209,6 +209,12 @@ describe('ReadOnlyComplexAttribute', function () {
|
|
|
209
209
|
expect(commentsContainer.prop('uri')).toBe(nestedAttributeValue.uri);
|
|
210
210
|
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/sIeHttl']);
|
|
211
211
|
expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.RELATION_ATTRIBUTE);
|
|
212
|
+
component.setProps({
|
|
213
|
+
attributeValue: __assign(__assign({}, nestedAttributeValue), { uri: 'entities/123/attributes/Reference/r123/AdditionalAttributes/2zoXFFwDl' })
|
|
214
|
+
});
|
|
215
|
+
commentsContainer = component.find(CommentsContainer);
|
|
216
|
+
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/123']);
|
|
217
|
+
expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
212
218
|
});
|
|
213
219
|
it('should render LabelRenderer instead of label and CommentsContainer if "LabelRenderer" prop is defined', function () {
|
|
214
220
|
var LabelRenderer = function () { return React.createElement("span", null); };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { getAttrDataTypeDefinition, getHistoryAppearanceByUri, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris, isOv,
|
|
2
|
+
import { getAttrDataTypeDefinition, getHistoryAppearanceByUri, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris, isOv, getHistoryAttributeClassName, isRelationUri } 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';
|
|
@@ -17,7 +17,7 @@ export var SimpleAttribute = function (_a) {
|
|
|
17
17
|
var attributeAppearance = getHistoryAppearanceByUri(attributeValue.uri, appearance);
|
|
18
18
|
var historyClassName = getHistoryAttributeClassName(attributeAppearance);
|
|
19
19
|
var dataTypeValue = (React.createElement(DataTypeValue, { value: getAttributeValue(attributeValue), dataTypeDefinition: getAttrDataTypeDefinition(attributeType) }));
|
|
20
|
-
var objectType =
|
|
20
|
+
var objectType = isRelationUri(attributeValue.uri)
|
|
21
21
|
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
22
22
|
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
23
23
|
return inlined || historyClassName ? (React.createElement("div", { className: classnames(className, (_b = {},
|
|
@@ -104,6 +104,12 @@ describe('SimpleAttribute tests', function () {
|
|
|
104
104
|
var commentsContainer = component.find(CommentsContainer);
|
|
105
105
|
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/12rMNliU']);
|
|
106
106
|
expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.RELATION_ATTRIBUTE);
|
|
107
|
+
component.setProps({
|
|
108
|
+
attributeValue: __assign(__assign({}, attributeValue), { uri: 'entities/sIeHttl/attributes/Reference/r123/Simple/u123' })
|
|
109
|
+
});
|
|
110
|
+
commentsContainer = component.find(CommentsContainer);
|
|
111
|
+
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/sIeHttl']);
|
|
112
|
+
expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
107
113
|
});
|
|
108
114
|
it('should render highlighted label', function () {
|
|
109
115
|
var attributeType = { type: 'String', name: 'Name', uri: 'testAttributeUri', label: 'Affiliation Status' };
|
|
@@ -39,8 +39,8 @@ export var CommentTarget = function (_a) {
|
|
|
39
39
|
}
|
|
40
40
|
case CollaborationObjectTypes.RELATION_ATTRIBUTE: {
|
|
41
41
|
var relationTypeUri = comment.relatedObjectUris.find(startsWith('configuration/relationTypes'));
|
|
42
|
-
var attributeTypeUri = getAttributeTypeUriByValueUri(comment.objectId, relationTypeUri);
|
|
43
|
-
var attributeType = findAttributeTypeByUri(metadata, attributeTypeUri);
|
|
42
|
+
var attributeTypeUri = relationTypeUri && getAttributeTypeUriByValueUri(comment.objectId, relationTypeUri);
|
|
43
|
+
var attributeType = attributeTypeUri && findAttributeTypeByUri(metadata, attributeTypeUri);
|
|
44
44
|
return (React.createElement(React.Fragment, null,
|
|
45
45
|
React.createElement(Typography, { className: styles.title }, i18n.text('Selected attribute:')),
|
|
46
46
|
React.createElement(Typography, { className: styles.label }, attributeType === null || attributeType === void 0 ? void 0 : attributeType.label)));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
type Props = {
|
|
3
3
|
width?: number;
|
|
4
4
|
open: boolean;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare const SidePanel:
|
|
7
|
+
export declare const SidePanel: ({ width, open, children }: Props) => JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useStyles } from './styles';
|
|
3
|
+
import ErrorBoundary from '../ErrorBoundary/ErrorBoundary';
|
|
4
|
+
import EmptyState, { EMPTY_STATE_ICONS, EMPTY_STATE_VARIANTS } from '../EmptyState/EmptyState';
|
|
5
|
+
import i18n from 'ui-i18n';
|
|
3
6
|
export var SidePanel = function (_a) {
|
|
4
7
|
var width = _a.width, open = _a.open, children = _a.children;
|
|
5
8
|
var styles = useStyles();
|
|
6
9
|
return (React.createElement("div", { className: styles.contentWrapper, "data-reltio-id": "side-panel", style: {
|
|
7
10
|
width: width ? "".concat(open ? width : 0, "px") : '100%'
|
|
8
|
-
} },
|
|
11
|
+
} },
|
|
12
|
+
React.createElement(ErrorBoundary, { error: React.createElement(EmptyState, { LogoRenderer: EMPTY_STATE_ICONS.ERROR, text: i18n.text('Something went wrong'), variant: EMPTY_STATE_VARIANTS.full }) }, open && children)));
|
|
9
13
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1797",
|
|
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
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-sdk": "^1.4.1763",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"d3-cloud": "^1.2.5",
|
|
13
13
|
"d3-geo": "^2.0.1",
|