@reltio/components 1.4.2231 → 1.4.2233
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 +2 -2
- 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
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.selectedAttributeTypes = exports.createMetadata = exports.
|
|
14
|
+
exports.selectedAttributeTypes = exports.createMetadata = exports.createEntityWithAllParticipationStatuses = exports.createEntity = void 0;
|
|
15
15
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
16
16
|
var createEntity = function (_a) {
|
|
17
17
|
var _b = _a === void 0 ? {} : _a, _c = _b.withAppliedSurvivorshipRules, withAppliedSurvivorshipRules = _c === void 0 ? false : _c;
|
|
@@ -45,49 +45,54 @@ var createEntity = function (_a) {
|
|
|
45
45
|
}))
|
|
46
46
|
],
|
|
47
47
|
DeepNested: [
|
|
48
|
-
{
|
|
49
|
-
label: 'Nested Label',
|
|
50
|
-
value: {
|
|
48
|
+
__assign({ label: 'Nested Label', value: {
|
|
51
49
|
FirstLevelNestedSub1: [
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
__assign({ type: 'configuration/entityTypes/HCP/attributes/DeepNested/attributes/FirstLevelNestedSub1', ov: true, value: '123', uri: 'entities/01L2n5z/attributes/DeepNested/1ZAtO4T6/FirstLevelNestedSub1/1ZAtO8jM' }, (withAppliedSurvivorshipRules && {
|
|
51
|
+
ovDetails: {
|
|
52
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
53
|
+
appliedSurvivorshipRules: {
|
|
54
|
+
LUD: [{ LUD: ['LUD', 'Frequency'] }, 'LUD']
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}))
|
|
58
58
|
]
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
}, ov: true, uri: 'entities/01L2n5z/attributes/DeepNested/1ZAtO4T6' }, (withAppliedSurvivorshipRules && {
|
|
60
|
+
ovDetails: {
|
|
61
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
62
|
+
appliedSurvivorshipRules: {
|
|
63
|
+
SRC_SYS: [{ SRC_SYS: ['Aggregation', 'LUD'] }, 'SRC_SYS']
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}))
|
|
63
67
|
],
|
|
64
68
|
Address: [
|
|
65
|
-
{
|
|
66
|
-
label: 'Reference Address',
|
|
67
|
-
relationshipLabel: 'new address',
|
|
68
|
-
refEntity: {
|
|
69
|
+
__assign({ label: 'Reference Address', relationshipLabel: 'new address', refEntity: {
|
|
69
70
|
objectURI: 'entities/2EpaVt0k',
|
|
70
71
|
type: 'configuration/entityTypes/Location',
|
|
71
72
|
crosswalks: []
|
|
72
|
-
},
|
|
73
|
-
refRelation: {
|
|
73
|
+
}, refRelation: {
|
|
74
74
|
objectURI: 'relations/1GrMXM4O',
|
|
75
75
|
type: 'configuration/relationTypes/HasAddress',
|
|
76
76
|
crosswalks: []
|
|
77
|
-
},
|
|
78
|
-
uri: 'entities/2Vek4DnE/attributes/Address/1GrMXM4O',
|
|
79
|
-
value: {
|
|
77
|
+
}, uri: 'entities/2Vek4DnE/attributes/Address/1GrMXM4O', value: {
|
|
80
78
|
AddressLine1: [
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
__assign({ ov: true, type: 'configuration/entityTypes/Location/attributes/AddressLine1', uri: 'entities/2Vek4DnE/attributes/Address/1GrMXM4O/AddressLine1/2GcBL4K00', value: 'address line 1 value' }, (withAppliedSurvivorshipRules && {
|
|
80
|
+
ovDetails: {
|
|
81
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
82
|
+
appliedSurvivorshipRules: {
|
|
83
|
+
Frequency: [{ Frequency: ['MinValue', 'LUD'] }, 'Frequency']
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}))
|
|
87
87
|
]
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
}, startObjectCrosswalks: [] }, (withAppliedSurvivorshipRules && {
|
|
89
|
+
ovDetails: {
|
|
90
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
|
|
91
|
+
appliedSurvivorshipRules: {
|
|
92
|
+
MinValue: [{ LUD: ['Frequency'] }, 'MinValue']
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}))
|
|
91
96
|
],
|
|
92
97
|
ImageGallery: [
|
|
93
98
|
{
|
|
@@ -121,7 +126,7 @@ var createEntity = function (_a) {
|
|
|
121
126
|
};
|
|
122
127
|
};
|
|
123
128
|
exports.createEntity = createEntity;
|
|
124
|
-
var
|
|
129
|
+
var createEntityWithAllParticipationStatuses = function () {
|
|
125
130
|
var entity = (0, exports.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
126
131
|
return __assign(__assign({}, entity), { attributes: __assign(__assign({}, entity.attributes), { Boolean: [
|
|
127
132
|
{
|
|
@@ -133,10 +138,40 @@ var createEntityWithoutAppliedRule = function () {
|
|
|
133
138
|
participationStatus: mdm_sdk_1.ParticipationStatus.Pinned,
|
|
134
139
|
appliedSurvivorshipRules: 'N/A'
|
|
135
140
|
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
ov: true,
|
|
144
|
+
type: 'configuration/entityTypes/HCP/attributes/Boolean',
|
|
145
|
+
uri: 'entities/01L2n5z/attributes/Boolean/Ignored',
|
|
146
|
+
value: 'false',
|
|
147
|
+
ovDetails: {
|
|
148
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.Ignored,
|
|
149
|
+
appliedSurvivorshipRules: 'N/A'
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
ov: true,
|
|
154
|
+
type: 'configuration/entityTypes/HCP/attributes/Boolean',
|
|
155
|
+
uri: 'entities/01L2n5z/attributes/Boolean/EndDatedCrosswalk',
|
|
156
|
+
value: 'true',
|
|
157
|
+
ovDetails: {
|
|
158
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.EndDatedCrosswalk,
|
|
159
|
+
appliedSurvivorshipRules: 'N/A'
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
ov: true,
|
|
164
|
+
type: 'configuration/entityTypes/HCP/attributes/Boolean',
|
|
165
|
+
uri: 'entities/01L2n5z/attributes/Boolean/NotParticipating',
|
|
166
|
+
value: 'false',
|
|
167
|
+
ovDetails: {
|
|
168
|
+
participationStatus: mdm_sdk_1.ParticipationStatus.NotParticipating,
|
|
169
|
+
appliedSurvivorshipRules: 'N/A'
|
|
170
|
+
}
|
|
136
171
|
}
|
|
137
172
|
] }) });
|
|
138
173
|
};
|
|
139
|
-
exports.
|
|
174
|
+
exports.createEntityWithAllParticipationStatuses = createEntityWithAllParticipationStatuses;
|
|
140
175
|
var createMetadata = function () {
|
|
141
176
|
return {
|
|
142
177
|
entityTypes: [
|
|
@@ -231,6 +266,30 @@ var createMetadata = function () {
|
|
|
231
266
|
]
|
|
232
267
|
}
|
|
233
268
|
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
uri: 'configuration/entityTypes/Location',
|
|
272
|
+
label: 'Location',
|
|
273
|
+
attributes: [
|
|
274
|
+
{
|
|
275
|
+
label: 'Address Line 1',
|
|
276
|
+
name: 'AddressLine1',
|
|
277
|
+
type: 'String',
|
|
278
|
+
uri: 'configuration/entityTypes/Location/attributes/AddressLine1'
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
survivorshipGroups: [
|
|
282
|
+
{
|
|
283
|
+
uri: 'configuration/entityTypes/Location/survivorshipGroups/default',
|
|
284
|
+
default: true,
|
|
285
|
+
mapping: [
|
|
286
|
+
{
|
|
287
|
+
attribute: 'configuration/entityTypes/Location/attributes/AddressLine1',
|
|
288
|
+
survivorshipStrategy: 'Frequency'
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
]
|
|
234
293
|
}
|
|
235
294
|
],
|
|
236
295
|
survivorshipStrategies: [
|
|
@@ -451,62 +451,6 @@ 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
|
-
}); });
|
|
510
454
|
describe('Edit attributes', function () {
|
|
511
455
|
it('should edit attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
512
456
|
var unmockTableSizing, entity, onEdit, props, user;
|
|
@@ -830,4 +774,294 @@ describe('attribute table tests', function () {
|
|
|
830
774
|
}
|
|
831
775
|
});
|
|
832
776
|
}); });
|
|
777
|
+
describe('rule type column behaviour', function () {
|
|
778
|
+
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 () {
|
|
779
|
+
var unmockTableSizing, entity, user, ruleTypeColumns, ovValuesColumns, fallbackIcon, tooltip;
|
|
780
|
+
return __generator(this, function (_a) {
|
|
781
|
+
switch (_a.label) {
|
|
782
|
+
case 0:
|
|
783
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
784
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
785
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
786
|
+
expect(react_2.screen.getByText('Rule type')).toBeInTheDocument();
|
|
787
|
+
ruleTypeColumns = react_2.screen.getAllByTestId('column-name-ruleType');
|
|
788
|
+
expect((0, react_2.within)(ruleTypeColumns[0]).getByText('Frequency')).toBeInTheDocument();
|
|
789
|
+
ovValuesColumns = react_2.screen.getAllByTestId('column-name-ovValues');
|
|
790
|
+
fallbackIcon = (0, test_utils_1.getMuiIconByName)('Info', ovValuesColumns[0]);
|
|
791
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
792
|
+
case 1:
|
|
793
|
+
_a.sent();
|
|
794
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
795
|
+
case 2:
|
|
796
|
+
tooltip = _a.sent();
|
|
797
|
+
expect((0, react_2.within)(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
798
|
+
expect((0, react_2.within)(tooltip).getAllByText('Source system').length).toBe(3);
|
|
799
|
+
expect((0, react_2.within)(tooltip).getByText('Aggregation')).toBeInTheDocument();
|
|
800
|
+
expect((0, react_2.within)(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
801
|
+
expect((0, test_utils_1.getMuiIconsByName)('CancelOutlined', tooltip).length).toBe(4);
|
|
802
|
+
expect((0, test_utils_1.getMuiIconByName)('CheckCircle', tooltip)).toBeInTheDocument();
|
|
803
|
+
expect((0, react_2.within)(ruleTypeColumns[1]).getByText('Frequency')).toBeInTheDocument();
|
|
804
|
+
expect((0, test_utils_1.getMuiIconByName)('Info', ovValuesColumns[1])).not.toBeInTheDocument();
|
|
805
|
+
unmockTableSizing();
|
|
806
|
+
return [2 /*return*/];
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
}); });
|
|
810
|
+
it('should render N/A rule type and show tooltips for all participation statuses', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
811
|
+
var unmockTableSizing, entity, user, ruleTypeColumns, infoIcons, tooltip;
|
|
812
|
+
return __generator(this, function (_a) {
|
|
813
|
+
switch (_a.label) {
|
|
814
|
+
case 0:
|
|
815
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
816
|
+
entity = (0, AttributesTable_test_data_1.createEntityWithAllParticipationStatuses)();
|
|
817
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
818
|
+
ruleTypeColumns = react_2.screen.getAllByTestId('column-name-ruleType');
|
|
819
|
+
expect((0, react_2.within)(ruleTypeColumns[1]).getAllByText('N/A')).toHaveLength(4);
|
|
820
|
+
infoIcons = (0, test_utils_1.getMuiIconsByName)('Info', ruleTypeColumns[1]);
|
|
821
|
+
expect(infoIcons).toHaveLength(4);
|
|
822
|
+
return [4 /*yield*/, user.hover(infoIcons[0])];
|
|
823
|
+
case 1:
|
|
824
|
+
_a.sent();
|
|
825
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
826
|
+
case 2:
|
|
827
|
+
tooltip = _a.sent();
|
|
828
|
+
expect((0, react_2.within)(tooltip).getByText("Value survives because 'pin' flag is set. Survivorship not evaluated")).toBeInTheDocument();
|
|
829
|
+
return [4 /*yield*/, user.hover(infoIcons[1])];
|
|
830
|
+
case 3:
|
|
831
|
+
_a.sent();
|
|
832
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
833
|
+
case 4:
|
|
834
|
+
tooltip = _a.sent();
|
|
835
|
+
expect((0, react_2.within)(tooltip).getByText("Value did not participate in survivorship evaluation because 'ignore' flag is set")).toBeInTheDocument();
|
|
836
|
+
return [4 /*yield*/, user.hover(infoIcons[2])];
|
|
837
|
+
case 5:
|
|
838
|
+
_a.sent();
|
|
839
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
840
|
+
case 6:
|
|
841
|
+
tooltip = _a.sent();
|
|
842
|
+
expect((0, react_2.within)(tooltip).getByText('Value did not participate in survivorship evaluation because its crosswalk is end-dated')).toBeInTheDocument();
|
|
843
|
+
return [4 /*yield*/, user.hover(infoIcons[3])];
|
|
844
|
+
case 7:
|
|
845
|
+
_a.sent();
|
|
846
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
847
|
+
case 8:
|
|
848
|
+
tooltip = _a.sent();
|
|
849
|
+
expect((0, react_2.within)(tooltip).getByText('Value did not participate in survivorship evaluation because another value was pinned or the source was ignored')).toBeInTheDocument();
|
|
850
|
+
unmockTableSizing();
|
|
851
|
+
return [2 /*return*/];
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
}); });
|
|
855
|
+
it('should render correct rule type column for nested attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
856
|
+
var unmockTableSizing, entity, user, nestedRuleTypeCell, expandButton;
|
|
857
|
+
return __generator(this, function (_a) {
|
|
858
|
+
switch (_a.label) {
|
|
859
|
+
case 0:
|
|
860
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
861
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
862
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
863
|
+
nestedRuleTypeCell = getCellByIndexes(2, 1);
|
|
864
|
+
expect((0, react_2.within)(nestedRuleTypeCell).getByText('Source system')).toBeInTheDocument();
|
|
865
|
+
expandButton = (0, react_2.within)(nestedRuleTypeCell).getByTestId('arrow-expand-button');
|
|
866
|
+
expect(expandButton).toBeInTheDocument();
|
|
867
|
+
expect((0, react_2.within)(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
868
|
+
expect((0, react_2.within)(nestedRuleTypeCell).queryByText('Recency')).not.toBeInTheDocument();
|
|
869
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
870
|
+
case 1:
|
|
871
|
+
_a.sent();
|
|
872
|
+
expect((0, react_2.within)(nestedRuleTypeCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
873
|
+
expect((0, react_2.within)(nestedRuleTypeCell).getByText('Recency')).toBeInTheDocument();
|
|
874
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
875
|
+
case 2:
|
|
876
|
+
_a.sent();
|
|
877
|
+
expect((0, react_2.within)(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
878
|
+
expect((0, react_2.within)(nestedRuleTypeCell).queryByText('Recency')).not.toBeInTheDocument();
|
|
879
|
+
unmockTableSizing();
|
|
880
|
+
return [2 /*return*/];
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
}); });
|
|
884
|
+
it('should render correct rule type column for reference attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
885
|
+
var unmockTableSizing, entity, user, referenceRuleTypeCell, expandButton;
|
|
886
|
+
return __generator(this, function (_a) {
|
|
887
|
+
switch (_a.label) {
|
|
888
|
+
case 0:
|
|
889
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
890
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
891
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
892
|
+
referenceRuleTypeCell = getCellByIndexes(3, 1);
|
|
893
|
+
expect((0, react_2.within)(referenceRuleTypeCell).getByText('Minimum value')).toBeInTheDocument();
|
|
894
|
+
expandButton = (0, react_2.within)(referenceRuleTypeCell).getByTestId('arrow-expand-button');
|
|
895
|
+
expect(expandButton).toBeInTheDocument();
|
|
896
|
+
expect((0, react_2.within)(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
897
|
+
expect((0, react_2.within)(referenceRuleTypeCell).queryByText('Frequency')).not.toBeInTheDocument();
|
|
898
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
899
|
+
case 1:
|
|
900
|
+
_a.sent();
|
|
901
|
+
expect((0, react_2.within)(referenceRuleTypeCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
902
|
+
expect((0, react_2.within)(referenceRuleTypeCell).getByText('Frequency')).toBeInTheDocument();
|
|
903
|
+
return [4 /*yield*/, user.click(expandButton)];
|
|
904
|
+
case 2:
|
|
905
|
+
_a.sent();
|
|
906
|
+
expect((0, react_2.within)(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
907
|
+
expect((0, react_2.within)(referenceRuleTypeCell).queryByText('Frequency')).not.toBeInTheDocument();
|
|
908
|
+
unmockTableSizing();
|
|
909
|
+
return [2 /*return*/];
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}); });
|
|
913
|
+
it('should synchronize expansion between nested OV values and rule type columns', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
914
|
+
var unmockTableSizing, entity, user, nestedOvValuesCell, nestedRuleTypeCell, ovExpandButton, ruleTypeExpandButton;
|
|
915
|
+
return __generator(this, function (_a) {
|
|
916
|
+
switch (_a.label) {
|
|
917
|
+
case 0:
|
|
918
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
919
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
920
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
921
|
+
nestedOvValuesCell = getCellByIndexes(2, 0);
|
|
922
|
+
nestedRuleTypeCell = getCellByIndexes(2, 1);
|
|
923
|
+
ovExpandButton = (0, react_2.within)(nestedOvValuesCell).getByTestId('arrow-expand-button');
|
|
924
|
+
ruleTypeExpandButton = (0, react_2.within)(nestedRuleTypeCell).getByTestId('arrow-expand-button');
|
|
925
|
+
expect((0, react_2.within)(nestedOvValuesCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
926
|
+
expect((0, react_2.within)(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
927
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
928
|
+
case 1:
|
|
929
|
+
_a.sent();
|
|
930
|
+
expect((0, react_2.within)(nestedOvValuesCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
931
|
+
expect((0, react_2.within)(nestedRuleTypeCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
932
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
933
|
+
case 2:
|
|
934
|
+
_a.sent();
|
|
935
|
+
expect((0, react_2.within)(nestedOvValuesCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
936
|
+
expect((0, react_2.within)(nestedRuleTypeCell).queryByText('Int_HCP')).not.toBeInTheDocument();
|
|
937
|
+
return [4 /*yield*/, user.click(ruleTypeExpandButton)];
|
|
938
|
+
case 3:
|
|
939
|
+
_a.sent();
|
|
940
|
+
expect((0, react_2.within)(nestedOvValuesCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
941
|
+
expect((0, react_2.within)(nestedRuleTypeCell).getByText('Int_HCP')).toBeInTheDocument();
|
|
942
|
+
unmockTableSizing();
|
|
943
|
+
return [2 /*return*/];
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
}); });
|
|
947
|
+
it('should synchronize expansion between reference OV values and rule type columns', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
948
|
+
var unmockTableSizing, entity, user, referenceOvValuesCell, referenceRuleTypeCell, ovExpandButton, ruleTypeExpandButton;
|
|
949
|
+
return __generator(this, function (_a) {
|
|
950
|
+
switch (_a.label) {
|
|
951
|
+
case 0:
|
|
952
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
953
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
954
|
+
user = setUp(__assign(__assign({}, defaultProps), { entity: entity, visibleColumns: undefined })).user;
|
|
955
|
+
referenceOvValuesCell = getCellByIndexes(3, 0);
|
|
956
|
+
referenceRuleTypeCell = getCellByIndexes(3, 1);
|
|
957
|
+
ovExpandButton = (0, react_2.within)(referenceOvValuesCell).getByTestId('arrow-expand-button');
|
|
958
|
+
ruleTypeExpandButton = (0, react_2.within)(referenceRuleTypeCell).getByTestId('arrow-expand-button');
|
|
959
|
+
expect((0, react_2.within)(referenceOvValuesCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
960
|
+
expect((0, react_2.within)(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
961
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
962
|
+
case 1:
|
|
963
|
+
_a.sent();
|
|
964
|
+
expect((0, react_2.within)(referenceOvValuesCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
965
|
+
expect((0, react_2.within)(referenceRuleTypeCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
966
|
+
return [4 /*yield*/, user.click(ovExpandButton)];
|
|
967
|
+
case 2:
|
|
968
|
+
_a.sent();
|
|
969
|
+
expect((0, react_2.within)(referenceOvValuesCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
970
|
+
expect((0, react_2.within)(referenceRuleTypeCell).queryByText('Address Line 1')).not.toBeInTheDocument();
|
|
971
|
+
return [4 /*yield*/, user.click(ruleTypeExpandButton)];
|
|
972
|
+
case 3:
|
|
973
|
+
_a.sent();
|
|
974
|
+
expect((0, react_2.within)(referenceOvValuesCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
975
|
+
expect((0, react_2.within)(referenceRuleTypeCell).getByText('Address Line 1')).toBeInTheDocument();
|
|
976
|
+
unmockTableSizing();
|
|
977
|
+
return [2 /*return*/];
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
}); });
|
|
981
|
+
it('should render fallback icons correctly for nested attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
982
|
+
var unmockTableSizing, entity, user, ovValueCell, fallbackIcon, tooltip, fallbackIcons;
|
|
983
|
+
return __generator(this, function (_a) {
|
|
984
|
+
switch (_a.label) {
|
|
985
|
+
case 0:
|
|
986
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
987
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
988
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
989
|
+
ovValueCell = react_2.screen.getAllByTestId('column-name-ovValues')[2];
|
|
990
|
+
fallbackIcon = (0, test_utils_1.getMuiIconByName)('Info', ovValueCell);
|
|
991
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
992
|
+
case 1:
|
|
993
|
+
_a.sent();
|
|
994
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
995
|
+
case 2:
|
|
996
|
+
tooltip = _a.sent();
|
|
997
|
+
expect((0, react_2.within)(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
998
|
+
expect((0, react_2.within)(tooltip).getAllByText('Source system').length).toBe(3);
|
|
999
|
+
expect((0, react_2.within)(tooltip).getByText('Aggregation')).toBeInTheDocument();
|
|
1000
|
+
expect((0, react_2.within)(tooltip).getByText('Recency')).toBeInTheDocument();
|
|
1001
|
+
return [4 /*yield*/, user.unhover(fallbackIcon)];
|
|
1002
|
+
case 3:
|
|
1003
|
+
_a.sent();
|
|
1004
|
+
return [4 /*yield*/, user.click((0, react_2.within)(ovValueCell).getByTestId('arrow-expand-button'))];
|
|
1005
|
+
case 4:
|
|
1006
|
+
_a.sent();
|
|
1007
|
+
fallbackIcons = (0, test_utils_1.getMuiIconsByName)('Info', ovValueCell);
|
|
1008
|
+
expect(fallbackIcons.length).toBe(2);
|
|
1009
|
+
return [4 /*yield*/, user.hover(fallbackIcons[1])];
|
|
1010
|
+
case 5:
|
|
1011
|
+
_a.sent();
|
|
1012
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
1013
|
+
case 6:
|
|
1014
|
+
tooltip = _a.sent();
|
|
1015
|
+
expect((0, react_2.within)(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
1016
|
+
expect((0, react_2.within)(tooltip).getAllByText('Recency').length).toBe(4);
|
|
1017
|
+
expect((0, react_2.within)(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
1018
|
+
unmockTableSizing();
|
|
1019
|
+
return [2 /*return*/];
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}); });
|
|
1023
|
+
it('should render fallback icons correctly for reference attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1024
|
+
var unmockTableSizing, entity, user, ovValueCell, fallbackIcon, tooltip, fallbackIcons;
|
|
1025
|
+
return __generator(this, function (_a) {
|
|
1026
|
+
switch (_a.label) {
|
|
1027
|
+
case 0:
|
|
1028
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
1029
|
+
entity = (0, AttributesTable_test_data_1.createEntity)({ withAppliedSurvivorshipRules: true });
|
|
1030
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined, entity: entity })).user;
|
|
1031
|
+
ovValueCell = react_2.screen.getAllByTestId('column-name-ovValues')[3];
|
|
1032
|
+
fallbackIcon = (0, test_utils_1.getMuiIconByName)('Info', ovValueCell);
|
|
1033
|
+
return [4 /*yield*/, user.hover(fallbackIcon)];
|
|
1034
|
+
case 1:
|
|
1035
|
+
_a.sent();
|
|
1036
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
1037
|
+
case 2:
|
|
1038
|
+
tooltip = _a.sent();
|
|
1039
|
+
expect((0, react_2.within)(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
1040
|
+
expect((0, react_2.within)(tooltip).getAllByText('Minimum value').length).toBe(2);
|
|
1041
|
+
expect((0, react_2.within)(tooltip).getByText('Frequency')).toBeInTheDocument();
|
|
1042
|
+
expect((0, react_2.within)(tooltip).getByText('Recency')).toBeInTheDocument();
|
|
1043
|
+
return [4 /*yield*/, user.unhover(fallbackIcon)];
|
|
1044
|
+
case 3:
|
|
1045
|
+
_a.sent();
|
|
1046
|
+
return [4 /*yield*/, user.click((0, react_2.within)(ovValueCell).getByTestId('arrow-expand-button'))];
|
|
1047
|
+
case 4:
|
|
1048
|
+
_a.sent();
|
|
1049
|
+
fallbackIcons = (0, test_utils_1.getMuiIconsByName)('Info', ovValueCell);
|
|
1050
|
+
expect(fallbackIcons.length).toBe(2);
|
|
1051
|
+
return [4 /*yield*/, user.hover(fallbackIcons[1])];
|
|
1052
|
+
case 5:
|
|
1053
|
+
_a.sent();
|
|
1054
|
+
return [4 /*yield*/, react_2.screen.findByRole('tooltip')];
|
|
1055
|
+
case 6:
|
|
1056
|
+
tooltip = _a.sent();
|
|
1057
|
+
expect((0, react_2.within)(tooltip).getByText('OV decision path')).toBeInTheDocument();
|
|
1058
|
+
expect((0, react_2.within)(tooltip).getAllByText('Frequency').length).toBe(3);
|
|
1059
|
+
expect((0, react_2.within)(tooltip).getByText('Recency')).toBeInTheDocument();
|
|
1060
|
+
expect((0, react_2.within)(tooltip).getByText('Minimum value')).toBeInTheDocument();
|
|
1061
|
+
unmockTableSizing();
|
|
1062
|
+
return [2 /*return*/];
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
}); });
|
|
1066
|
+
});
|
|
833
1067
|
});
|
|
@@ -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,32 @@
|
|
|
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.AttributeRule = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
var ramda_1 = require("ramda");
|
|
10
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
11
|
+
var ComplexRule_1 = require("../ComplexRule");
|
|
12
|
+
var SimpleRule_1 = require("../SimpleRule");
|
|
13
|
+
var AttributeTitle_1 = require("../../../../../AttributeTitle");
|
|
14
|
+
var SyncedValueHeight_1 = require("../../../../../SyncedValueHeight");
|
|
15
|
+
var AttributeRule_module_css_1 = __importDefault(require("./AttributeRule.module.css"));
|
|
16
|
+
var AttributeRule = function (_a) {
|
|
17
|
+
var attributeType = _a.attributeType, values = _a.values, getRuleTypeData = _a.getRuleTypeData, parentUri = _a.parentUri;
|
|
18
|
+
var ovValues = (0, ramda_1.filter)(mdm_sdk_1.isOv, values);
|
|
19
|
+
var blockUri = parentUri ? "".concat(parentUri, "/").concat(attributeType.uri) : attributeType.uri;
|
|
20
|
+
var renderValue = function (value) {
|
|
21
|
+
var content = (0, mdm_sdk_1.isComplexAttribute)(attributeType) ? (react_1.default.createElement(ComplexRule_1.ComplexRule, { attributeType: attributeType, attributeValue: value, getRuleTypeData: getRuleTypeData })) : (react_1.default.createElement(SimpleRule_1.SimpleRule, { attributeValue: value, attributeType: attributeType, getRuleTypeData: getRuleTypeData }));
|
|
22
|
+
return (react_1.default.createElement(SyncedValueHeight_1.ValueHeightConsumer, { key: value.uri, uri: value.uri }, content));
|
|
23
|
+
};
|
|
24
|
+
return ovValues.length === 1 && !(0, mdm_sdk_1.isComplexAttribute)(attributeType) ? (react_1.default.createElement(SyncedValueHeight_1.ValueHeightConsumer, { uri: ovValues[0].uri },
|
|
25
|
+
react_1.default.createElement("div", { className: AttributeRule_module_css_1.default.oneLineRule },
|
|
26
|
+
react_1.default.createElement(AttributeTitle_1.AttributeTitle, { label: attributeType.label, className: (0, classnames_1.default)(AttributeRule_module_css_1.default.label, AttributeRule_module_css_1.default.labelMargin) }),
|
|
27
|
+
react_1.default.createElement(SimpleRule_1.SimpleRule, { attributeValue: ovValues[0], attributeType: attributeType, getRuleTypeData: getRuleTypeData })))) : (react_1.default.createElement(SyncedValueHeight_1.ValueHeightConsumer, { uri: blockUri },
|
|
28
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
29
|
+
react_1.default.createElement(AttributeTitle_1.AttributeTitle, { label: attributeType.label, className: AttributeRule_module_css_1.default.label }),
|
|
30
|
+
react_1.default.createElement("div", { className: AttributeRule_module_css_1.default.valuesList }, values.map(renderValue)))));
|
|
31
|
+
};
|
|
32
|
+
exports.AttributeRule = AttributeRule;
|
package/cjs/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
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AttributeRule } from './AttributeRule';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttributeRule = void 0;
|
|
4
|
+
var AttributeRule_1 = require("./AttributeRule");
|
|
5
|
+
Object.defineProperty(exports, "AttributeRule", { enumerable: true, get: function () { return AttributeRule_1.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 {};
|