@reltio/components 1.4.1988 → 1.4.1990
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/ActionsPanel/ActionsPanel.test.js +1 -1
- package/cjs/ActionsPanel/types.d.ts +2 -1
- package/cjs/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.js +1 -1
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.js +3 -3
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.test.js +2 -2
- package/cjs/AutoSizeList/AutoSizeList.js +6 -6
- package/cjs/BooleanRadioEditor/BooleanRadioEditor.test.js +2 -2
- package/cjs/DataTypeValueEditor/useEditorContext.test.js +17 -0
- package/cjs/DependentLookupEditor/DependentLookupEditor.js +2 -1
- package/cjs/DependentLookupEditor/DependentLookupEditor.test.js +1 -1
- package/cjs/DropDownMenuButton/DropDownMenuButton.d.ts +1 -1
- package/cjs/DropDownMenuButton/DropDownMenuButton.js +6 -1
- package/cjs/DropDownSelector/DropDownSelector.test.js +0 -5
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +1 -1
- package/cjs/EditModeAttributesList/EditModeAttributesList.test.js +1 -6
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.test.js +2 -0
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.test.js +2 -6
- package/cjs/EmptyState/EmptyState.test.js +1 -1
- package/cjs/EntitySelector/EntitySelector.test.js +237 -113
- package/cjs/ErrorBoundary/ErrorBoundary.test.js +2 -2
- package/cjs/HOCs/withFilter/components/ColumnFilter/ColumnFilter.js +6 -1
- package/cjs/ImageAttributesLine/types.d.ts +2 -1
- package/cjs/ImageDetailsView/helpers.test.js +0 -5
- package/cjs/ImportButton/ImportButton.test.js +1 -1
- package/cjs/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.test.js +1 -1
- package/cjs/MapChart/MapChart.js +1 -0
- package/cjs/Marginator/Marginator.d.ts +1 -1
- package/cjs/MultiSelect/MultiSelect.js +1 -1
- package/cjs/MultipliableSelect/MultipliableSelect.js +1 -3
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +1 -1
- package/cjs/ProfileBand/ProfileBand.js +1 -1
- package/cjs/ProfilesList/ProfilesList.spec.js +1 -2
- package/cjs/RCTree/RCTree.d.ts +2 -2
- package/cjs/RCTree/RCTree.js +0 -3
- package/cjs/ReactSortableTree/ReactSortableTree.js +2 -2
- package/cjs/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.js +1 -3
- package/cjs/ReactSortableTree/components/TreeNode/TreeNode.js +1 -3
- package/cjs/ReactSortableTree/components/TreePlaceholder/TreePlaceholder.js +0 -1
- package/cjs/ReactSortableTree/helpers/generic.js +0 -1
- package/cjs/ReactSortableTree/helpers/tree.js +1 -1
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +2 -2
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +2 -2
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +1 -6
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +3 -3
- package/cjs/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/cjs/ReltioMap/ReltioMap.d.ts +1 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.test.js +0 -1
- package/cjs/TableSkeleton/TableSkeleton.d.ts +1 -1
- package/cjs/TagsEditor/TagsEditor.test.js +16 -0
- package/cjs/TenantLabel/TenantLabel.spec.js +3 -3
- package/cjs/TypeaheadEditor/TypeaheadEditor.js +21 -6
- package/cjs/TypeaheadEditor/TypeaheadEditor.test.js +21 -0
- package/cjs/VirtualGroupedList/VirtualGroupedList.js +14 -5
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.js +2 -2
- package/cjs/VirtualGroupedList/useScrollToFocusItem.test.js +2 -2
- package/cjs/features/activity-log/utils/filters.test.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +8 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +2 -2
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.js +6 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +0 -3
- package/cjs/features/crosswalks/AttributesTable/types.d.ts +2 -1
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +1 -1
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +1 -1
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +4 -5
- package/cjs/features/history/HistoryFilterButton/HistoryFilterButton.js +6 -3
- package/cjs/features/history/HistoryTree/HistoryTree.js +5 -1
- package/cjs/features/history/hooks/useHistoryTree.js +6 -3
- package/cjs/features/workflow/AddWorkflowButton/AddWorkflowButton.spec.js +2 -2
- package/cjs/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -1
- package/cjs/features/workflow/WorkflowTaskCard/WorkflowTaskCard.test.js +8 -8
- package/cjs/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.spec.js +0 -1
- package/cjs/features/workflow/WorkflowTaskCard/components/PotentialMatchTaskCard/PotentialMatchTaskCard.spec.js +2 -2
- package/cjs/features/workflow/hooks/useWorkflowAssignee.js +2 -1
- package/cjs/helpers/customScript.test.js +8 -8
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.js +5 -3
- package/cjs/hooks/useMarkAsNotMatchRequest/useMarkAsNotMatchRequest.js +2 -1
- package/cjs/hooks/useMatchesColumnsData/helpers.js +3 -4
- package/cjs/hooks/useMergeAllRequest/useMergeAllRequest.js +2 -1
- package/cjs/hooks/usePagingSimulator/helpers.js +0 -1
- package/cjs/hooks/useSavedSearchesRequest/useSavedSearchesRequest.js +7 -2
- package/cjs/icons/AIPowered.d.ts +1 -2
- package/cjs/test-utils/TestStylesProvider.js +1 -2
- package/cjs/types/basicTable.d.ts +2 -2
- package/cjs/types/index.d.ts +1 -1
- package/esm/ActionsPanel/ActionsPanel.test.js +1 -1
- package/esm/ActionsPanel/types.d.ts +2 -1
- package/esm/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.js +1 -1
- package/esm/AttributesFiltersButton/AttributesFiltersButton.js +3 -3
- package/esm/AttributesFiltersButton/AttributesFiltersButton.test.js +2 -2
- package/esm/AutoSizeList/AutoSizeList.js +6 -6
- package/esm/BooleanRadioEditor/BooleanRadioEditor.test.js +2 -2
- package/esm/DataTypeValueEditor/useEditorContext.test.js +17 -0
- package/esm/DependentLookupEditor/DependentLookupEditor.js +2 -1
- package/esm/DependentLookupEditor/DependentLookupEditor.test.js +1 -1
- package/esm/DropDownMenuButton/DropDownMenuButton.d.ts +1 -1
- package/esm/DropDownMenuButton/DropDownMenuButton.js +6 -1
- package/esm/DropDownSelector/DropDownSelector.test.js +0 -5
- package/esm/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +1 -1
- package/esm/EditModeAttributesList/EditModeAttributesList.test.js +1 -6
- package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.test.js +2 -0
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.test.js +2 -6
- package/esm/EmptyState/EmptyState.test.js +1 -1
- package/esm/EntitySelector/EntitySelector.test.js +237 -113
- package/esm/ErrorBoundary/ErrorBoundary.test.js +2 -2
- package/esm/HOCs/withFilter/components/ColumnFilter/ColumnFilter.js +6 -1
- package/esm/ImageAttributesLine/types.d.ts +2 -1
- package/esm/ImageDetailsView/helpers.test.js +0 -5
- package/esm/ImportButton/ImportButton.test.js +1 -1
- package/esm/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.test.js +1 -1
- package/esm/MapChart/MapChart.js +1 -0
- package/esm/Marginator/Marginator.d.ts +1 -1
- package/esm/MultiSelect/MultiSelect.js +1 -1
- package/esm/MultipliableSelect/MultipliableSelect.js +1 -3
- package/esm/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +1 -1
- package/esm/ProfileBand/ProfileBand.js +1 -1
- package/esm/ProfilesList/ProfilesList.spec.js +1 -2
- package/esm/RCTree/RCTree.d.ts +2 -2
- package/esm/RCTree/RCTree.js +0 -3
- package/esm/ReactSortableTree/ReactSortableTree.js +2 -2
- package/esm/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.js +1 -3
- package/esm/ReactSortableTree/components/TreeNode/TreeNode.js +1 -3
- package/esm/ReactSortableTree/components/TreePlaceholder/TreePlaceholder.js +0 -1
- package/esm/ReactSortableTree/helpers/generic.js +0 -1
- package/esm/ReactSortableTree/helpers/tree.js +1 -1
- package/esm/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +2 -2
- package/esm/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +2 -2
- package/esm/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +1 -6
- package/esm/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +3 -3
- package/esm/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/esm/ReltioMap/ReltioMap.d.ts +1 -1
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.test.js +0 -1
- package/esm/TableSkeleton/TableSkeleton.d.ts +1 -1
- package/esm/TagsEditor/TagsEditor.test.js +16 -0
- package/esm/TenantLabel/TenantLabel.spec.js +3 -3
- package/esm/TypeaheadEditor/TypeaheadEditor.js +21 -6
- package/esm/TypeaheadEditor/TypeaheadEditor.test.js +21 -0
- package/esm/VirtualGroupedList/VirtualGroupedList.js +14 -5
- package/esm/VirtualGroupedList/VirtualGroupedList.spec.js +2 -2
- package/esm/VirtualGroupedList/useScrollToFocusItem.test.js +2 -2
- package/esm/features/activity-log/utils/filters.test.js +1 -1
- package/esm/features/crosswalks/AttributesTable/AttributesTable.js +8 -2
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +2 -2
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +1 -1
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.js +6 -1
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +0 -3
- package/esm/features/crosswalks/AttributesTable/types.d.ts +2 -1
- package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +1 -1
- package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +1 -1
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +2 -3
- package/esm/features/history/HistoryFilterButton/HistoryFilterButton.js +6 -3
- package/esm/features/history/HistoryTree/HistoryTree.js +5 -1
- package/esm/features/history/hooks/useHistoryTree.js +6 -3
- package/esm/features/workflow/AddWorkflowButton/AddWorkflowButton.spec.js +2 -2
- package/esm/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -1
- package/esm/features/workflow/WorkflowTaskCard/WorkflowTaskCard.test.js +8 -8
- package/esm/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.spec.js +0 -1
- package/esm/features/workflow/WorkflowTaskCard/components/PotentialMatchTaskCard/PotentialMatchTaskCard.spec.js +2 -2
- package/esm/features/workflow/hooks/useWorkflowAssignee.js +2 -1
- package/esm/helpers/customScript.test.js +8 -8
- package/esm/hooks/useKeyboardNavigation/useKeyboardNavigation.js +5 -3
- package/esm/hooks/useMarkAsNotMatchRequest/useMarkAsNotMatchRequest.js +2 -1
- package/esm/hooks/useMatchesColumnsData/helpers.js +1 -2
- package/esm/hooks/useMergeAllRequest/useMergeAllRequest.js +2 -1
- package/esm/hooks/usePagingSimulator/helpers.js +0 -1
- package/esm/hooks/useSavedSearchesRequest/useSavedSearchesRequest.js +7 -2
- package/esm/icons/AIPowered.d.ts +1 -2
- package/esm/test-utils/TestStylesProvider.js +1 -2
- package/esm/types/basicTable.d.ts +2 -2
- package/esm/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -89,7 +89,8 @@ var HistoryTree = function (_a) {
|
|
|
89
89
|
var handleHistoryCircleMouseOver = function (uri, timestamp, index) {
|
|
90
90
|
if ((0, ramda_1.isNil)(graphData.rows[index].label)) {
|
|
91
91
|
var options = { time: timestamp, select: 'crosswalks' };
|
|
92
|
-
(0, mdm_sdk_1.getEntity)(uri, options)
|
|
92
|
+
(0, mdm_sdk_1.getEntity)(uri, options)
|
|
93
|
+
.then(function (_a) {
|
|
93
94
|
var crosswalks = _a.crosswalks;
|
|
94
95
|
var label = crosswalks
|
|
95
96
|
? (0, ramda_1.uniqBy)((0, ramda_1.prop)('type'), crosswalks)
|
|
@@ -101,6 +102,9 @@ var HistoryTree = function (_a) {
|
|
|
101
102
|
.join(', ')
|
|
102
103
|
: ui_i18n_1.default.text('No data');
|
|
103
104
|
setGraphData(function (prevGraphData) { return (__assign(__assign({}, prevGraphData), { rows: prevGraphData.rows.map(function (row) { return (row.index === index ? __assign(__assign({}, row), { label: label }) : row); }) })); });
|
|
105
|
+
})
|
|
106
|
+
.catch(function (error) {
|
|
107
|
+
console.warn(error);
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
};
|
|
@@ -68,9 +68,12 @@ var useHistoryTree = function (_a) {
|
|
|
68
68
|
if (!relatedLane)
|
|
69
69
|
return;
|
|
70
70
|
var lifeTimeLength = relatedLane.lifeTime.length;
|
|
71
|
-
lifeTimeLength
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
if (lifeTimeLength) {
|
|
72
|
+
(0, history_1.startNewLife)(relatedLane.lifeTime, change);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
(0, history_1.endLife)(relatedLane.lifeTime, change);
|
|
76
|
+
}
|
|
74
77
|
rows.push({
|
|
75
78
|
uri: uri,
|
|
76
79
|
user: change.user,
|
|
@@ -55,7 +55,7 @@ describe('AddWorkflowButton tests', function () {
|
|
|
55
55
|
} }) });
|
|
56
56
|
var mdmValues = __assign(__assign({}, defaultMdmValues), { user: user });
|
|
57
57
|
var component = setUp(mdmValues);
|
|
58
|
-
expect(component.isEmptyRender());
|
|
58
|
+
expect(component.isEmptyRender()).toBeTruthy();
|
|
59
59
|
});
|
|
60
60
|
it('should not render button if "workflow:config.definition" permission is missing', function () {
|
|
61
61
|
var user = __assign(__assign({}, defaultUser), { userPermissions: __assign(__assign({}, defaultUser.userPermissions), { permissions: {
|
|
@@ -65,7 +65,7 @@ describe('AddWorkflowButton tests', function () {
|
|
|
65
65
|
} }) });
|
|
66
66
|
var mdmValues = __assign(__assign({}, defaultMdmValues), { user: user });
|
|
67
67
|
var component = setUp(mdmValues);
|
|
68
|
-
expect(component.isEmptyRender());
|
|
68
|
+
expect(component.isEmptyRender()).toBeTruthy();
|
|
69
69
|
});
|
|
70
70
|
it('should render main parts correctly if all permissions exists', function () {
|
|
71
71
|
var component = setUp();
|
|
@@ -165,7 +165,7 @@ describe('AssigneeSelector tests', function () {
|
|
|
165
165
|
return [4 /*yield*/, react_2.screen.findByText('user2')];
|
|
166
166
|
case 3:
|
|
167
167
|
_a.sent();
|
|
168
|
-
return [4 /*yield*/, user.
|
|
168
|
+
return [4 /*yield*/, user.paste('USER2')];
|
|
169
169
|
case 4:
|
|
170
170
|
_a.sent();
|
|
171
171
|
expect(react_2.screen.getByText('user2')).toBeInTheDocument();
|
|
@@ -173,9 +173,9 @@ describe('WorkflowTaskCard tests', function () {
|
|
|
173
173
|
return [4 /*yield*/, user.click(react_2.screen.getByRole('button'))];
|
|
174
174
|
case 1:
|
|
175
175
|
_a.sent();
|
|
176
|
-
|
|
176
|
+
react_2.screen.getByText('Data Change Request Review');
|
|
177
177
|
expect(react_2.screen.getByTestId('info-block')).toHaveTextContent('DCR ID: 123Created by: egorshkov on 01/14/2022Step: DCR Review');
|
|
178
|
-
|
|
178
|
+
react_2.screen.getByText('new1 new1 - 123111');
|
|
179
179
|
return [2 /*return*/];
|
|
180
180
|
}
|
|
181
181
|
});
|
|
@@ -183,24 +183,24 @@ describe('WorkflowTaskCard tests', function () {
|
|
|
183
183
|
it('should render card for potentialMatchReview', function () {
|
|
184
184
|
var task = __assign(__assign({}, defaultTask), { processType: mdm_sdk_1.PredefinedWorkflowProcessType.potentialMatchReview, displayName: 'Match Review', processDefinitionDisplayName: 'Potential Match Review' });
|
|
185
185
|
setUp(task);
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
react_2.screen.getByRole('button');
|
|
187
|
+
react_2.screen.getByText('Potential Match Review');
|
|
188
188
|
expect(react_2.screen.getByTestId('info-block')).toHaveTextContent('Created by: egorshkov on 01/14/2022Step: Match Review');
|
|
189
189
|
});
|
|
190
190
|
it('should render card for recommendForDelete', function () {
|
|
191
191
|
var task = __assign(__assign({}, defaultTask), { processType: mdm_sdk_1.PredefinedWorkflowProcessType.recommendForDelete, displayName: 'Delete Review', processDefinitionDisplayName: 'Recommend for Delete' });
|
|
192
192
|
setUp(task);
|
|
193
193
|
expect(react_2.screen.getByTestId('delete-request-task-icon')).toBeInTheDocument();
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
react_2.screen.getByRole('button');
|
|
195
|
+
react_2.screen.getByText('Recommend for Delete');
|
|
196
196
|
expect(react_2.screen.getByTestId('info-block')).toHaveTextContent('Created by: egorshkov on 01/14/2022Step: Delete Review');
|
|
197
197
|
});
|
|
198
198
|
it('should render GenericWorkflowTaskCard for all other cases', function () {
|
|
199
199
|
var task = __assign(__assign({}, defaultTask), { processType: 'some custom type', displayName: 'Some Custom Task', processDefinitionDisplayName: 'Some Custom Task Definition' });
|
|
200
200
|
setUp(task);
|
|
201
201
|
expect(react_2.screen.getByTestId('default-task-icon')).toBeInTheDocument();
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
react_2.screen.getByRole('button');
|
|
203
|
+
react_2.screen.getByText('Some Custom Task Definition');
|
|
204
204
|
expect(react_2.screen.getByTestId('info-block')).toHaveTextContent('Created by: egorshkov on 01/14/2022Step: Some Custom Task');
|
|
205
205
|
});
|
|
206
206
|
});
|
|
@@ -59,7 +59,6 @@ var DcrTaskIcon_1 = __importDefault(require("../../../../../icons/DcrTaskIcon"))
|
|
|
59
59
|
var LineDecorator_1 = require("../../../LineDecorator");
|
|
60
60
|
var AttributesChanges_1 = require("../../../AttributesChanges");
|
|
61
61
|
var DataChangeRequestTaskCard_1 = require("./DataChangeRequestTaskCard");
|
|
62
|
-
//eslint-disable-next-line
|
|
63
62
|
jest.mock('../GenericWorkflowTaskCard', function () { return ({
|
|
64
63
|
// eslint-disable-next-line
|
|
65
64
|
GenericWorkflowTaskCard: function (_a) {
|
|
@@ -124,8 +124,8 @@ describe('PotentialMatchTaskCard tests', function () {
|
|
|
124
124
|
_a = setUp(), user = _a.user, container = _a.container;
|
|
125
125
|
infos = container.querySelectorAll('.info');
|
|
126
126
|
expect(react_2.screen.getByText('Potential Match Review')).toBeInTheDocument();
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
react_2.screen.getByText('01/22/2022');
|
|
128
|
+
react_2.screen.queryByText('Test Entity');
|
|
129
129
|
expect(react_2.screen.queryByTestId('profile-match-card')).not.toBeInTheDocument();
|
|
130
130
|
expect(infos[0]).toHaveTextContent('Created by: egorshkov on 01/14/2022');
|
|
131
131
|
expect(infos[1]).toHaveTextContent('Step: PM review');
|
|
@@ -28,7 +28,8 @@ var useWorkflowAssignee = function (_a) {
|
|
|
28
28
|
var checkWorkflowPermission = (0, useWorkflowCheckPermission_1.useWorkflowCheckPermission)();
|
|
29
29
|
var canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && (0, common_1.isOpenTask)(isOpen);
|
|
30
30
|
(0, react_1.useEffect)(function () {
|
|
31
|
-
|
|
31
|
+
if (showCurrentAssignee)
|
|
32
|
+
setCurrentAssignee(assigneeToValue(assignee));
|
|
32
33
|
}, [assignee]);
|
|
33
34
|
var getAssignees = (0, react_1.useCallback)(function (text) {
|
|
34
35
|
if (workflowPath && canUpdateTask && taskId) {
|
|
@@ -55,7 +55,7 @@ jest.mock('nanoid', function () {
|
|
|
55
55
|
var nanoid = jest.requireActual('nanoid');
|
|
56
56
|
return __assign(__assign({}, nanoid), { nanoid: jest.fn() });
|
|
57
57
|
});
|
|
58
|
-
describe('customScript helpers tests
|
|
58
|
+
describe('customScript helpers tests', function () {
|
|
59
59
|
beforeAll(function () {
|
|
60
60
|
nanoid_1.nanoid.mockReturnValue('nanoid');
|
|
61
61
|
});
|
|
@@ -66,12 +66,12 @@ describe('customScript helpers tests ', function () {
|
|
|
66
66
|
var apiPath = '/nui/reltioAPI';
|
|
67
67
|
var reltioPath = 'https://tst-01.reltio.com/reltio';
|
|
68
68
|
var tenant = 'tenant';
|
|
69
|
-
describe('getWorkerURL tests
|
|
69
|
+
describe('getWorkerURL tests', function () {
|
|
70
70
|
it('should return correct worker url', function () {
|
|
71
71
|
expect((0, customScript_1.getWorkerURL)(uiPath, tenant)).toBe('http://localhost:3000/nui/worker_api.js');
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
|
-
describe('getRequestFakeUrl tests
|
|
74
|
+
describe('getRequestFakeUrl tests', function () {
|
|
75
75
|
it('should return correct fake url if not starts with apiPath', function () {
|
|
76
76
|
var url = '/entities';
|
|
77
77
|
expect((0, customScript_1.getRequestFakeUrl)(url, apiPath, reltioPath, tenant)).toBe('https://tst-01.reltio.com/reltio/api/tenant/entities');
|
|
@@ -81,13 +81,13 @@ describe('customScript helpers tests ', function () {
|
|
|
81
81
|
expect((0, customScript_1.getRequestFakeUrl)(url, apiPath, reltioPath, tenant)).toBe('https://tst-01.reltio.com/reltio/entities');
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
describe('getResponseFakeUrl tests
|
|
84
|
+
describe('getResponseFakeUrl tests', function () {
|
|
85
85
|
it('should return correct fake url', function () {
|
|
86
86
|
var url = '/nui/reltioAPI/entities';
|
|
87
87
|
expect((0, customScript_1.getResponseFakeUrl)(url, apiPath, reltioPath)).toBe('https://tst-01.reltio.com/reltio/entities');
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
-
describe('getProcessedTask tests
|
|
90
|
+
describe('getProcessedTask tests', function () {
|
|
91
91
|
it('should return same task if no url', function () {
|
|
92
92
|
var task = { action: mdm_sdk_1.CustomAction.REQUEST, params: {} };
|
|
93
93
|
expect((0, customScript_1.getProcessedTask)(task, apiPath, reltioPath, tenant)).toBe(task);
|
|
@@ -122,7 +122,7 @@ describe('customScript helpers tests ', function () {
|
|
|
122
122
|
expect((0, customScript_1.getProcessedTask)(task, apiPath, reltioPath, tenant)).toEqual(__assign(__assign({}, task), { params: __assign(__assign({}, task.params), { url: '/nui/reltioAPI/api/tenant/entities', validationUrl: task.params.url }) }));
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
|
-
describe('getFilesWithArrayBuffer tests
|
|
125
|
+
describe('getFilesWithArrayBuffer tests', function () {
|
|
126
126
|
var fileTxt = new File(['testTxt'], 'foo.txt', { type: 'text/plain' });
|
|
127
127
|
var filePng = new File(['testPng'], 'test.png', { type: 'png/image' });
|
|
128
128
|
var getResult = function (file) { return ({
|
|
@@ -177,7 +177,7 @@ describe('customScript helpers tests ', function () {
|
|
|
177
177
|
});
|
|
178
178
|
}); });
|
|
179
179
|
});
|
|
180
|
-
describe('isValidCustomScript tests
|
|
180
|
+
describe('isValidCustomScript tests', function () {
|
|
181
181
|
it('should return true if valid custom script', function () {
|
|
182
182
|
expect((0, customScript_1.isValidCustomScript)({
|
|
183
183
|
files: ['https://retlio.com/file.js'],
|
|
@@ -198,7 +198,7 @@ describe('customScript helpers tests ', function () {
|
|
|
198
198
|
})).toBe(false);
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
|
-
describe('resetHtml tests
|
|
201
|
+
describe('resetHtml tests', function () {
|
|
202
202
|
var worker = {};
|
|
203
203
|
var html = '<div>html</div>';
|
|
204
204
|
var innerText = 'test';
|
|
@@ -29,7 +29,8 @@ var useKeyboardNavigation = function (_a) {
|
|
|
29
29
|
var handleSelectFocusedItem = (0, react_1.useCallback)(function () {
|
|
30
30
|
if (!(0, ramda_1.isNil)(focusIndex)) {
|
|
31
31
|
var item = items[focusIndex].item;
|
|
32
|
-
!item.item.notSelectable
|
|
32
|
+
if (!item.item.notSelectable)
|
|
33
|
+
onSelectFocusedItem({ item: item.item, groupData: item });
|
|
33
34
|
}
|
|
34
35
|
}, [onSelectFocusedItem, items, focusIndex]);
|
|
35
36
|
var handleKeyDown = (0, react_1.useCallback)(function (event) {
|
|
@@ -52,7 +53,7 @@ var useKeyboardNavigation = function (_a) {
|
|
|
52
53
|
handleSelectFocusedItem();
|
|
53
54
|
break;
|
|
54
55
|
case 'Tab':
|
|
55
|
-
onClose
|
|
56
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event);
|
|
56
57
|
break;
|
|
57
58
|
default:
|
|
58
59
|
return;
|
|
@@ -62,7 +63,8 @@ var useKeyboardNavigation = function (_a) {
|
|
|
62
63
|
if (restoreFocusIndex.current) {
|
|
63
64
|
restoreFocusIndex.current = false;
|
|
64
65
|
var moveIndex = items.findIndex(function (listItem) { return listItem.item.moveTo; });
|
|
65
|
-
moveIndex > -1
|
|
66
|
+
if (moveIndex > -1)
|
|
67
|
+
setFocusIndex(moveIndex);
|
|
66
68
|
}
|
|
67
69
|
else {
|
|
68
70
|
setFocusIndex(null);
|
|
@@ -23,7 +23,8 @@ var useMarkAsNotMatchRequest = function (_a) {
|
|
|
23
23
|
.catch(onError)
|
|
24
24
|
.finally(function () {
|
|
25
25
|
onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
|
|
26
|
-
isMountedRef.current
|
|
26
|
+
if (isMountedRef.current)
|
|
27
|
+
setIsPending(false);
|
|
27
28
|
});
|
|
28
29
|
}, [dtssPath, entities, entity, isMountedRef, onFinishRequest, onStartRequest, onError, onSuccess, tenant]);
|
|
29
30
|
return { isPending: isPending, sendMarkAsNotMatchRequest: sendMarkAsNotMatchRequest };
|
|
@@ -7,8 +7,7 @@ exports.groupColumnsDataByMatchAttributes = exports.getMatchAttrColumns = export
|
|
|
7
7
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
8
8
|
var ramda_1 = require("ramda");
|
|
9
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
|
-
var
|
|
11
|
-
var getColumnsDataFromEntityAttributes = (0, ramda_1.pipe)((0, ramda_2.map)(function (attr) { return ({
|
|
10
|
+
var getColumnsDataFromEntityAttributes = (0, ramda_1.pipe)((0, ramda_1.map)(function (attr) { return ({
|
|
12
11
|
id: (0, mdm_sdk_1.attributeUriToSearchUri)(attr.uri),
|
|
13
12
|
label: (0, mdm_sdk_1.getLabel)(attr.label),
|
|
14
13
|
dataTypeDefinition: (0, mdm_sdk_1.getAttrDataTypeDefinition)(attr)
|
|
@@ -32,11 +31,11 @@ var isNestedForOneOfColumns = (0, ramda_1.curry)(function (columns, column) {
|
|
|
32
31
|
var isNestedAttrColumn = function (column) { return (0, mdm_sdk_1.isNested)(column.dataTypeDefinition); };
|
|
33
32
|
var isRelatedToColumns = function (columns) { return (0, ramda_1.either)((0, ramda_1.includes)(ramda_1.__, columns), isNestedForOneOfColumns(columns)); };
|
|
34
33
|
var getMatchAttrColumns = function (matchAttributes, columnsData) {
|
|
35
|
-
return (0, ramda_1.pipe)((0,
|
|
34
|
+
return (0, ramda_1.pipe)((0, ramda_1.reject)(isNestedAttrColumn), (0, ramda_1.filter)(isMatchAttrColumn(matchAttributes)))(columnsData);
|
|
36
35
|
};
|
|
37
36
|
exports.getMatchAttrColumns = getMatchAttrColumns;
|
|
38
37
|
var groupColumnsDataByMatchAttributes = function (matchAttributes, columnsData) {
|
|
39
|
-
var _a = (0, ramda_1.pipe)((0,
|
|
38
|
+
var _a = (0, ramda_1.pipe)((0, ramda_1.reject)(isNestedAttrColumn), (0, ramda_1.partition)(isMatchAttrColumn(matchAttributes)))(columnsData), matchAttrColumns = _a[0], otherColumns = _a[1];
|
|
40
39
|
if (matchAttrColumns.length) {
|
|
41
40
|
return [
|
|
42
41
|
{
|
|
@@ -32,7 +32,8 @@ var useMergeAllRequest = function (_a) {
|
|
|
32
32
|
.catch(onError)
|
|
33
33
|
.finally(function () {
|
|
34
34
|
onFinishRequest === null || onFinishRequest === void 0 ? void 0 : onFinishRequest();
|
|
35
|
-
isMountedRef.current
|
|
35
|
+
if (isMountedRef.current)
|
|
36
|
+
setIsPending(false);
|
|
36
37
|
});
|
|
37
38
|
}, [
|
|
38
39
|
dtssPath,
|
|
@@ -70,7 +70,6 @@ var createPagingSimulator = function (request) {
|
|
|
70
70
|
if (!shouldSendRequest) return [3 /*break*/, 2];
|
|
71
71
|
return [4 /*yield*/, request(requestParams)];
|
|
72
72
|
case 1:
|
|
73
|
-
// eslint-disable-next-line no-unused-vars
|
|
74
73
|
requestResponse = _b.sent();
|
|
75
74
|
previousValues = requestParams;
|
|
76
75
|
_b.label = 2;
|
|
@@ -125,7 +125,7 @@ var useSavedSearchesRequest = function (_a) {
|
|
|
125
125
|
return [3 /*break*/, 6];
|
|
126
126
|
case 5:
|
|
127
127
|
error_1 = _c.sent();
|
|
128
|
-
console.warn(error_1);
|
|
128
|
+
console.warn(error_1);
|
|
129
129
|
if (!(0, mdm_sdk_1.isAbortError)(error_1)) {
|
|
130
130
|
updateRequestState('loading', types_1.RequestStates.ERROR);
|
|
131
131
|
setData([]);
|
|
@@ -174,7 +174,12 @@ var useSavedSearchesRequest = function (_a) {
|
|
|
174
174
|
return [4 /*yield*/, (0, mdm_sdk_1.createSavedSearch)([__assign(__assign({}, savedSearch), { type: type })])];
|
|
175
175
|
case 2:
|
|
176
176
|
result = _a.sent();
|
|
177
|
-
page === 0
|
|
177
|
+
if (page === 0) {
|
|
178
|
+
loadSavedSearches();
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
setPage(0);
|
|
182
|
+
}
|
|
178
183
|
updateRequestState('creating', types_1.RequestStates.LOADED);
|
|
179
184
|
return [2 /*return*/, { success: true, result: result }];
|
|
180
185
|
case 3:
|
package/cjs/icons/AIPowered.d.ts
CHANGED
|
@@ -8,11 +8,10 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var jss_1 = require("jss");
|
|
9
9
|
var StylesProvider_1 = __importDefault(require("@mui/styles/StylesProvider"));
|
|
10
10
|
var styles_1 = require("@mui/material/styles");
|
|
11
|
-
var styles_2 = require("@mui/material/styles");
|
|
12
11
|
var TestStylesProvider = function (_a) {
|
|
13
12
|
var children = _a.children;
|
|
14
13
|
var jss = (0, jss_1.create)();
|
|
15
|
-
var muiTheme = (0,
|
|
14
|
+
var muiTheme = (0, styles_1.createTheme)({});
|
|
16
15
|
jss.use({
|
|
17
16
|
onProcessStyle: function (style) { return ({
|
|
18
17
|
display: style.display,
|
|
@@ -82,9 +82,9 @@ export type RenderRowCellProps = {
|
|
|
82
82
|
rowValue: RowValue;
|
|
83
83
|
cellIndex: number;
|
|
84
84
|
cell: RowCell;
|
|
85
|
-
CellValueRenderer: (props: unknown) =>
|
|
85
|
+
CellValueRenderer: (props: unknown) => React.ReactElement;
|
|
86
86
|
};
|
|
87
|
-
export type RenderRowCell = ({ columnIndex, columnData, rowIndex, rowValue, cellIndex, cell, CellValueRenderer }: RenderRowCellProps) =>
|
|
87
|
+
export type RenderRowCell = ({ columnIndex, columnData, rowIndex, rowValue, cellIndex, cell, CellValueRenderer }: RenderRowCellProps) => React.ReactElement;
|
|
88
88
|
export type OnFilter = (event: {
|
|
89
89
|
columnId: string;
|
|
90
90
|
filter: ColumnFilter;
|
package/cjs/types/index.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ export type ReactSelectMuiSkinProps = {
|
|
|
200
200
|
TextFieldProps?: TextFieldProps;
|
|
201
201
|
innerRef?: React.MutableRefObject<any>;
|
|
202
202
|
inputRef?: React.MutableRefObject<any>;
|
|
203
|
-
menuListFooter?:
|
|
203
|
+
menuListFooter?: React.ReactElement;
|
|
204
204
|
};
|
|
205
205
|
export type DropdownIndicatorWithMuiSkinProps<T> = DropdownIndicatorProps & {
|
|
206
206
|
selectProps: DropdownIndicatorProps['selectProps'] & ReactSelectMuiSkinProps;
|
|
@@ -85,7 +85,7 @@ describe('ActionsPanel tests', function () {
|
|
|
85
85
|
expect(screen.queryByTestId('testButton')).toBeInTheDocument();
|
|
86
86
|
expect(screen.queryByLabelText('More actions')).toBeInTheDocument();
|
|
87
87
|
});
|
|
88
|
-
it('should call onActionsMenuOpen, onActionsMenuClose
|
|
88
|
+
it('should call onActionsMenuOpen, onActionsMenuClose', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
89
|
var onActionsMenuOpenSpy, onActionsMenuCloseSpy, user;
|
|
90
90
|
return __generator(this, function (_a) {
|
|
91
91
|
switch (_a.label) {
|
|
@@ -24,7 +24,7 @@ var AttributeSelector = function (_a) {
|
|
|
24
24
|
values: []
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
onFilterAttributeChange
|
|
27
|
+
onFilterAttributeChange === null || onFilterAttributeChange === void 0 ? void 0 : onFilterAttributeChange(selectInfo);
|
|
28
28
|
}, [rowData, onFilterAttributeChange, filter, operator, changeFilter, id, addNewFilter]);
|
|
29
29
|
return (React.createElement(BasicAttributeSelector, { itemsGroups: attributeSelectorItemsGroups, ungroup: attributeSelectorItemsGroups.length < 2, single: true, value: attribute, getLabel: getSelectedAttributeLabel, onSelect: changeAttribute, onOpenPopup: attributeSelectorProps.onOpen }));
|
|
30
30
|
};
|
|
@@ -32,15 +32,15 @@ var AttributesFiltersButton = function (_a) {
|
|
|
32
32
|
}, [filtersProp, isOpen]);
|
|
33
33
|
var applyButtonHandler = useCallback(function () {
|
|
34
34
|
onChange(filters);
|
|
35
|
-
onApply
|
|
35
|
+
onApply === null || onApply === void 0 ? void 0 : onApply();
|
|
36
36
|
togglePopup();
|
|
37
37
|
}, [filters, onChange, onApply]);
|
|
38
38
|
var cancelButtonHandler = useCallback(function () {
|
|
39
|
-
onCancel
|
|
39
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
40
40
|
togglePopup();
|
|
41
41
|
}, [onCancel]);
|
|
42
42
|
var clearAllButtonHandler = useCallback(function () {
|
|
43
|
-
onClear
|
|
43
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
44
44
|
setFilters([]);
|
|
45
45
|
}, [onClear]);
|
|
46
46
|
return (React.createElement(React.Fragment, null,
|
|
@@ -117,7 +117,7 @@ describe('AttributesFiltersButton tests', function () {
|
|
|
117
117
|
expect(screen.getByRole('button')).toHaveClass('MuiButton-colorInherit');
|
|
118
118
|
expect(getMuiIconByName('FilterList')).not.toHaveClass('MuiSvgIcon-colorPrimary');
|
|
119
119
|
});
|
|
120
|
-
it('should close Popover after cancel
|
|
120
|
+
it('should close Popover after cancel backdrop clicking', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
121
121
|
var user, button;
|
|
122
122
|
return __generator(this, function (_a) {
|
|
123
123
|
switch (_a.label) {
|
|
@@ -208,7 +208,7 @@ describe('AttributesFiltersButton tests', function () {
|
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
}); });
|
|
211
|
-
it('should render children
|
|
211
|
+
it('should render children', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
212
212
|
var user;
|
|
213
213
|
return __generator(this, function (_a) {
|
|
214
214
|
switch (_a.label) {
|
|
@@ -15,14 +15,15 @@ import ReactResizeDetector from 'react-resize-detector';
|
|
|
15
15
|
import { debounce } from '@reltio/mdm-sdk';
|
|
16
16
|
import { useStyles } from './styles';
|
|
17
17
|
var AutoSizeList = function (_a) {
|
|
18
|
-
var _b
|
|
18
|
+
var _b;
|
|
19
|
+
var _c = _a.width, width = _c === void 0 ? 0 : _c, _d = _a.height, height = _d === void 0 ? 0 : _d, defaultItemSize = _a.defaultItemSize, data = _a.data, children = _a.children, itemKey = _a.itemKey, showNotMeasuredItems = _a.showNotMeasuredItems, listRefProp = _a.listRef;
|
|
19
20
|
var styles = useStyles();
|
|
20
21
|
var rowHeightsCache = useRef({});
|
|
21
22
|
var cacheRowHeight = function (key, height) {
|
|
22
23
|
var _a;
|
|
23
24
|
rowHeightsCache.current = __assign(__assign({}, rowHeightsCache.current), (_a = {}, _a[key] = height, _a));
|
|
24
25
|
};
|
|
25
|
-
var
|
|
26
|
+
var _e = useState({}), rowHeights = _e[0], setRowHeights = _e[1];
|
|
26
27
|
var applyRowHeights = useCallback(debounce(function () {
|
|
27
28
|
setRowHeights(__assign({}, rowHeightsCache.current));
|
|
28
29
|
}), []);
|
|
@@ -31,10 +32,9 @@ var AutoSizeList = function (_a) {
|
|
|
31
32
|
var getItemSize = function (index) { return rowHeights[getItemKey(index)] || defaultItemSize; };
|
|
32
33
|
var localListRef = useRef();
|
|
33
34
|
var listRef = listRefProp || localListRef;
|
|
34
|
-
listRef.current
|
|
35
|
-
var Row = useMemo(
|
|
36
|
-
|
|
37
|
-
function () {
|
|
35
|
+
(_b = listRef.current) === null || _b === void 0 ? void 0 : _b.resetAfterIndex(0, false);
|
|
36
|
+
var Row = useMemo(function () {
|
|
37
|
+
//eslint-disable-next-line
|
|
38
38
|
return function (_a) {
|
|
39
39
|
var data = _a.data, index = _a.index, style = _a.style;
|
|
40
40
|
var key = getItemKeyFromData(data, index);
|
|
@@ -59,8 +59,8 @@ describe('BooleanRadioEditor', function () {
|
|
|
59
59
|
it('should render two boolean editors with "Yes" and "No" labels', function () {
|
|
60
60
|
setUp();
|
|
61
61
|
expect(screen.getAllByRole('checkbox')).toHaveLength(2);
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
screen.getByLabelText('Yes');
|
|
63
|
+
screen.getByLabelText('No');
|
|
64
64
|
});
|
|
65
65
|
it('should have radio buttons behaviour', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
66
|
var checkboxes;
|
|
@@ -114,6 +114,23 @@ describe('useEditorContext tests', function () {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
}); });
|
|
117
|
+
it('should return getSuggestions which passes request error through', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
118
|
+
var error, fieldName, dataTypeDefinition, result;
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0:
|
|
122
|
+
error = { errorCode: 403, errorMessage: 'Access is denied' };
|
|
123
|
+
getFacetedAttributeData.mockRejectedValue(error);
|
|
124
|
+
fieldName = 'attributes.TextField';
|
|
125
|
+
dataTypeDefinition = { type: DataTypes.TYPE_TYPEAHEAD };
|
|
126
|
+
result = setUp({ fieldName: fieldName, dataTypeDefinition: dataTypeDefinition }).result;
|
|
127
|
+
return [4 /*yield*/, expect(result.current.getSuggestions('value', 100, 0)).rejects.toMatchObject(error)];
|
|
128
|
+
case 1:
|
|
129
|
+
_a.sent();
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); });
|
|
117
134
|
it('should return getLookups which dispatches an action for "Lookup" type', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
118
135
|
var response, fieldName, dataTypeDefinition, result;
|
|
119
136
|
return __generator(this, function (_a) {
|
|
@@ -88,7 +88,8 @@ export var DependentLookupEditor = function (_a) {
|
|
|
88
88
|
};
|
|
89
89
|
var handleFocus = function () {
|
|
90
90
|
var _a, _b, _c;
|
|
91
|
-
|
|
91
|
+
if (value)
|
|
92
|
+
(_c = (_b = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.select) === null || _b === void 0 ? void 0 : _b.inputRef) === null || _c === void 0 ? void 0 : _c.select();
|
|
92
93
|
};
|
|
93
94
|
var resetOptions = function () {
|
|
94
95
|
setPageNumber(1);
|
|
@@ -663,7 +663,7 @@ describe('DependentLookupEditor', function () {
|
|
|
663
663
|
}
|
|
664
664
|
});
|
|
665
665
|
}); });
|
|
666
|
-
|
|
666
|
+
it.skip('should call props.getLookups with default offset = 0 after LookupCode updated', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
667
667
|
var getLookups, wrapper, newLookupCode;
|
|
668
668
|
return __generator(this, function (_a) {
|
|
669
669
|
switch (_a.label) {
|
|
@@ -11,7 +11,7 @@ type Props<T> = {
|
|
|
11
11
|
menuId: string;
|
|
12
12
|
onMenuOpen?: () => void;
|
|
13
13
|
onMenuClose?: () => void;
|
|
14
|
-
MenuItemRenderer?: (props: any) =>
|
|
14
|
+
MenuItemRenderer?: (props: any) => React.ReactElement;
|
|
15
15
|
};
|
|
16
16
|
export declare function DropDownMenuButton<T = DropDownMenuItem>({ className, menuId, buttonComponent, buttonContent, menuItems, buttonProps, popoverProps, onMenuOpen, onMenuClose, MenuItemRenderer }: Props<T>): React.JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -25,7 +25,12 @@ export function DropDownMenuButton(_a) {
|
|
|
25
25
|
var buttonRef = useRef();
|
|
26
26
|
var _k = useState(false), isOpen = _k[0], setIsOpen = _k[1];
|
|
27
27
|
useDidUpdateEffect(function () {
|
|
28
|
-
|
|
28
|
+
if (isOpen) {
|
|
29
|
+
onMenuOpen();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
onMenuClose();
|
|
33
|
+
}
|
|
29
34
|
}, [isOpen]);
|
|
30
35
|
var handleToggle = useCallback(function (e) {
|
|
31
36
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
@@ -13,11 +13,6 @@ describe('DropDownSelector', function () {
|
|
|
13
13
|
expect(wrapper.prop('components').IndicatorSeparator.name).toEqual('EmptyStub');
|
|
14
14
|
expect(wrapper.prop('components').ClearIndicator.name).toEqual('EmptyStub');
|
|
15
15
|
});
|
|
16
|
-
it('should render Select if "getOptions" prop is not provided', function () {
|
|
17
|
-
var wrapper = shallow(React.createElement(DropDownSelector, { label: 'label' }));
|
|
18
|
-
expect(wrapper.find(ReactSelect).length).toBe(1);
|
|
19
|
-
expect(wrapper.find(AsyncReactSelect).length).toBe(0);
|
|
20
|
-
});
|
|
21
16
|
it('should render AsyncSelect if "getOptions" prop is provided', function () {
|
|
22
17
|
var wrapper = shallow(React.createElement(DropDownSelector, { getOptions: function () { }, label: 'label' }));
|
|
23
18
|
expect(wrapper.find(ReactSelect).length).toBe(0);
|
package/esm/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js
CHANGED
|
@@ -99,7 +99,7 @@ describe('EditModeAttribute', function () {
|
|
|
99
99
|
expect(component.find(NestedAttributeEditor).length).toBe(0);
|
|
100
100
|
expect(component.find(ReferenceAttributeEditor).length).toBe(0);
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
102
|
-
var showEmptyEditors = props.showEmptyEditors, onAddAttributes = props.onAddAttributes, lazy = props.lazy, crosswalks = props.crosswalks, errors = props.errors, filteredProps = __rest(props, ["showEmptyEditors", "onAddAttributes", "lazy", "crosswalks", "errors"]);
|
|
102
|
+
var showEmptyEditors = props.showEmptyEditors, onAddAttributes = props.onAddAttributes, lazy = props.lazy, crosswalks = props.crosswalks, errors = props.errors, filteredProps = __rest(props, ["showEmptyEditors", "onAddAttributes", "lazy", "crosswalks", "errors"]);
|
|
103
103
|
expect(component.find(SimpleAttributeEditor).props()).toEqual(__assign(__assign({}, filteredProps), { isReltioCrosswalk: true }));
|
|
104
104
|
expect(isReltioCrosswalk).toHaveBeenCalledWith(props.crosswalks, props.attributeValue);
|
|
105
105
|
});
|
|
@@ -105,12 +105,7 @@ describe('EditModeAttributesList tests', function () {
|
|
|
105
105
|
pagers.forEach(function (pager) {
|
|
106
106
|
expect(pager.prop('attributeType').hidden).toBeFalsy();
|
|
107
107
|
var shouldHasPaging = pager.prop('attributeType').uri === 'configuration/relationTypes/knowledge/attributes/Role';
|
|
108
|
-
|
|
109
|
-
expect(pager.prop('paging')).toBe(attributes.paging['configuration/relationTypes/knowledge/attributes/Role']);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
expect(pager.prop('paging')).toBeUndefined();
|
|
113
|
-
}
|
|
108
|
+
expect(pager.prop('paging')).toBe(shouldHasPaging ? attributes.paging['configuration/relationTypes/knowledge/attributes/Role'] : undefined);
|
|
114
109
|
});
|
|
115
110
|
});
|
|
116
111
|
it('should not add to more attr types single value types with non-empty attr value', function () {
|
|
@@ -160,6 +160,7 @@ describe('AttributeRenderer', function () {
|
|
|
160
160
|
expect(attribute.prop('crosswalks')).toBe(props.crosswalks);
|
|
161
161
|
expect(attribute.prop('errors')).toBe(props.errors);
|
|
162
162
|
expect(attribute.prop('ownError')).toBe(i === 0 ? props.errors[0] : undefined);
|
|
163
|
+
// eslint-disable-next-line jest/no-conditional-expect
|
|
163
164
|
expect(attribute.prop('onAddOneMore')).toEqual(isLast ? expect.any(Function) : null);
|
|
164
165
|
expect(attribute.prop('onDeleteAttribute')).toEqual(expect.any(Function));
|
|
165
166
|
expect(attribute.prop('onAddAttributes')).toBe(props.onAddAttributes);
|
|
@@ -171,6 +172,7 @@ describe('AttributeRenderer', function () {
|
|
|
171
172
|
var onAddOneMore = attribute.prop('onAddOneMore');
|
|
172
173
|
onAddOneMore();
|
|
173
174
|
});
|
|
175
|
+
// eslint-disable-next-line jest/no-conditional-expect
|
|
174
176
|
expect(props.onAddAttributes).toHaveBeenCalledWith([
|
|
175
177
|
{
|
|
176
178
|
parentUri: props.parentUri,
|