@reltio/components 1.4.1996 → 1.4.1998

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 (141) hide show
  1. package/cjs/ResizablePanes/ResizablePanes.js +5 -6
  2. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  3. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  4. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +267 -0
  5. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  6. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  7. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  8. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  9. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  10. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  11. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  12. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  13. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  14. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  15. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  16. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  17. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  18. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  19. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  20. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  21. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  22. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  23. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  24. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  25. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  26. package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  27. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  28. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +784 -0
  29. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  30. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  31. package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +102 -79
  32. package/cjs/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  33. package/cjs/features/activity-log/Field/Field.d.ts +2 -3
  34. package/cjs/features/activity-log/Field/Field.js +24 -2
  35. package/cjs/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  36. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  37. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.test.js +207 -0
  38. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  39. package/cjs/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  40. package/cjs/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  41. package/esm/ResizablePanes/ResizablePanes.js +5 -6
  42. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  43. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  44. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +262 -0
  45. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  46. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  47. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  48. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  49. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  50. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  51. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  52. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  53. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  54. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  55. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  56. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  57. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  58. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  59. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  60. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  61. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  62. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  63. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  64. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  65. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  66. package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  67. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  68. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +779 -0
  69. package/esm/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  70. package/esm/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  71. package/esm/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +104 -58
  72. package/esm/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  73. package/esm/features/activity-log/Field/Field.d.ts +2 -3
  74. package/esm/features/activity-log/Field/Field.js +24 -2
  75. package/esm/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  76. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  77. package/esm/features/activity-log/RecordUpdates/RecordUpdates.test.js +202 -0
  78. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  79. package/esm/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  80. package/esm/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  81. package/package.json +1 -1
  82. package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -142
  83. package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -131
  84. package/cjs/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -252
  85. package/cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -158
  86. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -135
  87. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -65
  88. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  89. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -119
  90. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  91. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -75
  92. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  93. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -140
  94. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  95. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -41
  96. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  97. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -87
  98. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  99. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -19
  100. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  101. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -179
  102. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  103. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -150
  104. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  105. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -124
  106. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts +0 -1
  107. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -137
  108. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.d.ts +0 -1
  109. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -126
  110. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.d.ts +0 -1
  111. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -247
  112. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts +0 -1
  113. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -153
  114. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts +0 -1
  115. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -130
  116. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts +0 -1
  117. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -60
  118. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  119. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -114
  120. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  121. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -72
  122. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  123. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -135
  124. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  125. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -36
  126. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  127. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -82
  128. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  129. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -14
  130. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  131. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -151
  132. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  133. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -122
  134. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  135. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -119
  136. /package/cjs/features/activity-log/{ActivityExportButton/ActivityExportButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  137. /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  138. /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
  139. /package/{cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  140. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  141. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
@@ -91,10 +91,9 @@ var ResizablePanes = function (_a) {
91
91
  (0, react_1.useEffect)(function () {
92
92
  actualizeSizes();
93
93
  }, [actualizeSizes, percentageMaxSize, percentageMinSize]);
94
- var handleChange = (0, react_1.useCallback)((0, mdm_sdk_1.debounce)(function (size) {
95
- if (size === undefined)
94
+ var handleChange = (0, react_1.useCallback)((0, mdm_sdk_1.debounce)(function (size, containerSize) {
95
+ if (size === undefined || containerSize === 0)
96
96
  return;
97
- var containerSize = getContainerSize();
98
97
  onChange({
99
98
  percentageSize: size + '%',
100
99
  isMaxSize: +percentageMaxSize > 0
@@ -103,7 +102,7 @@ var ResizablePanes = function (_a) {
103
102
  isMinSize: isEqualSize(size, percentageMinSize),
104
103
  size: Math.round((size * containerSize) / 100)
105
104
  });
106
- }, debounceInterval), [onChange, percentageMaxSize, percentageMinSize, getContainerSize]);
105
+ }, debounceInterval), [onChange, percentageMaxSize, percentageMinSize]);
107
106
  var handleDragging = (0, react_1.useCallback)(function (isDragging) {
108
107
  if (isDragging) {
109
108
  // Why do we need handleChange() here?
@@ -113,10 +112,10 @@ var ResizablePanes = function (_a) {
113
112
  disableAnimation();
114
113
  }
115
114
  else {
116
- handleChange(panelRef.current.getSize());
115
+ handleChange(panelRef.current.getSize(), getContainerSize());
117
116
  enableAnimation();
118
117
  }
119
- }, [disableAnimation, enableAnimation, handleChange]);
118
+ }, [disableAnimation, enableAnimation, handleChange, getContainerSize]);
120
119
  var paneAnimationStyle = (0, react_1.useMemo)(function () { return ({
121
120
  transition: theme.transitions.create('flex', {
122
121
  easing: theme.transitions.easing.sharp,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ActivityData, ActivityTypes } from '../types';
3
3
  type FactoryProps = {
4
4
  type: ActivityTypes;
5
- data: ActivityData;
5
+ data?: ActivityData;
6
6
  };
7
7
  export declare class ActivitiesFactory {
8
8
  static getComponent: ({ type, data }: FactoryProps) => React.JSX.Element;
@@ -37,7 +37,7 @@ var ActivitiesFactory = /** @class */ (function () {
37
37
  case types_1.ActivityTypes.COMMENT_ADDED:
38
38
  case types_1.ActivityTypes.COMMENT_DELETED:
39
39
  case types_1.ActivityTypes.COMMENT_UPDATED:
40
- return react_1.default.createElement(CommentActivity_1.CommentActivity, { data: data, type: type });
40
+ return react_1.default.createElement(CommentActivity_1.CommentActivity, { type: type });
41
41
  case types_1.ActivityTypes.ENTITIES_MERGED_MANUALLY:
42
42
  case types_1.ActivityTypes.ENTITIES_MERGED:
43
43
  case types_1.ActivityTypes.ENTITIES_MERGED_ON_THE_FLY:
@@ -0,0 +1,267 @@
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
+ var react_1 = __importDefault(require("react"));
7
+ var react_2 = require("@testing-library/react");
8
+ var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
9
+ var CollapsibleItemsContext_1 = require("../contexts/CollapsibleItemsContext");
10
+ var types_1 = require("../types");
11
+ var ActivitiesFactory_1 = require("./ActivitiesFactory");
12
+ var defaultMdmValues = {
13
+ metadata: {
14
+ entityTypes: [],
15
+ groupTypes: []
16
+ }
17
+ };
18
+ var setUp = function (_a) {
19
+ var props = _a.props, _b = _a.mdmValues, mdmValues = _b === void 0 ? defaultMdmValues : _b;
20
+ var Providers = function (_a) {
21
+ var children = _a.children;
22
+ return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
23
+ react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
24
+ };
25
+ return (0, react_2.render)(ActivitiesFactory_1.ActivitiesFactory.getComponent(props), { wrapper: Providers });
26
+ };
27
+ describe('Activities factory tests', function () {
28
+ describe('comment activity', function () {
29
+ it('should render comment activity for COMMENT_ADDED activity type', function () {
30
+ var props = { type: types_1.ActivityTypes.COMMENT_ADDED };
31
+ setUp({ props: props });
32
+ react_2.screen.getByTestId('comment-activity');
33
+ });
34
+ it('should render comment activity for COMMENT_DELETED activity type', function () {
35
+ var props = { type: types_1.ActivityTypes.COMMENT_DELETED };
36
+ setUp({ props: props });
37
+ react_2.screen.getByTestId('comment-activity');
38
+ });
39
+ it('should render comment activity for COMMENT_UPDATED activity type', function () {
40
+ var props = { type: types_1.ActivityTypes.COMMENT_UPDATED };
41
+ setUp({ props: props });
42
+ react_2.screen.getByTestId('comment-activity');
43
+ });
44
+ });
45
+ describe('merge activity', function () {
46
+ var defaultData = {
47
+ uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
48
+ user: 'marat.ahmetzyanov',
49
+ timestamp: 1620711408828,
50
+ items: [],
51
+ itemsTotal: 0
52
+ };
53
+ it('should render merge activity for ENTITIES_MERGED_MANUALLY activity type', function () {
54
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_MERGED_MANUALLY };
55
+ setUp({ props: props });
56
+ react_2.screen.getByTestId('merge-activity');
57
+ });
58
+ it('should render merge activity for ENTITIES_MERGED activity type', function () {
59
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_MERGED };
60
+ setUp({ props: props });
61
+ react_2.screen.getByTestId('merge-activity');
62
+ });
63
+ it('should render merge activity for ENTITIES_MERGED_ON_THE_FLY activity type', function () {
64
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_MERGED_ON_THE_FLY };
65
+ setUp({ props: props });
66
+ react_2.screen.getByTestId('merge-activity');
67
+ });
68
+ it('should render merge activity for ENTITIES_SPLITTED activity type', function () {
69
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_SPLITTED };
70
+ setUp({ props: props });
71
+ react_2.screen.getByTestId('merge-activity');
72
+ });
73
+ it('should render merge activity for ENTITY_LOST_MERGE activity type', function () {
74
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_LOST_MERGE };
75
+ setUp({ props: props });
76
+ react_2.screen.getByTestId('merge-activity');
77
+ });
78
+ });
79
+ describe('potential match activity', function () {
80
+ var defaultData = {
81
+ uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
82
+ user: 'marat.ahmetzyanov',
83
+ timestamp: 1620711408828,
84
+ items: [],
85
+ itemsTotal: 0
86
+ };
87
+ it('should render potential match activity for POTENTIAL_MATCHES_FOUND activity type', function () {
88
+ var props = { data: defaultData, type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND };
89
+ setUp({ props: props });
90
+ react_2.screen.getByTestId('potential-match-activity');
91
+ });
92
+ it('should render potential match activity for POTENTIAL_MATCHES_REMOVED activity type', function () {
93
+ var props = { data: defaultData, type: types_1.ActivityTypes.POTENTIAL_MATCHES_REMOVED };
94
+ setUp({ props: props });
95
+ react_2.screen.getByTestId('potential-match-activity');
96
+ });
97
+ it('should render potential match activity for NOT_MATCHES_SET activity type', function () {
98
+ var props = { data: defaultData, type: types_1.ActivityTypes.NOT_MATCHES_SET };
99
+ setUp({ props: props });
100
+ react_2.screen.getByTestId('potential-match-activity');
101
+ });
102
+ it('should render potential match activity for NOT_MATCHES_RESET activity type', function () {
103
+ var props = { data: defaultData, type: types_1.ActivityTypes.NOT_MATCHES_RESET };
104
+ setUp({ props: props });
105
+ react_2.screen.getByTestId('potential-match-activity');
106
+ });
107
+ });
108
+ describe('profile activity', function () {
109
+ var defaultData = {
110
+ uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
111
+ user: 'marat.ahmetzyanov',
112
+ timestamp: 1620711408828,
113
+ items: [],
114
+ itemsTotal: 0
115
+ };
116
+ it('should render profile activity for ENTITY_CHANGED activity type', function () {
117
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_CHANGED };
118
+ setUp({ props: props });
119
+ react_2.screen.getByTestId('profile-activity');
120
+ });
121
+ it('should render profile activity for ENTITY_CREATED activity type', function () {
122
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_CREATED };
123
+ setUp({ props: props });
124
+ react_2.screen.getByTestId('profile-activity');
125
+ });
126
+ it('should render profile activity for ENTITY_REMOVED activity type', function () {
127
+ var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_REMOVED };
128
+ setUp({ props: props });
129
+ react_2.screen.getByTestId('profile-activity');
130
+ });
131
+ it('should render profile activity for ANALYTICS_ATTRIBUTES_CHANGED activity type', function () {
132
+ var props = { data: defaultData, type: types_1.ActivityTypes.ANALYTICS_ATTRIBUTES_CHANGED };
133
+ setUp({ props: props });
134
+ react_2.screen.getByTestId('profile-activity');
135
+ });
136
+ });
137
+ describe('relation activity', function () {
138
+ var defaultData = {
139
+ uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
140
+ user: 'marat.ahmetzyanov',
141
+ timestamp: 1620711408828,
142
+ items: [],
143
+ itemsTotal: 0
144
+ };
145
+ it('should render relation activity for RELATIONSHIP_CHANGED activity type', function () {
146
+ var props = { data: defaultData, type: types_1.ActivityTypes.RELATIONSHIP_CHANGED };
147
+ setUp({ props: props });
148
+ react_2.screen.getByTestId('relation-activity');
149
+ });
150
+ it('should render relation activity for RELATIONSHIP_CREATED activity type', function () {
151
+ var props = { data: defaultData, type: types_1.ActivityTypes.RELATIONSHIP_CREATED };
152
+ setUp({ props: props });
153
+ react_2.screen.getByTestId('relation-activity');
154
+ });
155
+ it('should render relation activity for RELATIONSHIP_REMOVED activity type', function () {
156
+ var props = { data: defaultData, type: types_1.ActivityTypes.RELATIONSHIP_REMOVED };
157
+ setUp({ props: props });
158
+ react_2.screen.getByTestId('relation-activity');
159
+ });
160
+ });
161
+ describe('search activity', function () {
162
+ it('should render search activity for USER_SEARCH activity type', function () {
163
+ var props = {
164
+ data: {
165
+ uri: 'activities/504c-9876-79bc2a96',
166
+ user: 'polina.arsenteva',
167
+ label: 'USER_SEARCH',
168
+ description: '{"activity":{"query":null,"uiState":{"view":{"searchResultsMode":"table","entityTypeTab":null,"previewPanelMode":null},"facets":{},"advanced":[],"searchOptions":{"searchByOv":true,"ovOnly":true},"keyword":null,"map":null,"version":"2.0"}},"version":"2.0"}',
169
+ timestamp: 1626952820539
170
+ },
171
+ type: types_1.ActivityTypes.USER_SEARCH
172
+ };
173
+ setUp({ props: props });
174
+ react_2.screen.getByTestId('search-activity');
175
+ });
176
+ });
177
+ describe('group activity', function () {
178
+ var defaultData = {
179
+ uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
180
+ user: 'marat.ahmetzyanov',
181
+ timestamp: 1620711408828,
182
+ items: [],
183
+ itemsTotal: 0
184
+ };
185
+ it('should render group activity for GROUP_CHANGED activity type', function () {
186
+ var props = { data: defaultData, type: types_1.ActivityTypes.GROUP_CHANGED };
187
+ setUp({ props: props });
188
+ react_2.screen.getByTestId('group-activity');
189
+ });
190
+ it('should render group activity for GROUP_CREATED activity type', function () {
191
+ var props = { data: defaultData, type: types_1.ActivityTypes.GROUP_CREATED };
192
+ setUp({ props: props });
193
+ react_2.screen.getByTestId('group-activity');
194
+ });
195
+ it('should render group activity for GROUP_REMOVED activity type', function () {
196
+ var props = { data: defaultData, type: types_1.ActivityTypes.GROUP_REMOVED };
197
+ setUp({ props: props });
198
+ react_2.screen.getByTestId('group-activity');
199
+ });
200
+ });
201
+ describe('simple activity', function () {
202
+ var defaultData = {
203
+ uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
204
+ user: 'marat.ahmetzyanov',
205
+ timestamp: 1620711408828,
206
+ description: '{}',
207
+ itemsTotal: 0
208
+ };
209
+ it('should render simple activity for USER_LOGIN activity type', function () {
210
+ var props = { data: defaultData, type: types_1.ActivityTypes.USER_LOGIN };
211
+ setUp({ props: props });
212
+ react_2.screen.getByTestId('simple-activity');
213
+ });
214
+ it('should render simple activity for USER_LOGOUT activity type', function () {
215
+ var props = { data: defaultData, type: types_1.ActivityTypes.USER_LOGOUT };
216
+ setUp({ props: props });
217
+ react_2.screen.getByTestId('simple-activity');
218
+ });
219
+ it('should render simple activity for MODEL_UPDATED activity type', function () {
220
+ var props = { data: defaultData, type: types_1.ActivityTypes.MODEL_UPDATED };
221
+ setUp({ props: props });
222
+ react_2.screen.getByTestId('simple-activity');
223
+ });
224
+ it('should render simple activity for PERIODIC_TASK_SCHEDULED activity type', function () {
225
+ var props = { data: defaultData, type: types_1.ActivityTypes.PERIODIC_TASK_SCHEDULED };
226
+ setUp({ props: props });
227
+ react_2.screen.getByTestId('simple-activity');
228
+ });
229
+ it('should render simple activity for USER_PROFILE_VIEW activity type', function () {
230
+ var props = { data: defaultData, type: types_1.ActivityTypes.USER_PROFILE_VIEW };
231
+ setUp({ props: props });
232
+ react_2.screen.getByTestId('simple-activity');
233
+ });
234
+ });
235
+ describe('synchronization issues activity', function () {
236
+ it('should render synchronization issues activity for SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE activity type', function () {
237
+ var props = {
238
+ data: {
239
+ uri: 'activities/0dcf97d0-5006-46d6-b82f-07579922e2f6',
240
+ user: 'sfdc.connector.admin',
241
+ label: 'label',
242
+ timestamp: 1652374313724,
243
+ items: [
244
+ {
245
+ id: '42uxv5X2',
246
+ timestamp: 1652374313724,
247
+ objectUri: 'entities/15T9kNFk',
248
+ objectType: 'configuration/entityTypes/HCP',
249
+ objectLabel: 'Andy Andy'
250
+ }
251
+ ],
252
+ itemsTotal: 1
253
+ },
254
+ type: types_1.ActivityTypes.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE
255
+ };
256
+ setUp({ props: props });
257
+ react_2.screen.getByTestId('synchronization-issues-activity');
258
+ });
259
+ });
260
+ describe('not implemented', function () {
261
+ it('should render not implemented text for unexpected types', function () {
262
+ var props = { type: 'UNEXPECTED_ACTIVITY' };
263
+ setUp({ props: props });
264
+ react_2.screen.getByText('UNEXPECTED_ACTIVITY NOT IMPLEMENTED');
265
+ });
266
+ });
267
+ });
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { ActivityData, ActivityTypes } from '../../../types';
2
+ import { ActivityTypes } from '../../../types';
3
3
  type Props = {
4
4
  type: ActivityTypes;
5
- data: ActivityData;
6
5
  };
7
6
  export declare const CommentActivity: ({ type }: Props) => React.JSX.Element;
8
7
  export {};
@@ -8,6 +8,6 @@ var react_1 = __importDefault(require("react"));
8
8
  var ActivityTitle_1 = require("../../../ActivityTitle");
9
9
  var CommentActivity = function (_a) {
10
10
  var type = _a.type;
11
- return react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type });
11
+ return react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "comment-activity" });
12
12
  };
13
13
  exports.CommentActivity = CommentActivity;
@@ -4,30 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
- var enzyme_1 = require("enzyme");
8
- var CommentActivity_1 = require("./CommentActivity");
7
+ var react_2 = require("@testing-library/react");
9
8
  var types_1 = require("../../../types");
10
- describe('CommentActivity tests', function () {
11
- var data = {
12
- uri: 'activities/6aa6a54a-a41b-49fd-8070-b4900d3e5468',
13
- user: 'denis.tkachev',
14
- label: 'COMMENT_ADDED',
15
- description: '{"commentId":"00005LQ","createdBy":"denis.tkachev","createdTime":1623229206252,"modifiedTime":1623229206252,"deleted":false,"visibility":"public","status":"open","objectId":"entities/1BKYwm2t","objectType":"entity","permanentLink":"https://tst-01.reltio.com/ui/uitest3/#p~com.reltio.plugins.entity.HCPPerspective_e~entities%2F1BKYwm2t_ps~profile_cmt~00005LQ","relatedObjectUris":["entities/1BKYwm2t"]}',
16
- timestamp: 1623229209927,
17
- items: [
18
- {
19
- id: '5pUxeNLr',
20
- user: 'denis.tkachev',
21
- method: 'POST',
22
- url: '/reltio/api/uitest3/activities',
23
- clientType: 'UNKNOWN',
24
- timestamp: 1623229209927
25
- }
26
- ],
27
- itemsTotal: 1
28
- };
9
+ var CommentActivity_1 = require("./CommentActivity");
10
+ describe('Comment activity tests', function () {
29
11
  it('should render correctly', function () {
30
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(CommentActivity_1.CommentActivity, { type: types_1.ActivityTypes.COMMENT_ADDED, data: data }));
31
- expect(wrapper.find('ActivityTitle').prop('type')).toBe(types_1.ActivityTypes.COMMENT_ADDED);
12
+ (0, react_2.render)(react_1.default.createElement(CommentActivity_1.CommentActivity, { type: types_1.ActivityTypes.COMMENT_ADDED }));
13
+ react_2.screen.getByText('Comment added');
32
14
  });
33
15
  });
@@ -5,16 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.GroupActivity = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
- var ActivityTitle_1 = require("../../../ActivityTitle");
9
8
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
10
9
  var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
10
+ var ActivityTitle_1 = require("../../../ActivityTitle");
11
11
  var ObjectLabel_1 = require("../ObjectLabel");
12
12
  var GroupActivity = function (_a) {
13
13
  var _b, _c;
14
14
  var data = _a.data, type = _a.type;
15
15
  var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
16
16
  var label = (0, mdm_sdk_1.getGroupLabelByTypeUri)(metadata, (_c = (_b = data.items) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.objectType);
17
- return (react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type },
17
+ return (react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "group-activity" },
18
18
  react_1.default.createElement(ObjectLabel_1.ObjectLabel, { label: (0, mdm_sdk_1.getLabel)(label) })));
19
19
  };
20
20
  exports.GroupActivity = GroupActivity;
@@ -20,12 +20,7 @@ var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
20
20
  var types_1 = require("../../../types");
21
21
  var GroupActivity_1 = require("./GroupActivity");
22
22
  var metadata = {
23
- groupTypes: [
24
- {
25
- uri: 'configuration/groupTypes/Test',
26
- label: 'Test group'
27
- }
28
- ]
23
+ groupTypes: [{ uri: 'configuration/groupTypes/Test', label: 'Test group' }]
29
24
  };
30
25
  var setUp = function (props) {
31
26
  var Providers = function (_a) {
@@ -34,28 +29,13 @@ var setUp = function (props) {
34
29
  };
35
30
  return (0, react_2.render)(react_1.default.createElement(GroupActivity_1.GroupActivity, __assign({}, props)), { wrapper: Providers });
36
31
  };
37
- describe('GroupActivity tests', function () {
32
+ describe('Group activity tests', function () {
38
33
  it('should render correctly', function () {
39
34
  var data = {
40
35
  uri: 'activities/d6e61e96-6310-434a-99f9-e694e5f35475',
41
36
  user: 'alexander.kirsanov',
42
37
  timestamp: 1621874356842,
43
- items: [
44
- {
45
- id: '7a5l7pc1',
46
- user: 'alexander.kirsanov',
47
- method: 'POST',
48
- url: '/reltio/api/alenat/groups/7a5l7h5V/members',
49
- clientType: 'Reltio UI',
50
- timestamp: 1621874356842,
51
- objectUri: 'groups/7a5l7h5V',
52
- objectType: 'configuration/groupTypes/Test',
53
- data: {
54
- type: 'GROUP_CHANGED'
55
- },
56
- eventId: '1621874356842_1AeizH7'
57
- }
58
- ],
38
+ items: [{ id: 'sh2Ks8AN', timestamp: 1621874356842, objectType: 'configuration/groupTypes/Test' }],
59
39
  itemsTotal: 1
60
40
  };
61
41
  var props = { type: types_1.ActivityTypes.GROUP_CHANGED, data: data };
@@ -13,8 +13,8 @@ var MergeActivity = function (_a) {
13
13
  var type = _a.type, data = _a.data;
14
14
  var itemsTotal = data.itemsTotal, items = data.items, uri = data.uri;
15
15
  var isMinimized = itemsTotal === 1 && !(items[0].data.potentialMatches || items[0].data.newUri);
16
- return (react_1.default.createElement("div", null,
17
- react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type }, isMinimized && react_1.default.createElement(EntityObject_1.EntityObject, { item: items[0] })),
16
+ return (react_1.default.createElement("div", { "data-reltio-id": "merge-activity" },
17
+ react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "merge-activity-title" }, isMinimized && react_1.default.createElement(EntityObject_1.EntityObject, { item: items[0] })),
18
18
  !isMinimized && (react_1.default.createElement(CollapsibleActivityRecords_1.CollapsibleActivityRecords, { activityUri: uri, items: items, RecordComponent: PotentialMatchRecord_1.PotentialMatchRecord }))));
19
19
  };
20
20
  exports.MergeActivity = MergeActivity;