@reltio/components 1.4.1997 → 1.4.1999
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/UpSetChart/UpSetChart.d.ts +5 -8
- package/cjs/UpSetChart/UpSetChart.js +61 -5
- package/cjs/UpSetChart/UpSetChart.test.js +198 -0
- package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
- package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
- package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
- package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
- package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
- package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
- package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
- package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
- package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
- package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
- package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
- package/cjs/UpSetChart/constants.d.ts +16 -3
- package/cjs/UpSetChart/constants.js +20 -4
- package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
- package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
- package/cjs/UpSetChart/helpers.d.ts +20 -0
- package/cjs/UpSetChart/helpers.js +127 -0
- package/cjs/UpSetChart/styles.d.ts +4 -1
- package/cjs/UpSetChart/styles.js +11 -12
- package/cjs/UpSetChart/types.d.ts +16 -0
- package/cjs/UpSetChart/types.js +2 -0
- package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
- package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
- 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/UpSetChart/UpSetChart.d.ts +5 -8
- package/esm/UpSetChart/UpSetChart.js +38 -5
- package/esm/UpSetChart/UpSetChart.test.js +193 -0
- package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
- package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
- package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
- package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
- package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
- package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChart/index.js +1 -0
- package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
- package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
- package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
- package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
- package/esm/UpSetChart/constants.d.ts +16 -3
- package/esm/UpSetChart/constants.js +19 -3
- package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
- package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
- package/esm/UpSetChart/helpers.d.ts +20 -0
- package/esm/UpSetChart/helpers.js +120 -0
- package/esm/UpSetChart/styles.d.ts +4 -1
- package/esm/UpSetChart/styles.js +11 -12
- package/esm/UpSetChart/types.d.ts +16 -0
- package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
- package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
- 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.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.js +0 -140
- 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 → UpSetChart/UpSetChart.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/UpSetChart/types.js} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ActivityTypes } from '../types';
|
|
3
|
-
type Props = {
|
|
3
|
+
type Props = Omit<React.ComponentPropsWithoutRef<'div'>, 'className'> & {
|
|
4
4
|
type: ActivityTypes;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
5
|
};
|
|
7
|
-
export declare const ActivityTitle: ({ type, children }: Props) => React.JSX.Element;
|
|
6
|
+
export declare const ActivityTitle: ({ type, children, ...restProps }: Props) => React.JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
2
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
26
|
};
|
|
@@ -8,9 +30,9 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
30
|
var activities_1 = require("../utils/activities");
|
|
9
31
|
var styles_1 = require("./styles");
|
|
10
32
|
var ActivityTitle = function (_a) {
|
|
11
|
-
var type = _a.type, children = _a.children;
|
|
33
|
+
var type = _a.type, children = _a.children, restProps = __rest(_a, ["type", "children"]);
|
|
12
34
|
var styles = (0, styles_1.useStyles)();
|
|
13
|
-
return (react_1.default.createElement("span", { className: styles.activityTitle },
|
|
35
|
+
return (react_1.default.createElement("span", __assign({ className: styles.activityTitle }, restProps),
|
|
14
36
|
react_1.default.createElement("span", { className: styles.activityType }, (0, activities_1.getActivityLabel)(type)),
|
|
15
37
|
children));
|
|
16
38
|
};
|
package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js
CHANGED
|
@@ -1,94 +1,117 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
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);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
7
47
|
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
48
|
};
|
|
25
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
51
|
};
|
|
28
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
53
|
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
+
var CollapsibleItemsContext_1 = require("../contexts/CollapsibleItemsContext");
|
|
33
57
|
var CollapsibleActivityRecords_1 = require("./CollapsibleActivityRecords");
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
var defaultItems = [
|
|
59
|
+
{ id: 'item-1', timestamp: 1234567890 },
|
|
60
|
+
{ id: 'item-2', timestamp: 1234567890 },
|
|
61
|
+
{ id: 'item-3', timestamp: 1234567890 },
|
|
62
|
+
{ id: 'item-4', timestamp: 1234567890 },
|
|
63
|
+
{ id: 'item-5', timestamp: 1234567890 }
|
|
64
|
+
];
|
|
65
|
+
var RecordComponent = function (_a) {
|
|
66
|
+
var item = _a.item;
|
|
67
|
+
return react_1.default.createElement("div", { "data-reltio-id": "activity-record" }, item.id);
|
|
68
|
+
};
|
|
69
|
+
var defaultProps = { activityUri: 'activity-uri', items: defaultItems, RecordComponent: RecordComponent };
|
|
70
|
+
var setUp = function (props) {
|
|
71
|
+
if (props === void 0) { props = defaultProps; }
|
|
72
|
+
var user = user_event_1.default.setup();
|
|
73
|
+
var Providers = function (_a) {
|
|
74
|
+
var children = _a.children;
|
|
75
|
+
return (react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children));
|
|
76
|
+
};
|
|
77
|
+
return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(CollapsibleActivityRecords_1.CollapsibleActivityRecords, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
78
|
+
};
|
|
79
|
+
describe('Collapsible activity records tests', function () {
|
|
42
80
|
it('should not render anything if items empty', function () {
|
|
43
|
-
var
|
|
44
|
-
expect(
|
|
45
|
-
expect(component.find(MoreItemsLink_1.MoreItemsLink)).toHaveLength(0);
|
|
46
|
-
});
|
|
47
|
-
it('should render 3 items without Link', function () {
|
|
48
|
-
var items = [
|
|
49
|
-
{ id: 'string1', timestamp: 123 },
|
|
50
|
-
{ id: 'string2', timestamp: 123 },
|
|
51
|
-
{ id: 'string3', timestamp: 123 }
|
|
52
|
-
];
|
|
53
|
-
useCollapsibleItems.mockImplementation(function () { return ({ itemsToShow: items, onExpand: onExpand, collapsedItemsCount: 0 }); });
|
|
54
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(CollapsibleActivityRecords_1.CollapsibleActivityRecords, { RecordComponent: Component, items: items, activityUri: '11' }));
|
|
55
|
-
expect(component.find(Component)).toHaveLength(3);
|
|
56
|
-
expect(component.find(MoreItemsLink_1.MoreItemsLink)).toHaveLength(0);
|
|
81
|
+
var container = setUp(__assign(__assign({}, defaultProps), { items: [] })).container;
|
|
82
|
+
expect(container).toBeEmptyDOMElement();
|
|
57
83
|
});
|
|
58
|
-
it('should render
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
it('should render and expand items correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var user, activityRecords;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
user = setUp().user;
|
|
90
|
+
activityRecords = react_2.screen.getAllByTestId('activity-record');
|
|
91
|
+
expect(activityRecords).toHaveLength(3);
|
|
92
|
+
expect(activityRecords[0]).toHaveTextContent('item-1');
|
|
93
|
+
expect(activityRecords[1]).toHaveTextContent('item-2');
|
|
94
|
+
expect(activityRecords[2]).toHaveTextContent('item-3');
|
|
95
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('button', { name: '2 more records' }))];
|
|
96
|
+
case 1:
|
|
97
|
+
_a.sent();
|
|
98
|
+
activityRecords = react_2.screen.getAllByTestId('activity-record');
|
|
99
|
+
expect(activityRecords).toHaveLength(5);
|
|
100
|
+
expect(activityRecords[3]).toHaveTextContent('item-4');
|
|
101
|
+
expect(activityRecords[4]).toHaveTextContent('item-5');
|
|
102
|
+
expect(react_2.screen.queryByRole('button')).not.toBeInTheDocument();
|
|
103
|
+
return [2 /*return*/];
|
|
104
|
+
}
|
|
78
105
|
});
|
|
79
|
-
|
|
106
|
+
}); });
|
|
107
|
+
it('should not render more items link if items count is 3 or less', function () {
|
|
108
|
+
setUp(__assign(__assign({}, defaultProps), { items: defaultItems.slice(0, 3) }));
|
|
109
|
+
expect(react_2.screen.getAllByTestId('activity-record')).toHaveLength(3);
|
|
110
|
+
expect(react_2.screen.queryByRole('button')).not.toBeInTheDocument();
|
|
80
111
|
});
|
|
81
|
-
it('should render
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{ id: 'string3', timestamp: 123 },
|
|
86
|
-
{ id: 'string4', timestamp: 123 },
|
|
87
|
-
{ id: 'string5', timestamp: 123 }
|
|
88
|
-
];
|
|
89
|
-
useCollapsibleItems.mockImplementation(function () { return ({ itemsToShow: items, onExpand: onExpand, collapsedItemsCount: 0 }); });
|
|
90
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(CollapsibleActivityRecords_1.CollapsibleActivityRecords, { RecordComponent: Component, items: items, activityUri: '11' }));
|
|
91
|
-
expect(component.find(Component)).toHaveLength(5);
|
|
92
|
-
expect(component.find(MoreItemsLink_1.MoreItemsLink)).toHaveLength(0);
|
|
112
|
+
it('should render more items link correctly if items count is 4', function () {
|
|
113
|
+
setUp(__assign(__assign({}, defaultProps), { items: defaultItems.slice(0, 4) }));
|
|
114
|
+
expect(react_2.screen.getAllByTestId('activity-record')).toHaveLength(3);
|
|
115
|
+
react_2.screen.getByRole('button', { name: '1 more record' });
|
|
93
116
|
});
|
|
94
117
|
});
|
|
@@ -15,32 +15,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
18
|
+
var react_2 = require("@testing-library/react");
|
|
19
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
20
|
+
var types_1 = require("../types");
|
|
19
21
|
var EntityObject_1 = require("./EntityObject");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
var defaultItem = {
|
|
23
|
+
id: '3vJgNLSN',
|
|
24
|
+
timestamp: 1621847085259,
|
|
25
|
+
objectUri: 'relations/edEnRRW',
|
|
26
|
+
objectLabel: 'object label',
|
|
27
|
+
data: { type: types_1.ActivityTypes.ENTITY_CHANGED }
|
|
28
|
+
};
|
|
29
|
+
var defaultProps = {
|
|
30
|
+
item: defaultItem
|
|
31
|
+
};
|
|
32
|
+
var defaultMdmValues = {
|
|
33
|
+
uiPath: 'https://reltio.com/nui'
|
|
34
|
+
};
|
|
35
|
+
var setUp = function (_a) {
|
|
36
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
37
|
+
var Providers = function (_a) {
|
|
38
|
+
var children = _a.children;
|
|
39
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues }, children));
|
|
40
|
+
};
|
|
41
|
+
return (0, react_2.render)(react_1.default.createElement(EntityObject_1.EntityObject, __assign({}, props)), { wrapper: Providers });
|
|
42
|
+
};
|
|
43
|
+
describe('Entity object tests', function () {
|
|
44
|
+
it('should render entity object correctly', function () {
|
|
45
|
+
setUp();
|
|
46
|
+
var link = react_2.screen.getByText('object label');
|
|
47
|
+
expect(link).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~relations/edEnRRW');
|
|
48
|
+
expect(link).not.toHaveClass('removed');
|
|
49
|
+
});
|
|
50
|
+
it('should render entity object with ENTITY_REMOVED type correctly', function () {
|
|
51
|
+
var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: { type: types_1.ActivityTypes.ENTITY_REMOVED } }) });
|
|
52
|
+
setUp({ props: props });
|
|
53
|
+
expect(react_2.screen.getByText('object label')).toHaveClass('removed');
|
|
45
54
|
});
|
|
46
55
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type Props = {
|
|
2
|
+
type Props = Omit<React.ComponentPropsWithoutRef<'div'>, 'className'> & {
|
|
3
3
|
fieldName: string;
|
|
4
|
-
children: React.ReactNode;
|
|
5
4
|
};
|
|
6
|
-
export declare const Field: ({ fieldName, children }: Props) => React.JSX.Element;
|
|
5
|
+
export declare const Field: ({ fieldName, children, ...restProps }: Props) => React.JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
2
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
26
|
};
|
|
@@ -7,9 +29,9 @@ exports.Field = void 0;
|
|
|
7
29
|
var react_1 = __importDefault(require("react"));
|
|
8
30
|
var styles_1 = require("./styles");
|
|
9
31
|
var Field = function (_a) {
|
|
10
|
-
var fieldName = _a.fieldName, children = _a.children;
|
|
32
|
+
var fieldName = _a.fieldName, children = _a.children, restProps = __rest(_a, ["fieldName", "children"]);
|
|
11
33
|
var styles = (0, styles_1.useStyles)();
|
|
12
|
-
return (react_1.default.createElement("div", { className: styles.field },
|
|
34
|
+
return (react_1.default.createElement("div", __assign({ className: styles.field }, restProps),
|
|
13
35
|
react_1.default.createElement("span", { className: styles.fieldName },
|
|
14
36
|
fieldName,
|
|
15
37
|
":"),
|
|
@@ -10,48 +10,174 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
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);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
13
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
51
|
};
|
|
16
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
53
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
57
|
+
var CollapsibleItemsContext_1 = require("../contexts/CollapsibleItemsContext");
|
|
58
|
+
var types_1 = require("../types");
|
|
19
59
|
var PotentialMatchRecord_1 = require("./PotentialMatchRecord");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
var defaultItem = {
|
|
61
|
+
id: '3LfWvAlI',
|
|
62
|
+
timestamp: 1621847092199,
|
|
63
|
+
objectUri: 'entities/11EunumT',
|
|
64
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
65
|
+
objectLabel: 'record label',
|
|
66
|
+
data: {
|
|
67
|
+
potentialMatches: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw,entities/p3Js13Nm,entities/zIlemSd09',
|
|
68
|
+
type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND,
|
|
69
|
+
'entities/sOoSQYm': 'entity label 1',
|
|
70
|
+
'entities/sOoSQYq': 'entity label 2',
|
|
71
|
+
'entities/sOoSQYw': 'entity label 3',
|
|
72
|
+
'entities/p3Js13Nm': 'entity label 4',
|
|
73
|
+
'entities/zIlemSd09': 'entity label 5'
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
var defaultProps = {
|
|
77
|
+
item: defaultItem
|
|
78
|
+
};
|
|
79
|
+
var defaultMdmValues = {
|
|
80
|
+
uiPath: 'https://reltio.com/nui'
|
|
81
|
+
};
|
|
82
|
+
var setUp = function (_a) {
|
|
83
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
84
|
+
var user = user_event_1.default.setup();
|
|
85
|
+
var Providers = function (_a) {
|
|
86
|
+
var children = _a.children;
|
|
87
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
88
|
+
react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
|
|
37
89
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
90
|
+
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(PotentialMatchRecord_1.PotentialMatchRecord, __assign({}, props)), { wrapper: Providers }));
|
|
91
|
+
};
|
|
92
|
+
describe('Potential match record tests', function () {
|
|
93
|
+
it('should render nothing if there are not potentialMatches or newUri fields', function () {
|
|
94
|
+
var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: { type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND } }) });
|
|
95
|
+
var container = setUp({ props: props }).container;
|
|
96
|
+
expect(container).toBeEmptyDOMElement();
|
|
42
97
|
});
|
|
43
|
-
it('should render
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
newUri: 'entities/2eIQy30G',
|
|
47
|
-
type: 'ENTITIES_SPLITTED'
|
|
48
|
-
} });
|
|
49
|
-
var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(PotentialMatchRecord_1.PotentialMatchRecord, { item: newUriItem }));
|
|
50
|
-
expect(wrapper.find('EntityObject').length).toBe(1);
|
|
51
|
-
expect(wrapper.find('PotentialMatchField').length).toBe(1);
|
|
98
|
+
it('should render record label correctly', function () {
|
|
99
|
+
setUp();
|
|
100
|
+
expect(react_2.screen.getByText('record label')).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/11EunumT');
|
|
52
101
|
});
|
|
53
|
-
it('should
|
|
54
|
-
var
|
|
55
|
-
|
|
102
|
+
it('should render matches correctly for potentialMatches field', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
103
|
+
var user, _a, links, moreItemsLink;
|
|
104
|
+
var _b;
|
|
105
|
+
return __generator(this, function (_c) {
|
|
106
|
+
switch (_c.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
user = setUp().user;
|
|
109
|
+
expect(react_2.screen.getByTestId('potential-matches-field')).toHaveTextContent('Matches found:entity label 1, entity label 2, entity label 3 and 2 more matches');
|
|
110
|
+
_a = react_2.screen.getAllByRole('link'), links = _a.slice(1);
|
|
111
|
+
expect(links).toHaveLength(3);
|
|
112
|
+
expect(links[0]).toHaveTextContent('entity label 1');
|
|
113
|
+
expect(links[0]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYm');
|
|
114
|
+
expect(links[1]).toHaveTextContent('entity label 2');
|
|
115
|
+
expect(links[1]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYq');
|
|
116
|
+
expect(links[2]).toHaveTextContent('entity label 3');
|
|
117
|
+
expect(links[2]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYw');
|
|
118
|
+
moreItemsLink = react_2.screen.getByRole('button', { name: '2 more matches' });
|
|
119
|
+
return [4 /*yield*/, user.click(moreItemsLink)];
|
|
120
|
+
case 1:
|
|
121
|
+
_c.sent();
|
|
122
|
+
expect(react_2.screen.getByTestId('potential-matches-field')).toHaveTextContent('Matches found:entity label 1, entity label 2, entity label 3, entity label 4, entity label 5');
|
|
123
|
+
_b = react_2.screen.getAllByRole('link'), links = _b.slice(1);
|
|
124
|
+
expect(links).toHaveLength(5);
|
|
125
|
+
expect(links[3]).toHaveTextContent('entity label 4');
|
|
126
|
+
expect(links[3]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/p3Js13Nm');
|
|
127
|
+
expect(links[4]).toHaveTextContent('entity label 5');
|
|
128
|
+
expect(links[4]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/zIlemSd09');
|
|
129
|
+
expect(moreItemsLink).not.toBeInTheDocument();
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); });
|
|
134
|
+
it('should render matches correctly for newUri field', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
|
+
var props, user, _a, links, moreItemsLink;
|
|
136
|
+
var _b;
|
|
137
|
+
return __generator(this, function (_c) {
|
|
138
|
+
switch (_c.label) {
|
|
139
|
+
case 0:
|
|
140
|
+
props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: {
|
|
141
|
+
type: types_1.ActivityTypes.ENTITIES_SPLITTED,
|
|
142
|
+
newUri: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw,entities/p3Js13Nm',
|
|
143
|
+
'entities/sOoSQYm': 'entity label 1',
|
|
144
|
+
'entities/sOoSQYq': 'entity label 2',
|
|
145
|
+
'entities/sOoSQYw': 'entity label 3',
|
|
146
|
+
'entities/p3Js13Nm': 'entity label 4'
|
|
147
|
+
} }) });
|
|
148
|
+
user = setUp({ props: props }).user;
|
|
149
|
+
expect(react_2.screen.getByTestId('potential-matches-field')).toHaveTextContent('Un-merged with:entity label 1, entity label 2, entity label 3 and 1 more match');
|
|
150
|
+
_a = react_2.screen.getAllByRole('link'), links = _a.slice(1);
|
|
151
|
+
expect(links).toHaveLength(3);
|
|
152
|
+
expect(links[0]).toHaveTextContent('entity label 1');
|
|
153
|
+
expect(links[0]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYm');
|
|
154
|
+
expect(links[1]).toHaveTextContent('entity label 2');
|
|
155
|
+
expect(links[1]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYq');
|
|
156
|
+
expect(links[2]).toHaveTextContent('entity label 3');
|
|
157
|
+
expect(links[2]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYw');
|
|
158
|
+
moreItemsLink = react_2.screen.getByRole('button', { name: '1 more match' });
|
|
159
|
+
return [4 /*yield*/, user.click(moreItemsLink)];
|
|
160
|
+
case 1:
|
|
161
|
+
_c.sent();
|
|
162
|
+
expect(react_2.screen.getByTestId('potential-matches-field')).toHaveTextContent('Un-merged with:entity label 1, entity label 2, entity label 3, entity label 4');
|
|
163
|
+
_b = react_2.screen.getAllByRole('link'), links = _b.slice(1);
|
|
164
|
+
expect(links).toHaveLength(4);
|
|
165
|
+
expect(links[3]).toHaveTextContent('entity label 4');
|
|
166
|
+
expect(links[3]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/p3Js13Nm');
|
|
167
|
+
expect(moreItemsLink).not.toBeInTheDocument();
|
|
168
|
+
return [2 /*return*/];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}); });
|
|
172
|
+
it('should not render more items link if items count is 3 or less', function () {
|
|
173
|
+
var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: {
|
|
174
|
+
potentialMatches: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw',
|
|
175
|
+
type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND,
|
|
176
|
+
'entities/sOoSQYm': 'entity label 1',
|
|
177
|
+
'entities/sOoSQYq': 'entity label 2',
|
|
178
|
+
'entities/sOoSQYw': 'entity label 3'
|
|
179
|
+
} }) });
|
|
180
|
+
setUp({ props: props });
|
|
181
|
+
expect(react_2.screen.queryByRole('button')).not.toBeInTheDocument();
|
|
56
182
|
});
|
|
57
183
|
});
|
|
@@ -22,7 +22,7 @@ var PotentialMatchField = function (_a) {
|
|
|
22
22
|
items: matches.split(',')
|
|
23
23
|
}), onExpand = _c.onExpand, collapsedItemsCount = _c.collapsedItemsCount, itemsToShow = _c.itemsToShow;
|
|
24
24
|
var type = data === null || data === void 0 ? void 0 : data.type;
|
|
25
|
-
return (react_1.default.createElement(Field_1.Field, { fieldName: (0, helpers_1.getFieldName)(type) },
|
|
25
|
+
return (react_1.default.createElement(Field_1.Field, { fieldName: (0, helpers_1.getFieldName)(type), "data-reltio-id": "potential-matches-field" },
|
|
26
26
|
itemsToShow
|
|
27
27
|
.map(function (url, index) { return (react_1.default.createElement(EntityUriLink_1.EntityUriLink, { key: index, value: url, className: styles.link }, (0, mdm_sdk_1.getLabel)(data[url]))); })
|
|
28
28
|
.reduce(function (prev, curr) { return [prev, ', ', curr]; }),
|