@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.
- package/cjs/ResizablePanes/ResizablePanes.js +5 -6
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +267 -0
- package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
- package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
- package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
- package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
- package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
- package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
- package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
- package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
- package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +784 -0
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
- package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +102 -79
- package/cjs/features/activity-log/EntityObject/EntityObject.test.js +35 -26
- package/cjs/features/activity-log/Field/Field.d.ts +2 -3
- package/cjs/features/activity-log/Field/Field.js +24 -2
- package/cjs/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
- package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.test.js +207 -0
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
- package/cjs/features/activity-log/RelationObject/RelationObject.test.js +46 -29
- package/cjs/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
- package/esm/ResizablePanes/ResizablePanes.js +5 -6
- package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
- package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +262 -0
- package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
- package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
- package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
- package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
- package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
- package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
- package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
- package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
- package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
- package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
- package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
- package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +779 -0
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
- package/esm/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +104 -58
- package/esm/features/activity-log/EntityObject/EntityObject.test.js +35 -26
- package/esm/features/activity-log/Field/Field.d.ts +2 -3
- package/esm/features/activity-log/Field/Field.js +24 -2
- package/esm/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
- package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
- package/esm/features/activity-log/RecordUpdates/RecordUpdates.test.js +202 -0
- package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
- package/esm/features/activity-log/RelationObject/RelationObject.test.js +46 -29
- package/esm/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
- package/package.json +1 -1
- package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -142
- package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -131
- package/cjs/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -252
- package/cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -158
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -135
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -65
- package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
- package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -119
- package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
- package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -75
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -140
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -41
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -87
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -19
- package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
- package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -179
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -150
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -124
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -137
- package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -126
- package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -247
- package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -153
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -130
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -60
- package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -114
- package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
- package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -72
- package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
- package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -135
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -36
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -82
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -14
- package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
- package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -151
- package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
- package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -122
- package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
- package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -119
- /package/cjs/features/activity-log/{ActivityExportButton/ActivityExportButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js
CHANGED
|
@@ -16,6 +16,6 @@ export var SearchActivity = function (_a) {
|
|
|
16
16
|
}, [data.description]);
|
|
17
17
|
var handleOpenSearch = pipe(always(searchState), openSearch);
|
|
18
18
|
var readableQueryString = useReadableSearchState(searchState).readableQueryString;
|
|
19
|
-
return (React.createElement(ActivityTitle, { type: type },
|
|
19
|
+
return (React.createElement(ActivityTitle, { type: type, "data-reltio-id": "search-activity" },
|
|
20
20
|
React.createElement("span", { className: styles.link, onClick: handleOpenSearch }, readableQueryString || i18n.text('all profiles'))));
|
|
21
21
|
};
|
package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js
CHANGED
|
@@ -9,198 +9,175 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
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
|
+
};
|
|
12
48
|
import React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import { ActivityTypes } from '../../../types';
|
|
16
|
-
import { useReadableSearchState } from '../../../../../hooks/useReadableSearchState';
|
|
49
|
+
import { render, screen } from '@testing-library/react';
|
|
50
|
+
import userEvent from '@testing-library/user-event';
|
|
17
51
|
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
52
|
+
import { ActivityTypes } from '../../../types';
|
|
53
|
+
import { SearchActivity } from './SearchActivity';
|
|
54
|
+
var defaultMdmValues = {
|
|
55
|
+
metadata: {
|
|
56
|
+
entityTypes: [
|
|
57
|
+
{
|
|
58
|
+
uri: 'configuration/entityTypes/HCP',
|
|
59
|
+
label: 'HCP',
|
|
60
|
+
attributes: [
|
|
61
|
+
{
|
|
62
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstName',
|
|
63
|
+
name: 'FirstName',
|
|
64
|
+
type: 'String',
|
|
65
|
+
label: 'First Name'
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
dataTenants: [],
|
|
72
|
+
attributesPresentation: {},
|
|
73
|
+
lookups: {}
|
|
74
|
+
};
|
|
75
|
+
var mdmActions = {
|
|
76
|
+
openSearch: jest.fn(),
|
|
77
|
+
lookupsListResolved: jest.fn()
|
|
23
78
|
};
|
|
24
|
-
|
|
79
|
+
var setUp = function (_a) {
|
|
80
|
+
var props = _a.props, _b = _a.mdmValues, mdmValues = _b === void 0 ? defaultMdmValues : _b;
|
|
81
|
+
var user = userEvent.setup();
|
|
82
|
+
var Providers = function (_a) {
|
|
83
|
+
var children = _a.children;
|
|
84
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues, actions: mdmActions }, children));
|
|
85
|
+
};
|
|
86
|
+
return __assign({ user: user }, render(React.createElement(SearchActivity, __assign({}, props)), { wrapper: Providers }));
|
|
87
|
+
};
|
|
88
|
+
describe('Search activity tests', function () {
|
|
25
89
|
afterEach(function () {
|
|
26
90
|
jest.clearAllMocks();
|
|
27
91
|
});
|
|
28
|
-
it('should render readable new search state and open it on click correctly', function () {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
advanced: [],
|
|
66
|
-
searchOptions: {
|
|
67
|
-
searchByOv: true,
|
|
68
|
-
ovOnly: true
|
|
69
|
-
},
|
|
70
|
-
keyword: null,
|
|
71
|
-
map: null,
|
|
72
|
-
version: '2.0'
|
|
73
|
-
};
|
|
74
|
-
expect(useReadableSearchState).toHaveBeenCalledWith(searchState);
|
|
75
|
-
wrapper.find('.link').simulate('click');
|
|
76
|
-
expect(openSearch).toHaveBeenCalledWith(searchState);
|
|
77
|
-
});
|
|
78
|
-
it('should render readable old search state and open it on click correctly', function () {
|
|
79
|
-
useReadableSearchState.mockReturnValueOnce({
|
|
80
|
-
readableQueryString: 'readable search state',
|
|
81
|
-
readableQuery: []
|
|
92
|
+
it('should render readable new search state and open it on click correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
+
var props, user;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
props = {
|
|
98
|
+
data: {
|
|
99
|
+
uri: 'activities/504c-9876-79bc2a96',
|
|
100
|
+
user: 'polina.arsenteva',
|
|
101
|
+
label: 'USER_SEARCH',
|
|
102
|
+
description: '{"activity":{"query":"filter=equals(type%2C\'configuration%2FentityTypes%2FHCP\')&options=searchByOv%2CovOnly","uiState":{"view":{"searchResultsMode":"table","entityTypeTab":"configuration/entityTypes/HCP", "previewPanelMode":null},"facets":{"type":{"fieldName":"type","values":["configuration/entityTypes/HCP"]}, "attributes.FirstName":{"fieldName":"attributes.FirstName","values":["Alex"],"entityTypeUri":"configuration/entityTypes/HCP"}},"advanced":[],"searchOptions":{"searchByOv":true,"ovOnly":true},"keyword":null,"map":null,"version":"2.0"}},"version":"2.0"}',
|
|
103
|
+
timestamp: 1626952820539
|
|
104
|
+
},
|
|
105
|
+
type: ActivityTypes.USER_SEARCH
|
|
106
|
+
};
|
|
107
|
+
user = setUp({ props: props }).user;
|
|
108
|
+
return [4 /*yield*/, user.click(screen.getByText('HCP: First Name = "Alex"'))];
|
|
109
|
+
case 1:
|
|
110
|
+
_a.sent();
|
|
111
|
+
expect(mdmActions.openSearch).toHaveBeenCalledWith({
|
|
112
|
+
advanced: [],
|
|
113
|
+
facets: {
|
|
114
|
+
'attributes.FirstName': {
|
|
115
|
+
entityTypeUri: 'configuration/entityTypes/HCP',
|
|
116
|
+
fieldName: 'attributes.FirstName',
|
|
117
|
+
values: ['Alex']
|
|
118
|
+
},
|
|
119
|
+
type: { fieldName: 'type', values: ['configuration/entityTypes/HCP'] }
|
|
120
|
+
},
|
|
121
|
+
keyword: null,
|
|
122
|
+
map: null,
|
|
123
|
+
searchOptions: { ovOnly: true, searchByOv: true },
|
|
124
|
+
version: '2.0',
|
|
125
|
+
view: { entityTypeTab: 'configuration/entityTypes/HCP', previewPanelMode: null, searchResultsMode: 'table' }
|
|
126
|
+
});
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
82
129
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
currentTenant: 'uitest2',
|
|
121
|
-
fieldName: 'tenants'
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
facetClass: 'com.reltio.plugins.search.dev.EntityTypeSearchFacet',
|
|
125
|
-
title: 'Entity Types',
|
|
126
|
-
isCollapsed: false,
|
|
127
|
-
isClosable: false,
|
|
128
|
-
dataTenant: null,
|
|
129
|
-
additional: false,
|
|
130
|
-
hideForDataTenant: false,
|
|
131
|
-
values: [],
|
|
132
|
-
fieldName: 'type',
|
|
133
|
-
includeFilter: null,
|
|
134
|
-
typeAhead: false,
|
|
135
|
-
pageSize: 100,
|
|
136
|
-
showAllEntityTypes: false
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
facetClass: 'com.reltio.plugins.search.dev.RoleSearchFacet',
|
|
140
|
-
title: 'Roles',
|
|
141
|
-
isCollapsed: false,
|
|
142
|
-
isClosable: false,
|
|
143
|
-
dataTenant: null,
|
|
144
|
-
additional: false,
|
|
145
|
-
hideForDataTenant: false,
|
|
146
|
-
values: [],
|
|
147
|
-
fieldName: 'roles',
|
|
148
|
-
includeFilter: [],
|
|
149
|
-
typeAhead: true,
|
|
150
|
-
pageSize: 7
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
facetClass: 'com.reltio.plugins.search.dev.SearchFacetWithCheckboxes',
|
|
154
|
-
title: 'Tags',
|
|
155
|
-
isCollapsed: false,
|
|
156
|
-
isClosable: false,
|
|
157
|
-
dataTenant: null,
|
|
158
|
-
additional: false,
|
|
159
|
-
hideForDataTenant: false,
|
|
160
|
-
values: ['some text'],
|
|
161
|
-
fieldName: 'tags',
|
|
162
|
-
includeFilter: null,
|
|
163
|
-
typeAhead: true,
|
|
164
|
-
pageSize: 7
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
forTenant: 'uitest2',
|
|
168
|
-
model: {
|
|
169
|
-
tags: {
|
|
170
|
-
labels: ['some text'],
|
|
171
|
-
filter: null
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
view: {
|
|
175
|
-
mode: 'NoPreview',
|
|
176
|
-
tabs: []
|
|
130
|
+
}); });
|
|
131
|
+
it('should render readable old search state and open it on click correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
132
|
+
var props, user;
|
|
133
|
+
return __generator(this, function (_a) {
|
|
134
|
+
switch (_a.label) {
|
|
135
|
+
case 0:
|
|
136
|
+
props = {
|
|
137
|
+
data: {
|
|
138
|
+
uri: 'activities/1763-bf44-daeb9d6e',
|
|
139
|
+
user: 'polina.arsenteva',
|
|
140
|
+
label: 'USER_SEARCH',
|
|
141
|
+
description: '{"keyword":null,"isRawFilter":false,"facets":[{"facetClass":"com.reltio.plugins.search.dev.SearchFacetWithCheckboxes","title":"Tags","values":["tag"],"fieldName":"tags"}],"forTenant":"alenat","model":{"tags":{"labels":["tag"],"filter":null}},"view":{"mode":"NoPreview","tabs":[]}}',
|
|
142
|
+
timestamp: 1626956152002
|
|
143
|
+
},
|
|
144
|
+
type: ActivityTypes.USER_SEARCH
|
|
145
|
+
};
|
|
146
|
+
user = setUp({ props: props }).user;
|
|
147
|
+
return [4 /*yield*/, user.click(screen.getByText('Tags = "tag"'))];
|
|
148
|
+
case 1:
|
|
149
|
+
_a.sent();
|
|
150
|
+
expect(mdmActions.openSearch).toHaveBeenCalledWith({
|
|
151
|
+
facets: [
|
|
152
|
+
{
|
|
153
|
+
facetClass: 'com.reltio.plugins.search.dev.SearchFacetWithCheckboxes',
|
|
154
|
+
fieldName: 'tags',
|
|
155
|
+
title: 'Tags',
|
|
156
|
+
values: ['tag']
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
forTenant: 'alenat',
|
|
160
|
+
isRawFilter: false,
|
|
161
|
+
keyword: null,
|
|
162
|
+
model: { tags: { filter: null, labels: ['tag'] } },
|
|
163
|
+
view: { mode: 'NoPreview', tabs: [] }
|
|
164
|
+
});
|
|
165
|
+
return [2 /*return*/];
|
|
177
166
|
}
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
wrapper.find('.link').simulate('click');
|
|
181
|
-
expect(openSearch).toHaveBeenCalledWith(searchState);
|
|
182
|
-
});
|
|
167
|
+
});
|
|
168
|
+
}); });
|
|
183
169
|
it('should render all profiles if readable search state is empty', function () {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
id: '3ZOMTE6R',
|
|
194
|
-
user: 'polina.arsenteva',
|
|
195
|
-
method: 'POST',
|
|
196
|
-
url: '/reltio/api/sokol/activities',
|
|
197
|
-
clientType: 'Reltio UI',
|
|
198
|
-
timestamp: 1626952820539
|
|
199
|
-
}
|
|
200
|
-
],
|
|
201
|
-
itemsTotal: 1
|
|
170
|
+
var props = {
|
|
171
|
+
data: {
|
|
172
|
+
uri: 'activities/504c-9876-79bc2a96',
|
|
173
|
+
user: 'polina.arsenteva',
|
|
174
|
+
label: 'USER_SEARCH',
|
|
175
|
+
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"}',
|
|
176
|
+
timestamp: 1626952820539
|
|
177
|
+
},
|
|
178
|
+
type: ActivityTypes.USER_SEARCH
|
|
202
179
|
};
|
|
203
|
-
|
|
204
|
-
|
|
180
|
+
setUp({ props: props });
|
|
181
|
+
screen.getByText('all profiles');
|
|
205
182
|
});
|
|
206
183
|
});
|
package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js
CHANGED
|
@@ -10,7 +10,7 @@ export var SimpleActivity = function (_a) {
|
|
|
10
10
|
var styles = useStyles();
|
|
11
11
|
var description = parseJSON(data.description);
|
|
12
12
|
var itemsTotal = data.itemsTotal;
|
|
13
|
-
return (React.createElement(ActivityTitle, { type: type },
|
|
13
|
+
return (React.createElement(ActivityTitle, { type: type, "data-reltio-id": "simple-activity" },
|
|
14
14
|
description && (React.createElement(EntityUriLink, { className: styles.link, value: description.uri }, getLabel(description.label))),
|
|
15
|
-
itemsTotal > 1 && React.createElement(ObjectLabel, { label: i18n.text('(${itemsTotal} records)', { itemsTotal: itemsTotal }) })));
|
|
15
|
+
itemsTotal > 1 && (React.createElement(ObjectLabel, { "data-reltio-id": "simple-activity-items-total", label: i18n.text('(${itemsTotal} records)', { itemsTotal: itemsTotal }) }))));
|
|
16
16
|
};
|
package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js
CHANGED
|
@@ -10,36 +10,52 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { render, screen } from '@testing-library/react';
|
|
14
|
+
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
15
15
|
import { ActivityTypes } from '../../../types';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
id: '3Gme7xNf',
|
|
26
|
-
user: 'polina.arsenteva',
|
|
27
|
-
method: 'POST',
|
|
28
|
-
url: '/reltio/api/alenat/activities',
|
|
29
|
-
clientType: 'Reltio UI',
|
|
30
|
-
timestamp: 1622625987531
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
itemsTotal: 1
|
|
16
|
+
import { SimpleActivity } from './SimpleActivity';
|
|
17
|
+
var defaultMdmValues = {
|
|
18
|
+
uiPath: 'https://reltio.com/nui'
|
|
19
|
+
};
|
|
20
|
+
var setUp = function (_a) {
|
|
21
|
+
var props = _a.props, _b = _a.mdmValues, mdmValues = _b === void 0 ? defaultMdmValues : _b;
|
|
22
|
+
var Providers = function (_a) {
|
|
23
|
+
var children = _a.children;
|
|
24
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues }, children));
|
|
34
25
|
};
|
|
35
|
-
|
|
26
|
+
return render(React.createElement(SimpleActivity, __assign({}, props)), { wrapper: Providers });
|
|
27
|
+
};
|
|
28
|
+
describe('Simple activity tests', function () {
|
|
36
29
|
it('should render correctly', function () {
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
var props = {
|
|
31
|
+
type: ActivityTypes.USER_LOGIN,
|
|
32
|
+
data: {
|
|
33
|
+
uri: 'activities/de19-08e1-b220b95c',
|
|
34
|
+
user: 'polina.arsenteva',
|
|
35
|
+
label: 'User login',
|
|
36
|
+
timestamp: 1622625987531,
|
|
37
|
+
description: '{"uri":"entities/k5nO0xA","label":"test"}',
|
|
38
|
+
itemsTotal: 2
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
setUp({ props: props });
|
|
42
|
+
screen.getByText('Logged in');
|
|
43
|
+
screen.getByText('(2 records)');
|
|
44
|
+
expect(screen.getByText('test')).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/k5nO0xA');
|
|
45
|
+
});
|
|
46
|
+
it('should render correctly if description is not passed and itemsTotal is 1 or less', function () {
|
|
47
|
+
var props = {
|
|
48
|
+
type: ActivityTypes.USER_LOGIN,
|
|
49
|
+
data: {
|
|
50
|
+
uri: 'activities/de19-08e1-b220b95c',
|
|
51
|
+
user: 'polina.arsenteva',
|
|
52
|
+
label: 'User login',
|
|
53
|
+
timestamp: 1622625987531,
|
|
54
|
+
itemsTotal: 1
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
setUp({ props: props });
|
|
58
|
+
expect(screen.queryByRole('link')).not.toBeInTheDocument();
|
|
59
|
+
expect(screen.queryByTestId('simple-activity-items-total')).not.toBeInTheDocument();
|
|
44
60
|
});
|
|
45
61
|
});
|
|
@@ -11,9 +11,8 @@ export var SynchronizationIssuesActivity = function (_a) {
|
|
|
11
11
|
var description = parseJSON(data.description);
|
|
12
12
|
var itemsTotal = data.itemsTotal;
|
|
13
13
|
var objectUri = data.items[0].objectUri;
|
|
14
|
-
return (React.createElement(ActivityTitle, { type: type },
|
|
15
|
-
React.createElement(React.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
itemsTotal > 1 && React.createElement(ObjectLabel, { label: i18n.text('(${itemsTotal} records)', { itemsTotal: itemsTotal }) })));
|
|
14
|
+
return (React.createElement(ActivityTitle, { type: type, "data-reltio-id": "synchronization-issues-activity" },
|
|
15
|
+
isRelationUri(objectUri) ? (React.createElement("span", { className: styles.relationUri }, objectUri)) : (React.createElement(EntityObject, { item: data.items[0] })),
|
|
16
|
+
description && (React.createElement(ObjectLabel, { "data-reltio-id": "synchronization-issues-activity-description", label: description.label })),
|
|
17
|
+
itemsTotal > 1 && (React.createElement(ObjectLabel, { "data-reltio-id": "synchronization-issues-activity-items-total", label: i18n.text('(${itemsTotal} records)', { itemsTotal: itemsTotal }) }))));
|
|
19
18
|
};
|
|
@@ -10,56 +10,63 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { render, screen } from '@testing-library/react';
|
|
14
|
+
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
15
15
|
import { ActivityTypes } from '../../../types';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
import { SynchronizationIssuesActivity } from './SynchronizationIssuesActivity';
|
|
17
|
+
var defaultItem = {
|
|
18
|
+
id: '42uxv5X2',
|
|
19
|
+
timestamp: 1652374313724,
|
|
20
|
+
objectUri: 'entities/15T9kNFk',
|
|
21
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
22
|
+
objectLabel: 'Andy Andy'
|
|
23
|
+
};
|
|
24
|
+
var defaultData = {
|
|
25
|
+
uri: 'activities/0dcf97d0-5006-46d6-b82f-07579922e2f6',
|
|
26
|
+
user: 'sfdc.connector.admin',
|
|
27
|
+
label: 'label',
|
|
28
|
+
timestamp: 1652374313724,
|
|
29
|
+
items: [defaultItem],
|
|
30
|
+
itemsTotal: 1
|
|
31
|
+
};
|
|
32
|
+
var defaultProps = {
|
|
33
|
+
type: ActivityTypes.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE,
|
|
34
|
+
data: defaultData
|
|
35
|
+
};
|
|
36
|
+
var defaultMdmValues = {
|
|
37
|
+
uiPath: 'https://reltio.com/nui'
|
|
38
|
+
};
|
|
39
|
+
var setUp = function (_a) {
|
|
40
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
41
|
+
var Providers = function (_a) {
|
|
42
|
+
var children = _a.children;
|
|
43
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues }, children));
|
|
36
44
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
expect(
|
|
44
|
-
|
|
45
|
-
expect(
|
|
46
|
-
expect(descriptionDiv.prop('label')).toBe('test');
|
|
45
|
+
return render(React.createElement(SynchronizationIssuesActivity, __assign({}, props)), { wrapper: Providers });
|
|
46
|
+
};
|
|
47
|
+
describe('Synchronization issues activity tests', function () {
|
|
48
|
+
it('should render correctly', function () {
|
|
49
|
+
setUp();
|
|
50
|
+
screen.getByText('SFDC connector synchronization issue');
|
|
51
|
+
expect(screen.getByText('Andy Andy')).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/15T9kNFk');
|
|
52
|
+
expect(screen.queryByTestId('synchronization-issues-activity-description')).not.toBeInTheDocument();
|
|
53
|
+
expect(screen.queryByTestId('synchronization-issues-activity-items-total')).not.toBeInTheDocument();
|
|
47
54
|
});
|
|
48
55
|
it('should render relation uri correctly', function () {
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: [
|
|
57
|
+
__assign(__assign({}, defaultItem), { objectUri: 'relations/15T9kNFk', objectType: 'configuration/relationTypes/HasAddress' })
|
|
58
|
+
] }) });
|
|
59
|
+
setUp({ props: props });
|
|
60
|
+
screen.getByText('relations/15T9kNFk');
|
|
61
|
+
});
|
|
62
|
+
it('should render description if it has been passed', function () {
|
|
63
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { description: '{"label":"description"}' }) });
|
|
64
|
+
setUp({ props: props });
|
|
65
|
+
screen.getByText('description');
|
|
66
|
+
});
|
|
67
|
+
it('should render items total if itemsTotal is greater than 1', function () {
|
|
68
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { itemsTotal: 2 }) });
|
|
69
|
+
setUp({ props: props });
|
|
70
|
+
screen.getByText('(2 records)');
|
|
64
71
|
});
|
|
65
72
|
});
|