@reltio/components 1.4.2231 → 1.4.2232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/InlineComplexAttribute/InlineComplexAttribute.js +2 -2
- package/InlineComplexAttribute/InlineComplexAttribute.test.js +7 -7
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.d.ts +5 -2
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.d.ts +5 -2
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +3 -3
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.d.ts +5 -2
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +15 -11
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.d.ts +5 -2
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +13 -11
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +5 -2
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +24 -12
- package/SimpleAttribute/SimpleAttribute.js +3 -2
- package/SyncedValueHeight/ValueHeightConsumer.js +12 -0
- package/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightReporter.js +12 -6
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.js +2 -2
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +7 -7
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.d.ts +5 -2
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.d.ts +5 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +3 -3
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.d.ts +5 -2
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +15 -11
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.d.ts +5 -2
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.js +13 -11
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +5 -2
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +23 -11
- package/cjs/SimpleAttribute/SimpleAttribute.js +3 -2
- package/cjs/SyncedValueHeight/ValueHeightConsumer.js +39 -0
- package/cjs/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightReporter.js +11 -5
- package/cjs/contexts/AutoExpandedAttributesContext/index.d.ts +8 -0
- package/cjs/contexts/{ExpandedAttributesContext → AutoExpandedAttributesContext}/index.js +8 -8
- package/cjs/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.js → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js} +3 -3
- package/cjs/contexts/SyncedExpandedAttributesContext/index.d.ts +12 -0
- package/cjs/contexts/SyncedExpandedAttributesContext/index.js +56 -0
- package/{features/crosswalks/contexts/SyncedValueHeightsContext.d.ts → cjs/contexts/SyncedValueHeightsContext/index.d.ts} +2 -2
- package/cjs/{features/crosswalks/contexts/SyncedValueHeightsContext.js → contexts/SyncedValueHeightsContext/index.js} +10 -15
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +5 -3
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +1 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +93 -34
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +290 -56
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.d.ts +11 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.js +32 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/AttributeRule/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.d.ts +10 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.js +60 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/ComplexRule/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +5 -64
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +2 -2
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.d.ts +10 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.js +94 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.module.css.js +9 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/index.d.ts +1 -0
- package/cjs/features/crosswalks/AttributesTable/components/SimpleRule/index.js +5 -0
- package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +1 -2
- package/cjs/features/crosswalks/AttributesTable/helpers.js +82 -56
- package/cjs/features/crosswalks/AttributesTable/helpers.test.js +539 -360
- package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -10
- package/cjs/features/crosswalks/AttributesTable/types.js +6 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +4 -4
- package/contexts/AutoExpandedAttributesContext/index.d.ts +8 -0
- package/contexts/AutoExpandedAttributesContext/index.js +11 -0
- package/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.js → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js} +4 -4
- package/contexts/SyncedExpandedAttributesContext/index.d.ts +12 -0
- package/contexts/SyncedExpandedAttributesContext/index.js +28 -0
- package/{cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts → contexts/SyncedValueHeightsContext/index.d.ts} +2 -2
- package/{features/crosswalks/contexts/SyncedValueHeightsContext.js → contexts/SyncedValueHeightsContext/index.js} +9 -13
- package/features/crosswalks/AttributesTable/AttributesTable.js +5 -3
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +1 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +91 -32
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +291 -57
- package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.d.ts +11 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.js +25 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/AttributeRule/index.js +1 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.d.ts +10 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.js +30 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/ComplexRule.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/ComplexRule/index.js +1 -0
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +6 -65
- package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +2 -2
- package/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.d.ts +10 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.js +64 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/SimpleRule.module.css.js +9 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/index.d.ts +1 -0
- package/features/crosswalks/AttributesTable/components/SimpleRule/index.js +1 -0
- package/features/crosswalks/AttributesTable/helpers.d.ts +1 -2
- package/features/crosswalks/AttributesTable/helpers.js +82 -55
- package/features/crosswalks/AttributesTable/helpers.test.js +540 -361
- package/features/crosswalks/AttributesTable/types.d.ts +17 -10
- package/features/crosswalks/AttributesTable/types.js +5 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/cjs/contexts/ExpandedAttributesContext/index.d.ts +0 -8
- package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +0 -15
- package/contexts/ExpandedAttributesContext/index.d.ts +0 -8
- package/contexts/ExpandedAttributesContext/index.js +0 -11
- package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +0 -8
- /package/{cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightConsumer.d.ts +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/ValueHeightReporter.d.ts +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/index.d.ts +0 -0
- /package/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/index.js +0 -0
- /package/{features/crosswalks/AttributesTable/components → cjs}/SyncedValueHeight/ValueHeightConsumer.d.ts +0 -0
- /package/{features/crosswalks/AttributesTable/components → cjs}/SyncedValueHeight/ValueHeightReporter.d.ts +0 -0
- /package/{features/crosswalks/AttributesTable/components → cjs}/SyncedValueHeight/index.d.ts +0 -0
- /package/cjs/{features/crosswalks/AttributesTable/components/SyncedValueHeight → SyncedValueHeight}/index.js +0 -0
- /package/cjs/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.d.ts → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.d.ts} +0 -0
- /package/contexts/{ExpandedAttributesContext/useAttributeExpanded.test.d.ts → AutoExpandedAttributesContext/useAttributeAutoExpanded.test.d.ts} +0 -0
|
@@ -62,7 +62,7 @@ import { mockDndKit } from '../../../test-utils/dndKit';
|
|
|
62
62
|
import { DndContext } from '@dnd-kit/core';
|
|
63
63
|
import { getMuiIconByName, getMuiIconsByName, mockBasicTableSizing } from '../../../test-utils';
|
|
64
64
|
import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
|
|
65
|
-
import { createEntity,
|
|
65
|
+
import { createEntity, createEntityWithAllParticipationStatuses, createMetadata, selectedAttributeTypes } from './AttributesTable.test-data';
|
|
66
66
|
import AttributesTable from './AttributesTable';
|
|
67
67
|
jest.mock('@dnd-kit/core', function () { return mockDndKit; });
|
|
68
68
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { debounce: function (x) { return x; } })); });
|
|
@@ -446,62 +446,6 @@ describe('attribute table tests', function () {
|
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
448
|
}); });
|
|
449
|
-
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 () {
|
|
450
|
-
var unmockTableSizing, entity, user, ruleTypeColumns, ovValuesColumns, fallbackIcon, tooltip;
|
|
451
|
-
return __generator(this, function (_a) {
|
|
452
|
-
switch (_a.label) {
|
|
453
|
-
case 0:
|
|
454
|
-
unmockTableSizing = mockBasicTableSizing();
|
|
455
|
-
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
456
|
-
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
457
|
-
expect(screen.getByText('Rule type')).toBeInTheDocument();
|
|
458
|
-
ruleTypeColumns = screen.getAllByTestId('column-name-ruleType');
|
|
459
|
-
expect(within(ruleTypeColumns[0]).getByText('Frequency')).toBeInTheDocument();
|
|
460
|
-
ovValuesColumns = screen.getAllByTestId('column-name-ovValues');
|
|
461
|
-
fallbackIcon = getMuiIconByName('Info', ovValuesColumns[0]);
|
|
462
|
-
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
463
|
-
case 1:
|
|
464
|
-
_a.sent();
|
|
465
|
-
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
466
|
-
case 2:
|
|
467
|
-
tooltip = _a.sent();
|
|
468
|
-
expect(within(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
469
|
-
expect(within(tooltip).getAllByText('Source system').length).toBe(3);
|
|
470
|
-
expect(within(tooltip).getByText('Aggregation')).toBeInTheDocument();
|
|
471
|
-
expect(within(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
472
|
-
expect(getMuiIconsByName('CancelOutlined', tooltip).length).toBe(4);
|
|
473
|
-
expect(getMuiIconByName('CheckCircle', tooltip)).toBeInTheDocument();
|
|
474
|
-
expect(within(ruleTypeColumns[1]).getByText('Frequency')).toBeInTheDocument();
|
|
475
|
-
expect(getMuiIconByName('Info', ovValuesColumns[1])).not.toBeInTheDocument();
|
|
476
|
-
unmockTableSizing();
|
|
477
|
-
return [2 /*return*/];
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
}); });
|
|
481
|
-
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 () {
|
|
482
|
-
var unmockTableSizing, entity, user, ruleTypeColumns, infoIcon, tooltip;
|
|
483
|
-
return __generator(this, function (_a) {
|
|
484
|
-
switch (_a.label) {
|
|
485
|
-
case 0:
|
|
486
|
-
unmockTableSizing = mockBasicTableSizing();
|
|
487
|
-
entity = createEntityWithoutAppliedRule();
|
|
488
|
-
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
489
|
-
ruleTypeColumns = screen.getAllByTestId('column-name-ruleType');
|
|
490
|
-
expect(within(ruleTypeColumns[1]).getByText('N/A')).toBeInTheDocument();
|
|
491
|
-
infoIcon = getMuiIconByName('Info', ruleTypeColumns[1]);
|
|
492
|
-
expect(infoIcon).toBeInTheDocument();
|
|
493
|
-
return [4 /*yield*/, user.hover(infoIcon)];
|
|
494
|
-
case 1:
|
|
495
|
-
_a.sent();
|
|
496
|
-
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
497
|
-
case 2:
|
|
498
|
-
tooltip = _a.sent();
|
|
499
|
-
expect(within(tooltip).getByText("Value survives because 'pin' flag is set. Survivorship not evaluated")).toBeInTheDocument();
|
|
500
|
-
unmockTableSizing();
|
|
501
|
-
return [2 /*return*/];
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}); });
|
|
505
449
|
describe('Edit attributes', function () {
|
|
506
450
|
it('should edit attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
507
451
|
var unmockTableSizing, entity, onEdit, props, user;
|
|
@@ -825,4 +769,294 @@ describe('attribute table tests', function () {
|
|
|
825
769
|
}
|
|
826
770
|
});
|
|
827
771
|
}); });
|
|
772
|
+
describe('rule type column behaviour', function () {
|
|
773
|
+
it('should render rule type column and fallback icons correctly according to applied survivorship rules for simple attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
774
|
+
var unmockTableSizing, entity, user, ruleTypeColumns, ovValuesColumns, fallbackIcon, tooltip;
|
|
775
|
+
return __generator(this, function (_a) {
|
|
776
|
+
switch (_a.label) {
|
|
777
|
+
case 0:
|
|
778
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
779
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
780
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
781
|
+
expect(screen.getByText('Rule type')).toBeInTheDocument();
|
|
782
|
+
ruleTypeColumns = screen.getAllByTestId('column-name-ruleType');
|
|
783
|
+
expect(within(ruleTypeColumns[0]).getByText('Frequency')).toBeInTheDocument();
|
|
784
|
+
ovValuesColumns = screen.getAllByTestId('column-name-ovValues');
|
|
785
|
+
fallbackIcon = getMuiIconByName('Info', ovValuesColumns[0]);
|
|
786
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
787
|
+
case 1:
|
|
788
|
+
_a.sent();
|
|
789
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
790
|
+
case 2:
|
|
791
|
+
tooltip = _a.sent();
|
|
792
|
+
expect(within(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
793
|
+
expect(within(tooltip).getAllByText('Source system').length).toBe(3);
|
|
794
|
+
expect(within(tooltip).getByText('Aggregation')).toBeInTheDocument();
|
|
795
|
+
expect(within(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
796
|
+
expect(getMuiIconsByName('CancelOutlined', tooltip).length).toBe(4);
|
|
797
|
+
expect(getMuiIconByName('CheckCircle', tooltip)).toBeInTheDocument();
|
|
798
|
+
expect(within(ruleTypeColumns[1]).getByText('Frequency')).toBeInTheDocument();
|
|
799
|
+
expect(getMuiIconByName('Info', ovValuesColumns[1])).not.toBeInTheDocument();
|
|
800
|
+
unmockTableSizing();
|
|
801
|
+
return [2 /*return*/];
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
}); });
|
|
805
|
+
it('should render N/A rule type and show tooltips for all participation statuses', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
806
|
+
var unmockTableSizing, entity, user, ruleTypeColumns, infoIcons, tooltip;
|
|
807
|
+
return __generator(this, function (_a) {
|
|
808
|
+
switch (_a.label) {
|
|
809
|
+
case 0:
|
|
810
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
811
|
+
entity = createEntityWithAllParticipationStatuses();
|
|
812
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
813
|
+
ruleTypeColumns = screen.getAllByTestId('column-name-ruleType');
|
|
814
|
+
expect(within(ruleTypeColumns[1]).getAllByText('N/A')).toHaveLength(4);
|
|
815
|
+
infoIcons = getMuiIconsByName('Info', ruleTypeColumns[1]);
|
|
816
|
+
expect(infoIcons).toHaveLength(4);
|
|
817
|
+
return [4 /*yield*/, user.hover(infoIcons[0])];
|
|
818
|
+
case 1:
|
|
819
|
+
_a.sent();
|
|
820
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
821
|
+
case 2:
|
|
822
|
+
tooltip = _a.sent();
|
|
823
|
+
expect(within(tooltip).getByText("Value survives because 'pin' flag is set. Survivorship not evaluated")).toBeInTheDocument();
|
|
824
|
+
return [4 /*yield*/, user.hover(infoIcons[1])];
|
|
825
|
+
case 3:
|
|
826
|
+
_a.sent();
|
|
827
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
828
|
+
case 4:
|
|
829
|
+
tooltip = _a.sent();
|
|
830
|
+
expect(within(tooltip).getByText("Value did not participate in survivorship evaluation because 'ignore' flag is set")).toBeInTheDocument();
|
|
831
|
+
return [4 /*yield*/, user.hover(infoIcons[2])];
|
|
832
|
+
case 5:
|
|
833
|
+
_a.sent();
|
|
834
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
835
|
+
case 6:
|
|
836
|
+
tooltip = _a.sent();
|
|
837
|
+
expect(within(tooltip).getByText('Value did not participate in survivorship evaluation because its crosswalk is end-dated')).toBeInTheDocument();
|
|
838
|
+
return [4 /*yield*/, user.hover(infoIcons[3])];
|
|
839
|
+
case 7:
|
|
840
|
+
_a.sent();
|
|
841
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
842
|
+
case 8:
|
|
843
|
+
tooltip = _a.sent();
|
|
844
|
+
expect(within(tooltip).getByText('Value did not participate in survivorship evaluation because another value was pinned or the source was ignored')).toBeInTheDocument();
|
|
845
|
+
unmockTableSizing();
|
|
846
|
+
return [2 /*return*/];
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
}); });
|
|
850
|
+
it('should render correct rule type column for nested attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
851
|
+
var unmockTableSizing, entity, user, nestedRuleTypeCell, expandButton;
|
|
852
|
+
return __generator(this, function (_a) {
|
|
853
|
+
switch (_a.label) {
|
|
854
|
+
case 0:
|
|
855
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
856
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
857
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
858
|
+
nestedRuleTypeCell = getCellByIndexes(2, 1);
|
|
859
|
+
expect(within(nestedRuleTypeCell).getByText('Source system')).toBeInTheDocument();
|
|
860
|
+
expandButton = within(nestedRuleTypeCell).getByTestId('arrow-expand-button');
|
|
861
|
+
expect(expandButton).toBeInTheDocument();
|
|
862
|
+
expect(within(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
863
|
+
expect(within(nestedRuleTypeCell).queryByText('Recency')).not.toBeInTheDocument();
|
|
864
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
865
|
+
case 1:
|
|
866
|
+
_a.sent();
|
|
867
|
+
expect(within(nestedRuleTypeCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
868
|
+
expect(within(nestedRuleTypeCell).getByText('Recency')).toBeInTheDocument();
|
|
869
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
870
|
+
case 2:
|
|
871
|
+
_a.sent();
|
|
872
|
+
expect(within(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
873
|
+
expect(within(nestedRuleTypeCell).queryByText('Recency')).not.toBeInTheDocument();
|
|
874
|
+
unmockTableSizing();
|
|
875
|
+
return [2 /*return*/];
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
}); });
|
|
879
|
+
it('should render correct rule type column for reference attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
880
|
+
var unmockTableSizing, entity, user, referenceRuleTypeCell, expandButton;
|
|
881
|
+
return __generator(this, function (_a) {
|
|
882
|
+
switch (_a.label) {
|
|
883
|
+
case 0:
|
|
884
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
885
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
886
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
887
|
+
referenceRuleTypeCell = getCellByIndexes(3, 1);
|
|
888
|
+
expect(within(referenceRuleTypeCell).getByText('Minimum value')).toBeInTheDocument();
|
|
889
|
+
expandButton = within(referenceRuleTypeCell).getByTestId('arrow-expand-button');
|
|
890
|
+
expect(expandButton).toBeInTheDocument();
|
|
891
|
+
expect(within(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
892
|
+
expect(within(referenceRuleTypeCell).queryByText('Frequency')).not.toBeInTheDocument();
|
|
893
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
894
|
+
case 1:
|
|
895
|
+
_a.sent();
|
|
896
|
+
expect(within(referenceRuleTypeCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
897
|
+
expect(within(referenceRuleTypeCell).getByText('Frequency')).toBeInTheDocument();
|
|
898
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
899
|
+
case 2:
|
|
900
|
+
_a.sent();
|
|
901
|
+
expect(within(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
902
|
+
expect(within(referenceRuleTypeCell).queryByText('Frequency')).not.toBeInTheDocument();
|
|
903
|
+
unmockTableSizing();
|
|
904
|
+
return [2 /*return*/];
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
}); });
|
|
908
|
+
it('should synchronize expansion between nested OV values and rule type columns', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
909
|
+
var unmockTableSizing, entity, user, nestedOvValuesCell, nestedRuleTypeCell, ovExpandButton, ruleTypeExpandButton;
|
|
910
|
+
return __generator(this, function (_a) {
|
|
911
|
+
switch (_a.label) {
|
|
912
|
+
case 0:
|
|
913
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
914
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
915
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
916
|
+
nestedOvValuesCell = getCellByIndexes(2, 0);
|
|
917
|
+
nestedRuleTypeCell = getCellByIndexes(2, 1);
|
|
918
|
+
ovExpandButton = within(nestedOvValuesCell).getByTestId('arrow-expand-button');
|
|
919
|
+
ruleTypeExpandButton = within(nestedRuleTypeCell).getByTestId('arrow-expand-button');
|
|
920
|
+
expect(within(nestedOvValuesCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
921
|
+
expect(within(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
922
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
923
|
+
case 1:
|
|
924
|
+
_a.sent();
|
|
925
|
+
expect(within(nestedOvValuesCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
926
|
+
expect(within(nestedRuleTypeCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
927
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
928
|
+
case 2:
|
|
929
|
+
_a.sent();
|
|
930
|
+
expect(within(nestedOvValuesCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
931
|
+
expect(within(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
932
|
+
return [4 /*yield*/, user.click(ruleTypeExpandButton)];
|
|
933
|
+
case 3:
|
|
934
|
+
_a.sent();
|
|
935
|
+
expect(within(nestedOvValuesCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
936
|
+
expect(within(nestedRuleTypeCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
937
|
+
unmockTableSizing();
|
|
938
|
+
return [2 /*return*/];
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
}); });
|
|
942
|
+
it('should synchronize expansion between reference OV values and rule type columns', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
943
|
+
var unmockTableSizing, entity, user, referenceOvValuesCell, referenceRuleTypeCell, ovExpandButton, ruleTypeExpandButton;
|
|
944
|
+
return __generator(this, function (_a) {
|
|
945
|
+
switch (_a.label) {
|
|
946
|
+
case 0:
|
|
947
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
948
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
949
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
950
|
+
referenceOvValuesCell = getCellByIndexes(3, 0);
|
|
951
|
+
referenceRuleTypeCell = getCellByIndexes(3, 1);
|
|
952
|
+
ovExpandButton = within(referenceOvValuesCell).getByTestId('arrow-expand-button');
|
|
953
|
+
ruleTypeExpandButton = within(referenceRuleTypeCell).getByTestId('arrow-expand-button');
|
|
954
|
+
expect(within(referenceOvValuesCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
955
|
+
expect(within(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
956
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
957
|
+
case 1:
|
|
958
|
+
_a.sent();
|
|
959
|
+
expect(within(referenceOvValuesCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
960
|
+
expect(within(referenceRuleTypeCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
961
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
962
|
+
case 2:
|
|
963
|
+
_a.sent();
|
|
964
|
+
expect(within(referenceOvValuesCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
965
|
+
expect(within(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
966
|
+
return [4 /*yield*/, user.click(ruleTypeExpandButton)];
|
|
967
|
+
case 3:
|
|
968
|
+
_a.sent();
|
|
969
|
+
expect(within(referenceOvValuesCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
970
|
+
expect(within(referenceRuleTypeCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
971
|
+
unmockTableSizing();
|
|
972
|
+
return [2 /*return*/];
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
}); });
|
|
976
|
+
it('should render fallback icons correctly for nested attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
977
|
+
var unmockTableSizing, entity, user, ovValueCell, fallbackIcon, tooltip, fallbackIcons;
|
|
978
|
+
return __generator(this, function (_a) {
|
|
979
|
+
switch (_a.label) {
|
|
980
|
+
case 0:
|
|
981
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
982
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
983
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
984
|
+
ovValueCell = screen.getAllByTestId('column-name-ovValues')[2];
|
|
985
|
+
fallbackIcon = getMuiIconByName('Info', ovValueCell);
|
|
986
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
987
|
+
case 1:
|
|
988
|
+
_a.sent();
|
|
989
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
990
|
+
case 2:
|
|
991
|
+
tooltip = _a.sent();
|
|
992
|
+
expect(within(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
993
|
+
expect(within(tooltip).getAllByText('Source system').length).toBe(3);
|
|
994
|
+
expect(within(tooltip).getByText('Aggregation')).toBeInTheDocument();
|
|
995
|
+
expect(within(tooltip).getByText('Recency')).toBeInTheDocument();
|
|
996
|
+
return [4 /*yield*/, user.unhover(fallbackIcon)];
|
|
997
|
+
case 3:
|
|
998
|
+
_a.sent();
|
|
999
|
+
return [4 /*yield*/, user.click(within(ovValueCell).getByTestId('arrow-expand-button'))];
|
|
1000
|
+
case 4:
|
|
1001
|
+
_a.sent();
|
|
1002
|
+
fallbackIcons = getMuiIconsByName('Info', ovValueCell);
|
|
1003
|
+
expect(fallbackIcons.length).toBe(2);
|
|
1004
|
+
return [4 /*yield*/, user.hover(fallbackIcons[1])];
|
|
1005
|
+
case 5:
|
|
1006
|
+
_a.sent();
|
|
1007
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
1008
|
+
case 6:
|
|
1009
|
+
tooltip = _a.sent();
|
|
1010
|
+
expect(within(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
1011
|
+
expect(within(tooltip).getAllByText('Recency').length).toBe(4);
|
|
1012
|
+
expect(within(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
1013
|
+
unmockTableSizing();
|
|
1014
|
+
return [2 /*return*/];
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
}); });
|
|
1018
|
+
it('should render fallback icons correctly for reference attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1019
|
+
var unmockTableSizing, entity, user, ovValueCell, fallbackIcon, tooltip, fallbackIcons;
|
|
1020
|
+
return __generator(this, function (_a) {
|
|
1021
|
+
switch (_a.label) {
|
|
1022
|
+
case 0:
|
|
1023
|
+
unmockTableSizing = mockBasicTableSizing();
|
|
1024
|
+
entity = createEntity({ withAppliedSurvivorshipRules: true });
|
|
1025
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
1026
|
+
ovValueCell = screen.getAllByTestId('column-name-ovValues')[3];
|
|
1027
|
+
fallbackIcon = getMuiIconByName('Info', ovValueCell);
|
|
1028
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
1029
|
+
case 1:
|
|
1030
|
+
_a.sent();
|
|
1031
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
1032
|
+
case 2:
|
|
1033
|
+
tooltip = _a.sent();
|
|
1034
|
+
expect(within(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
1035
|
+
expect(within(tooltip).getAllByText('Minimum value').length).toBe(2);
|
|
1036
|
+
expect(within(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
1037
|
+
expect(within(tooltip).getByText('Recency')).toBeInTheDocument();
|
|
1038
|
+
return [4 /*yield*/, user.unhover(fallbackIcon)];
|
|
1039
|
+
case 3:
|
|
1040
|
+
_a.sent();
|
|
1041
|
+
return [4 /*yield*/, user.click(within(ovValueCell).getByTestId('arrow-expand-button'))];
|
|
1042
|
+
case 4:
|
|
1043
|
+
_a.sent();
|
|
1044
|
+
fallbackIcons = getMuiIconsByName('Info', ovValueCell);
|
|
1045
|
+
expect(fallbackIcons.length).toBe(2);
|
|
1046
|
+
return [4 /*yield*/, user.hover(fallbackIcons[1])];
|
|
1047
|
+
case 5:
|
|
1048
|
+
_a.sent();
|
|
1049
|
+
return [4 /*yield*/, screen.findByRole('tooltip')];
|
|
1050
|
+
case 6:
|
|
1051
|
+
tooltip = _a.sent();
|
|
1052
|
+
expect(within(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
1053
|
+
expect(within(tooltip).getAllByText('Frequency').length).toBe(3);
|
|
1054
|
+
expect(within(tooltip).getByText('Recency')).toBeInTheDocument();
|
|
1055
|
+
expect(within(tooltip).getByText('Minimum value')).toBeInTheDocument();
|
|
1056
|
+
unmockTableSizing();
|
|
1057
|
+
return [2 /*return*/];
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
}); });
|
|
1061
|
+
});
|
|
828
1062
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, AttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { RuleTypeValues } from '../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
attributeType: AttributeType;
|
|
6
|
+
values: AttributeValue[];
|
|
7
|
+
getRuleTypeData: RuleTypeValues['getRuleTypeData'];
|
|
8
|
+
parentUri?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const AttributeRule: ({ attributeType, values, getRuleTypeData, parentUri }: Props) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { filter } from 'ramda';
|
|
4
|
+
import { isComplexAttribute, isOv } from '@reltio/mdm-sdk';
|
|
5
|
+
import { ComplexRule } from '../ComplexRule';
|
|
6
|
+
import { SimpleRule } from '../SimpleRule';
|
|
7
|
+
import { AttributeTitle } from '../../../../../AttributeTitle';
|
|
8
|
+
import { ValueHeightConsumer } from '../../../../../SyncedValueHeight';
|
|
9
|
+
import styles from './AttributeRule.module.css';
|
|
10
|
+
export var AttributeRule = function (_a) {
|
|
11
|
+
var attributeType = _a.attributeType, values = _a.values, getRuleTypeData = _a.getRuleTypeData, parentUri = _a.parentUri;
|
|
12
|
+
var ovValues = filter(isOv, values);
|
|
13
|
+
var blockUri = parentUri ? "".concat(parentUri, "/").concat(attributeType.uri) : attributeType.uri;
|
|
14
|
+
var renderValue = function (value) {
|
|
15
|
+
var content = isComplexAttribute(attributeType) ? (React.createElement(ComplexRule, { attributeType: attributeType, attributeValue: value, getRuleTypeData: getRuleTypeData })) : (React.createElement(SimpleRule, { attributeValue: value, attributeType: attributeType, getRuleTypeData: getRuleTypeData }));
|
|
16
|
+
return (React.createElement(ValueHeightConsumer, { key: value.uri, uri: value.uri }, content));
|
|
17
|
+
};
|
|
18
|
+
return ovValues.length === 1 && !isComplexAttribute(attributeType) ? (React.createElement(ValueHeightConsumer, { uri: ovValues[0].uri },
|
|
19
|
+
React.createElement("div", { className: styles.oneLineRule },
|
|
20
|
+
React.createElement(AttributeTitle, { label: attributeType.label, className: classnames(styles.label, styles.labelMargin) }),
|
|
21
|
+
React.createElement(SimpleRule, { attributeValue: ovValues[0], attributeType: attributeType, getRuleTypeData: getRuleTypeData })))) : (React.createElement(ValueHeightConsumer, { uri: blockUri },
|
|
22
|
+
React.createElement(React.Fragment, null,
|
|
23
|
+
React.createElement(AttributeTitle, { label: attributeType.label, className: styles.label }),
|
|
24
|
+
React.createElement("div", { className: styles.valuesList }, values.map(renderValue)))));
|
|
25
|
+
};
|
package/features/crosswalks/AttributesTable/components/AttributeRule/AttributeRule.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"label":"AttributeRule-label--61r2v","labelMargin":"AttributeRule-labelMargin--xs5k8","oneLineRule":"AttributeRule-oneLineRule--wyGzN","valuesList":"AttributeRule-valuesList--0M64-"};
|
|
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 = `.AttributeRule-label--61r2v{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AttributeRule-labelMargin--xs5k8{margin-right:12px}.AttributeRule-oneLineRule--wyGzN{align-items:center;display:flex}.AttributeRule-valuesList--0M64-{margin-left:9px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AttributeRule } from './AttributeRule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AttributeRule } from './AttributeRule';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
3
|
+
import { AttributeValueLite, RuleTypeValues } from '../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
attributeType: AttributeType;
|
|
6
|
+
attributeValue: AttributeValueLite;
|
|
7
|
+
getRuleTypeData: RuleTypeValues['getRuleTypeData'];
|
|
8
|
+
};
|
|
9
|
+
export declare const ComplexRule: ({ attributeType, attributeValue, getRuleTypeData }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { getAttributesListForReadMode, getAttributeTypeSubAttributes } from '@reltio/mdm-sdk';
|
|
3
|
+
import { ArrowExpandButton } from '../../../../../ArrowExpandButton';
|
|
4
|
+
import { BranchDecorator } from '../../../../../BranchDecorator';
|
|
5
|
+
import { useSyncedExpandedAttributes } from '../../../../../contexts/SyncedExpandedAttributesContext';
|
|
6
|
+
import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
|
|
7
|
+
import { SimpleRule } from '../SimpleRule';
|
|
8
|
+
import { AttributeRule } from '../AttributeRule';
|
|
9
|
+
import styles from './ComplexRule.module.css';
|
|
10
|
+
export var ComplexRule = function (_a) {
|
|
11
|
+
var attributeType = _a.attributeType, attributeValue = _a.attributeValue, getRuleTypeData = _a.getRuleTypeData;
|
|
12
|
+
var metadata = useMdmMetadata();
|
|
13
|
+
var expandedContext = useSyncedExpandedAttributes();
|
|
14
|
+
var attributeUri = attributeValue.uri;
|
|
15
|
+
var expanded = expandedContext ? expandedContext.isExpanded(attributeUri) : false;
|
|
16
|
+
var toggle = useCallback(function () {
|
|
17
|
+
if (expandedContext && attributeUri) {
|
|
18
|
+
expandedContext.toggle(attributeUri);
|
|
19
|
+
}
|
|
20
|
+
}, [expandedContext, attributeUri]);
|
|
21
|
+
var subAttributes = getAttributeTypeSubAttributes(metadata, attributeType);
|
|
22
|
+
var entity = { attributes: attributeValue.value };
|
|
23
|
+
var attributesList = getAttributesListForReadMode(subAttributes, entity, false, []);
|
|
24
|
+
return (React.createElement("div", null,
|
|
25
|
+
React.createElement("div", { className: styles.expandableRule },
|
|
26
|
+
React.createElement(ArrowExpandButton, { expanded: expanded, onClick: toggle }),
|
|
27
|
+
React.createElement(SimpleRule, { attributeValue: attributeValue, attributeType: attributeType, getRuleTypeData: getRuleTypeData })),
|
|
28
|
+
expanded && (React.createElement("div", null, attributesList.map(function (item) { return (React.createElement(BranchDecorator, { key: item.attrType.uri, enabled: true, className: styles.rulePaddingWrapper },
|
|
29
|
+
React.createElement(AttributeRule, { attributeType: item.attrType, values: item.values, getRuleTypeData: getRuleTypeData, parentUri: attributeUri }))); })))));
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"expandableRule":"ComplexRule-expandableRule--p9mC6","rulePaddingWrapper":"ComplexRule-rulePaddingWrapper--fBmSa"};
|
|
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 = `.ComplexRule-expandableRule--p9mC6{align-items:center;display:flex;min-height:18px}.ComplexRule-rulePaddingWrapper--fBmSa{padding-bottom:1px}.ComplexRule-rulePaddingWrapper--fBmSa:last-child{padding-bottom:2px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComplexRule } from './ComplexRule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComplexRule } from './ComplexRule';
|
|
@@ -18,7 +18,7 @@ import { EntityContext } from '../../../../../contexts/EntityContext';
|
|
|
18
18
|
import { useMdmEntity } from '../../../../../contexts/MdmModuleContext';
|
|
19
19
|
import { FallbackIndicator } from '../FallbackIndicator';
|
|
20
20
|
import { useCommonStyles } from '../../styles';
|
|
21
|
-
import { ValueHeightReporter } from '
|
|
21
|
+
import { ValueHeightReporter } from '../../../../../SyncedValueHeight';
|
|
22
22
|
import { useStyles } from './styles';
|
|
23
23
|
export var OvValuesRenderer = function (_a) {
|
|
24
24
|
var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging, draggableProps = _a.draggableProps;
|
package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { RuleTypeValues } from '../../types';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
value: RuleTypeValues;
|
|
5
5
|
};
|
|
6
|
-
export declare const RuleTypeRenderer: ({ value: {
|
|
6
|
+
export declare const RuleTypeRenderer: ({ value: { attributeType, attributeValues, getRuleTypeData } }: Props) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,72 +1,13 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import i18n from 'ui-i18n';
|
|
4
2
|
import classnames from 'classnames';
|
|
5
|
-
import
|
|
6
|
-
import { ParticipationStatus } from '@reltio/mdm-sdk';
|
|
7
|
-
import { withTooltip } from '../../../../../HOCs/withTooltip';
|
|
8
|
-
import { RuleTypeInfoButton } from '../RuleTypeInfoButton';
|
|
3
|
+
import { isComplexAttribute } from '@reltio/mdm-sdk';
|
|
9
4
|
import { useCommonStyles } from '../../styles';
|
|
10
|
-
import { ValueHeightConsumer } from '
|
|
5
|
+
import { ValueHeightConsumer } from '../../../../../SyncedValueHeight';
|
|
6
|
+
import { SimpleRule } from '../SimpleRule';
|
|
7
|
+
import { ComplexRule } from '../ComplexRule';
|
|
11
8
|
import styles from './RuleTypeRenderer.module.css';
|
|
12
|
-
var InfoIconWithTooltip = withTooltip(InfoIcon);
|
|
13
|
-
var PARTICIPATION_STATUS_MAP = (_a = {},
|
|
14
|
-
Object.defineProperty(_a, ParticipationStatus.Pinned, {
|
|
15
|
-
get: function () {
|
|
16
|
-
return i18n.text("Value survives because 'pin' flag is set. Survivorship not evaluated");
|
|
17
|
-
},
|
|
18
|
-
enumerable: false,
|
|
19
|
-
configurable: true
|
|
20
|
-
}),
|
|
21
|
-
Object.defineProperty(_a, ParticipationStatus.Ignored, {
|
|
22
|
-
get: function () {
|
|
23
|
-
return i18n.text("Value did not participate in survivorship evaluation because 'ignore' flag is set");
|
|
24
|
-
},
|
|
25
|
-
enumerable: false,
|
|
26
|
-
configurable: true
|
|
27
|
-
}),
|
|
28
|
-
Object.defineProperty(_a, ParticipationStatus.EndDatedCrosswalk, {
|
|
29
|
-
get: function () {
|
|
30
|
-
return i18n.text("Value did not participate in survivorship evaluation because it's crosswalk is end-dated");
|
|
31
|
-
},
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true
|
|
34
|
-
}),
|
|
35
|
-
Object.defineProperty(_a, ParticipationStatus.NotParticipating, {
|
|
36
|
-
get: function () {
|
|
37
|
-
return i18n.text('Value did not participate in survivorship evaluation because another value was pinned or the source was ignored');
|
|
38
|
-
},
|
|
39
|
-
enumerable: false,
|
|
40
|
-
configurable: true
|
|
41
|
-
}),
|
|
42
|
-
_a);
|
|
43
9
|
export var RuleTypeRenderer = function (_a) {
|
|
44
|
-
var
|
|
10
|
+
var _b = _a.value, attributeType = _b.attributeType, attributeValues = _b.attributeValues, getRuleTypeData = _b.getRuleTypeData;
|
|
45
11
|
var commonStyles = useCommonStyles();
|
|
46
|
-
|
|
47
|
-
var strategy = data.strategy, primaryAttributeUri = data.primaryAttributeUri, comparisonAttributeUri = data.comparisonAttributeUri, sourcesUriOrder = data.sourcesUriOrder;
|
|
48
|
-
if (!strategy)
|
|
49
|
-
return null;
|
|
50
|
-
var showInfoIcon = sourcesUriOrder || primaryAttributeUri || comparisonAttributeUri;
|
|
51
|
-
return (React.createElement("div", { className: styles.strategyItem },
|
|
52
|
-
React.createElement("div", { className: styles.label }, strategy.label),
|
|
53
|
-
showInfoIcon && (React.createElement(RuleTypeInfoButton, { info: {
|
|
54
|
-
sourcesUriOrder: sourcesUriOrder,
|
|
55
|
-
primaryAttributeUri: primaryAttributeUri,
|
|
56
|
-
comparisonAttributeUri: comparisonAttributeUri
|
|
57
|
-
} }))));
|
|
58
|
-
};
|
|
59
|
-
var renderStatus = function (participationStatus) {
|
|
60
|
-
var description = PARTICIPATION_STATUS_MAP[participationStatus];
|
|
61
|
-
return (React.createElement("div", { className: styles.statusItem },
|
|
62
|
-
i18n.text('N/A'),
|
|
63
|
-
description && React.createElement(InfoIconWithTooltip, { className: styles.infoIcon, tooltipTitle: description })));
|
|
64
|
-
};
|
|
65
|
-
var renderRuleType = function (item) {
|
|
66
|
-
if (item.type === 'status') {
|
|
67
|
-
return renderStatus(item.data);
|
|
68
|
-
}
|
|
69
|
-
return renderStrategy(item.data);
|
|
70
|
-
};
|
|
71
|
-
return (React.createElement("div", { className: classnames(styles.list, commonStyles.basicCell) }, ruleTypes.map(function (item) { return (React.createElement(ValueHeightConsumer, { key: item.valueUri, uri: item.valueUri }, renderRuleType(item))); })));
|
|
12
|
+
return (React.createElement("div", { className: classnames(styles.list, commonStyles.basicCell) }, attributeValues.length === 0 ? (React.createElement(SimpleRule, { attributeType: attributeType, getRuleTypeData: getRuleTypeData })) : (attributeValues.map(function (attributeValue) { return (React.createElement(ValueHeightConsumer, { key: attributeValue.uri, uri: attributeValue.uri }, isComplexAttribute(attributeType) ? (React.createElement(ComplexRule, { attributeType: attributeType, attributeValue: attributeValue, getRuleTypeData: getRuleTypeData })) : (React.createElement(SimpleRule, { attributeType: attributeType, attributeValue: attributeValue, getRuleTypeData: getRuleTypeData })))); }))));
|
|
72
13
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"list":"RuleTypeRenderer-list--IejtI"
|
|
1
|
+
const styles = {"list":"RuleTypeRenderer-list--IejtI"};
|
|
2
2
|
if (typeof document !== 'undefined') {
|
|
3
3
|
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
4
|
const style = document.createElement('style');
|
|
5
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}
|
|
6
|
+
style.innerHTML = `.RuleTypeRenderer-list--IejtI{font-size:13px;line-height:16px}.RuleTypeRenderer-list--IejtI:before{content:"";display:block;height:20px}.RuleTypeRenderer-list--IejtI>div+div{margin-top:4px}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
3
|
+
import { AttributeValueLite, RuleTypeValues } from '../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
attributeType: AttributeType;
|
|
6
|
+
attributeValue?: AttributeValueLite;
|
|
7
|
+
getRuleTypeData: RuleTypeValues['getRuleTypeData'];
|
|
8
|
+
};
|
|
9
|
+
export declare const SimpleRule: ({ attributeType, attributeValue, getRuleTypeData }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|