@reltio/components 1.4.2226 → 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.
Files changed (83) hide show
  1. package/AttributeVerificationStatus/AttributeVerificationStatus.module.css.js +2 -2
  2. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  3. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  4. package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.module.css.js +1 -1
  5. package/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  6. package/SimpleAttribute/SimpleAttribute.js +15 -7
  7. package/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  8. package/VerificationButton/VerificationButton.js +9 -17
  9. package/VerificationButton/VerificationButton.module.css.js +2 -2
  10. package/cjs/AttributeVerificationStatus/AttributeVerificationStatus.module.css.js +2 -2
  11. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  12. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  13. package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.module.css.js +1 -1
  14. package/cjs/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  15. package/cjs/SimpleAttribute/SimpleAttribute.js +19 -11
  16. package/cjs/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  17. package/cjs/VerificationButton/VerificationButton.js +9 -17
  18. package/cjs/VerificationButton/VerificationButton.module.css.js +2 -2
  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/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  46. package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  47. package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +49 -20
  48. package/features/crosswalks/AttributesTable/AttributesTable.test.js +58 -2
  49. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  50. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +24 -0
  51. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  52. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  53. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +1 -0
  54. package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  55. package/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  56. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  57. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  58. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  59. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  60. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +8 -0
  61. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  62. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +23 -0
  63. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  64. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +2 -0
  65. package/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  66. package/features/crosswalks/AttributesTable/helpers.js +95 -18
  67. package/features/crosswalks/AttributesTable/helpers.test.js +501 -52
  68. package/features/crosswalks/AttributesTable/types.d.ts +17 -3
  69. package/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  70. package/features/crosswalks/contexts/SyncedValueHeightsContext.js +38 -0
  71. package/package.json +2 -2
  72. package/SimpleAttribute/styles.d.ts +0 -1
  73. package/SimpleAttribute/styles.js +0 -42
  74. package/cjs/SimpleAttribute/styles.d.ts +0 -1
  75. package/cjs/SimpleAttribute/styles.js +0 -45
  76. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  77. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -13
  78. package/cjs/icons/VerifyAllIcon.d.ts +0 -3
  79. package/cjs/icons/VerifyAllIcon.js +0 -26
  80. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  81. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -10
  82. package/icons/VerifyAllIcon.d.ts +0 -3
  83. package/icons/VerifyAllIcon.js +0 -21
@@ -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 {};
@@ -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; } });
@@ -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;
@@ -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: 'XS', onClick: openPopup }),
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'
@@ -3,5 +3,5 @@ import { RuleTypeValues } from '../../types';
3
3
  type Props = {
4
4
  value: RuleTypeValues;
5
5
  };
6
- export declare const RuleTypeRenderer: ({ value: { ruleType, sourcesUriOrder, primaryAttributeUri, comparisonAttributeUri } }: Props) => React.JSX.Element;
6
+ export declare const RuleTypeRenderer: ({ value: { ruleTypes } }: Props) => React.JSX.Element;
7
7
  export {};
@@ -2,24 +2,78 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
+ var _a;
5
6
  Object.defineProperty(exports, "__esModule", { value: true });
6
7
  exports.RuleTypeRenderer = void 0;
7
8
  var react_1 = __importDefault(require("react"));
9
+ var ui_i18n_1 = __importDefault(require("ui-i18n"));
8
10
  var classnames_1 = __importDefault(require("classnames"));
11
+ var Info_1 = __importDefault(require("@mui/icons-material/Info"));
12
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
13
+ var withTooltip_1 = require("../../../../../HOCs/withTooltip");
9
14
  var RuleTypeInfoButton_1 = require("../RuleTypeInfoButton");
10
15
  var styles_1 = require("../../styles");
11
- var styles_2 = require("./styles");
16
+ var SyncedValueHeight_1 = require("../SyncedValueHeight");
17
+ var RuleTypeRenderer_module_css_1 = __importDefault(require("./RuleTypeRenderer.module.css"));
18
+ var InfoIconWithTooltip = (0, withTooltip_1.withTooltip)(Info_1.default);
19
+ var PARTICIPATION_STATUS_MAP = (_a = {},
20
+ Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.Pinned, {
21
+ get: function () {
22
+ return ui_i18n_1.default.text("Value survives because 'pin' flag is set. Survivorship not evaluated");
23
+ },
24
+ enumerable: false,
25
+ configurable: true
26
+ }),
27
+ Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.Ignored, {
28
+ get: function () {
29
+ return ui_i18n_1.default.text("Value did not participate in survivorship evaluation because 'ignore' flag is set");
30
+ },
31
+ enumerable: false,
32
+ configurable: true
33
+ }),
34
+ Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.EndDatedCrosswalk, {
35
+ get: function () {
36
+ return ui_i18n_1.default.text("Value did not participate in survivorship evaluation because it's crosswalk is end-dated");
37
+ },
38
+ enumerable: false,
39
+ configurable: true
40
+ }),
41
+ Object.defineProperty(_a, mdm_sdk_1.ParticipationStatus.NotParticipating, {
42
+ get: function () {
43
+ return ui_i18n_1.default.text('Value did not participate in survivorship evaluation because another value was pinned or the source was ignored');
44
+ },
45
+ enumerable: false,
46
+ configurable: true
47
+ }),
48
+ _a);
12
49
  var RuleTypeRenderer = function (_a) {
13
- var _b = _a.value, ruleType = _b.ruleType, sourcesUriOrder = _b.sourcesUriOrder, primaryAttributeUri = _b.primaryAttributeUri, comparisonAttributeUri = _b.comparisonAttributeUri;
14
- var styles = (0, styles_2.useStyles)();
50
+ var ruleTypes = _a.value.ruleTypes;
15
51
  var commonStyles = (0, styles_1.useCommonStyles)();
16
- var showInfoIcon = sourcesUriOrder || primaryAttributeUri || comparisonAttributeUri;
17
- return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, commonStyles.basicCell) },
18
- react_1.default.createElement("div", { className: styles.label }, ruleType.label),
19
- showInfoIcon && (react_1.default.createElement(RuleTypeInfoButton_1.RuleTypeInfoButton, { info: {
20
- sourcesUriOrder: sourcesUriOrder,
21
- primaryAttributeUri: primaryAttributeUri,
22
- comparisonAttributeUri: comparisonAttributeUri
23
- } }))));
52
+ var renderStrategy = function (data) {
53
+ var strategy = data.strategy, primaryAttributeUri = data.primaryAttributeUri, comparisonAttributeUri = data.comparisonAttributeUri, sourcesUriOrder = data.sourcesUriOrder;
54
+ if (!strategy)
55
+ return null;
56
+ var showInfoIcon = sourcesUriOrder || primaryAttributeUri || comparisonAttributeUri;
57
+ return (react_1.default.createElement("div", { className: RuleTypeRenderer_module_css_1.default.strategyItem },
58
+ react_1.default.createElement("div", { className: RuleTypeRenderer_module_css_1.default.label }, strategy.label),
59
+ showInfoIcon && (react_1.default.createElement(RuleTypeInfoButton_1.RuleTypeInfoButton, { info: {
60
+ sourcesUriOrder: sourcesUriOrder,
61
+ primaryAttributeUri: primaryAttributeUri,
62
+ comparisonAttributeUri: comparisonAttributeUri
63
+ } }))));
64
+ };
65
+ var renderStatus = function (participationStatus) {
66
+ var description = PARTICIPATION_STATUS_MAP[participationStatus];
67
+ return (react_1.default.createElement("div", { className: RuleTypeRenderer_module_css_1.default.statusItem },
68
+ ui_i18n_1.default.text('N/A'),
69
+ description && react_1.default.createElement(InfoIconWithTooltip, { className: RuleTypeRenderer_module_css_1.default.infoIcon, tooltipTitle: description })));
70
+ };
71
+ var renderRuleType = function (item) {
72
+ if (item.type === 'status') {
73
+ return renderStatus(item.data);
74
+ }
75
+ return renderStrategy(item.data);
76
+ };
77
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)(RuleTypeRenderer_module_css_1.default.list, commonStyles.basicCell) }, ruleTypes.map(function (item) { return (react_1.default.createElement(SyncedValueHeight_1.ValueHeightConsumer, { key: item.valueUri, uri: item.valueUri }, renderRuleType(item))); })));
24
78
  };
25
79
  exports.RuleTypeRenderer = RuleTypeRenderer;
@@ -0,0 +1,9 @@
1
+ const styles = {"list":"RuleTypeRenderer-list--IejtI","label":"RuleTypeRenderer-label--9oONL","strategyItem":"RuleTypeRenderer-strategyItem--yfhkv","statusItem":"RuleTypeRenderer-statusItem--R23Qz","infoIcon":"RuleTypeRenderer-infoIcon--LVMk6"};
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 = `.RuleTypeRenderer-list--IejtI:before{content:"";display:block;height:20px}.RuleTypeRenderer-list--IejtI>div+div{margin-top:4px}.RuleTypeRenderer-label--9oONL{margin-right:5px}.RuleTypeRenderer-statusItem--R23Qz,.RuleTypeRenderer-strategyItem--yfhkv{align-items:center;display:flex}.RuleTypeRenderer-infoIcon--LVMk6{color:var(--mui-palette-text-secondary);height:16px;margin-left:4px;width:16px}`;
7
+ head.appendChild(style);
8
+ }
9
+ module.exports = styles;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ type Props = {
3
+ uri: string;
4
+ children: ReactNode;
5
+ };
6
+ export declare const ValueHeightConsumer: ({ uri, children }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,15 @@
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.ValueHeightConsumer = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var SyncedValueHeightsContext_1 = require("../../../contexts/SyncedValueHeightsContext");
9
+ var ValueHeightConsumer = function (_a) {
10
+ var uri = _a.uri, children = _a.children;
11
+ var getHeight = (0, SyncedValueHeightsContext_1.useSyncedValueHeights)().getHeight;
12
+ var height = getHeight(uri);
13
+ return react_1.default.createElement("div", { style: height ? { minHeight: height } : undefined }, children);
14
+ };
15
+ exports.ValueHeightConsumer = ValueHeightConsumer;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ type Props = {
3
+ uri: string;
4
+ children: ReactNode;
5
+ };
6
+ export declare const ValueHeightReporter: ({ uri, children }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ValueHeightReporter = void 0;
30
+ var react_1 = __importStar(require("react"));
31
+ var react_resize_detector_1 = __importDefault(require("react-resize-detector"));
32
+ var SyncedValueHeightsContext_1 = require("../../../contexts/SyncedValueHeightsContext");
33
+ var ValueHeightReporter = function (_a) {
34
+ var uri = _a.uri, children = _a.children;
35
+ var reportHeight = (0, SyncedValueHeightsContext_1.useSyncedValueHeights)().reportHeight;
36
+ var contentRef = (0, react_1.useRef)(null);
37
+ var lastHeightRef = (0, react_1.useRef)();
38
+ var report = (0, react_1.useCallback)(function () {
39
+ var _a;
40
+ var height = (_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight;
41
+ if (!height || height === lastHeightRef.current)
42
+ return;
43
+ lastHeightRef.current = height;
44
+ reportHeight(uri, height);
45
+ }, [reportHeight, uri, lastHeightRef]);
46
+ (0, react_1.useLayoutEffect)(function () {
47
+ report();
48
+ }, [report]);
49
+ return (react_1.default.createElement("div", { ref: contentRef },
50
+ react_1.default.createElement(react_resize_detector_1.default, { handleHeight: true, onResize: report }),
51
+ children));
52
+ };
53
+ exports.ValueHeightReporter = ValueHeightReporter;
@@ -0,0 +1,2 @@
1
+ export { ValueHeightConsumer } from './ValueHeightConsumer';
2
+ export { ValueHeightReporter } from './ValueHeightReporter';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValueHeightReporter = exports.ValueHeightConsumer = void 0;
4
+ var ValueHeightConsumer_1 = require("./ValueHeightConsumer");
5
+ Object.defineProperty(exports, "ValueHeightConsumer", { enumerable: true, get: function () { return ValueHeightConsumer_1.ValueHeightConsumer; } });
6
+ var ValueHeightReporter_1 = require("./ValueHeightReporter");
7
+ Object.defineProperty(exports, "ValueHeightReporter", { enumerable: true, get: function () { return ValueHeightReporter_1.ValueHeightReporter; } });
@@ -1,4 +1,4 @@
1
- import { AttributeType, AttributeValue, Crosswalk, Metadata, RecordAttributesType } from '@reltio/mdm-sdk';
1
+ import { AppliedSurvivorshipRule, AttributeType, AttributeValue, Crosswalk, Metadata, OvDetails, RecordAttributesType } from '@reltio/mdm-sdk';
2
2
  import { CrosswalksMap } from '../../../types';
3
3
  import { CrosswalksByOwnerTypeMap } from '../types';
4
4
  import { AttributesTableRowValue, RuleTypeValues } from './types';
@@ -29,7 +29,9 @@ export declare const COLUMNS_DATA: ({
29
29
  })[];
30
30
  export declare const DEFAULT_VISIBLE_COLUMNS: string[];
31
31
  export declare const countAttributeValues: (type: string, values: AttributeValue[], crosswalksMap: CrosswalksMap) => number;
32
- export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string, activeSurvivorshipGroupUri?: string) => RuleTypeValues;
32
+ export declare const collectRuleNames: (rule: AppliedSurvivorshipRule | undefined) => string[];
33
+ export declare const getFallbackLabels: (metadata: Metadata, ovDetails: OvDetails) => string[];
34
+ export declare const getRuleTypeValues: (metadata: Metadata, attributeType: AttributeType, parentTypeUri: string, attributeValues: AttributeValue[], activeSurvivorshipGroupUri?: string) => RuleTypeValues;
33
35
  export declare const getWinnerCrosswalks: (attributeValues: AttributeValue[], crosswalksMap: CrosswalksMap) => Crosswalk[];
34
36
  export declare const getBasicTableColumnsData: any;
35
37
  export declare const getBasicTableRowsData: (metadata: Metadata, parentTypeUri: string, attrTypes: AttributeType[], columns: string[], crosswalksMap: CrosswalksByOwnerTypeMap, attributes: RecordAttributesType, activeSurvivorshipGroupUri?: string) => AttributesTableRowValue[];
@@ -1,4 +1,15 @@
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
  var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
14
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
15
  if (ar || !(i in from)) {
@@ -12,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
24
  };
14
25
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getBasicTableRowsData = exports.getBasicTableColumnsData = exports.getWinnerCrosswalks = exports.getRuleTypeValues = exports.countAttributeValues = exports.DEFAULT_VISIBLE_COLUMNS = exports.COLUMNS_DATA = void 0;
26
+ exports.getBasicTableRowsData = exports.getBasicTableColumnsData = exports.getWinnerCrosswalks = exports.getRuleTypeValues = exports.getFallbackLabels = exports.collectRuleNames = exports.countAttributeValues = exports.DEFAULT_VISIBLE_COLUMNS = exports.COLUMNS_DATA = void 0;
16
27
  var ui_i18n_1 = __importDefault(require("ui-i18n"));
17
28
  var ramda_1 = require("ramda");
18
29
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
@@ -114,27 +125,95 @@ var fixReferencedAttributeUri = (0, ramda_1.curry)(function (parentType, attrTyp
114
125
  return attrTypeUri;
115
126
  }
116
127
  });
117
- var getRuleTypeValues = function (metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri) {
118
- var _a, _b;
128
+ var collectRuleNames = function (rule) {
129
+ if (!rule) {
130
+ return [];
131
+ }
132
+ if (typeof rule === 'string') {
133
+ return [rule];
134
+ }
135
+ var entries = Object.entries(rule);
136
+ return entries.flatMap(function (_a) {
137
+ var key = _a[0], value = _a[1];
138
+ return __spreadArray([key], value.flatMap(exports.collectRuleNames), true);
139
+ });
140
+ };
141
+ exports.collectRuleNames = collectRuleNames;
142
+ var getFallbackLabels = function (metadata, ovDetails) {
143
+ if ((ovDetails === null || ovDetails === void 0 ? void 0 : ovDetails.participationStatus) && ovDetails.participationStatus !== mdm_sdk_1.ParticipationStatus.Strategy) {
144
+ return [];
145
+ }
146
+ var appliedRules = ovDetails === null || ovDetails === void 0 ? void 0 : ovDetails.appliedSurvivorshipRules;
147
+ var rules = (0, exports.collectRuleNames)(appliedRules);
148
+ if (rules.length <= 1) {
149
+ return [];
150
+ }
151
+ return rules.map(function (uri) { var _a; return ((_a = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, uri)) === null || _a === void 0 ? void 0 : _a.label) || uri; });
152
+ };
153
+ exports.getFallbackLabels = getFallbackLabels;
154
+ var getStrategyAdditionalFields = function (metadata, strategy, mapping, attributeType, currentSurvivorshipGroup) {
155
+ var fixUri = fixReferencedAttributeUri(attributeType);
156
+ var primaryAttributeUri = isOtherAttributeWinnerRule(strategy) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
157
+ var comparisonAttributeUri = (0, mdm_sdk_1.isComplexAttribute)(attributeType) && isMinMaxValueRule(strategy)
158
+ ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.comparisonAttributeUri)
159
+ : undefined;
160
+ var sourcesUriOrder = isSourceSystemRule(strategy)
161
+ ? (0, ramda_1.uniq)(__spreadArray(__spreadArray(__spreadArray([], ((mapping === null || mapping === void 0 ? void 0 : mapping.sourcesUriOrder) || []), true), ((currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.sourcesUriOrder) || []), true), getSourcesUriOrderFromMetadata(metadata), true))
162
+ : undefined;
163
+ return {
164
+ primaryAttributeUri: primaryAttributeUri,
165
+ comparisonAttributeUri: comparisonAttributeUri,
166
+ sourcesUriOrder: sourcesUriOrder
167
+ };
168
+ };
169
+ var getAppliedSurvivorshipRules = function (metadata, mapping, attributeType, attributeValues, currentSurvivorshipGroup) {
170
+ if ((0, mdm_sdk_1.isComplexAttribute)(attributeType) || !attributeValues) {
171
+ return [];
172
+ }
173
+ return (0, ramda_1.pipe)((0, ramda_1.filter)(isOvValue), (0, ramda_1.map)(function (value) {
174
+ var ovDetails = value.ovDetails;
175
+ if (!ovDetails || !ovDetails.appliedSurvivorshipRules) {
176
+ return null;
177
+ }
178
+ if (ovDetails.participationStatus === mdm_sdk_1.ParticipationStatus.Strategy) {
179
+ return { type: 'rule', data: ovDetails.appliedSurvivorshipRules, valueUri: value.uri };
180
+ }
181
+ return { type: 'status', data: ovDetails.participationStatus, valueUri: value.uri };
182
+ }), (0, ramda_1.reject)(ramda_1.isNil), (0, ramda_1.map)(function (ruleOrStatus) {
183
+ if (ruleOrStatus.type === 'status') {
184
+ return ruleOrStatus;
185
+ }
186
+ var appliedRules = (0, exports.collectRuleNames)(ruleOrStatus.data);
187
+ var lastRule = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, (0, ramda_1.last)(appliedRules));
188
+ return lastRule
189
+ ? {
190
+ type: 'rule',
191
+ valueUri: ruleOrStatus.valueUri,
192
+ data: __assign({ strategy: lastRule }, getStrategyAdditionalFields(metadata, lastRule, mapping, attributeType, currentSurvivorshipGroup))
193
+ }
194
+ : null;
195
+ }), (0, ramda_1.reject)(ramda_1.isNil))(attributeValues);
196
+ };
197
+ var getRuleTypeValues = function (metadata, attributeType, parentTypeUri, attributeValues, activeSurvivorshipGroupUri) {
198
+ var _a, _b, _c, _d;
119
199
  var parentType = __spreadArray(__spreadArray([], metadata.entityTypes, true), (metadata.relationTypes || []), true).find((0, ramda_1.propEq)('uri', parentTypeUri));
120
200
  var survivorshipGroups = (_a = parentType === null || parentType === void 0 ? void 0 : parentType.survivorshipGroups) !== null && _a !== void 0 ? _a : [];
121
201
  var currentSurvivorshipGroup = (activeSurvivorshipGroupUri && survivorshipGroups.find((0, ramda_1.propEq)('uri', activeSurvivorshipGroupUri))) ||
122
202
  survivorshipGroups.find((0, ramda_1.propEq)('default', true));
123
203
  var mapping = (_b = currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.mapping) === null || _b === void 0 ? void 0 : _b.find((0, ramda_1.propEq)('attribute', attributeType.uri));
124
- var ruleType = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, mapping === null || mapping === void 0 ? void 0 : mapping.survivorshipStrategy) || (0, mdm_sdk_1.getDefaultSurvivorshipStrategy)(metadata);
125
- var sourcesUriOrder = isSourceSystemRule(ruleType)
126
- ? (0, ramda_1.uniq)(__spreadArray(__spreadArray(__spreadArray([], ((mapping === null || mapping === void 0 ? void 0 : mapping.sourcesUriOrder) || []), true), ((currentSurvivorshipGroup === null || currentSurvivorshipGroup === void 0 ? void 0 : currentSurvivorshipGroup.sourcesUriOrder) || []), true), getSourcesUriOrderFromMetadata(metadata), true))
127
- : undefined;
128
- var fixUri = fixReferencedAttributeUri(attributeType);
129
- var primaryAttributeUri = isOtherAttributeWinnerRule(ruleType) ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.primaryAttributeUri) : undefined;
130
- var comparisonAttributeUri = (0, mdm_sdk_1.isComplexAttribute)(attributeType) && isMinMaxValueRule(ruleType)
131
- ? fixUri(mapping === null || mapping === void 0 ? void 0 : mapping.comparisonAttributeUri)
132
- : undefined;
204
+ var defaultRuleType = (0, mdm_sdk_1.getSurvivorshipStrategy)(metadata, mapping === null || mapping === void 0 ? void 0 : mapping.survivorshipStrategy) || (0, mdm_sdk_1.getDefaultSurvivorshipStrategy)(metadata);
205
+ var appliedSurvivorshipRules = getAppliedSurvivorshipRules(metadata, mapping, attributeType, attributeValues, currentSurvivorshipGroup);
206
+ if (appliedSurvivorshipRules.length > 0) {
207
+ return { ruleTypes: appliedSurvivorshipRules };
208
+ }
133
209
  return {
134
- ruleType: ruleType,
135
- sourcesUriOrder: sourcesUriOrder,
136
- primaryAttributeUri: primaryAttributeUri,
137
- comparisonAttributeUri: comparisonAttributeUri
210
+ ruleTypes: [
211
+ {
212
+ type: 'rule',
213
+ valueUri: (_d = (_c = attributeValues === null || attributeValues === void 0 ? void 0 : attributeValues[0]) === null || _c === void 0 ? void 0 : _c.uri) !== null && _d !== void 0 ? _d : '',
214
+ data: __assign({ strategy: defaultRuleType }, getStrategyAdditionalFields(metadata, defaultRuleType, mapping, attributeType, currentSurvivorshipGroup))
215
+ }
216
+ ]
138
217
  };
139
218
  };
140
219
  exports.getRuleTypeValues = getRuleTypeValues;
@@ -181,7 +260,7 @@ var getRowValueForColumn = function (columnId, metadata, parentTypeUri, attribut
181
260
  case 'count':
182
261
  return (0, exports.countAttributeValues)(attributeType.type, attributeValues, crosswalksMap);
183
262
  case 'ruleType':
184
- return (0, exports.getRuleTypeValues)(metadata, attributeType, parentTypeUri, activeSurvivorshipGroupUri);
263
+ return (0, exports.getRuleTypeValues)(metadata, attributeType, parentTypeUri, attributeValues, activeSurvivorshipGroupUri);
185
264
  case 'winnerSources':
186
265
  return { crosswalks: (0, exports.getWinnerCrosswalks)(attributeValues, crosswalksMap) };
187
266
  default: