@reltio/components 1.4.2227 → 1.4.2229

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.
Files changed (85) hide show
  1. package/AttributesFiltersBuilder/AttributesFiltersBuilder.js +5 -4
  2. package/AttributesFiltersBuilder/helpers.js +6 -1
  3. package/FacetsSelector/FacetsSelector.d.ts +1 -1
  4. package/FacetsSelector/FacetsSelector.js +1 -1
  5. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  6. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  7. package/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  8. package/SimpleAttribute/SimpleAttribute.js +15 -7
  9. package/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  10. package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +3 -2
  11. package/cjs/AttributesFiltersBuilder/helpers.js +6 -1
  12. package/cjs/FacetsSelector/FacetsSelector.d.ts +1 -1
  13. package/cjs/FacetsSelector/FacetsSelector.js +1 -1
  14. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  15. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  16. package/cjs/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  17. package/cjs/SimpleAttribute/SimpleAttribute.js +19 -11
  18. package/cjs/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  19. package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  20. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  21. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +51 -21
  22. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +56 -0
  23. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  24. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +31 -0
  25. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  26. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  27. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +5 -0
  28. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  29. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  30. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  31. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  32. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  33. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  34. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +15 -0
  35. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  36. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +53 -0
  37. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  38. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +7 -0
  39. package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  40. package/cjs/features/crosswalks/AttributesTable/helpers.js +96 -17
  41. package/cjs/features/crosswalks/AttributesTable/helpers.test.js +499 -50
  42. package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -3
  43. package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  44. package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.js +66 -0
  45. package/cjs/helpers/attributesSelector.d.ts +2 -3
  46. package/cjs/helpers/attributesSelector.js +16 -18
  47. package/cjs/types/index.d.ts +1 -0
  48. package/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  49. package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  50. package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +49 -20
  51. package/features/crosswalks/AttributesTable/AttributesTable.test.js +58 -2
  52. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  53. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +24 -0
  54. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  55. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  56. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +1 -0
  57. package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  58. package/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  59. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  60. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  61. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  62. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  63. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +8 -0
  64. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  65. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +23 -0
  66. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  67. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +2 -0
  68. package/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  69. package/features/crosswalks/AttributesTable/helpers.js +95 -18
  70. package/features/crosswalks/AttributesTable/helpers.test.js +501 -52
  71. package/features/crosswalks/AttributesTable/types.d.ts +17 -3
  72. package/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  73. package/features/crosswalks/contexts/SyncedValueHeightsContext.js +38 -0
  74. package/helpers/attributesSelector.d.ts +2 -3
  75. package/helpers/attributesSelector.js +16 -17
  76. package/package.json +2 -2
  77. package/types/index.d.ts +1 -0
  78. package/SimpleAttribute/styles.d.ts +0 -1
  79. package/SimpleAttribute/styles.js +0 -42
  80. package/cjs/SimpleAttribute/styles.d.ts +0 -1
  81. package/cjs/SimpleAttribute/styles.js +0 -45
  82. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  83. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -13
  84. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  85. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -10
@@ -20,9 +20,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  };
21
21
  import React, { useCallback, useRef, useMemo, memo } from 'react';
22
22
  import { always, evolve } from 'ramda';
23
- import { SearchOperator, findClosestCommonAncestor, getEntityType } from '@reltio/mdm-sdk';
23
+ import { SearchOperator, findClosestCommonAncestor, findRegularAttribute, getBaseUri, getEntityType } from '@reltio/mdm-sdk';
24
24
  import { EmptyStub } from '../EmptyStub';
25
- import { getAttributeSelectorItems, getOperationalTypeUriFromAttrTypes } from '../helpers/attributesSelector';
25
+ import { getAttributeSelectorItems } from '../helpers/attributesSelector';
26
26
  import { getRowsDataFromFilters } from './helpers';
27
27
  import { AttributesFilterSelector } from '../AttributesFilterSelector';
28
28
  import { RowActions } from './components/RowActions';
@@ -51,12 +51,13 @@ var AttributesFiltersBuilder = function (_a) {
51
51
  var currentEntityType = useMemo(function () {
52
52
  var entityTypesUris = attributesTypesGroups.map(function (_a) {
53
53
  var attributeTypes = _a.attributeTypes;
54
- return getOperationalTypeUriFromAttrTypes(attributeTypes);
54
+ var regularAttribute = findRegularAttribute(attributeTypes);
55
+ return regularAttribute ? getBaseUri(regularAttribute.uri) : null;
55
56
  });
56
57
  var closestEntityTypeAncestorUri = findClosestCommonAncestor(metadata, entityTypesUris);
57
58
  return getEntityType(metadata, closestEntityTypeAncestorUri);
58
59
  }, [attributesTypesGroups, metadata]);
59
- var attributeSelectorItemsGroups = useMemo(function () { return getAttributeSelectorItems(metadata, attributesTypesGroups, attributesTypesGroupFilter); }, [attributesTypesGroups, metadata]);
60
+ var attributeSelectorItemsGroups = useMemo(function () { return getAttributeSelectorItems(metadata, attributesTypesGroups, attributesTypesGroupFilter); }, [metadata, attributesTypesGroups]);
60
61
  var rowsData = useMemo(function () { return (filters.length ? getRowsDataFromFilters(filters, attributeSelectorItemsGroups) : []); }, [attributeSelectorItemsGroups, filters]);
61
62
  var _f = useFilterAutoFocus(rowsData), attributeFilterRef = _f.attributeFilterRef, lastAttributesCountRef = _f.lastAttributesCountRef;
62
63
  attributesCountRef.current = rowsData.length;
@@ -14,10 +14,15 @@ var findAttributeSelectorItem = function (fieldName, attributesGroup) {
14
14
  }
15
15
  };
16
16
  findAttribute(fieldName, attributesGroupItem.attributes);
17
+ if (attrGroup) {
18
+ return "break";
19
+ }
17
20
  };
18
21
  for (var _i = 0, attributesGroup_1 = attributesGroup; _i < attributesGroup_1.length; _i++) {
19
22
  var attributesGroupItem = attributesGroup_1[_i];
20
- _loop_1(attributesGroupItem);
23
+ var state_1 = _loop_1(attributesGroupItem);
24
+ if (state_1 === "break")
25
+ break;
21
26
  }
22
27
  return attrGroup;
23
28
  };
@@ -7,7 +7,7 @@ type Props = {
7
7
  selectedFacetsFieldNames: string[];
8
8
  onOpen: () => void;
9
9
  onClose: () => void;
10
- onFacetToggle: (item: FacetConfig, selected: boolean) => void;
10
+ onFacetToggle: (item: FacetConfig, selected: boolean, groupId?: string) => void;
11
11
  };
12
12
  export declare const FacetsSelector: ({ open, data, selectedFacetsFieldNames, onOpen, onClose, onFacetToggle }: Props) => React.JSX.Element;
13
13
  export default FacetsSelector;
@@ -18,7 +18,7 @@ export var FacetsSelector = function (_a) {
18
18
  }, [onClose]);
19
19
  var handleListItemClick = useCallback(function (facetConfig, checked, groupId) {
20
20
  setLastFacetClicked({ facetConfig: facetConfig, groupId: groupId });
21
- onFacetToggle(facetConfig, checked);
21
+ onFacetToggle(facetConfig, checked, groupId);
22
22
  }, [onFacetToggle]);
23
23
  var handleOpen = useCallback(function () {
24
24
  showSearchInput();
@@ -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 { useStyles } from './styles';
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 styles = useStyles();
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;
@@ -79,12 +79,13 @@ var AttributesFiltersBuilder = function (_a) {
79
79
  var currentEntityType = (0, react_1.useMemo)(function () {
80
80
  var entityTypesUris = attributesTypesGroups.map(function (_a) {
81
81
  var attributeTypes = _a.attributeTypes;
82
- return (0, attributesSelector_1.getOperationalTypeUriFromAttrTypes)(attributeTypes);
82
+ var regularAttribute = (0, mdm_sdk_1.findRegularAttribute)(attributeTypes);
83
+ return regularAttribute ? (0, mdm_sdk_1.getBaseUri)(regularAttribute.uri) : null;
83
84
  });
84
85
  var closestEntityTypeAncestorUri = (0, mdm_sdk_1.findClosestCommonAncestor)(metadata, entityTypesUris);
85
86
  return (0, mdm_sdk_1.getEntityType)(metadata, closestEntityTypeAncestorUri);
86
87
  }, [attributesTypesGroups, metadata]);
87
- var attributeSelectorItemsGroups = (0, react_1.useMemo)(function () { return (0, attributesSelector_1.getAttributeSelectorItems)(metadata, attributesTypesGroups, attributesTypesGroupFilter); }, [attributesTypesGroups, metadata]);
88
+ var attributeSelectorItemsGroups = (0, react_1.useMemo)(function () { return (0, attributesSelector_1.getAttributeSelectorItems)(metadata, attributesTypesGroups, attributesTypesGroupFilter); }, [metadata, attributesTypesGroups]);
88
89
  var rowsData = (0, react_1.useMemo)(function () { return (filters.length ? (0, helpers_1.getRowsDataFromFilters)(filters, attributeSelectorItemsGroups) : []); }, [attributeSelectorItemsGroups, filters]);
89
90
  var _f = (0, useFilterAutoFocus_1.useFilterAutoFocus)(rowsData), attributeFilterRef = _f.attributeFilterRef, lastAttributesCountRef = _f.lastAttributesCountRef;
90
91
  attributesCountRef.current = rowsData.length;
@@ -17,10 +17,15 @@ var findAttributeSelectorItem = function (fieldName, attributesGroup) {
17
17
  }
18
18
  };
19
19
  findAttribute(fieldName, attributesGroupItem.attributes);
20
+ if (attrGroup) {
21
+ return "break";
22
+ }
20
23
  };
21
24
  for (var _i = 0, attributesGroup_1 = attributesGroup; _i < attributesGroup_1.length; _i++) {
22
25
  var attributesGroupItem = attributesGroup_1[_i];
23
- _loop_1(attributesGroupItem);
26
+ var state_1 = _loop_1(attributesGroupItem);
27
+ if (state_1 === "break")
28
+ break;
24
29
  }
25
30
  return attrGroup;
26
31
  };
@@ -7,7 +7,7 @@ type Props = {
7
7
  selectedFacetsFieldNames: string[];
8
8
  onOpen: () => void;
9
9
  onClose: () => void;
10
- onFacetToggle: (item: FacetConfig, selected: boolean) => void;
10
+ onFacetToggle: (item: FacetConfig, selected: boolean, groupId?: string) => void;
11
11
  };
12
12
  export declare const FacetsSelector: ({ open, data, selectedFacetsFieldNames, onOpen, onClose, onFacetToggle }: Props) => React.JSX.Element;
13
13
  export default FacetsSelector;
@@ -47,7 +47,7 @@ var FacetsSelector = function (_a) {
47
47
  }, [onClose]);
48
48
  var handleListItemClick = (0, react_1.useCallback)(function (facetConfig, checked, groupId) {
49
49
  setLastFacetClicked({ facetConfig: facetConfig, groupId: groupId });
50
- onFacetToggle(facetConfig, checked);
50
+ onFacetToggle(facetConfig, checked, groupId);
51
51
  }, [onFacetToggle]);
52
52
  var handleOpen = (0, react_1.useCallback)(function () {
53
53
  showSearchInput();
@@ -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 styles_1 = require("./styles");
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 styles = (0, styles_1.useStyles)();
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[styles.multilineAttribute] = !inlined, _c)) },
61
- react_1.default.createElement("span", { className: (0, classnames_1.default)(styles.attributeValue, styles[historyClassName], (_d = {},
62
- _d[styles.ovFalse] = !(0, mdm_sdk_1.isOv)(attributeValue),
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, styles.root, classnames_2.COMMENTS_CONTAINER_VISIBILITY_AREA, (_e = {},
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)(styles.attributeValue, (_f = {}, _f[styles.ovFalse] = !(0, mdm_sdk_1.isOv)(attributeValue), _f)), "data-reltio-id": "reltio-attribute-value" },
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
- react_1.default.createElement(CommentsContainer_1.CommentsContainer, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: (0, mdm_sdk_1.createRelatedObjectUris)(objectType, {
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(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
+ 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: () => Entity;
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 createEntity = function () {
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
- ov: true,
13
- type: 'configuration/entityTypes/HCP/attributes/Boolean',
14
- uri: 'entities/01L2n5z/attributes/Boolean/5nmc3Cp',
15
- value: 'true'
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
- ov: true,
21
- type: 'configuration/entityTypes/HCP/attributes/TextField',
22
- uri: 'entities/01L2n5z/attributes/TextField/5noU1aB',
23
- value: 'text field value'
24
- },
25
- {
26
- ov: false,
27
- type: 'configuration/entityTypes/HCP/attributes/TextField',
28
- uri: 'entities/01L2n5z/attributes/TextField/5noU1aB',
29
- value: 'another text value',
30
- ignored: true
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;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { OvDetails } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ ovDetails: OvDetails;
5
+ };
6
+ export declare const FallbackIndicator: ({ ovDetails }: Props) => React.JSX.Element;
7
+ export {};