@reltio/components 1.4.2200 → 1.4.2202

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 (103) hide show
  1. package/ProfileResizablePanes/ProfileResizablePanes.js +1 -1
  2. package/ProfileResizablePanes/ProfileResizablePanes.spec.js +16 -2
  3. package/RequestedData/RequestedData.d.ts +12 -0
  4. package/RequestedData/RequestedData.js +26 -0
  5. package/RequestedData/RequestedData.module.css.js +9 -0
  6. package/RequestedData/index.d.ts +1 -0
  7. package/RequestedData/index.js +1 -0
  8. package/cjs/ProfileResizablePanes/ProfileResizablePanes.js +1 -1
  9. package/cjs/ProfileResizablePanes/ProfileResizablePanes.spec.js +16 -2
  10. package/cjs/RequestedData/RequestedData.d.ts +12 -0
  11. package/cjs/RequestedData/RequestedData.js +33 -0
  12. package/cjs/RequestedData/RequestedData.module.css.js +9 -0
  13. package/cjs/RequestedData/index.d.ts +1 -0
  14. package/cjs/RequestedData/index.js +5 -0
  15. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +5 -0
  16. package/cjs/features/activity-log/ActivitiesFactory/components/InteractionActivity/InteractionActivity.d.ts +8 -0
  17. package/cjs/features/activity-log/ActivitiesFactory/components/InteractionActivity/InteractionActivity.js +20 -0
  18. package/cjs/features/activity-log/ActivitiesFactory/components/InteractionActivity/index.d.ts +1 -0
  19. package/cjs/features/activity-log/ActivitiesFactory/components/InteractionActivity/index.js +5 -0
  20. package/cjs/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -2
  21. package/cjs/features/activity-log/ActivityLog/helpers.js +1 -1
  22. package/cjs/features/activity-log/InteractionRecord/InteractionRecord.d.ts +7 -0
  23. package/cjs/features/activity-log/InteractionRecord/InteractionRecord.js +17 -0
  24. package/cjs/features/activity-log/InteractionRecord/index.d.ts +1 -0
  25. package/cjs/features/activity-log/InteractionRecord/index.js +5 -0
  26. package/cjs/features/activity-log/types.d.ts +3 -1
  27. package/cjs/features/activity-log/types.js +2 -0
  28. package/cjs/features/activity-log/utils/activities.js +2 -0
  29. package/cjs/features/history/types.d.ts +2 -0
  30. package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +36 -3
  31. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +1 -3
  32. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +15 -6
  33. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +4 -3
  34. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +2 -28
  35. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +4 -3
  36. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +11 -3
  37. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -3
  38. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +5 -5
  39. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +2 -2
  40. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +2 -28
  41. package/cjs/features/workflow/ChangeRequestEditor/context/index.d.ts +20 -0
  42. package/cjs/features/workflow/ChangeRequestEditor/context/index.js +76 -0
  43. package/cjs/features/workflow/ChangeRequestEditor/helpers/helper.test.d.ts +1 -0
  44. package/cjs/features/workflow/ChangeRequestEditor/helpers/helper.test.js +237 -0
  45. package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +4 -0
  46. package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.js +105 -0
  47. package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +3 -1
  48. package/cjs/features/workflow/helpers/attributes.js +14 -3
  49. package/cjs/features/workflow/helpers/attributes.test.js +29 -7
  50. package/cjs/features/workflow/helpers/merge.d.ts +3 -2
  51. package/cjs/features/workflow/helpers/merge.js +62 -18
  52. package/cjs/features/workflow/helpers/merge.test.js +56 -2
  53. package/cjs/features/workflow/hooks/useChangesList.d.ts +2 -2
  54. package/cjs/features/workflow/types.d.ts +4 -3
  55. package/cjs/index.d.ts +1 -0
  56. package/cjs/index.js +6 -4
  57. package/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +5 -0
  58. package/features/activity-log/ActivitiesFactory/components/InteractionActivity/InteractionActivity.d.ts +8 -0
  59. package/features/activity-log/ActivitiesFactory/components/InteractionActivity/InteractionActivity.js +13 -0
  60. package/features/activity-log/ActivitiesFactory/components/InteractionActivity/index.d.ts +1 -0
  61. package/features/activity-log/ActivitiesFactory/components/InteractionActivity/index.js +1 -0
  62. package/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -2
  63. package/features/activity-log/ActivityLog/helpers.js +1 -1
  64. package/features/activity-log/InteractionRecord/InteractionRecord.d.ts +7 -0
  65. package/features/activity-log/InteractionRecord/InteractionRecord.js +10 -0
  66. package/features/activity-log/InteractionRecord/index.d.ts +1 -0
  67. package/features/activity-log/InteractionRecord/index.js +1 -0
  68. package/features/activity-log/types.d.ts +3 -1
  69. package/features/activity-log/types.js +2 -0
  70. package/features/activity-log/utils/activities.js +2 -0
  71. package/features/history/types.d.ts +2 -0
  72. package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +13 -3
  73. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +1 -3
  74. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +15 -6
  75. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +4 -3
  76. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +2 -5
  77. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +4 -3
  78. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +13 -5
  79. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -3
  80. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +6 -6
  81. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +2 -2
  82. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +2 -5
  83. package/features/workflow/ChangeRequestEditor/context/index.d.ts +20 -0
  84. package/features/workflow/ChangeRequestEditor/context/index.js +49 -0
  85. package/features/workflow/ChangeRequestEditor/helpers/helper.test.d.ts +1 -0
  86. package/features/workflow/ChangeRequestEditor/helpers/helper.test.js +235 -0
  87. package/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +4 -0
  88. package/features/workflow/ChangeRequestEditor/helpers/helpers.js +100 -0
  89. package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +3 -1
  90. package/features/workflow/helpers/attributes.js +14 -3
  91. package/features/workflow/helpers/attributes.test.js +29 -7
  92. package/features/workflow/helpers/merge.d.ts +3 -2
  93. package/features/workflow/helpers/merge.js +60 -17
  94. package/features/workflow/helpers/merge.test.js +56 -2
  95. package/features/workflow/hooks/useChangesList.d.ts +2 -2
  96. package/features/workflow/types.d.ts +4 -3
  97. package/index.d.ts +1 -0
  98. package/index.js +1 -0
  99. package/package.json +2 -2
  100. package/cjs/features/workflow/ChangeRequestEditor/helpers.d.ts +0 -3
  101. package/cjs/features/workflow/ChangeRequestEditor/helpers.js +0 -16
  102. package/features/workflow/ChangeRequestEditor/helpers.d.ts +0 -3
  103. package/features/workflow/ChangeRequestEditor/helpers.js +0 -12
@@ -32,8 +32,20 @@ describe('attributes helpers tests', function () {
32
32
  attributeType: 'configuration/entityTypes/HCA/attributes/CountryCode',
33
33
  id: '41cb3gGy',
34
34
  newPinOrIgnoreValue: true,
35
- newValue: { value: 'Chile', lookupCode: 'CL', lookupRawValue: 'Chile', pin: true },
36
- oldValue: { value: 'Chile', lookupCode: 'CL', lookupRawValue: 'Chile', pin: true },
35
+ newValue: {
36
+ value: 'Chile',
37
+ lookupCode: 'CL',
38
+ lookupRawValue: 'Chile',
39
+ pin: true,
40
+ lineIds: ['3AqlrpfGa/value/newValue']
41
+ },
42
+ oldValue: {
43
+ value: 'Chile',
44
+ lookupCode: 'CL',
45
+ lookupRawValue: 'Chile',
46
+ pin: true,
47
+ lineIds: ['3AqlrpfGa/value/oldValue']
48
+ },
37
49
  type: mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE
38
50
  }
39
51
  },
@@ -44,7 +56,12 @@ describe('attributes helpers tests', function () {
44
56
  attributeType: 'configuration/entityTypes/HCA/attributes/CountryCode',
45
57
  id: '41cb3c0i',
46
58
  newPinOrIgnoreValue: false,
47
- newValue: { value: 'Bahamas', lookupCode: 'BS', lookupRawValue: 'BS' },
59
+ newValue: {
60
+ value: 'Bahamas',
61
+ lookupCode: 'BS',
62
+ lookupRawValue: 'BS',
63
+ lineIds: ['uri$$1643545710682']
64
+ },
48
65
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE
49
66
  }
50
67
  }
@@ -76,7 +93,7 @@ describe('attributes helpers tests', function () {
76
93
  attributeType: metadata_test_data_1.metadata.entityTypes[0].attributes[1],
77
94
  label: 'Country Code',
78
95
  level: 0,
79
- newValue: changes.CountryCode[0].value.newValue,
96
+ newValue: __assign(__assign({}, changes.CountryCode[0].value.newValue), { lineIds: ['3AqlrpfGa/value/oldValue'] }),
80
97
  operation: 'ignored',
81
98
  isReferenceSubAttribute: false
82
99
  },
@@ -116,7 +133,12 @@ describe('attributes helpers tests', function () {
116
133
  };
117
134
  var changes = {
118
135
  TestAttribute: [{ value: { newValue: '123', type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE } }],
119
- 'activeness.startDate': [{ newValue: { value: 1644001200000 }, type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE }]
136
+ 'activeness.startDate': [
137
+ {
138
+ newValue: { value: 1644001200000, lineIds: ['relations/t58vHMD/activeness/startDate/newValue'] },
139
+ type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE
140
+ }
141
+ ]
120
142
  };
121
143
  it('should not show operation for relation title', function () {
122
144
  expect((0, attributes_1.getRelationChanges)(metadata_test_data_1.metadata, relationInfo, changes, mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE)).toEqual([
@@ -131,7 +153,7 @@ describe('attributes helpers tests', function () {
131
153
  attributeType: mdm_sdk_1.EntityAttrTypes.startDate,
132
154
  label: mdm_sdk_1.EntityAttrTypes.startDate.label,
133
155
  level: 2,
134
- newValue: { value: 1644001200000 },
156
+ newValue: { value: 1644001200000, lineIds: ['relations/t58vHMD/activeness/startDate/newValue'] },
135
157
  operation: mdm_sdk_1.DCROperationTypes.ADDED,
136
158
  isReferenceSubAttribute: false
137
159
  },
@@ -159,7 +181,7 @@ describe('attributes helpers tests', function () {
159
181
  attributeType: mdm_sdk_1.EntityAttrTypes.startDate,
160
182
  label: mdm_sdk_1.EntityAttrTypes.startDate.label,
161
183
  level: 2,
162
- newValue: { value: 1644001200000 },
184
+ newValue: { value: 1644001200000, lineIds: ['relations/t58vHMD/activeness/startDate/newValue'] },
163
185
  operation: mdm_sdk_1.DCROperationTypes.ADDED,
164
186
  isReferenceSubAttribute: false
165
187
  },
@@ -1,3 +1,4 @@
1
- import { DCRChanges, GroupedObjectsInfo, Metadata } from '@reltio/mdm-sdk';
1
+ import { GroupedObjectsInfo, Metadata, EnrichedDCRChanges, EnrichedChangeValue, ChangeValue, DCRChanges } from '@reltio/mdm-sdk';
2
2
  import { Diff } from '../types';
3
- export declare const mergeChanges: (metadata: Metadata, changes: DCRChanges, entityInfo: GroupedObjectsInfo["entity"], relationsInfo: GroupedObjectsInfo["relations"]) => [Diff[], Diff[]];
3
+ export declare const extractLineIds: (value: ChangeValue | EnrichedChangeValue) => string[] | undefined;
4
+ export declare const mergeChanges: (metadata: Metadata, changes: EnrichedDCRChanges | DCRChanges, entityInfo: GroupedObjectsInfo["entity"], relationsInfo: GroupedObjectsInfo["relations"]) => [Diff[], Diff[]];
@@ -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.mergeChanges = void 0;
14
+ exports.mergeChanges = exports.extractLineIds = void 0;
15
15
  var ramda_1 = require("ramda");
16
16
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
17
17
  var attributes_1 = require("./attributes");
@@ -23,18 +23,30 @@ var SPECIAL_ATTRIBUTES_NAMES = [
23
23
  mdm_sdk_1.EntityAttrTypes.startDate.name,
24
24
  mdm_sdk_1.EntityAttrTypes.endDate.name
25
25
  ];
26
+ var extractLineIds = function (value) {
27
+ return typeof value === 'object' && 'lineIds' in value ? value.lineIds : undefined;
28
+ };
29
+ exports.extractLineIds = extractLineIds;
26
30
  var prepareStartOrEndDate = function (_a) {
27
31
  var newValue = _a.newValue, oldValue = _a.oldValue;
32
+ var actualNewValue = newValue && 'value' in newValue ? newValue.value : newValue;
33
+ var actualOldValue = oldValue && 'value' in oldValue ? oldValue.value : oldValue;
28
34
  var parseValue = function (value) { return (isNaN(value) || (0, mdm_sdk_1.isEmptyValue)(value) ? value : parseInt(value)); };
29
35
  var isExistedValue = function (value) { return (value === null || value === void 0 ? void 0 : value.length) && !(0, mdm_sdk_1.isEmptyValue)(value) && !(0, mdm_sdk_1.isEmptyValue)(value[0]); };
30
- var isExistNewValue = isExistedValue(newValue);
31
- var isExistOldValue = isExistedValue(oldValue);
36
+ var isExistNewValue = isExistedValue(actualNewValue);
37
+ var isExistOldValue = isExistedValue(actualOldValue);
32
38
  if (isExistNewValue && isExistOldValue) {
33
39
  return [
34
40
  {
35
41
  type: mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE,
36
- oldValue: { value: parseValue(oldValue[0]) },
37
- newValue: { value: parseValue(newValue[0]) }
42
+ oldValue: {
43
+ value: parseValue(actualOldValue[0]),
44
+ lineIds: (0, exports.extractLineIds)(oldValue)
45
+ },
46
+ newValue: {
47
+ value: parseValue(actualNewValue[0]),
48
+ lineIds: (0, exports.extractLineIds)(newValue)
49
+ }
38
50
  }
39
51
  ];
40
52
  }
@@ -42,7 +54,10 @@ var prepareStartOrEndDate = function (_a) {
42
54
  return [
43
55
  {
44
56
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
45
- newValue: { value: parseValue(newValue[0]) }
57
+ newValue: {
58
+ value: parseValue(actualNewValue[0]),
59
+ lineIds: (0, exports.extractLineIds)(newValue)
60
+ }
46
61
  }
47
62
  ];
48
63
  }
@@ -50,26 +65,31 @@ var prepareStartOrEndDate = function (_a) {
50
65
  return [
51
66
  {
52
67
  type: mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE,
53
- oldValue: { value: parseValue(oldValue[0]) }
68
+ oldValue: {
69
+ value: parseValue(actualOldValue[0]),
70
+ lineIds: (0, exports.extractLineIds)(oldValue)
71
+ }
54
72
  }
55
73
  ];
56
74
  }
57
75
  };
58
76
  var prepareRolesOrTags = function (metadata, change) {
59
77
  var _a = change.newValue, newValue = _a === void 0 ? [] : _a, _b = change.oldValue, oldValue = _b === void 0 ? [] : _b;
60
- var diffNewValue = (0, ramda_1.difference)(newValue, oldValue);
61
- var diffOldValue = (0, ramda_1.difference)(oldValue, newValue);
78
+ var preparedNewValue = 'value' in newValue ? newValue.value : newValue;
79
+ var preparedOldValue = 'value' in oldValue ? oldValue.value : oldValue;
80
+ var diffNewValue = (0, ramda_1.difference)(preparedNewValue, preparedOldValue);
81
+ var diffOldValue = (0, ramda_1.difference)(preparedOldValue, preparedNewValue);
62
82
  var items = [];
63
83
  if (diffNewValue.length) {
64
84
  items.push({
65
85
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
66
- newValue: { value: diffNewValue }
86
+ newValue: { value: diffNewValue, lineIds: (0, exports.extractLineIds)(newValue) }
67
87
  });
68
88
  }
69
89
  if (diffOldValue.length) {
70
90
  items.push({
71
91
  type: mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE,
72
- oldValue: { value: diffOldValue }
92
+ oldValue: { value: diffOldValue, lineIds: (0, exports.extractLineIds)(oldValue) }
73
93
  });
74
94
  }
75
95
  return items;
@@ -85,7 +105,7 @@ var getPath = function (change) {
85
105
  return path;
86
106
  };
87
107
  var prepareAttribute = function (container, change) {
88
- var _a;
108
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
89
109
  var changePath = getPath(change);
90
110
  var pathArray = changePath.split(ATTRIBUTE_DELIMITER);
91
111
  var holder = container;
@@ -93,9 +113,20 @@ var prepareAttribute = function (container, change) {
93
113
  var key = pathArray[i];
94
114
  var id = pathArray[i + 1];
95
115
  var currentValue = (holder[key] || []).find((0, ramda_1.propEq)('id', id));
116
+ if (!(0, ramda_1.isNil)(currentValue)) {
117
+ var newLineIds = (0, exports.extractLineIds)(change.newValue);
118
+ var oldLineIds = (0, exports.extractLineIds)(change.oldValue);
119
+ var currentLineId = ((_b = (_a = currentValue.value) === null || _a === void 0 ? void 0 : _a.newValue) === null || _b === void 0 ? void 0 : _b.lineIds) || ((_d = (_c = currentValue.value) === null || _c === void 0 ? void 0 : _c.oldValue) === null || _d === void 0 ? void 0 : _d.lineIds);
120
+ if (((_f = (_e = currentValue.value) === null || _e === void 0 ? void 0 : _e.newValue) === null || _f === void 0 ? void 0 : _f.lineIds) && newLineIds) {
121
+ currentValue.value.newValue.lineIds = currentLineId.concat(newLineIds);
122
+ }
123
+ if (((_h = (_g = currentValue.value) === null || _g === void 0 ? void 0 : _g.oldValue) === null || _h === void 0 ? void 0 : _h.lineIds) && oldLineIds) {
124
+ currentValue.value.oldValue.lineIds = currentLineId.concat(oldLineIds);
125
+ }
126
+ }
96
127
  var newValue = pathArray.length === i + 2 ? change : {};
97
128
  var value = currentValue ? currentValue : { id: id, value: newValue };
98
- var refObjectURI = ((_a = change.refObjectURI) === null || _a === void 0 ? void 0 : _a.indexOf(id)) >= 0 && change.refObjectURI;
129
+ var refObjectURI = ((_j = change.refObjectURI) === null || _j === void 0 ? void 0 : _j.indexOf(id)) >= 0 && change.refObjectURI;
99
130
  if (refObjectURI) {
100
131
  value.refObjectURI = refObjectURI;
101
132
  }
@@ -107,7 +138,7 @@ var prepareAttribute = function (container, change) {
107
138
  return container;
108
139
  };
109
140
  var createEntityOrRelation = function (metadata, value) {
110
- var _a = value.attributes, attributes = _a === void 0 ? {} : _a, startDate = value.startDate, endDate = value.endDate;
141
+ var _a = value.attributes, attributes = _a === void 0 ? {} : _a, startDate = value.startDate, endDate = value.endDate, lineIds = value.lineIds;
111
142
  var _b = value, roles = _b.roles, tags = _b.tags, defaultProfilePicValue = _b.defaultProfilePicValue;
112
143
  var newObject = __assign({}, attributes);
113
144
  if (defaultProfilePicValue) {
@@ -117,7 +148,10 @@ var createEntityOrRelation = function (metadata, value) {
117
148
  newObject[mdm_sdk_1.EntityAttrTypes.roles.name] = [
118
149
  {
119
150
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
120
- newValue: { value: roles.map((0, mdm_sdk_1.getRoleLabel)(metadata)).join(', ') }
151
+ newValue: {
152
+ value: roles.map((0, mdm_sdk_1.getRoleLabel)(metadata)).join(', '),
153
+ lineIds: lineIds && ["".concat(lineIds[0], "/").concat(mdm_sdk_1.EntityAttrTypes.roles.name)]
154
+ }
121
155
  }
122
156
  ];
123
157
  }
@@ -125,7 +159,10 @@ var createEntityOrRelation = function (metadata, value) {
125
159
  newObject[mdm_sdk_1.EntityAttrTypes.tags.name] = [
126
160
  {
127
161
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
128
- newValue: { value: tags.join(', ') }
162
+ newValue: {
163
+ value: tags.join(', '),
164
+ lineIds: lineIds && ["".concat(lineIds[0], "/").concat(mdm_sdk_1.EntityAttrTypes.tags.name)]
165
+ }
129
166
  }
130
167
  ];
131
168
  }
@@ -133,7 +170,10 @@ var createEntityOrRelation = function (metadata, value) {
133
170
  newObject[mdm_sdk_1.EntityAttrTypes.startDate.name] = [
134
171
  {
135
172
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
136
- newValue: { value: startDate }
173
+ newValue: {
174
+ value: startDate,
175
+ lineIds: lineIds && ["".concat(lineIds[0], "/").concat(mdm_sdk_1.EntityAttrTypes.startDate.name)]
176
+ }
137
177
  }
138
178
  ];
139
179
  }
@@ -141,10 +181,14 @@ var createEntityOrRelation = function (metadata, value) {
141
181
  newObject[mdm_sdk_1.EntityAttrTypes.endDate.name] = [
142
182
  {
143
183
  type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE,
144
- newValue: { value: endDate }
184
+ newValue: {
185
+ value: endDate,
186
+ lineIds: lineIds && ["".concat(lineIds[0], "/").concat(mdm_sdk_1.EntityAttrTypes.endDate.name)]
187
+ }
145
188
  }
146
189
  ];
147
190
  }
191
+ newObject['lineIds'] = lineIds;
148
192
  return newObject;
149
193
  };
150
194
  var mergeAttributesInChange = function (metadata, objectInfo, change, container) {
@@ -201,6 +201,7 @@ describe('mergeChanges tests', function () {
201
201
  {
202
202
  id: 'BpiR2Vqh',
203
203
  type: mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP,
204
+ lineIds: ['relations/1EvCRmwC/BpiR2Vqh'],
204
205
  newValue: {
205
206
  uri: 'relations/1EvCRmwC',
206
207
  type: 'configuration/relationTypes/Assistant',
@@ -210,7 +211,8 @@ describe('mergeChanges tests', function () {
210
211
  endObject: {
211
212
  objectURI: 'entities/1C2v7IRp'
212
213
  },
213
- startDate: 1643742000000
214
+ startDate: 1643742000000,
215
+ lineIds: ['relations/1EvCRmwC/BpiR2Vqh/newValue']
214
216
  }
215
217
  }
216
218
  ]
@@ -237,6 +239,7 @@ describe('mergeChanges tests', function () {
237
239
  }
238
240
  ], _a)),
239
241
  label: metadata_test_data_1.metadata.relationTypes[1].label,
242
+ lineIds: ['relations/1EvCRmwC/BpiR2Vqh/newValue'],
240
243
  level: 1
241
244
  },
242
245
  {
@@ -244,11 +247,62 @@ describe('mergeChanges tests', function () {
244
247
  label: 'Start date',
245
248
  level: 2,
246
249
  newValue: {
247
- value: 1643742000000
250
+ value: 1643742000000,
251
+ lineIds: ["relations/1EvCRmwC/BpiR2Vqh/newValue/".concat(mdm_sdk_1.EntityAttrTypes.startDate.name)]
248
252
  },
249
253
  operation: mdm_sdk_1.DCROperationTypes.ADDED
250
254
  }
251
255
  ];
252
256
  expect((0, merge_1.mergeChanges)(metadata_test_data_1.metadata, changes, objectInfo, relationsInfo)).toMatchObject([[], mergedRelations]);
253
257
  });
258
+ it('should merge lineIds when multiple changes have the same attributePath', function () {
259
+ var _a;
260
+ var _b, _c;
261
+ var changes = (_a = {},
262
+ _a[entityUri] = [
263
+ {
264
+ id: '0Kb5iws',
265
+ type: mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE,
266
+ objectType: 'configuration/entityTypes/HCP',
267
+ attributePath: 'CountryCode/2DEYF4Zg',
268
+ oldValue: {
269
+ value: 'American Samoa',
270
+ lookupCode: 'ASM',
271
+ lookupRawValue: 'ASM',
272
+ lineIds: ['line-1']
273
+ },
274
+ newValue: {
275
+ value: 'Algeria',
276
+ lookupCode: 'DZA',
277
+ lookupRawValue: 'DZA',
278
+ lineIds: ['line-2']
279
+ },
280
+ newPinOrIgnoreValue: false,
281
+ attributeType: 'configuration/entityTypes/HCP/attributes/CountryCode'
282
+ },
283
+ {
284
+ id: '0Kb5nD8',
285
+ type: mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE,
286
+ objectType: 'configuration/entityTypes/HCP',
287
+ attributePath: 'CountryCode/2DEYF4Zg',
288
+ oldValue: {
289
+ value: 'American Samoa',
290
+ lookupCode: 'ASM',
291
+ lookupRawValue: 'ASM',
292
+ lineIds: ['line-3']
293
+ },
294
+ newValue: {
295
+ value: 'Algeria',
296
+ lookupCode: 'DZA',
297
+ lookupRawValue: 'DZA',
298
+ lineIds: ['line-4']
299
+ },
300
+ newPinOrIgnoreValue: false,
301
+ attributeType: 'configuration/entityTypes/HCP/attributes/CountryCode'
302
+ }
303
+ ],
304
+ _a);
305
+ var mergedChanges = (0, merge_1.mergeChanges)(metadata_test_data_1.metadata, changes, objectInfo, [])[0];
306
+ expect((_c = (_b = mergedChanges[0]) === null || _b === void 0 ? void 0 : _b.newValue) === null || _c === void 0 ? void 0 : _c.lineIds).toEqual(['line-2', 'line-4']);
307
+ });
254
308
  });
@@ -1,7 +1,7 @@
1
- import { DCRChanges, GroupedObjectsInfo } from '@reltio/mdm-sdk';
1
+ import { EnrichedDCRChanges, GroupedObjectsInfo, DCRChanges } from '@reltio/mdm-sdk';
2
2
  import { Diff, Title } from '../types';
3
3
  type Props = {
4
- changes: DCRChanges;
4
+ changes: EnrichedDCRChanges | DCRChanges;
5
5
  entityInfo: GroupedObjectsInfo['entity'];
6
6
  relationsInfo: GroupedObjectsInfo['relations'];
7
7
  };
@@ -1,4 +1,4 @@
1
- import { AttributeType, ChangeValue, DCRAttributeValue, DCROperationTypes, DCRRelationInfo, TRelationType } from '@reltio/mdm-sdk';
1
+ import { AttributeType, DCRAttributeValue, DCROperationTypes, DCRRelationInfo, EnrichedChangeValue, TRelationType, ChangeValue } from '@reltio/mdm-sdk';
2
2
  export type TaskAction = {
3
3
  text: string;
4
4
  onClick: (comment: string) => void;
@@ -10,10 +10,11 @@ export type Diff = {
10
10
  attributeType: AttributeType | null;
11
11
  relationType?: TRelationType;
12
12
  attributeValue?: DCRAttributeValue | RelationAttributeValue;
13
- newValue?: ChangeValue;
14
- oldValue?: ChangeValue;
13
+ newValue?: EnrichedChangeValue | ChangeValue;
14
+ oldValue?: EnrichedChangeValue | ChangeValue;
15
15
  operation?: DCROperationTypes;
16
16
  isReferenceSubAttribute?: boolean;
17
+ lineIds?: string[];
17
18
  };
18
19
  export type Title = {
19
20
  label: string;
package/cjs/index.d.ts CHANGED
@@ -195,6 +195,7 @@ export { QuickFiltersEntityTypeFacet } from './QuickFiltersEntityTypeFacet';
195
195
  export { FacetGroupTitle } from './FacetGroupTitle';
196
196
  export { FacetsSelector } from './FacetsSelector';
197
197
  export { FacetContainer } from './FacetContainer';
198
+ export { RequestedData } from './RequestedData';
198
199
  export { withTooltip } from './HOCs/withTooltip';
199
200
  export { withAsyncMount } from './HOCs/withAsyncMount';
200
201
  export { withDragHandle } from './HOCs/withDragHandle';
package/cjs/index.js CHANGED
@@ -18,10 +18,10 @@ exports.NestedAttribute = exports.MoreAttributesButton = exports.InlineReference
18
18
  exports.ReactSelectMenuList = exports.ReactSelectLoadMoreButton = exports.ReactSelectDropdownIndicatorWithIconButton = exports.ReactSelectDropdownIndicator = exports.Highlighter = exports.HierarchyNodeTitle = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.ExpandableSearchInput = exports.ErrorPopup = exports.ErrorBoundary = exports.SegmentIdLink = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.Drawer = exports.DataTypeValue = exports.DataTenantBadge = exports.ConnectionRelationTypeSelector = exports.CollaborationItem = exports.ConfirmationDialog = exports.CommentsContainer = exports.ColoredSourceIcon = exports.CollapseButton = exports.TreeChart = exports.TableWithBars = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleAttributeEditor = exports.SimpleAttribute = exports.RowCellChips = exports.RowCellChipWithTooltip = exports.RowCellAutoSizer = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.ReferenceAttribute = exports.ImageAttributesLine = exports.ReadOnlyAttributesPager = exports.ReadOnlyAttributesList = exports.ReadOnlyAttribute = exports.ReadOnlyAttributeValuesBlock = exports.PieChart = exports.OvIcon = exports.NestedAttributeEditor = void 0;
19
19
  exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportButton = exports.ReadableSearchQueryBuilder = exports.ReadableSearchQuery = exports.LogicOperatorWithPlaceholder = exports.LogicOperator = exports.TableSkeleton = exports.StepNavigation = exports.TenantLabel = exports.RelevanceScoreBadge = exports.RequiredMark = exports.SettingsMenu = exports.TenantsDropDownSelector = exports.TenantIcon = exports.SourceSystemsSelector = exports.MatchRulesSelector = exports.MultiValueSelector = exports.ProfilesList = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.ImageGalleryDialog = exports.RelationTypesSelector = exports.ScreenProfileBand = exports.ProfileBandNavigation = exports.EmptyStub = exports.MaskingSwitcher = exports.FileTypeEditor = exports.EmptySearchResult = exports.DropDownEditor = exports.FilterValueEditor = exports.MultiValueChip = exports.TextEditor = exports.DateRangeEditor = exports.NumberEditor = exports.DataTypeValueEditor = exports.DateEditor = exports.ErrorWrapper = exports.ErrorMessage = exports.HIDE = exports.INSERT_RIGHT = exports.INSERT_LEFT = exports.ConfigColumnPopup = exports.ConfigureColumnsPopup = exports.ConnectionEditor = exports.DropDownSelector = exports.ReactSelectOptionWithCheckIcon = exports.ReactSelectMenuWithPopper = void 0;
20
20
  exports.DefaultHeadCellRendererWithTooltip = exports.LazyRenderer = exports.MetadataTypesSelector = exports.DateRangeSelector = exports.UpSetChart = exports.GaugeChart = exports.RelationEditor = exports.ReltioMap = exports.Marginator = exports.LightArrowTooltip = exports.ScrollableTabs = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = exports.SidePanel = exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopup = exports.WhiteSearchInput = exports.SearchInput = exports.ProfileResizablePanes = exports.ResizablePanes = exports.ReltioGridLayout = exports.RCTreeSwitchRenderer = exports.RCTreeLevelLines = exports.RCTree = exports.reactSortableTreeHelpers = exports.ReactSortableTree = exports.MultiSelect = exports.QueryBuilderRowsGroup = exports.QueryBuilderRow = exports.ProfileCard = exports.ProfileBand = exports.PotentialMatchReviewCard = exports.PopupWithArrow = exports.Popper = exports.MultipleInput = exports.ModeSwitcherSelect = exports.ModeSwitcher = exports.TransitiveMatchBlock = exports.SimpleMatchRulesBuilder = exports.SimpleMatchRulesBlock = exports.SimpleMatchRules = exports.MatchRulesBlock = void 0;
21
- exports.SandboxAPIContext = exports.RelationContext = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.useEntityLoadingIndication = exports.EntityLoadingIndicationProvider = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.usePerspectivesSettings = exports.PerspectivesSettingsContext = exports.PivotingAttributeContext = exports.UsersContext = exports.InitialCollaborationContextValue = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockNavigationContext = exports.BlockImageGalleryDialogContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = exports.MdmModuleProvider = exports.withColumnConfigurator = exports.withBlockNavigation = exports.withCollapseButton = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.withContext = exports.withDateRangeSelector = exports.withDragHandle = exports.withAsyncMount = exports.withTooltip = exports.FacetContainer = exports.FacetsSelector = exports.FacetGroupTitle = exports.QuickFiltersEntityTypeFacet = exports.FacetGroup = exports.QuickFiltersFacetPanel = exports.AdvancedSearchFabButton = exports.QuickFiltersDrawer = void 0;
22
- exports.useUsers = exports.useSavedState = exports.useSafePromise = exports.useRunOnceAfterValueInitialization = exports.useRelationsLoader = exports.useRelationTypeSelector = exports.usePrevious = exports.useDidUpdateEffect = exports.useCommentsEntitiesMap = exports.useCollaboration = exports.useAsyncMount = exports.useAPI = exports.useActions = exports.useMatchesColumnsData = exports.useScrollToAttributeError = exports.ThemeProvider = exports.ProfileTablesContext = exports.HiddenAttributesContext = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.useDeleteUnmaskedAttributeForRelation = exports.useUnmaskedAttributeValue = exports.useUnmaskAttributeValue = exports.useMaskAttributeValue = exports.MaskedAttributesProvider = exports.useReloadData = exports.ReloadDataProvider = exports.useAttributeValueConfigPermissions = exports.ConfigPermissionsContextProvider = exports.ConfigPermissionsContext = exports.useActionsHook = exports.ActionsHookProvider = exports.PageRequestsAbortingContext = exports.DependentLookupAutopopulationContext = exports.FeaturesContext = exports.LabelsContext = exports.UrlGeneratorsContext = exports.isHighlightedAttributeType = exports.isHighlightedErrorType = exports.ScrollType = exports.ScrollToElementProvider = exports.ScrollToElementContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = void 0;
23
- exports.TestPerspectivesSettingsProvider = exports.getAttrPathFromColumnId = exports.getAttributeHeight = exports.getNestedPathByColumnId = exports.applyCompactValuesCountConstraint = exports.getAttributeSelectorItems = exports.mergeClasses = exports.isControlOrCommandPressed = exports.getValue = exports.getChecked = exports.showErrorMessage = exports.showDefaultErrorMessage = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsSizeById = exports.buildColumnsFilter = exports.useTableColumns = exports.useSegmentsLoader = exports.useDndBasicTableScrollModifier = exports.useDynamicYAxisWidth = exports.useFilterAutoFocus = exports.useSegmentationRequest = exports.resolveMarkers = exports.useMarkers = exports.useMaskedAttribute = exports.useKeyboardNavigation = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.useHiddenAttributes = exports.useSavedSearchesRequest = exports.useRequestDCRReview = exports.useAutoFocus = exports.useExpandInvalidRelations = exports.useLayoutResetter = exports.useIsMountedRef = exports.useSnackbar = exports.useSavedStateForEntityType = exports.useReadableSearchState = exports.useEditableConnection = exports.useCustomScripts = exports.useMarkAsNotMatchRequest = exports.useMergeAllRequest = exports.usePagingSimulator = exports.useMatchesLoader = exports.useConfigPermissions = exports.useWhyDidYouUpdate = void 0;
24
- exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = void 0;
21
+ exports.RelationContext = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.useEntityLoadingIndication = exports.EntityLoadingIndicationProvider = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.usePerspectivesSettings = exports.PerspectivesSettingsContext = exports.PivotingAttributeContext = exports.UsersContext = exports.InitialCollaborationContextValue = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockNavigationContext = exports.BlockImageGalleryDialogContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = exports.MdmModuleProvider = exports.withColumnConfigurator = exports.withBlockNavigation = exports.withCollapseButton = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.withContext = exports.withDateRangeSelector = exports.withDragHandle = exports.withAsyncMount = exports.withTooltip = exports.RequestedData = exports.FacetContainer = exports.FacetsSelector = exports.FacetGroupTitle = exports.QuickFiltersEntityTypeFacet = exports.FacetGroup = exports.QuickFiltersFacetPanel = exports.AdvancedSearchFabButton = exports.QuickFiltersDrawer = void 0;
22
+ exports.useSavedState = exports.useSafePromise = exports.useRunOnceAfterValueInitialization = exports.useRelationsLoader = exports.useRelationTypeSelector = exports.usePrevious = exports.useDidUpdateEffect = exports.useCommentsEntitiesMap = exports.useCollaboration = exports.useAsyncMount = exports.useAPI = exports.useActions = exports.useMatchesColumnsData = exports.useScrollToAttributeError = exports.ThemeProvider = exports.ProfileTablesContext = exports.HiddenAttributesContext = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.useDeleteUnmaskedAttributeForRelation = exports.useUnmaskedAttributeValue = exports.useUnmaskAttributeValue = exports.useMaskAttributeValue = exports.MaskedAttributesProvider = exports.useReloadData = exports.ReloadDataProvider = exports.useAttributeValueConfigPermissions = exports.ConfigPermissionsContextProvider = exports.ConfigPermissionsContext = exports.useActionsHook = exports.ActionsHookProvider = exports.PageRequestsAbortingContext = exports.DependentLookupAutopopulationContext = exports.FeaturesContext = exports.LabelsContext = exports.UrlGeneratorsContext = exports.isHighlightedAttributeType = exports.isHighlightedErrorType = exports.ScrollType = exports.ScrollToElementProvider = exports.ScrollToElementContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.SandboxAPIContext = void 0;
23
+ exports.getAttrPathFromColumnId = exports.getAttributeHeight = exports.getNestedPathByColumnId = exports.applyCompactValuesCountConstraint = exports.getAttributeSelectorItems = exports.mergeClasses = exports.isControlOrCommandPressed = exports.getValue = exports.getChecked = exports.showErrorMessage = exports.showDefaultErrorMessage = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsSizeById = exports.buildColumnsFilter = exports.useTableColumns = exports.useSegmentsLoader = exports.useDndBasicTableScrollModifier = exports.useDynamicYAxisWidth = exports.useFilterAutoFocus = exports.useSegmentationRequest = exports.resolveMarkers = exports.useMarkers = exports.useMaskedAttribute = exports.useKeyboardNavigation = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.useHiddenAttributes = exports.useSavedSearchesRequest = exports.useRequestDCRReview = exports.useAutoFocus = exports.useExpandInvalidRelations = exports.useLayoutResetter = exports.useIsMountedRef = exports.useSnackbar = exports.useSavedStateForEntityType = exports.useReadableSearchState = exports.useEditableConnection = exports.useCustomScripts = exports.useMarkAsNotMatchRequest = exports.useMergeAllRequest = exports.usePagingSimulator = exports.useMatchesLoader = exports.useConfigPermissions = exports.useWhyDidYouUpdate = exports.useUsers = void 0;
24
+ exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = void 0;
25
25
  // components
26
26
  var ActionButton_1 = require("./ActionButton");
27
27
  Object.defineProperty(exports, "ActionButton", { enumerable: true, get: function () { return ActionButton_1.ActionButton; } });
@@ -427,6 +427,8 @@ var FacetsSelector_1 = require("./FacetsSelector");
427
427
  Object.defineProperty(exports, "FacetsSelector", { enumerable: true, get: function () { return FacetsSelector_1.FacetsSelector; } });
428
428
  var FacetContainer_1 = require("./FacetContainer");
429
429
  Object.defineProperty(exports, "FacetContainer", { enumerable: true, get: function () { return FacetContainer_1.FacetContainer; } });
430
+ var RequestedData_1 = require("./RequestedData");
431
+ Object.defineProperty(exports, "RequestedData", { enumerable: true, get: function () { return RequestedData_1.RequestedData; } });
430
432
  // HOCs
431
433
  var withTooltip_1 = require("./HOCs/withTooltip");
432
434
  Object.defineProperty(exports, "withTooltip", { enumerable: true, get: function () { return withTooltip_1.withTooltip; } });
@@ -10,6 +10,7 @@ import { SearchActivity } from './components/SearchActivity';
10
10
  import { SimpleActivity } from './components/SimpleActivity';
11
11
  import { SynchronizationIssuesActivity } from './components/SynchronizationIssuesActivity';
12
12
  import { SegmentActivity } from './components/SegmentActivity';
13
+ import { InteractionActivity } from './components/InteractionActivity';
13
14
  import AddIcon from '../../../icons/Add';
14
15
  import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
15
16
  import CommentIcon from '../../../icons/Comment';
@@ -63,6 +64,9 @@ var ActivitiesFactory = /** @class */ (function () {
63
64
  case ActivityTypes.SEGMENT_DELETE:
64
65
  case ActivityTypes.SEGMENT_UPDATE:
65
66
  return React.createElement(SegmentActivity, { data: data, type: type });
67
+ case ActivityTypes.INTERACTION_CREATE:
68
+ case ActivityTypes.INTERACTION_UPDATE:
69
+ return React.createElement(InteractionActivity, { data: data, type: type });
66
70
  case ActivityTypes.USER_LOGIN:
67
71
  case ActivityTypes.USER_LOGOUT:
68
72
  case ActivityTypes.MODEL_UPDATED:
@@ -99,6 +103,7 @@ var ActivitiesFactory = /** @class */ (function () {
99
103
  case ActivityTypes.RELATIONSHIP_CREATED:
100
104
  case ActivityTypes.GROUP_CREATED:
101
105
  case ActivityTypes.SEGMENT_CREATE:
106
+ case ActivityTypes.INTERACTION_CREATE:
102
107
  return React.createElement(AddIcon, null);
103
108
  case ActivityTypes.ENTITY_REMOVED:
104
109
  case ActivityTypes.RELATIONSHIP_REMOVED:
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ActivityTypes, ActivityData } from '../../../types';
3
+ type Props = {
4
+ data: ActivityData;
5
+ type: ActivityTypes;
6
+ };
7
+ export declare const InteractionActivity: ({ data, type }: Props) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { CollapsibleActivityRecords } from '../../../CollapsibleActivityRecords';
3
+ import { InteractionRecord } from '../../../InteractionRecord';
4
+ import { ActivityTitle } from '../../../ActivityTitle';
5
+ var emptyArray = [];
6
+ export var InteractionActivity = function (_a) {
7
+ var _b, _c, _d;
8
+ var data = _a.data, type = _a.type;
9
+ var isMinimized = data.itemsTotal === 1 && !((_d = (_c = (_b = data === null || data === void 0 ? void 0 : data.items) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.deltaCollection) === null || _d === void 0 ? void 0 : _d.delta);
10
+ return (React.createElement("div", { "data-reltio-id": "interaction-activity" },
11
+ React.createElement(ActivityTitle, { type: type, "data-reltio-id": "segment-activity-title" }),
12
+ !isMinimized && (React.createElement(CollapsibleActivityRecords, { activityUri: data.uri, items: data.items || emptyArray, RecordComponent: InteractionRecord }))));
13
+ };
@@ -0,0 +1 @@
1
+ export { InteractionActivity } from './InteractionActivity';
@@ -0,0 +1 @@
1
+ export { InteractionActivity } from './InteractionActivity';
@@ -39,6 +39,7 @@ var otherTypes = [
39
39
  'SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE'
40
40
  ];
41
41
  var segmentTypes = ['SEGMENT_CREATE', 'SEGMENT_DELETE', 'SEGMENT_UPDATE'];
42
+ var interactionTypes = ['INTERACTION_CREATE', 'INTERACTION_UPDATE'];
42
43
  var profileTypes = [
43
44
  'ENTITY_CREATED',
44
45
  'ENTITY_CHANGED',
@@ -62,7 +63,7 @@ describe('helpers tests', function () {
62
63
  var metadata = {
63
64
  entityTypes: []
64
65
  };
65
- expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray([], otherTypes, true), segmentTypes, true));
66
+ expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray(__spreadArray([], otherTypes, true), segmentTypes, true), interactionTypes, true));
66
67
  });
67
68
  it('should return ActivityTypes with groupRelated when groupTypes is not empty', function () {
68
69
  var metadata = {
@@ -86,7 +87,7 @@ describe('helpers tests', function () {
86
87
  }
87
88
  ]
88
89
  };
89
- expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray(__spreadArray([], otherTypes, true), groupTypes, true), segmentTypes, true));
90
+ expect(getSelectorActivityTypes(metadata)).toEqual(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], otherTypes, true), groupTypes, true), segmentTypes, true), interactionTypes, true));
90
91
  });
91
92
  it('should return profile related ActivityTypes when entityType passed', function () {
92
93
  var metadata = {
@@ -19,7 +19,7 @@ var buildGroupedItem = function (_a) {
19
19
  };
20
20
  var getDay = function (_a) {
21
21
  var timestamp = _a.timestamp;
22
- return moment(timestamp).startOf('day');
22
+ return moment(timestamp).startOf('day').format('YYYY-MM-DD');
23
23
  };
24
24
  export var buildGroupedItems = pipe(groupBy(getDay), toPairs, map(buildGroupedItem));
25
25
  var chainIndexed = addIndex(chain);
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ActivityItem } from '../types';
3
+ type Props = {
4
+ item: ActivityItem;
5
+ };
6
+ export declare const InteractionRecord: ({ item }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Record } from '../Record';
3
+ import { RecordUpdates } from '../RecordUpdates';
4
+ export var InteractionRecord = function (_a) {
5
+ var _b;
6
+ var item = _a.item;
7
+ var updates = (_b = item === null || item === void 0 ? void 0 : item.deltaCollection) === null || _b === void 0 ? void 0 : _b.delta;
8
+ return (updates === null || updates === void 0 ? void 0 : updates.length) > 0 ? (React.createElement(Record, null,
9
+ React.createElement(RecordUpdates, { updates: updates, recordId: item.id }))) : null;
10
+ };
@@ -0,0 +1 @@
1
+ export { InteractionRecord } from './InteractionRecord';
@@ -0,0 +1 @@
1
+ export { InteractionRecord } from './InteractionRecord';
@@ -33,7 +33,9 @@ export declare enum ActivityTypes {
33
33
  GROUP_CHANGED = "GROUP_CHANGED",
34
34
  SEGMENT_CREATE = "SEGMENT_CREATE",
35
35
  SEGMENT_DELETE = "SEGMENT_DELETE",
36
- SEGMENT_UPDATE = "SEGMENT_UPDATE"
36
+ SEGMENT_UPDATE = "SEGMENT_UPDATE",
37
+ INTERACTION_CREATE = "INTERACTION_CREATE",
38
+ INTERACTION_UPDATE = "INTERACTION_UPDATE"
37
39
  }
38
40
  export type ActivitiesFilter = {
39
41
  users: string[];
@@ -33,6 +33,8 @@ export var ActivityTypes;
33
33
  ActivityTypes["SEGMENT_CREATE"] = "SEGMENT_CREATE";
34
34
  ActivityTypes["SEGMENT_DELETE"] = "SEGMENT_DELETE";
35
35
  ActivityTypes["SEGMENT_UPDATE"] = "SEGMENT_UPDATE";
36
+ ActivityTypes["INTERACTION_CREATE"] = "INTERACTION_CREATE";
37
+ ActivityTypes["INTERACTION_UPDATE"] = "INTERACTION_UPDATE";
36
38
  })(ActivityTypes || (ActivityTypes = {}));
37
39
  export var DeltaTypes;
38
40
  (function (DeltaTypes) {
@@ -90,6 +90,8 @@ export var getActivityLabel = function (type) {
90
90
  _a[ActivityTypes.SEGMENT_CREATE] = i18n.text('Segment created'),
91
91
  _a[ActivityTypes.SEGMENT_UPDATE] = i18n.text('Segment updated'),
92
92
  _a[ActivityTypes.SEGMENT_DELETE] = i18n.text('Segment deleted'),
93
+ _a[ActivityTypes.INTERACTION_CREATE] = i18n.text('Interaction created'),
94
+ _a[ActivityTypes.INTERACTION_UPDATE] = i18n.text('Interaction updated'),
93
95
  _a);
94
96
  return labels[type] || '';
95
97
  };
@@ -45,6 +45,8 @@ export declare const HistoryChangeTypes: {
45
45
  SEGMENT_CREATE: ActivityTypes.SEGMENT_CREATE;
46
46
  SEGMENT_DELETE: ActivityTypes.SEGMENT_DELETE;
47
47
  SEGMENT_UPDATE: ActivityTypes.SEGMENT_UPDATE;
48
+ INTERACTION_CREATE: ActivityTypes.INTERACTION_CREATE;
49
+ INTERACTION_UPDATE: ActivityTypes.INTERACTION_UPDATE;
48
50
  };
49
51
  export type HistoryChangeTypes = typeof HistoryChangeTypes;
50
52
  export declare enum HistoryActivityType {