@reltio/components 1.4.1998 → 1.4.2000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/cjs/UpSetChart/UpSetChart.d.ts +5 -8
  2. package/cjs/UpSetChart/UpSetChart.js +61 -5
  3. package/cjs/UpSetChart/UpSetChart.test.js +198 -0
  4. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  5. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
  6. package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  7. package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
  8. package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  9. package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
  10. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  11. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
  12. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  13. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
  14. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  15. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
  16. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  17. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
  18. package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  19. package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
  20. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  21. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
  22. package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  23. package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
  24. package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
  25. package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
  26. package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  27. package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
  28. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  29. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
  30. package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  31. package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
  32. package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  33. package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
  34. package/cjs/UpSetChart/constants.d.ts +16 -3
  35. package/cjs/UpSetChart/constants.js +20 -4
  36. package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  37. package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
  38. package/cjs/UpSetChart/helpers.d.ts +20 -0
  39. package/cjs/UpSetChart/helpers.js +127 -0
  40. package/cjs/UpSetChart/styles.d.ts +4 -1
  41. package/cjs/UpSetChart/styles.js +11 -12
  42. package/cjs/UpSetChart/types.d.ts +16 -0
  43. package/cjs/UpSetChart/types.js +2 -0
  44. package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  45. package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
  46. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  47. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +288 -0
  48. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +708 -370
  49. package/cjs/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  50. package/cjs/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  51. package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +265 -193
  52. package/cjs/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  53. package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  54. package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  55. package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +323 -225
  56. package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  57. package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  58. package/esm/UpSetChart/UpSetChart.d.ts +5 -8
  59. package/esm/UpSetChart/UpSetChart.js +38 -5
  60. package/esm/UpSetChart/UpSetChart.test.js +193 -0
  61. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  62. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
  63. package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  64. package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
  65. package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  66. package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
  67. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  68. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
  69. package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  70. package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
  71. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  72. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
  73. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  74. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
  75. package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  76. package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
  77. package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  78. package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
  79. package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  80. package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
  81. package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
  82. package/esm/UpSetChart/components/SetsChart/index.js +1 -0
  83. package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  84. package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
  85. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  86. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
  87. package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  88. package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
  89. package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  90. package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
  91. package/esm/UpSetChart/constants.d.ts +16 -3
  92. package/esm/UpSetChart/constants.js +19 -3
  93. package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  94. package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
  95. package/esm/UpSetChart/helpers.d.ts +20 -0
  96. package/esm/UpSetChart/helpers.js +120 -0
  97. package/esm/UpSetChart/styles.d.ts +4 -1
  98. package/esm/UpSetChart/styles.js +11 -12
  99. package/esm/UpSetChart/types.d.ts +16 -0
  100. package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  101. package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
  102. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  103. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.js +283 -0
  104. package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +711 -350
  105. package/esm/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  106. package/esm/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  107. package/esm/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +266 -194
  108. package/esm/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  109. package/esm/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  110. package/esm/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  111. package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +324 -226
  112. package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  113. package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  114. package/package.json +1 -1
  115. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  116. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -52
  117. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -323
  118. package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -142
  119. package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -146
  120. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  121. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -50
  122. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  123. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -58
  124. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  125. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -14
  126. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  127. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -110
  128. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  129. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -111
  130. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  131. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -67
  132. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  133. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -193
  134. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  135. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -22
  136. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  137. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -58
  138. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  139. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -69
  140. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  141. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -137
  142. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  143. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -56
  144. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  145. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -47
  146. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
  147. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -318
  148. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
  149. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -137
  150. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
  151. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -141
  152. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  153. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -45
  154. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  155. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -53
  156. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  157. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -9
  158. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  159. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -105
  160. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  161. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -106
  162. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  163. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -62
  164. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  165. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -188
  166. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  167. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -17
  168. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  169. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -53
  170. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  171. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -64
  172. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  173. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -132
  174. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  175. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -28
  176. /package/cjs/{features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts → UpSetChart/UpSetChart.test.d.ts} +0 -0
  177. /package/{cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
  178. /package/{cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts → esm/UpSetChart/types.js} +0 -0
@@ -1,318 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import React from 'react';
49
- import { render, fireEvent, within, screen } from '@testing-library/react';
50
- import userEvent from '@testing-library/user-event';
51
- import { DndProvider } from 'react-dnd';
52
- import HTML5Backend from 'react-dnd-html5-backend';
53
- import { mockBasicTableSizing } from '../../../test-utils';
54
- import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
55
- import { createEntity, createMetadata } from './IntegrationAttributesTable.test-data';
56
- import AttributesTable from './AttributesTable';
57
- jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { debounce: function (x) { return x; } })); });
58
- var visibleColumns = ['ovValues', 'values'];
59
- var selectedAttributeTypes = [
60
- {
61
- description: 'String Attribute',
62
- label: '<h1>String</h1>',
63
- name: 'TextField',
64
- type: 'String',
65
- uri: 'configuration/entityTypes/HCP/attributes/TextField'
66
- },
67
- {
68
- description: 'Yes or No',
69
- label: 'Boolean',
70
- name: 'Boolean',
71
- type: 'Boolean',
72
- uri: 'configuration/entityTypes/HCP/attributes/Boolean'
73
- }
74
- ];
75
- var crosswalksMap = {
76
- entity: {
77
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp': [
78
- {
79
- attributes: [
80
- 'entities/01L2n5z/attributes/TextField/5noU1aB',
81
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
82
- ],
83
- type: 'configuration/sources/Reltio',
84
- uri: 'entities/01L2n5z/crosswalks/7F10sMx',
85
- value: '01L2n5z'
86
- }
87
- ],
88
- 'entities/01L2n5z/attributes/TextField/5noU1aB': [
89
- {
90
- attributes: [
91
- 'entities/01L2n5z/attributes/TextField/5noU1aB',
92
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
93
- ],
94
- type: 'configuration/sources/Reltio',
95
- uri: 'entities/01L2n5z/crosswalks/7F10sMx',
96
- value: '01L2n5z'
97
- }
98
- ]
99
- },
100
- relation: {}
101
- };
102
- var metadata = createMetadata();
103
- var defaultProps = {
104
- entity: createEntity(),
105
- isLoading: false,
106
- crosswalksMap: crosswalksMap,
107
- visibleColumns: visibleColumns,
108
- onChangeVisibleColumns: function () { },
109
- readOnly: false,
110
- onDelete: function () { },
111
- onPin: function () { },
112
- onIgnore: function () { },
113
- onEdit: function () { },
114
- onAdd: function () { },
115
- selectedAttributeTypes: selectedAttributeTypes,
116
- onSelectAttributeTypes: function () { },
117
- additionalHeaderItems: null,
118
- className: 'className',
119
- emptyTempAttributeUris: []
120
- };
121
- var setUp = function (props) {
122
- var user = userEvent.setup({ delay: null, skipHover: true });
123
- var Providers = function (_a) {
124
- var children = _a.children;
125
- return (React.createElement(DndProvider, { backend: HTML5Backend },
126
- React.createElement(MdmModuleProvider, { values: { metadata: metadata } }, children)));
127
- };
128
- var renderer = render(React.createElement(AttributesTable, __assign({}, props)), { wrapper: Providers });
129
- return __assign(__assign({}, renderer), { user: user });
130
- };
131
- describe('attribute table tests', function () {
132
- var getRowByIndex = function (index) {
133
- var fixHeadAndFirstColumnContainer = screen.queryByTestId('fix-head-and-fix-column-container');
134
- return within(fixHeadAndFirstColumnContainer).queryAllByTestId("base-cell-".concat(index));
135
- };
136
- var getCellByIndexes = function (rowIndex, columnIndex) {
137
- var row = getRowByIndex(rowIndex);
138
- return row[columnIndex];
139
- };
140
- var editTextFieldAttribute = function (user) { return __awaiter(void 0, void 0, void 0, function () {
141
- var attribute;
142
- return __generator(this, function (_a) {
143
- switch (_a.label) {
144
- case 0:
145
- attribute = within(getCellByIndexes(0, 1)).getByTestId('value-index-0');
146
- return [4 /*yield*/, user.hover(attribute)];
147
- case 1:
148
- _a.sent();
149
- return [4 /*yield*/, user.click(within(attribute).queryByRole('button', { name: 'More actions' }))];
150
- case 2:
151
- _a.sent();
152
- return [4 /*yield*/, user.click(screen.getByText('Edit'))];
153
- case 3:
154
- _a.sent();
155
- return [4 /*yield*/, user.type(screen.getByRole('textbox'), 'newValue')];
156
- case 4:
157
- _a.sent();
158
- return [4 /*yield*/, user.keyboard('[Enter]')];
159
- case 5:
160
- _a.sent();
161
- return [2 /*return*/];
162
- }
163
- });
164
- }); };
165
- afterEach(function () {
166
- jest.clearAllMocks();
167
- });
168
- it.skip('should drag and drop rows correctly', function () {
169
- jest.useFakeTimers();
170
- var unmockTableSizing = mockBasicTableSizing();
171
- var onSelectAttributeTypes = jest.fn();
172
- var props = __assign(__assign({}, defaultProps), { onSelectAttributeTypes: onSelectAttributeTypes });
173
- setUp(props);
174
- expect(within(getCellByIndexes(1, 0)).queryByText('Yes')).toBeInTheDocument();
175
- expect(within(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
176
- expect(within(getCellByIndexes(1, 1)).queryByText('Yes')).toBeInTheDocument();
177
- expect(within(getCellByIndexes(0, 0)).queryByText('text field value')).toBeInTheDocument();
178
- expect(within(getCellByIndexes(0, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
179
- expect(within(getCellByIndexes(0, 1)).queryByText('text field value')).toBeInTheDocument();
180
- var dragIndicator = getCellByIndexes(0, 0).querySelector('.dragIndicator');
181
- fireEvent.dragStart(dragIndicator);
182
- jest.runAllTimers();
183
- expect(within(getCellByIndexes(1, 0)).queryByText('Yes')).not.toBeInTheDocument();
184
- expect(within(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
185
- expect(within(getCellByIndexes(1, 1)).queryByText('Yes')).not.toBeInTheDocument();
186
- expect(within(getCellByIndexes(0, 0)).queryByText('text field value')).not.toBeInTheDocument();
187
- expect(within(getCellByIndexes(0, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
188
- expect(within(getCellByIndexes(0, 1)).queryByText('text field value')).not.toBeInTheDocument();
189
- var dropRow = getCellByIndexes(1, 0);
190
- fireEvent.dragEnter(dropRow);
191
- expect(within(getCellByIndexes(0, 0)).queryByText('Boolean')).toBeInTheDocument();
192
- expect(within(getCellByIndexes(1, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
193
- fireEvent.dragEnd(dropRow);
194
- expect(onSelectAttributeTypes).toHaveBeenCalledWith([selectedAttributeTypes[1], selectedAttributeTypes[0]]);
195
- unmockTableSizing();
196
- });
197
- it('should not call onDelete when user clicks No and then Yes in confirmation dialog on deleting attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
198
- var unmockTableSizing, onDelete, props, user, attribute, moreButton, deleteButton, dialog, declineButton, confirmButton;
199
- return __generator(this, function (_a) {
200
- switch (_a.label) {
201
- case 0:
202
- unmockTableSizing = mockBasicTableSizing();
203
- onDelete = jest.fn();
204
- props = __assign(__assign({}, defaultProps), { onDelete: onDelete });
205
- user = setUp(props).user;
206
- attribute = within(getCellByIndexes(1, 1)).getByTestId('value-index-0');
207
- return [4 /*yield*/, user.hover(attribute)];
208
- case 1:
209
- _a.sent();
210
- moreButton = within(attribute).getByRole('button', { name: 'More actions' });
211
- return [4 /*yield*/, user.click(moreButton)];
212
- case 2:
213
- _a.sent();
214
- deleteButton = screen.getByText('Delete');
215
- return [4 /*yield*/, user.click(deleteButton)];
216
- case 3:
217
- _a.sent();
218
- dialog = screen.getByRole('dialog');
219
- declineButton = within(dialog).getByText('No');
220
- confirmButton = within(dialog).getByText('Yes');
221
- fireEvent.click(declineButton);
222
- fireEvent.click(confirmButton);
223
- expect(onDelete).not.toHaveBeenCalled();
224
- unmockTableSizing();
225
- return [2 /*return*/];
226
- }
227
- });
228
- }); });
229
- it('should pin and ignore auto generated attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
230
- var unmockTableSizing, onPin, onIgnore, selectedAttributeTypes, props, user, attribute, pinButton, ignoreButton;
231
- return __generator(this, function (_a) {
232
- switch (_a.label) {
233
- case 0:
234
- unmockTableSizing = mockBasicTableSizing();
235
- onPin = jest.fn();
236
- onIgnore = jest.fn();
237
- selectedAttributeTypes = [
238
- {
239
- description: 'Yes or No',
240
- label: 'Boolean',
241
- name: 'Boolean',
242
- type: 'Boolean',
243
- uri: 'configuration/entityTypes/HCP/attributes/Boolean',
244
- autoGenerated: true
245
- }
246
- ];
247
- props = __assign(__assign({}, defaultProps), { selectedAttributeTypes: selectedAttributeTypes, onPin: onPin, onIgnore: onIgnore });
248
- user = setUp(props).user;
249
- attribute = within(getCellByIndexes(0, 1)).getByTestId('value-index-0');
250
- return [4 /*yield*/, user.hover(attribute)];
251
- case 1:
252
- _a.sent();
253
- pinButton = within(attribute).getByLabelText('Pin').querySelector('button');
254
- ignoreButton = within(attribute).getByLabelText('Ignore').querySelector('button');
255
- expect(within(attribute).queryByRole('button', { name: 'More actions' })).not.toBeInTheDocument();
256
- return [4 /*yield*/, user.click(pinButton)];
257
- case 2:
258
- _a.sent();
259
- expect(onPin).toHaveBeenCalled();
260
- return [4 /*yield*/, user.click(ignoreButton)];
261
- case 3:
262
- _a.sent();
263
- expect(onIgnore).toHaveBeenCalled();
264
- unmockTableSizing();
265
- return [2 /*return*/];
266
- }
267
- });
268
- }); });
269
- it('should call on edit only once in case of dblClick on "Safe without ignore"', function () { return __awaiter(void 0, void 0, void 0, function () {
270
- var onEdit, unmockTableSizing, entity, props, user;
271
- return __generator(this, function (_a) {
272
- switch (_a.label) {
273
- case 0:
274
- onEdit = jest.fn();
275
- unmockTableSizing = mockBasicTableSizing();
276
- entity = createEntity();
277
- entity.attributes.TextField[0].ignored = true;
278
- props = __assign(__assign({}, defaultProps), { entity: entity, onEdit: onEdit });
279
- user = setUp(props).user;
280
- return [4 /*yield*/, editTextFieldAttribute(user)];
281
- case 1:
282
- _a.sent();
283
- return [4 /*yield*/, user.dblClick(screen.getByText('Ok'))];
284
- case 2:
285
- _a.sent();
286
- expect(onEdit).toHaveBeenCalledTimes(1);
287
- unmockTableSizing();
288
- return [2 /*return*/];
289
- }
290
- });
291
- }); });
292
- it('should call on edit only once in case of dblClick on "Save and apply Ignore to new value"', function () { return __awaiter(void 0, void 0, void 0, function () {
293
- var onEdit, unmockTableSizing, entity, props, user;
294
- return __generator(this, function (_a) {
295
- switch (_a.label) {
296
- case 0:
297
- onEdit = jest.fn();
298
- unmockTableSizing = mockBasicTableSizing();
299
- entity = createEntity();
300
- entity.attributes.TextField[0].ignored = true;
301
- props = __assign(__assign({}, defaultProps), { entity: entity, onEdit: onEdit });
302
- user = setUp(props).user;
303
- return [4 /*yield*/, editTextFieldAttribute(user)];
304
- case 1:
305
- _a.sent();
306
- return [4 /*yield*/, user.dblClick(screen.getByText('Save and apply Ignore to new value'))];
307
- case 2:
308
- _a.sent();
309
- return [4 /*yield*/, user.dblClick(screen.getByText('Ok'))];
310
- case 3:
311
- _a.sent();
312
- expect(onEdit).toHaveBeenCalledTimes(1);
313
- unmockTableSizing();
314
- return [2 /*return*/];
315
- }
316
- });
317
- }); });
318
- });
@@ -1,137 +0,0 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
- import React from 'react';
11
- import { mount } from 'enzyme';
12
- import { SortingStrategy } from '@reltio/mdm-sdk';
13
- import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
14
- import { BasicTableContext } from '../../../../../contexts/BasicTableContext';
15
- import AddAttributesButton from './AddAttributesButton';
16
- var metadata = {
17
- entityTypes: [
18
- {
19
- uri: 'configuration/entityTypes/HCP',
20
- label: 'HCP',
21
- attributes: [
22
- {
23
- label: 'Country Code',
24
- name: 'CountryCode',
25
- type: 'String',
26
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
27
- },
28
- {
29
- label: 'Date',
30
- name: 'Date',
31
- type: 'Date',
32
- uri: 'configuration/entityTypes/HCP/attributes/Date'
33
- },
34
- {
35
- label: 'Hidden',
36
- name: 'Hidden',
37
- type: 'String',
38
- uri: 'configuration/entityTypes/HCP/attributes/Hidden',
39
- hidden: true
40
- },
41
- {
42
- label: 'Nested',
43
- name: 'Nested',
44
- type: 'Nested',
45
- uri: 'configuration/entityTypes/HCP/attributes/Nested'
46
- },
47
- {
48
- label: 'Reference',
49
- name: 'Reference',
50
- type: 'Reference',
51
- uri: 'configuration/entityTypes/HCP/attributes/Reference'
52
- },
53
- {
54
- label: 'Image',
55
- name: 'Image',
56
- type: 'Image',
57
- uri: 'configuration/entityTypes/HCP/attributes/Image'
58
- }
59
- ]
60
- }
61
- ]
62
- };
63
- var attributesSortingStrategy = SortingStrategy.ASC_BY_NAME;
64
- var defaultProps = {
65
- parentUri: 'entities/1',
66
- parentTypeUri: 'configuration/entityTypes/HCP',
67
- onAdd: jest.fn(),
68
- selectedAttributeTypes: [
69
- {
70
- label: 'Country Code',
71
- name: 'CountryCode',
72
- type: 'String',
73
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
74
- }
75
- ],
76
- onSelectAttributeTypes: jest.fn()
77
- };
78
- var setUp = function (props) {
79
- if (props === void 0) { props = defaultProps; }
80
- return mount(React.createElement(BasicTableContext.Provider, { value: props },
81
- React.createElement(MdmModuleProvider, { values: { metadata: metadata, attributesSortingStrategy: attributesSortingStrategy } },
82
- React.createElement(AddAttributesButton, null))));
83
- };
84
- describe('AddAttributesButton tests', function () {
85
- it('should render attribute button with nested and non-selected simple attributes', function () {
86
- var wrapper = setUp();
87
- expect(wrapper.find('MoreAttributesButton').props()).toMatchObject({
88
- label: 'Attribute',
89
- popupTitle: 'Add attributes',
90
- data: [
91
- {
92
- label: 'Date',
93
- name: 'Date',
94
- type: 'Date',
95
- uri: 'configuration/entityTypes/HCP/attributes/Date'
96
- },
97
- {
98
- label: 'Nested',
99
- name: 'Nested',
100
- type: 'Nested',
101
- uri: 'configuration/entityTypes/HCP/attributes/Nested'
102
- }
103
- ]
104
- });
105
- });
106
- it('should add attribute to beginning on simple attribute select', function () {
107
- var onSelectAttributeTypes = defaultProps.onSelectAttributeTypes, selectedAttributeTypes = defaultProps.selectedAttributeTypes, onAdd = defaultProps.onAdd;
108
- var wrapper = setUp();
109
- var onApply = wrapper.find('MoreAttributesButton').prop('onApply');
110
- var selectedSimple = {
111
- label: 'Date',
112
- name: 'Date',
113
- type: 'Date',
114
- uri: 'configuration/entityTypes/HCP/attributes/Date'
115
- };
116
- onApply([selectedSimple]);
117
- expect(onSelectAttributeTypes).toHaveBeenCalledWith(__spreadArray([selectedSimple], selectedAttributeTypes, true));
118
- expect(onAdd).not.toHaveBeenCalled();
119
- });
120
- it('should add attribute to beginning on nested attribute select', function () {
121
- var onSelectAttributeTypes = defaultProps.onSelectAttributeTypes, selectedAttributeTypes = defaultProps.selectedAttributeTypes, onAdd = defaultProps.onAdd, parentUri = defaultProps.parentUri;
122
- var wrapper = setUp();
123
- var onApply = wrapper.find('MoreAttributesButton').prop('onApply');
124
- var selectedNested = {
125
- label: 'Nested',
126
- name: 'Nested',
127
- type: 'Nested',
128
- uri: 'configuration/entityTypes/HCP/attributes/Nested'
129
- };
130
- onApply([selectedNested]);
131
- expect(onSelectAttributeTypes).toHaveBeenCalledWith(__spreadArray([selectedNested], selectedAttributeTypes, true));
132
- expect(onAdd).toHaveBeenCalledWith({
133
- attributeType: selectedNested,
134
- parentUri: parentUri
135
- });
136
- });
137
- });
@@ -1,141 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { SimpleAttributesRenderer } from '../SimpleAttributesRenderer';
15
- import { NestedAttributesRenderer } from '../NestedAttributesRenderer';
16
- import { ReferenceAttributesRenderer } from '../ReferenceAttributesRenderer';
17
- import { AttributeValuesRenderer } from './AttributeValuesRenderer';
18
- describe('AttributeValuesRenderer tests', function () {
19
- var contextProps = {
20
- onPin: jest.fn(),
21
- onIgnore: jest.fn(),
22
- onAdd: jest.fn(),
23
- onEdit: jest.fn(),
24
- onDelete: jest.fn(),
25
- parentUri: 'entities/1',
26
- emptyTempAttributeUris: []
27
- };
28
- it('should render simple attributes correctly', function () {
29
- var value = {
30
- attributeValues: [
31
- {
32
- uri: 'entities/1/attributes/CountryCode/1',
33
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
34
- value: 'Italy',
35
- lookupCode: 'IT',
36
- ov: true
37
- }
38
- ],
39
- attributeType: {
40
- label: 'Country Code',
41
- name: 'CountryCode',
42
- type: 'String',
43
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
44
- },
45
- crosswalksMap: {}
46
- };
47
- var wrapper = shallow(React.createElement(AttributeValuesRenderer, __assign({ value: value }, contextProps)));
48
- expect(wrapper.find(SimpleAttributesRenderer).props()).toEqual(__assign(__assign({}, value), contextProps));
49
- });
50
- it('should render nested attributes correctly', function () {
51
- var value = {
52
- attributeValues: [
53
- {
54
- uri: 'entities/1/attributes/Nested/1',
55
- value: {
56
- SubNested: [
57
- {
58
- uri: 'entities/1/attributes/Nested/1/SubNested/1',
59
- type: 'String',
60
- value: '1'
61
- }
62
- ]
63
- },
64
- ov: true
65
- }
66
- ],
67
- attributeType: {
68
- uri: 'configuration/entityTypes/HCP/attributes/Nested',
69
- label: 'Nested',
70
- name: 'Nested',
71
- type: 'Nested',
72
- attributes: [
73
- {
74
- label: 'SubNested',
75
- name: 'SubNested',
76
- type: 'String',
77
- uri: 'configuration/entityTypes/HCP/attributes/Nested/attributes/SubNested'
78
- }
79
- ]
80
- },
81
- crosswalksMap: {}
82
- };
83
- var wrapper = shallow(React.createElement(AttributeValuesRenderer, __assign({ value: value }, contextProps)));
84
- expect(wrapper.find(NestedAttributesRenderer).props()).toEqual(__assign(__assign({}, value), contextProps));
85
- });
86
- it('should render reference attributes correctly', function () {
87
- var value = {
88
- attributeValues: [
89
- {
90
- label: '3588 Granada Aveue Santa Clara',
91
- relationshipLabel: 'Office',
92
- value: {
93
- AddressLine1: [
94
- {
95
- type: 'configuration/entityTypes/Location/attributes/AddressLine1',
96
- ov: true,
97
- value: '3588 Granada Aveue',
98
- uri: 'entities/1/attributes/Address/1/AddressLine1/1'
99
- }
100
- ]
101
- },
102
- ov: true,
103
- uri: 'entities/1/attributes/Address/1',
104
- refEntity: {},
105
- refRelation: {}
106
- }
107
- ],
108
- attributeType: {
109
- label: 'Address',
110
- name: 'Address',
111
- type: 'Reference',
112
- uri: 'configuration/entityTypes/HCP/attributes/Address'
113
- },
114
- crosswalksMap: {}
115
- };
116
- var wrapper = shallow(React.createElement(AttributeValuesRenderer, __assign({ value: value }, contextProps)));
117
- expect(wrapper.find(ReferenceAttributesRenderer).props()).toEqual(__assign(__assign({}, value), contextProps));
118
- });
119
- it('should disable edit and delete for attributes if table is read only', function () {
120
- var value = {
121
- attributeValues: [
122
- {
123
- uri: 'entities/1/attributes/CountryCode/1',
124
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
125
- value: 'Italy',
126
- lookupCode: 'IT',
127
- ov: true
128
- }
129
- ],
130
- attributeType: {
131
- label: 'Country Code',
132
- name: 'CountryCode',
133
- type: 'String',
134
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
135
- },
136
- crosswalksMap: {}
137
- };
138
- var wrapper = shallow(React.createElement(AttributeValuesRenderer, __assign({ value: value }, contextProps, { readOnly: true })));
139
- expect(wrapper.find(SimpleAttributesRenderer).props()).toEqual(__assign(__assign(__assign({}, value), contextProps), { disableEdit: true, disableDelete: true }));
140
- });
141
- });
@@ -1,45 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { Spacer } from '../../../../../Spacer';
15
- import { AddAttributesButton } from '../AddAttributesButton';
16
- import { AttributesHeadCellRenderer } from './AttributesHeadCellRenderer';
17
- describe('AttributesHeadCellRenderer tests', function () {
18
- it('should render correctly', function () {
19
- var props = {
20
- headCellData: {
21
- id: 'ovValues',
22
- label: 'Attribute & OvValues'
23
- }
24
- };
25
- var wrapper = shallow(React.createElement(AttributesHeadCellRenderer, __assign({}, props)));
26
- expect(wrapper.find('HeadCellRenderer').props()).toEqual(__assign(__assign({}, props), { children: [React.createElement(Spacer, null), React.createElement(AddAttributesButton, null)] }));
27
- });
28
- it('should not render AddAttributesButton if table is read only', function () {
29
- var props = {
30
- headCellData: {
31
- id: 'ovValues',
32
- label: 'Attribute & OvValues'
33
- },
34
- readOnly: true
35
- };
36
- var wrapper = shallow(React.createElement(AttributesHeadCellRenderer, __assign({}, props)));
37
- expect(wrapper.find('HeadCellRenderer').props()).toEqual({
38
- headCellData: {
39
- id: 'ovValues',
40
- label: 'Attribute & OvValues'
41
- },
42
- children: undefined
43
- });
44
- });
45
- });