@reltio/components 1.4.2227 → 1.4.2228
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/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
- package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
- package/SimpleAttribute/SimpleAttribute.d.ts +5 -2
- package/SimpleAttribute/SimpleAttribute.js +15 -7
- package/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
- package/cjs/SimpleAttribute/SimpleAttribute.d.ts +5 -2
- package/cjs/SimpleAttribute/SimpleAttribute.js +19 -11
- package/cjs/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +51 -21
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +56 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +31 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +15 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +53 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +7 -0
- package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
- package/cjs/features/crosswalks/AttributesTable/helpers.js +96 -17
- package/cjs/features/crosswalks/AttributesTable/helpers.test.js +499 -50
- package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -3
- package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
- package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.js +66 -0
- package/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +49 -20
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +58 -2
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +24 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +1 -0
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +8 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +23 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +2 -0
- package/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
- package/features/crosswalks/AttributesTable/helpers.js +95 -18
- package/features/crosswalks/AttributesTable/helpers.test.js +501 -52
- package/features/crosswalks/AttributesTable/types.d.ts +17 -3
- package/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
- package/features/crosswalks/contexts/SyncedValueHeightsContext.js +38 -0
- package/package.json +2 -2
- package/SimpleAttribute/styles.d.ts +0 -1
- package/SimpleAttribute/styles.js +0 -42
- package/cjs/SimpleAttribute/styles.d.ts +0 -1
- package/cjs/SimpleAttribute/styles.js +0 -45
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -13
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -10
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeType, AttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, AttributeValue, OvDetails } from '@reltio/mdm-sdk';
|
|
3
3
|
type SlotParams<T> = {
|
|
4
4
|
attributeType?: AttributeType;
|
|
5
5
|
attributeValue: T;
|
|
6
6
|
};
|
|
7
|
+
type WrapperParams = {
|
|
8
|
+
uri: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
7
11
|
type Props = {
|
|
8
12
|
values: AttributeValue[];
|
|
9
13
|
attributeType: AttributeType;
|
|
@@ -11,7 +15,11 @@ type Props = {
|
|
|
11
15
|
valueContainerClassName?: string;
|
|
12
16
|
LabelRenderer?: ({ attributeType, attributeValue }: SlotParams<AttributeValue>) => React.ReactElement;
|
|
13
17
|
RightSlot?: ({ attributeType, attributeValue }: SlotParams<AttributeValue>) => React.ReactElement;
|
|
18
|
+
FallbackSlot?: ({ ovDetails }: {
|
|
19
|
+
ovDetails: OvDetails;
|
|
20
|
+
}) => React.ReactElement;
|
|
14
21
|
showNonOv?: boolean;
|
|
22
|
+
AttributeValueWrapper?: ({ uri, children }: WrapperParams) => React.ReactElement;
|
|
15
23
|
};
|
|
16
24
|
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, RightSlot, ...props }: Props) => React.JSX.Element>;
|
|
17
25
|
export default _default;
|
|
@@ -27,11 +27,11 @@ import { ReadOnlyImageAttributesLine } from '../ReadOnlyImageAttributesLine';
|
|
|
27
27
|
import { LazyRenderer } from '../LazyRenderer';
|
|
28
28
|
var lazyRendererStyle = { height: '18px' };
|
|
29
29
|
var renderAttributesList = function (_a) {
|
|
30
|
-
var values = _a.values, valueContainerClassName = _a.valueContainerClassName, props = __rest(_a, ["values", "valueContainerClassName"]);
|
|
30
|
+
var values = _a.values, valueContainerClassName = _a.valueContainerClassName, AttributeValueWrapper = _a.AttributeValueWrapper, props = __rest(_a, ["values", "valueContainerClassName", "AttributeValueWrapper"]);
|
|
31
31
|
var enabledLazyRendering = (values === null || values === void 0 ? void 0 : values.length) > 20;
|
|
32
32
|
return (React.createElement(React.Fragment, null, (values || []).map(function (attributeValue) { return (React.createElement(LazyRenderer, { key: attributeValue.uri, className: valueContainerClassName, enabled: enabledLazyRendering, style: lazyRendererStyle },
|
|
33
|
-
React.createElement("div", { className: valueContainerClassName },
|
|
34
|
-
React.createElement(ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props))))); })));
|
|
33
|
+
React.createElement("div", { className: valueContainerClassName }, AttributeValueWrapper ? (React.createElement(AttributeValueWrapper, { uri: attributeValue.uri },
|
|
34
|
+
React.createElement(ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))) : (React.createElement(ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))))); })));
|
|
35
35
|
};
|
|
36
36
|
var ReadOnlyAttributeValuesBlock = function (_a) {
|
|
37
37
|
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, RightSlot = _a.RightSlot, props = __rest(_a, ["expanded", "LabelRenderer", "RightSlot"]);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeType, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, SimpleAttributeValue, OvDetails } from '@reltio/mdm-sdk';
|
|
3
3
|
type Props = {
|
|
4
4
|
className?: string;
|
|
5
5
|
attributeValue: SimpleAttributeValue;
|
|
6
6
|
attributeType: AttributeType;
|
|
7
7
|
inlined?: boolean;
|
|
8
|
+
FallbackSlot?: ({ ovDetails }: {
|
|
9
|
+
ovDetails: OvDetails;
|
|
10
|
+
}) => React.ReactElement;
|
|
8
11
|
};
|
|
9
|
-
export declare const SimpleAttribute: ({ className, attributeType, attributeValue: rawAttributeValue, inlined }: Props) => React.JSX.Element;
|
|
12
|
+
export declare const SimpleAttribute: ({ className, attributeType, attributeValue: rawAttributeValue, inlined, FallbackSlot }: Props) => React.JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
|
-
import { getAttrDataTypeDefinition, getHistoryAppearanceByUri, getAttributeValue, createRelatedObjectUris, isOv, getHistoryAttributeClassName, getObjectTypeByAttributeUri } from '@reltio/mdm-sdk';
|
|
2
|
+
import { getAttrDataTypeDefinition, getHistoryAppearanceByUri, getAttributeValue, createRelatedObjectUris, isOv, getHistoryAttributeClassName, getObjectTypeByAttributeUri, HistoryOperations, historyPalettes } from '@reltio/mdm-sdk';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { useMaskedAttribute } from '../hooks/useMaskedAttribute';
|
|
5
|
+
import { useCssVariableStyles } from '../hooks/useCssVariableStyles';
|
|
5
6
|
import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../constants/classnames';
|
|
6
7
|
import { HistoryDiffContext } from '../contexts/HistoryAppearanceContext';
|
|
7
8
|
import { HighlightedValuesContext } from '../contexts/HighlightedValuesContext';
|
|
@@ -9,15 +10,21 @@ import { CommentsContainer } from '../CommentsContainer';
|
|
|
9
10
|
import { DataTypeValue } from '../DataTypeValue';
|
|
10
11
|
import { PivotingTooltip } from '../PivotingTooltip';
|
|
11
12
|
import { MaskingSwitcher } from '../MaskingSwitcher';
|
|
12
|
-
import
|
|
13
|
+
import styles from './SimpleAttribute.module.css';
|
|
13
14
|
export var SimpleAttribute = function (_a) {
|
|
14
15
|
var _b, _c, _d, _e, _f;
|
|
15
|
-
var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, rawAttributeValue = _a.attributeValue, inlined = _a.inlined;
|
|
16
|
+
var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, rawAttributeValue = _a.attributeValue, inlined = _a.inlined, FallbackSlot = _a.FallbackSlot;
|
|
16
17
|
var _h = useMaskedAttribute({
|
|
17
18
|
attributeType: attributeType,
|
|
18
19
|
attributeValue: rawAttributeValue
|
|
19
20
|
}), isUnmaskingNeeded = _h.isUnmaskingNeeded, isMasked = _h.isMasked, toggleMasking = _h.toggleMasking, attributeValue = _h.attributeValue, isUnmasking = _h.isUnmasking;
|
|
20
|
-
var
|
|
21
|
+
var variableStyles = useCssVariableStyles({
|
|
22
|
+
'--history-insert-color': historyPalettes[HistoryOperations.insertAttribute].color,
|
|
23
|
+
'--history-update-backgroundColor': historyPalettes[HistoryOperations.updateAttribute].backgroundColor,
|
|
24
|
+
'--history-update-color': historyPalettes[HistoryOperations.updateAttribute].color,
|
|
25
|
+
'--history-delete-backgroundColor': historyPalettes[HistoryOperations.deleteAttribute].backgroundColor,
|
|
26
|
+
'--history-delete-color': historyPalettes[HistoryOperations.deleteAttribute].color
|
|
27
|
+
});
|
|
21
28
|
var _j = useContext(HighlightedValuesContext), _k = _j.highlightedValuesUris, highlightedValuesUris = _k === void 0 ? [] : _k, highlightedClassName = _j.highlightedClassName;
|
|
22
29
|
var appearance = useContext(HistoryDiffContext).appearance;
|
|
23
30
|
var attributeAppearance = getHistoryAppearanceByUri(attributeValue.uri, appearance);
|
|
@@ -25,7 +32,7 @@ export var SimpleAttribute = function (_a) {
|
|
|
25
32
|
var dataTypeValue = useMemo(function () { return (React.createElement(DataTypeValue, { value: getAttributeValue(attributeValue), dataTypeDefinition: getAttrDataTypeDefinition(attributeType) })); }, [attributeValue, attributeType]);
|
|
26
33
|
var objectType = getObjectTypeByAttributeUri(attributeValue.uri);
|
|
27
34
|
var unmaskingControl = isUnmaskingNeeded && (React.createElement(MaskingSwitcher, { isMasked: isMasked, onToggleMasking: toggleMasking, isUnmasking: isUnmasking }));
|
|
28
|
-
return inlined || historyClassName ? (React.createElement("div", { className: classnames(className, (_b = {},
|
|
35
|
+
return inlined || historyClassName ? (React.createElement("div", { style: variableStyles, className: classnames(className, (_b = {},
|
|
29
36
|
_b[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
|
|
30
37
|
_b)) },
|
|
31
38
|
React.createElement(PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: classnames((_c = {}, _c[styles.multilineAttribute] = !inlined, _c)) },
|
|
@@ -33,13 +40,14 @@ export var SimpleAttribute = function (_a) {
|
|
|
33
40
|
_d[styles.ovFalse] = !isOv(attributeValue),
|
|
34
41
|
_d)), "data-reltio-id": "reltio-attribute-value" },
|
|
35
42
|
dataTypeValue,
|
|
36
|
-
unmaskingControl)))) : (React.createElement("div", { "data-reltio-id": "comments-container-visibility-area", className: classnames(className, styles.root, COMMENTS_CONTAINER_VISIBILITY_AREA, (_e = {},
|
|
43
|
+
unmaskingControl)))) : (React.createElement("div", { "data-reltio-id": "comments-container-visibility-area", style: variableStyles, className: classnames(className, styles.root, COMMENTS_CONTAINER_VISIBILITY_AREA, (_e = {},
|
|
37
44
|
_e[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
|
|
38
45
|
_e)) },
|
|
39
46
|
React.createElement(PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri },
|
|
40
47
|
React.createElement("span", { className: classnames(styles.attributeValue, (_f = {}, _f[styles.ovFalse] = !isOv(attributeValue), _f)), "data-reltio-id": "reltio-attribute-value" },
|
|
41
48
|
dataTypeValue,
|
|
42
|
-
unmaskingControl
|
|
49
|
+
unmaskingControl,
|
|
50
|
+
FallbackSlot && React.createElement(FallbackSlot, { ovDetails: attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.ovDetails }))),
|
|
43
51
|
React.createElement(CommentsContainer, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
44
52
|
uri: attributeValue.uri
|
|
45
53
|
}), objectType: objectType })));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"root":"SimpleAttribute-root--msTML","commentsContainer":"SimpleAttribute-commentsContainer--kT8wH","attributeValue":"SimpleAttribute-attributeValue--5ESxH","updateAttribute":"SimpleAttribute-updateAttribute--HLqXI","insertAttribute":"SimpleAttribute-insertAttribute--3A5Xi","deleteAttribute":"SimpleAttribute-deleteAttribute--ftsz5","multilineAttribute":"SimpleAttribute-multilineAttribute--xY9V-","ovFalse":"SimpleAttribute-ovFalse--n4JcN"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.SimpleAttribute-root--msTML{align-items:start;display:flex;justify-content:space-between}.SimpleAttribute-commentsContainer--kT8wH{height:15px;margin-right:-4px}.SimpleAttribute-attributeValue--5ESxH{vertical-align:middle;white-space:break-spaces;word-break:break-all}.SimpleAttribute-updateAttribute--HLqXI{background-color:var(--history-update-backgroundColor);color:var(--history-update-color);margin-left:-4px;padding:0 4px;width:fit-content}.SimpleAttribute-updateAttribute--HLqXI>a{color:var(--history-update-color)}.SimpleAttribute-insertAttribute--3A5Xi{color:var(--history-insert-color);width:fit-content}.SimpleAttribute-insertAttribute--3A5Xi>a{color:var(--history-insert-color)}.SimpleAttribute-deleteAttribute--ftsz5{background-color:var(--history-delete-backgroundColor);color:var(--history-delete-color);margin-left:-4px;padding:0 4px;text-decoration:line-through;width:fit-content}.SimpleAttribute-deleteAttribute--ftsz5>a{color:var(--history-delete-color)}.SimpleAttribute-multilineAttribute--xY9V-{width:fit-content}.SimpleAttribute-ovFalse--n4JcN{opacity:var(--mui-inactive-opacity)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeType, AttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, AttributeValue, OvDetails } from '@reltio/mdm-sdk';
|
|
3
3
|
type SlotParams<T> = {
|
|
4
4
|
attributeType?: AttributeType;
|
|
5
5
|
attributeValue: T;
|
|
6
6
|
};
|
|
7
|
+
type WrapperParams = {
|
|
8
|
+
uri: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
7
11
|
type Props = {
|
|
8
12
|
values: AttributeValue[];
|
|
9
13
|
attributeType: AttributeType;
|
|
@@ -11,7 +15,11 @@ type Props = {
|
|
|
11
15
|
valueContainerClassName?: string;
|
|
12
16
|
LabelRenderer?: ({ attributeType, attributeValue }: SlotParams<AttributeValue>) => React.ReactElement;
|
|
13
17
|
RightSlot?: ({ attributeType, attributeValue }: SlotParams<AttributeValue>) => React.ReactElement;
|
|
18
|
+
FallbackSlot?: ({ ovDetails }: {
|
|
19
|
+
ovDetails: OvDetails;
|
|
20
|
+
}) => React.ReactElement;
|
|
14
21
|
showNonOv?: boolean;
|
|
22
|
+
AttributeValueWrapper?: ({ uri, children }: WrapperParams) => React.ReactElement;
|
|
15
23
|
};
|
|
16
24
|
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, RightSlot, ...props }: Props) => React.JSX.Element>;
|
|
17
25
|
export default _default;
|
|
@@ -52,11 +52,11 @@ var ReadOnlyImageAttributesLine_1 = require("../ReadOnlyImageAttributesLine");
|
|
|
52
52
|
var LazyRenderer_1 = require("../LazyRenderer");
|
|
53
53
|
var lazyRendererStyle = { height: '18px' };
|
|
54
54
|
var renderAttributesList = function (_a) {
|
|
55
|
-
var values = _a.values, valueContainerClassName = _a.valueContainerClassName, props = __rest(_a, ["values", "valueContainerClassName"]);
|
|
55
|
+
var values = _a.values, valueContainerClassName = _a.valueContainerClassName, AttributeValueWrapper = _a.AttributeValueWrapper, props = __rest(_a, ["values", "valueContainerClassName", "AttributeValueWrapper"]);
|
|
56
56
|
var enabledLazyRendering = (values === null || values === void 0 ? void 0 : values.length) > 20;
|
|
57
57
|
return (react_1.default.createElement(react_1.default.Fragment, null, (values || []).map(function (attributeValue) { return (react_1.default.createElement(LazyRenderer_1.LazyRenderer, { key: attributeValue.uri, className: valueContainerClassName, enabled: enabledLazyRendering, style: lazyRendererStyle },
|
|
58
|
-
react_1.default.createElement("div", { className: valueContainerClassName },
|
|
59
|
-
react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props))))); })));
|
|
58
|
+
react_1.default.createElement("div", { className: valueContainerClassName }, AttributeValueWrapper ? (react_1.default.createElement(AttributeValueWrapper, { uri: attributeValue.uri },
|
|
59
|
+
react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))) : (react_1.default.createElement(ReadOnlyAttributesFactory_1.ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))))); })));
|
|
60
60
|
};
|
|
61
61
|
var ReadOnlyAttributeValuesBlock = function (_a) {
|
|
62
62
|
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, RightSlot = _a.RightSlot, props = __rest(_a, ["expanded", "LabelRenderer", "RightSlot"]);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeType, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, SimpleAttributeValue, OvDetails } from '@reltio/mdm-sdk';
|
|
3
3
|
type Props = {
|
|
4
4
|
className?: string;
|
|
5
5
|
attributeValue: SimpleAttributeValue;
|
|
6
6
|
attributeType: AttributeType;
|
|
7
7
|
inlined?: boolean;
|
|
8
|
+
FallbackSlot?: ({ ovDetails }: {
|
|
9
|
+
ovDetails: OvDetails;
|
|
10
|
+
}) => React.ReactElement;
|
|
8
11
|
};
|
|
9
|
-
export declare const SimpleAttribute: ({ className, attributeType, attributeValue: rawAttributeValue, inlined }: Props) => React.JSX.Element;
|
|
12
|
+
export declare const SimpleAttribute: ({ className, attributeType, attributeValue: rawAttributeValue, inlined, FallbackSlot }: Props) => React.JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -31,6 +31,7 @@ var react_1 = __importStar(require("react"));
|
|
|
31
31
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
32
32
|
var classnames_1 = __importDefault(require("classnames"));
|
|
33
33
|
var useMaskedAttribute_1 = require("../hooks/useMaskedAttribute");
|
|
34
|
+
var useCssVariableStyles_1 = require("../hooks/useCssVariableStyles");
|
|
34
35
|
var classnames_2 = require("../constants/classnames");
|
|
35
36
|
var HistoryAppearanceContext_1 = require("../contexts/HistoryAppearanceContext");
|
|
36
37
|
var HighlightedValuesContext_1 = require("../contexts/HighlightedValuesContext");
|
|
@@ -38,15 +39,21 @@ var CommentsContainer_1 = require("../CommentsContainer");
|
|
|
38
39
|
var DataTypeValue_1 = require("../DataTypeValue");
|
|
39
40
|
var PivotingTooltip_1 = require("../PivotingTooltip");
|
|
40
41
|
var MaskingSwitcher_1 = require("../MaskingSwitcher");
|
|
41
|
-
var
|
|
42
|
+
var SimpleAttribute_module_css_1 = __importDefault(require("./SimpleAttribute.module.css"));
|
|
42
43
|
var SimpleAttribute = function (_a) {
|
|
43
44
|
var _b, _c, _d, _e, _f;
|
|
44
|
-
var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, rawAttributeValue = _a.attributeValue, inlined = _a.inlined;
|
|
45
|
+
var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, rawAttributeValue = _a.attributeValue, inlined = _a.inlined, FallbackSlot = _a.FallbackSlot;
|
|
45
46
|
var _h = (0, useMaskedAttribute_1.useMaskedAttribute)({
|
|
46
47
|
attributeType: attributeType,
|
|
47
48
|
attributeValue: rawAttributeValue
|
|
48
49
|
}), isUnmaskingNeeded = _h.isUnmaskingNeeded, isMasked = _h.isMasked, toggleMasking = _h.toggleMasking, attributeValue = _h.attributeValue, isUnmasking = _h.isUnmasking;
|
|
49
|
-
var
|
|
50
|
+
var variableStyles = (0, useCssVariableStyles_1.useCssVariableStyles)({
|
|
51
|
+
'--history-insert-color': mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.insertAttribute].color,
|
|
52
|
+
'--history-update-backgroundColor': mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.updateAttribute].backgroundColor,
|
|
53
|
+
'--history-update-color': mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.updateAttribute].color,
|
|
54
|
+
'--history-delete-backgroundColor': mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.deleteAttribute].backgroundColor,
|
|
55
|
+
'--history-delete-color': mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.deleteAttribute].color
|
|
56
|
+
});
|
|
50
57
|
var _j = (0, react_1.useContext)(HighlightedValuesContext_1.HighlightedValuesContext), _k = _j.highlightedValuesUris, highlightedValuesUris = _k === void 0 ? [] : _k, highlightedClassName = _j.highlightedClassName;
|
|
51
58
|
var appearance = (0, react_1.useContext)(HistoryAppearanceContext_1.HistoryDiffContext).appearance;
|
|
52
59
|
var attributeAppearance = (0, mdm_sdk_1.getHistoryAppearanceByUri)(attributeValue.uri, appearance);
|
|
@@ -54,22 +61,23 @@ var SimpleAttribute = function (_a) {
|
|
|
54
61
|
var dataTypeValue = (0, react_1.useMemo)(function () { return (react_1.default.createElement(DataTypeValue_1.DataTypeValue, { value: (0, mdm_sdk_1.getAttributeValue)(attributeValue), dataTypeDefinition: (0, mdm_sdk_1.getAttrDataTypeDefinition)(attributeType) })); }, [attributeValue, attributeType]);
|
|
55
62
|
var objectType = (0, mdm_sdk_1.getObjectTypeByAttributeUri)(attributeValue.uri);
|
|
56
63
|
var unmaskingControl = isUnmaskingNeeded && (react_1.default.createElement(MaskingSwitcher_1.MaskingSwitcher, { isMasked: isMasked, onToggleMasking: toggleMasking, isUnmasking: isUnmasking }));
|
|
57
|
-
return inlined || historyClassName ? (react_1.default.createElement("div", { className: (0, classnames_1.default)(className, (_b = {},
|
|
64
|
+
return inlined || historyClassName ? (react_1.default.createElement("div", { style: variableStyles, className: (0, classnames_1.default)(className, (_b = {},
|
|
58
65
|
_b[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
|
|
59
66
|
_b)) },
|
|
60
|
-
react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: (0, classnames_1.default)((_c = {}, _c[
|
|
61
|
-
react_1.default.createElement("span", { className: (0, classnames_1.default)(
|
|
62
|
-
_d[
|
|
67
|
+
react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: (0, classnames_1.default)((_c = {}, _c[SimpleAttribute_module_css_1.default.multilineAttribute] = !inlined, _c)) },
|
|
68
|
+
react_1.default.createElement("span", { className: (0, classnames_1.default)(SimpleAttribute_module_css_1.default.attributeValue, SimpleAttribute_module_css_1.default[historyClassName], (_d = {},
|
|
69
|
+
_d[SimpleAttribute_module_css_1.default.ovFalse] = !(0, mdm_sdk_1.isOv)(attributeValue),
|
|
63
70
|
_d)), "data-reltio-id": "reltio-attribute-value" },
|
|
64
71
|
dataTypeValue,
|
|
65
|
-
unmaskingControl)))) : (react_1.default.createElement("div", { "data-reltio-id": "comments-container-visibility-area", className: (0, classnames_1.default)(className,
|
|
72
|
+
unmaskingControl)))) : (react_1.default.createElement("div", { "data-reltio-id": "comments-container-visibility-area", style: variableStyles, className: (0, classnames_1.default)(className, SimpleAttribute_module_css_1.default.root, classnames_2.COMMENTS_CONTAINER_VISIBILITY_AREA, (_e = {},
|
|
66
73
|
_e[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
|
|
67
74
|
_e)) },
|
|
68
75
|
react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri },
|
|
69
|
-
react_1.default.createElement("span", { className: (0, classnames_1.default)(
|
|
76
|
+
react_1.default.createElement("span", { className: (0, classnames_1.default)(SimpleAttribute_module_css_1.default.attributeValue, (_f = {}, _f[SimpleAttribute_module_css_1.default.ovFalse] = !(0, mdm_sdk_1.isOv)(attributeValue), _f)), "data-reltio-id": "reltio-attribute-value" },
|
|
70
77
|
dataTypeValue,
|
|
71
|
-
unmaskingControl
|
|
72
|
-
|
|
78
|
+
unmaskingControl,
|
|
79
|
+
FallbackSlot && react_1.default.createElement(FallbackSlot, { ovDetails: attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.ovDetails }))),
|
|
80
|
+
react_1.default.createElement(CommentsContainer_1.CommentsContainer, { className: SimpleAttribute_module_css_1.default.commentsContainer, uri: attributeValue.uri, relatedObjectUris: (0, mdm_sdk_1.createRelatedObjectUris)(objectType, {
|
|
73
81
|
uri: attributeValue.uri
|
|
74
82
|
}), objectType: objectType })));
|
|
75
83
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"root":"SimpleAttribute-root--msTML","commentsContainer":"SimpleAttribute-commentsContainer--kT8wH","attributeValue":"SimpleAttribute-attributeValue--5ESxH","updateAttribute":"SimpleAttribute-updateAttribute--HLqXI","insertAttribute":"SimpleAttribute-insertAttribute--3A5Xi","deleteAttribute":"SimpleAttribute-deleteAttribute--ftsz5","multilineAttribute":"SimpleAttribute-multilineAttribute--xY9V-","ovFalse":"SimpleAttribute-ovFalse--n4JcN"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.SimpleAttribute-root--msTML{align-items:start;display:flex;justify-content:space-between}.SimpleAttribute-commentsContainer--kT8wH{height:15px;margin-right:-4px}.SimpleAttribute-attributeValue--5ESxH{vertical-align:middle;white-space:break-spaces;word-break:break-all}.SimpleAttribute-updateAttribute--HLqXI{background-color:var(--history-update-backgroundColor);color:var(--history-update-color);margin-left:-4px;padding:0 4px;width:fit-content}.SimpleAttribute-updateAttribute--HLqXI>a{color:var(--history-update-color)}.SimpleAttribute-insertAttribute--3A5Xi{color:var(--history-insert-color);width:fit-content}.SimpleAttribute-insertAttribute--3A5Xi>a{color:var(--history-insert-color)}.SimpleAttribute-deleteAttribute--ftsz5{background-color:var(--history-delete-backgroundColor);color:var(--history-delete-color);margin-left:-4px;padding:0 4px;text-decoration:line-through;width:fit-content}.SimpleAttribute-deleteAttribute--ftsz5>a{color:var(--history-delete-color)}.SimpleAttribute-multilineAttribute--xY9V-{width:fit-content}.SimpleAttribute-ovFalse--n4JcN{opacity:var(--mui-inactive-opacity)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -53,6 +53,7 @@ var helpers_1 = require("./helpers");
|
|
|
53
53
|
var ConfirmEditIgnoredDialog_1 = require("./components/ConfirmEditIgnoredDialog");
|
|
54
54
|
var CommonRowCellRenderer_1 = require("./components/CommonRowCellRenderer");
|
|
55
55
|
var LazyRenderer_1 = require("../../../LazyRenderer");
|
|
56
|
+
var SyncedValueHeightsContext_1 = require("../contexts/SyncedValueHeightsContext");
|
|
56
57
|
var styles_1 = require("./styles");
|
|
57
58
|
var DEFAULT_ROW_HEIGHT = 68;
|
|
58
59
|
var getIdFromRowValue = function (rowValue) { return rowValue.ovValues.attributeType.uri; };
|
|
@@ -147,7 +148,8 @@ var AttributesTable = function (_a) {
|
|
|
147
148
|
react_1.default.createElement(ColumnsSettings_1.ColumnsSettings, { columnsData: helpers_1.COLUMNS_DATA, selectedColumns: visibleColumns, onChangeColumns: onChangeVisibleColumns })),
|
|
148
149
|
react_1.default.createElement("div", { className: styles.tableContent },
|
|
149
150
|
isLoading && react_1.default.createElement(LinearLoadIndicator_1.LinearLoadIndicator, null),
|
|
150
|
-
react_1.default.createElement(
|
|
151
|
+
react_1.default.createElement(SyncedValueHeightsContext_1.SyncedValueHeightsProvider, null,
|
|
152
|
+
react_1.default.createElement(BasicTable_1.BasicTable, { ref: tableRef, fixFirstColumn: true, headRowHeight: 48, defaultColumnWidth: 250, defaultColumnMinWidth: 200, columnsData: visibleColumnsData, dndRowReorderingEnabled: false, dndRowReorderingHandler: handleReorderAttributeTypes, getIdFromRowValue: getIdFromRowValue, rowsData: rowsData, onScroll: debouncedNotifyLazyRenderer, renderRowCell: renderRowCell, getRowCellHeight: getRowCellHeight, context: tableContext }))),
|
|
151
153
|
react_1.default.createElement(ConfirmDeleteDialog_1.ConfirmDeleteDialog, { open: !!pendingDeletion, onClose: function () { return setPendingDeletion(null); }, onConfirm: handleDelete }),
|
|
152
154
|
react_1.default.createElement(ConfirmEditIgnoredDialog_1.ConfirmEditIgnoredDialog, { open: !!pendingIgnoredEditing, onClose: function () { return setPendingIgnoredEditing(null); }, onConfirmEditWithIgnore: function () { return pendingIgnoredEditing && onEdit(pendingIgnoredEditing); }, onConfirmEditWithoutIgnore: function () {
|
|
153
155
|
if (pendingIgnoredEditing)
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Entity, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
-
export declare const createEntity: (
|
|
2
|
+
export declare const createEntity: ({ withAppliedSurvivorshipRules }?: {
|
|
3
|
+
withAppliedSurvivorshipRules?: boolean;
|
|
4
|
+
}) => Entity;
|
|
5
|
+
export declare const createEntityWithoutAppliedRule: () => Entity;
|
|
3
6
|
export declare const createMetadata: () => Metadata;
|
|
4
7
|
export declare const selectedAttributeTypes: ({
|
|
5
8
|
description: string;
|
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectedAttributeTypes = exports.createMetadata = exports.createEntity = void 0;
|
|
4
|
-
var
|
|
14
|
+
exports.selectedAttributeTypes = exports.createMetadata = exports.createEntityWithoutAppliedRule = exports.createEntity = void 0;
|
|
15
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
16
|
+
var createEntity = function (_a) {
|
|
17
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.withAppliedSurvivorshipRules, withAppliedSurvivorshipRules = _c === void 0 ? false : _c;
|
|
5
18
|
return {
|
|
6
19
|
uri: 'entities/01L2n5z',
|
|
7
20
|
type: 'configuration/entityTypes/HCP',
|
|
8
21
|
label: 'entity label',
|
|
9
22
|
attributes: {
|
|
10
23
|
Boolean: [
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
24
|
+
__assign({ ov: true, type: 'configuration/entityTypes/HCP/attributes/Boolean', uri: 'entities/01L2n5z/attributes/Boolean/5nmc3Cp', value: 'true' }, (withAppliedSurvivorshipRules && {
|
|
25
|
+
ovDetails: {
|
|
26
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
27
|
+
appliedSurvivorshipRules: 'Frequency'
|
|
28
|
+
}
|
|
29
|
+
}))
|
|
17
30
|
],
|
|
18
31
|
TextField: [
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
__assign({ ov: true, type: 'configuration/entityTypes/HCP/attributes/TextField', uri: 'entities/01L2n5z/attributes/TextField/5noU1aB', value: 'text field value' }, (withAppliedSurvivorshipRules && {
|
|
33
|
+
ovDetails: {
|
|
34
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
35
|
+
appliedSurvivorshipRules: { SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, 'Frequency'] }
|
|
36
|
+
}
|
|
37
|
+
})),
|
|
38
|
+
__assign({ ov: false, type: 'configuration/entityTypes/HCP/attributes/TextField', uri: 'entities/01L2n5z/attributes/TextField/5noU1aB', value: 'another text value', ignored: true }, (withAppliedSurvivorshipRules && {
|
|
39
|
+
ovDetails: {
|
|
40
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
41
|
+
appliedSurvivorshipRules: {
|
|
42
|
+
SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'SRC_SYS'] }, { SRC_SYS: ['SRC_SYS'] }, 'LUD']
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}))
|
|
32
46
|
],
|
|
33
47
|
DeepNested: [
|
|
34
48
|
{
|
|
@@ -107,6 +121,22 @@ var createEntity = function () {
|
|
|
107
121
|
};
|
|
108
122
|
};
|
|
109
123
|
exports.createEntity = createEntity;
|
|
124
|
+
var createEntityWithoutAppliedRule = function () {
|
|
125
|
+
var entity = (0, exports.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
126
|
+
return __assign(__assign({}, entity), { attributes: __assign(__assign({}, entity.attributes), { Boolean: [
|
|
127
|
+
{
|
|
128
|
+
ov: true,
|
|
129
|
+
type: 'configuration/entityTypes/HCP/attributes/Boolean',
|
|
130
|
+
uri: 'entities/01L2n5z/attributes/Boolean/5nmc3CpPinned',
|
|
131
|
+
value: 'false',
|
|
132
|
+
ovDetails: {
|
|
133
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Pinned,
|
|
134
|
+
appliedSurvivorshipRules: 'N/A'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
] }) });
|
|
138
|
+
};
|
|
139
|
+
exports.createEntityWithoutAppliedRule = createEntityWithoutAppliedRule;
|
|
110
140
|
var createMetadata = function () {
|
|
111
141
|
return {
|
|
112
142
|
entityTypes: [
|
|
@@ -451,6 +451,62 @@ describe('attribute table tests', function () {
|
|
|
451
451
|
}
|
|
452
452
|
});
|
|
453
453
|
}); });
|
|
454
|
+
it('should render rule type column and fallback icons correctly according to applied survivorship rules', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
455
|
+
var unmockTableSizing, entity, user, ruleTypeColumns, ovValuesColumns, fallbackIcon, tooltip;
|
|
456
|
+
return __generator(this, function (_a) {
|
|
457
|
+
switch (_a.label) {
|
|
458
|
+
case 0:
|
|
459
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
460
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
461
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
462
|
+
expect(react_2.screen.getByText('Rule type')).toBeInTheDocument();
|
|
463
|
+
ruleTypeColumns = react_2.screen.getAllByTestId('column-name-ruleType');
|
|
464
|
+
expect((0, react_2.within)(ruleTypeColumns[0]).getByText('Frequency')).toBeInTheDocument();
|
|
465
|
+
ovValuesColumns = react_2.screen.getAllByTestId('column-name-ovValues');
|
|
466
|
+
fallbackIcon = (0, test_utils_1.getMuiIconByName)('Info', ovValuesColumns[0]);
|
|
467
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
468
|
+
case 1:
|
|
469
|
+
_a.sent();
|
|
470
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
471
|
+
case 2:
|
|
472
|
+
tooltip = _a.sent();
|
|
473
|
+
expect((0, react_2.within)(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
474
|
+
expect((0, react_2.within)(tooltip).getAllByText('Source system').length).toBe(3);
|
|
475
|
+
expect((0, react_2.within)(tooltip).getByText('Aggregation')).toBeInTheDocument();
|
|
476
|
+
expect((0, react_2.within)(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
477
|
+
expect((0, test_utils_1.getMuiIconsByName)('CancelOutlined', tooltip).length).toBe(4);
|
|
478
|
+
expect((0, test_utils_1.getMuiIconByName)('CheckCircle', tooltip)).toBeInTheDocument();
|
|
479
|
+
expect((0, react_2.within)(ruleTypeColumns[1]).getByText('Frequency')).toBeInTheDocument();
|
|
480
|
+
expect((0, test_utils_1.getMuiIconByName)('Info', ovValuesColumns[1])).not.toBeInTheDocument();
|
|
481
|
+
unmockTableSizing();
|
|
482
|
+
return [2 /*return*/];
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
}); });
|
|
486
|
+
it('should render N/A rule type and show tooltip in case of not participating value', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
487
|
+
var unmockTableSizing, entity, user, ruleTypeColumns, infoIcon, tooltip;
|
|
488
|
+
return __generator(this, function (_a) {
|
|
489
|
+
switch (_a.label) {
|
|
490
|
+
case 0:
|
|
491
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
492
|
+
entity = (0, AttributesTable_test_data_1.createEntityWithoutAppliedRule)();
|
|
493
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
494
|
+
ruleTypeColumns = react_2.screen.getAllByTestId('column-name-ruleType');
|
|
495
|
+
expect((0, react_2.within)(ruleTypeColumns[1]).getByText('N/A')).toBeInTheDocument();
|
|
496
|
+
infoIcon = (0, test_utils_1.getMuiIconByName)('Info', ruleTypeColumns[1]);
|
|
497
|
+
expect(infoIcon).toBeInTheDocument();
|
|
498
|
+
return [4 /*yield*/, user.hover(infoIcon)];
|
|
499
|
+
case 1:
|
|
500
|
+
_a.sent();
|
|
501
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
502
|
+
case 2:
|
|
503
|
+
tooltip = _a.sent();
|
|
504
|
+
expect((0, react_2.within)(tooltip).getByText("Value survives because 'pin' flag is set. Survivorship not evaluated")).toBeInTheDocument();
|
|
505
|
+
unmockTableSizing();
|
|
506
|
+
return [2 /*return*/];
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}); });
|
|
454
510
|
describe('Edit attributes', function () {
|
|
455
511
|
it('should edit attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
456
512
|
var unmockTableSizing, entity, onEdit, props, user;
|
package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FallbackIndicator = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
9
|
+
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
10
|
+
var CheckCircle_1 = __importDefault(require("@mui/icons-material/CheckCircle"));
|
|
11
|
+
var CancelOutlined_1 = __importDefault(require("@mui/icons-material/CancelOutlined"));
|
|
12
|
+
var Info_1 = __importDefault(require("@mui/icons-material/Info"));
|
|
13
|
+
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
14
|
+
var helpers_1 = require("../../helpers");
|
|
15
|
+
var withTooltip_1 = require("../../../../../HOCs/withTooltip");
|
|
16
|
+
var FallbackIndicator_module_css_1 = __importDefault(require("./FallbackIndicator.module.css"));
|
|
17
|
+
var InfoIconWithTooltip = (0, withTooltip_1.withTooltip)(Info_1.default);
|
|
18
|
+
var FallbackIndicator = function (_a) {
|
|
19
|
+
var ovDetails = _a.ovDetails;
|
|
20
|
+
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
21
|
+
var fallbackLabels = (0, helpers_1.getFallbackLabels)(metadata, ovDetails);
|
|
22
|
+
var renderTooltip = function () {
|
|
23
|
+
return (react_1.default.createElement("div", { className: FallbackIndicator_module_css_1.default.fallbackList },
|
|
24
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption", className: FallbackIndicator_module_css_1.default.fallbackTitle }, ui_i18n_1.default.text('OV decision path')),
|
|
25
|
+
fallbackLabels.map(function (label, index) { return (react_1.default.createElement("div", { key: index, className: FallbackIndicator_module_css_1.default.fallbackItem },
|
|
26
|
+
index === fallbackLabels.length - 1 ? (react_1.default.createElement(CheckCircle_1.default, { className: FallbackIndicator_module_css_1.default.fallbackItemIcon })) : (react_1.default.createElement(CancelOutlined_1.default, { className: FallbackIndicator_module_css_1.default.fallbackItemIcon })),
|
|
27
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption" }, label))); })));
|
|
28
|
+
};
|
|
29
|
+
return fallbackLabels.length > 0 ? (react_1.default.createElement(InfoIconWithTooltip, { tooltipTitle: renderTooltip(), className: FallbackIndicator_module_css_1.default.fallbackIcon })) : null;
|
|
30
|
+
};
|
|
31
|
+
exports.FallbackIndicator = FallbackIndicator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"fallbackItem":"FallbackIndicator-fallbackItem--6CBy-","fallbackItemIcon":"FallbackIndicator-fallbackItemIcon--8HsII","fallbackList":"FallbackIndicator-fallbackList--3JCCL","fallbackTitle":"FallbackIndicator-fallbackTitle--abWeO","fallbackIcon":"FallbackIndicator-fallbackIcon--ox4Ec"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.FallbackIndicator-fallbackItem--6CBy-{align-items:center;color:hsla(0,0%,100%,.6);display:flex;font-size:13px;padding-top:8px;position:relative}.FallbackIndicator-fallbackItem--6CBy-:last-child{color:#fff}.FallbackIndicator-fallbackItem--6CBy-:not(:last-child):after{background:hsla(0,0%,100%,.6);content:"";height:8px;left:7px;position:absolute;top:28px;width:2px}.FallbackIndicator-fallbackItemIcon--8HsII{height:16px;margin-right:4px;width:16px}.FallbackIndicator-fallbackList--3JCCL{min-width:150px;padding-bottom:8px;padding-top:8px}.FallbackIndicator-fallbackTitle--abWeO{font-weight:500;padding-bottom:4px}.FallbackIndicator-fallbackIcon--ox4Ec{color:var(--mui-palette-text-secondary);height:16px;margin-left:4px;vertical-align:middle;width:16px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FallbackIndicator } from './FallbackIndicator';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FallbackIndicator = void 0;
|
|
4
|
+
var FallbackIndicator_1 = require("./FallbackIndicator");
|
|
5
|
+
Object.defineProperty(exports, "FallbackIndicator", { enumerable: true, get: function () { return FallbackIndicator_1.FallbackIndicator; } });
|
package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js
CHANGED
|
@@ -22,7 +22,9 @@ var ReadOnlyAttributeValuesBlock_1 = require("../../../../../ReadOnlyAttributeVa
|
|
|
22
22
|
var AttributeTitle_1 = require("../../../../../AttributeTitle");
|
|
23
23
|
var EntityContext_1 = require("../../../../../contexts/EntityContext");
|
|
24
24
|
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
25
|
+
var FallbackIndicator_1 = require("../FallbackIndicator");
|
|
25
26
|
var styles_1 = require("../../styles");
|
|
27
|
+
var SyncedValueHeight_1 = require("../SyncedValueHeight");
|
|
26
28
|
var styles_2 = require("./styles");
|
|
27
29
|
var OvValuesRenderer = function (_a) {
|
|
28
30
|
var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging, draggableProps = _a.draggableProps;
|
|
@@ -34,6 +36,6 @@ var OvValuesRenderer = function (_a) {
|
|
|
34
36
|
react_1.default.createElement(DragIndicator_1.default, { className: styles.dragIndicatorIcon })),
|
|
35
37
|
react_1.default.createElement(AttributeTitle_1.AttributeTitle, { className: styles.attributeTitle, label: attributeType.label }),
|
|
36
38
|
!someRowIsDragging && (react_1.default.createElement(EntityContext_1.EntityContext.Provider, { value: entity },
|
|
37
|
-
react_1.default.createElement(ReadOnlyAttributeValuesBlock_1.ReadOnlyAttributeValuesBlock, { values: values, attributeType: attributeType, valueContainerClassName: styles.ovValue })))));
|
|
39
|
+
react_1.default.createElement(ReadOnlyAttributeValuesBlock_1.ReadOnlyAttributeValuesBlock, { values: values, attributeType: attributeType, valueContainerClassName: styles.ovValue, AttributeValueWrapper: SyncedValueHeight_1.ValueHeightReporter, FallbackSlot: FallbackIndicator_1.FallbackIndicator })))));
|
|
38
40
|
};
|
|
39
41
|
exports.OvValuesRenderer = OvValuesRenderer;
|
package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js
CHANGED
|
@@ -93,7 +93,7 @@ var RuleTypeInfoButton = function (_a) {
|
|
|
93
93
|
var openPopup = function (event) { return setAnchorEl(event.currentTarget); };
|
|
94
94
|
var closePopup = function () { return setAnchorEl(null); };
|
|
95
95
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
96
|
-
react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { icon: Info_1.default, tooltipTitle: ui_i18n_1.default.text('View details'), size: '
|
|
96
|
+
react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { icon: Info_1.default, tooltipTitle: ui_i18n_1.default.text('View details'), size: 'XXS', onClick: openPopup }),
|
|
97
97
|
react_1.default.createElement(Popover_1.default, { classes: { paper: styles.rulePopup }, open: !!anchorEl, anchorEl: anchorEl, onClose: closePopup, anchorOrigin: {
|
|
98
98
|
vertical: 'bottom',
|
|
99
99
|
horizontal: 'right'
|
package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { RuleTypeValues } from '../../types';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
value: RuleTypeValues;
|
|
5
5
|
};
|
|
6
|
-
export declare const RuleTypeRenderer: ({ value: {
|
|
6
|
+
export declare const RuleTypeRenderer: ({ value: { ruleTypes } }: Props) => React.JSX.Element;
|
|
7
7
|
export {};
|