@reltio/components 1.4.2269 → 1.4.2272
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/ActionButton/ActionButton.d.ts +1 -1
- package/ActionButton/ActionButton.js +1 -1
- package/ActionsPanel/types.d.ts +1 -1
- package/AsyncReactSelect/AsyncReactSelect.d.ts +1 -5
- package/AttributesFiltersBuilder/AttributesFiltersBuilder.js +2 -1
- package/AttributesFiltersButton/AttributesFiltersButton.js +1 -1
- package/AttributesValuesEditor/AttributesValuesEditor.js +3 -1
- package/AutoSizeList/AutoSizeList.js +1 -1
- package/BasicAttributeSelector/BasicAttributeSelector.js +1 -1
- package/BasicView/BasicView.d.ts +2 -10
- package/BubbleChart/BubbleChart.d.ts +1 -4
- package/CloudChart/CloudChart.d.ts +1 -4
- package/CollaborationItem/CollaborationItem.js +1 -1
- package/CollaborationItem/components/Comment/Comment.js +1 -1
- package/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +2 -1
- package/CreatableReactSelect/CreatableReactSelect.d.ts +1 -5
- package/DataTypeValueEditor/useEditorContext.test.js +1 -1
- package/DependentLookupEditor/styles.d.ts +1 -1
- package/DropDownMenuButton/DropDownMenuButton.d.ts +1 -1
- package/DropDownMenuButton/DropDownMenuButton.js +4 -2
- package/DropDownSelector/DropDownSelector.js +2 -1
- package/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.d.ts +4 -2
- package/EditModeAttributesList/EditModeAttributesList.d.ts +3 -2
- package/EmptyState/styles.d.ts +1 -1
- package/EntitySelector/EntitySelector.js +3 -1
- package/EntityUriLink/EntityUriLink.d.ts +4 -2
- package/ErrorBoundary/ErrorBoundary.d.ts +1 -0
- package/ExpandedValueTooltip/ExpandedValueTooltip.js +1 -1
- package/FacetsSelector/components/AttributeSelectorPopup/AttributeSelectorPopup.js +1 -1
- package/GaugeChart/GaugeChart.js +1 -1
- package/HOCs/withAsyncMount/withAsyncMount.js +2 -1
- package/HOCs/withReactSelectMuiSkin/components/ReactSelectControl/ReactSelectControl.js +2 -1
- package/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
- package/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.d.ts +1 -5
- package/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.js +3 -6
- package/HierarchyNodeTitle/useEntityDetails.test.js +1 -1
- package/ImageActionsOverlay/styles.d.ts +1 -1
- package/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/ImageDetailsView/components/MetaInfo/useEditMetaInfo.d.ts +9 -2
- package/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/MapChart/MapChart.d.ts +5 -4
- package/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/MetadataTypesSelector/components/ListLabel/ListLabel.js +1 -1
- package/MoreAttributesButton/MoreAttributesButton.js +1 -1
- package/MultiSelect/MultiSelect.d.ts +22 -40
- package/MultiSelect/MultiSelect.js +8 -18
- package/MultiSelect/styles.d.ts +1 -1
- package/MultiValueSelector/MultiValueSelector.js +3 -1
- package/PieChart/PieChart.d.ts +1 -5
- package/Popper/Popper.d.ts +5 -9
- package/Popper/Popper.js +5 -5
- package/PopupWithArrow/PopupWithArrow.d.ts +2 -1
- package/ProfileBandNavigation/useSearchNavigation.test.js +123 -123
- package/ProfilesList/ProfilesList.d.ts +1 -1
- package/RCTree/RCTree.d.ts +3 -4
- package/RCTree/RCTree.js +10 -2
- package/RCTree/RCTreeSwitchRenderer.d.ts +4 -4
- package/RCTree/index.d.ts +1 -0
- package/RCTree/types.d.ts +2 -0
- package/RCTree/useDelayedDragEventCall.d.ts +4 -1
- package/RCTree/useDnd.js +20 -9
- package/ReactSelect/ReactSelect.d.ts +1 -5
- package/ReactSortableTree/ReactSortableTree.js +0 -2
- package/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.d.ts +36 -64
- package/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.js +8 -18
- package/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.d.ts +4 -10
- package/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.js +1 -5
- package/ReactSortableTree/components/TreeNode/TreeNode.d.ts +23 -37
- package/ReactSortableTree/components/TreeNode/TreeNode.js +4 -10
- package/ReltioGridLayout/ReltioGridLayout.js +1 -1
- package/ReltioGridLayout/ReltioGridLayout.test.js +3 -3
- package/ResizablePanes/ResizablePanes.js +1 -1
- package/RowCellAutoSizer/RowCellAutoSizer.js +1 -1
- package/SegmentIdLink/SegmentIdLink.d.ts +4 -2
- package/SidePanelEmptyState/styles.d.ts +1 -1
- package/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +6 -11
- package/SimpleAttributeEditor/styles.d.ts +1 -1
- package/SimpleAttributeEditor/useAutopopulationContextValue.test.js +1 -1
- package/SimpleDropDownSelector/styles.d.ts +1 -1
- package/SmallIconButton/SmallIconButton.d.ts +4 -2
- package/SyncedValueHeight/ValueHeightReporter.js +1 -1
- package/UploadFileButton/components/UploadMode/UploadMode.js +1 -1
- package/UserSelector/UserSelector.js +1 -1
- package/VirtualGroupedList/useScrollToFocusItem.d.ts +4 -1
- package/VirtualGroupedList/useScrollToFocusItem.test.js +1 -1
- package/cjs/ActionButton/ActionButton.d.ts +1 -1
- package/cjs/ActionButton/ActionButton.js +1 -1
- package/cjs/ActionsPanel/types.d.ts +1 -1
- package/cjs/AsyncReactSelect/AsyncReactSelect.d.ts +1 -5
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +2 -1
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.js +1 -1
- package/cjs/AttributesValuesEditor/AttributesValuesEditor.js +3 -1
- package/cjs/AutoSizeList/AutoSizeList.js +1 -1
- package/cjs/BasicAttributeSelector/BasicAttributeSelector.js +1 -1
- package/cjs/BasicView/BasicView.d.ts +2 -10
- package/cjs/BubbleChart/BubbleChart.d.ts +1 -4
- package/cjs/CloudChart/CloudChart.d.ts +1 -4
- package/cjs/CollaborationItem/CollaborationItem.js +1 -1
- package/cjs/CollaborationItem/components/Comment/Comment.js +1 -1
- package/cjs/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +2 -1
- package/cjs/CreatableReactSelect/CreatableReactSelect.d.ts +1 -5
- package/cjs/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/cjs/DependentLookupEditor/styles.d.ts +1 -1
- package/cjs/DropDownMenuButton/DropDownMenuButton.d.ts +1 -1
- package/cjs/DropDownMenuButton/DropDownMenuButton.js +4 -2
- package/cjs/DropDownSelector/DropDownSelector.js +2 -1
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.d.ts +4 -2
- package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +3 -2
- package/cjs/EmptyState/styles.d.ts +1 -1
- package/cjs/EntitySelector/EntitySelector.js +3 -1
- package/cjs/EntityUriLink/EntityUriLink.d.ts +4 -2
- package/cjs/ErrorBoundary/ErrorBoundary.d.ts +1 -0
- package/cjs/ExpandedValueTooltip/ExpandedValueTooltip.js +1 -1
- package/cjs/FacetsSelector/components/AttributeSelectorPopup/AttributeSelectorPopup.js +1 -1
- package/cjs/GaugeChart/GaugeChart.js +1 -1
- package/cjs/HOCs/withAsyncMount/withAsyncMount.js +2 -1
- package/cjs/HOCs/withReactSelectMuiSkin/components/ReactSelectControl/ReactSelectControl.js +2 -1
- package/cjs/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
- package/cjs/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.d.ts +1 -5
- package/cjs/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.js +3 -6
- package/cjs/HierarchyNodeTitle/useEntityDetails.test.js +18 -18
- package/cjs/ImageActionsOverlay/styles.d.ts +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/cjs/ImageDetailsView/components/MetaInfo/useEditMetaInfo.d.ts +9 -2
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/cjs/MapChart/MapChart.d.ts +5 -4
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.js +1 -1
- package/cjs/MoreAttributesButton/MoreAttributesButton.js +1 -1
- package/cjs/MultiSelect/MultiSelect.d.ts +22 -40
- package/cjs/MultiSelect/MultiSelect.js +7 -17
- package/cjs/MultiSelect/styles.d.ts +1 -1
- package/cjs/MultiValueSelector/MultiValueSelector.js +3 -1
- package/cjs/PieChart/PieChart.d.ts +1 -5
- package/cjs/Popper/Popper.d.ts +5 -9
- package/cjs/Popper/Popper.js +5 -5
- package/cjs/PopupWithArrow/PopupWithArrow.d.ts +2 -1
- package/cjs/ProfileBandNavigation/useSearchNavigation.test.js +177 -177
- package/cjs/ProfilesList/ProfilesList.d.ts +1 -1
- package/cjs/RCTree/RCTree.d.ts +3 -4
- package/cjs/RCTree/RCTree.js +10 -2
- package/cjs/RCTree/RCTreeSwitchRenderer.d.ts +4 -4
- package/cjs/RCTree/index.d.ts +1 -0
- package/cjs/RCTree/types.d.ts +2 -0
- package/cjs/RCTree/useDelayedDragEventCall.d.ts +4 -1
- package/cjs/RCTree/useDnd.js +19 -8
- package/cjs/ReactSelect/ReactSelect.d.ts +1 -5
- package/cjs/ReactSortableTree/ReactSortableTree.js +0 -2
- package/cjs/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.d.ts +36 -64
- package/cjs/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.js +8 -18
- package/cjs/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.d.ts +4 -10
- package/cjs/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.js +1 -5
- package/cjs/ReactSortableTree/components/TreeNode/TreeNode.d.ts +23 -37
- package/cjs/ReactSortableTree/components/TreeNode/TreeNode.js +4 -10
- package/cjs/ReltioGridLayout/ReltioGridLayout.js +1 -1
- package/cjs/ReltioGridLayout/ReltioGridLayout.test.js +3 -3
- package/cjs/ResizablePanes/ResizablePanes.js +1 -1
- package/cjs/RowCellAutoSizer/RowCellAutoSizer.js +1 -1
- package/cjs/SegmentIdLink/SegmentIdLink.d.ts +4 -2
- package/cjs/SidePanelEmptyState/styles.d.ts +1 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +6 -11
- package/cjs/SimpleAttributeEditor/styles.d.ts +1 -1
- package/cjs/SimpleAttributeEditor/useAutopopulationContextValue.test.js +2 -2
- package/cjs/SimpleDropDownSelector/styles.d.ts +1 -1
- package/cjs/SmallIconButton/SmallIconButton.d.ts +4 -2
- package/cjs/SyncedValueHeight/ValueHeightReporter.js +1 -1
- package/cjs/UploadFileButton/components/UploadMode/UploadMode.js +1 -1
- package/cjs/UserSelector/UserSelector.js +1 -1
- package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +4 -1
- package/cjs/VirtualGroupedList/useScrollToFocusItem.test.js +5 -5
- package/cjs/contexts/AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js +2 -2
- package/cjs/contexts/ReloadDataContext/ReloadDataContext.spec.js +4 -4
- package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +10 -3
- package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +11 -6
- package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +15 -10
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +11 -6
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +26 -26
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +12 -12
- package/cjs/features/crosswalks/hooks/useModifiedEntity.js +4 -4
- package/cjs/features/crosswalks/hooks/useModifiedEntity.test.js +17 -17
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +17 -28
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +10 -10
- package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +3 -3
- package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +4 -4
- package/cjs/features/graph/hooks/useLoopRenderer.test.js +3 -3
- package/cjs/features/graph/hooks/useSigmaCustomRenderers.test.js +28 -28
- package/cjs/features/history/HistoryFilterButton/HistoryFilterButton.js +1 -1
- package/cjs/features/history/hooks/useHistory.test.js +36 -36
- package/cjs/features/history/hooks/useHistoryDiff.test.js +2 -2
- package/cjs/features/history/hooks/useHistoryEnabled.test.js +2 -2
- package/cjs/features/history/hooks/useHistorySlice.test.js +8 -8
- package/cjs/features/history/hooks/useHistoryTree.test.js +2 -2
- package/cjs/features/workflow/AddWorkflowDialog/styles.d.ts +1 -1
- package/cjs/features/workflow/helpers/dcr.js +15 -14
- package/cjs/features/workflow/hooks/useChangeRequest.test.js +7 -7
- package/cjs/features/workflow/hooks/useWorkflowCheckPermission.test.js +2 -2
- package/cjs/features/workflow/hooks/useWorkflowColor.test.js +2 -2
- package/cjs/helpers/customScript.test.js +3 -3
- package/cjs/hooks/useAPI/useAPI.js +2 -2
- package/cjs/hooks/useAPI/useAPI.test.js +134 -134
- package/cjs/hooks/useChangedAttributes/useChangedAttributes.js +2 -2
- package/cjs/hooks/useCollaboration/useCollaboration.d.ts +47 -9
- package/cjs/hooks/useCollaboration/useCollaboration.js +10 -13
- package/cjs/hooks/useCollaboration/useCollaboration.test.js +55 -54
- package/cjs/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +8 -8
- package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +10 -10
- package/cjs/hooks/useConfigPermissions/useConfigPermissions.test.js +2 -2
- package/cjs/hooks/useCustomScripts/useCustomScripts.test.js +25 -25
- package/cjs/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +1 -1
- package/cjs/hooks/useEditableConnection/useEditableConnection.test.js +2 -2
- package/cjs/hooks/useFilterAutoFocus/useFilterAutoFocus.d.ts +3 -3
- package/cjs/hooks/useHiddenAttributes/useHiddenAttributes.test.js +2 -2
- package/cjs/hooks/useHtmlSanitizer/useHtmlSanitizer.test.js +2 -2
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +1 -1
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.test.js +3 -3
- package/cjs/hooks/useMatchesLoader/useMatchesLoader.test.js +24 -16
- package/cjs/hooks/usePrevious/usePrevious.js +1 -1
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.test.js +5 -5
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.test.js +50 -50
- package/cjs/hooks/useSavedSearchesRequest/useSavedSearchesRequest.test.js +36 -36
- package/cjs/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +20 -16
- package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +3 -3
- package/cjs/hooks/useUsers/useUsers.test.js +14 -15
- package/cjs/hooks/useWhyDidYouUpdate/useWhyDidYouUpdate.js +1 -1
- package/cjs/test-utils/dndKit/DndContextComponent.js +3 -0
- package/cjs/test-utils/dndKit/index.d.ts +1 -0
- package/cjs/test-utils/dndKit/useDndMonitorProvider.d.ts +4 -1
- package/cjs/test-utils/dndKit/useDraggable.d.ts +1 -0
- package/cjs/test-utils/dndKit/useDraggable.js +8 -1
- package/cjs/test-utils/index.d.ts +1 -1
- package/cjs/test-utils/index.js +4 -1
- package/cjs/test-utils/mockStoreHooks.d.ts +4 -0
- package/cjs/test-utils/mockStoreHooks.js +21 -0
- package/cjs/utils/withChildrenProp.d.ts +10 -0
- package/cjs/utils/withChildrenProp.js +13 -0
- package/contexts/AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js +1 -1
- package/contexts/ReloadDataContext/ReloadDataContext.spec.js +1 -1
- package/features/activity-log/ActivityFilterButton/ActivityFilterButton.js +1 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +11 -4
- package/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +11 -6
- package/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +15 -10
- package/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +11 -6
- package/features/crosswalks/hooks/useAttributeActions.test.js +1 -1
- package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -1
- package/features/crosswalks/hooks/useModifiedEntity.js +4 -4
- package/features/crosswalks/hooks/useModifiedEntity.test.js +1 -1
- package/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +14 -25
- package/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +1 -1
- package/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +1 -1
- package/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +1 -1
- package/features/graph/hooks/useLoopRenderer.test.js +1 -1
- package/features/graph/hooks/useSigmaCustomRenderers.test.js +1 -1
- package/features/history/HistoryFilterButton/HistoryFilterButton.js +1 -1
- package/features/history/hooks/useHistory.test.js +1 -1
- package/features/history/hooks/useHistoryDiff.test.js +1 -1
- package/features/history/hooks/useHistoryEnabled.test.js +1 -1
- package/features/history/hooks/useHistorySlice.test.js +1 -1
- package/features/history/hooks/useHistoryTree.test.js +1 -1
- package/features/workflow/AddWorkflowDialog/styles.d.ts +1 -1
- package/features/workflow/helpers/dcr.js +15 -14
- package/features/workflow/hooks/useChangeRequest.test.js +1 -1
- package/features/workflow/hooks/useWorkflowCheckPermission.test.js +1 -1
- package/features/workflow/hooks/useWorkflowColor.test.js +1 -1
- package/helpers/customScript.test.js +1 -1
- package/hooks/useAPI/useAPI.js +2 -2
- package/hooks/useAPI/useAPI.test.js +44 -44
- package/hooks/useChangedAttributes/useChangedAttributes.js +2 -2
- package/hooks/useCollaboration/useCollaboration.d.ts +47 -9
- package/hooks/useCollaboration/useCollaboration.js +10 -13
- package/hooks/useCollaboration/useCollaboration.test.js +3 -2
- package/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -1
- package/hooks/useConfigPermissions/useConfigPermissions.test.js +1 -1
- package/hooks/useCustomScripts/useCustomScripts.test.js +11 -11
- package/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +1 -1
- package/hooks/useEditableConnection/useEditableConnection.test.js +1 -1
- package/hooks/useFilterAutoFocus/useFilterAutoFocus.d.ts +3 -3
- package/hooks/useHiddenAttributes/useHiddenAttributes.test.js +1 -1
- package/hooks/useHtmlSanitizer/useHtmlSanitizer.test.js +1 -1
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +1 -1
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.test.js +1 -1
- package/hooks/useMatchesLoader/useMatchesLoader.test.js +23 -15
- package/hooks/usePrevious/usePrevious.js +1 -1
- package/hooks/useReadableSearchState/useReadableSearchState.test.js +3 -3
- package/hooks/useRelationsLoader/useRelationsLoader.test.js +38 -38
- package/hooks/useSavedSearchesRequest/useSavedSearchesRequest.test.js +1 -1
- package/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +7 -3
- package/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/hooks/useUsers/useUsers.test.js +12 -13
- package/hooks/useWhyDidYouUpdate/useWhyDidYouUpdate.js +1 -1
- package/package.json +5 -6
- package/test-utils/dndKit/DndContextComponent.js +3 -0
- package/test-utils/dndKit/index.d.ts +1 -0
- package/test-utils/dndKit/useDndMonitorProvider.d.ts +4 -1
- package/test-utils/dndKit/useDraggable.d.ts +1 -0
- package/test-utils/dndKit/useDraggable.js +8 -1
- package/test-utils/index.d.ts +1 -1
- package/test-utils/index.js +1 -0
- package/test-utils/mockStoreHooks.d.ts +4 -0
- package/test-utils/mockStoreHooks.js +16 -0
- package/utils/withChildrenProp.d.ts +10 -0
- package/utils/withChildrenProp.js +9 -0
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import sanitizeHtml from 'sanitize-html';
|
|
13
|
-
import { renderHook } from '@testing-library/react
|
|
13
|
+
import { renderHook } from '@testing-library/react';
|
|
14
14
|
import { sanitizerOptions } from './helpers';
|
|
15
15
|
import { useHtmlSanitizer } from './useHtmlSanitizer';
|
|
16
16
|
var getHookResult = function () {
|
|
@@ -15,6 +15,6 @@ type Props<T, S> = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const useKeyboardNavigation: <T, S>({ items, open, onSelectFocusedItem, selectedItems, onClose }: Props<T, S>) => {
|
|
17
17
|
focusIndex: number;
|
|
18
|
-
handleKeyDown: (event: React.KeyboardEvent) =>
|
|
18
|
+
handleKeyDown: (event: React.KeyboardEvent) => false;
|
|
19
19
|
};
|
|
20
20
|
export {};
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { renderHook, act } from '@testing-library/react
|
|
12
|
+
import { renderHook, act } from '@testing-library/react';
|
|
13
13
|
import { useKeyboardNavigation } from './useKeyboardNavigation';
|
|
14
14
|
describe('useKeyboardNavigation hook', function () {
|
|
15
15
|
var items = [
|
|
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { getTransitiveMatches, getMatchesForDataTenantEntity } from '@reltio/mdm-sdk';
|
|
50
|
-
import { renderHook } from '@testing-library/react
|
|
50
|
+
import { renderHook, waitFor } from '@testing-library/react';
|
|
51
51
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
52
52
|
import { useMatchesLoader } from './useMatchesLoader';
|
|
53
53
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getTransitiveMatches: jest.fn(), getMatchesForDataTenantEntity: jest.fn(), isDataTenantEntity: jest.fn().mockImplementation(function (entity) { return !!entity.dataTenant; }) })); });
|
|
@@ -55,7 +55,7 @@ jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.re
|
|
|
55
55
|
* useMatchesLoader runs a useEffect that calls getMatches() on mount. getMatches() is async:
|
|
56
56
|
* it calls the SDK (getTransitiveMatches / getMatchesForDataTenantEntity), and when the
|
|
57
57
|
* promise resolves, it updates the state (setTotal, setMatches, setEntitiesMap), which triggers
|
|
58
|
-
* a re-render.
|
|
58
|
+
* a re-render. waitFor() waits for that next render, so assertions run after
|
|
59
59
|
* the async load has completed and we avoid races.
|
|
60
60
|
*/
|
|
61
61
|
describe('Test useMatchesLoader hook', function () {
|
|
@@ -105,12 +105,14 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
105
105
|
});
|
|
106
106
|
describe('Data masking behaviour', function () {
|
|
107
107
|
it('should call transitive endpoint without options if metadata doesnt have masked attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
-
var
|
|
108
|
+
var result;
|
|
109
109
|
return __generator(this, function (_a) {
|
|
110
110
|
switch (_a.label) {
|
|
111
111
|
case 0:
|
|
112
|
-
|
|
113
|
-
return [4 /*yield*/,
|
|
112
|
+
result = setUp().result;
|
|
113
|
+
return [4 /*yield*/, waitFor(function () {
|
|
114
|
+
expect(result.current).toBeDefined();
|
|
115
|
+
})];
|
|
114
116
|
case 1:
|
|
115
117
|
_a.sent();
|
|
116
118
|
expect(getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
@@ -120,14 +122,16 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
120
122
|
});
|
|
121
123
|
}); });
|
|
122
124
|
it('should call transitive endpoint with sendMasked option if metadata has masked attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
123
|
-
var metadata,
|
|
125
|
+
var metadata, result;
|
|
124
126
|
return __generator(this, function (_a) {
|
|
125
127
|
switch (_a.label) {
|
|
126
128
|
case 0:
|
|
127
129
|
metadata = getMetadata();
|
|
128
130
|
metadata.entityTypes[0].attributes[0].masking = { regexPattern: '.{4}$' };
|
|
129
|
-
|
|
130
|
-
return [4 /*yield*/,
|
|
131
|
+
result = setUp({ mdmValues: { metadata: metadata } }).result;
|
|
132
|
+
return [4 /*yield*/, waitFor(function () {
|
|
133
|
+
expect(result.current).toBeDefined();
|
|
134
|
+
})];
|
|
131
135
|
case 1:
|
|
132
136
|
_a.sent();
|
|
133
137
|
expect(getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
@@ -137,14 +141,16 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
137
141
|
});
|
|
138
142
|
}); });
|
|
139
143
|
it('should not add sendMasked or showAccess option if showMasking configuration property is false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
140
|
-
var metadata,
|
|
144
|
+
var metadata, result;
|
|
141
145
|
return __generator(this, function (_a) {
|
|
142
146
|
switch (_a.label) {
|
|
143
147
|
case 0:
|
|
144
148
|
metadata = getMetadata();
|
|
145
149
|
metadata.entityTypes[0].attributes[0].masking = { regexPattern: '.{4}$' };
|
|
146
|
-
|
|
147
|
-
return [4 /*yield*/,
|
|
150
|
+
result = setUp({ mdmValues: { metadata: metadata, showMasking: false } }).result;
|
|
151
|
+
return [4 /*yield*/, waitFor(function () {
|
|
152
|
+
expect(result.current).toBeDefined();
|
|
153
|
+
})];
|
|
148
154
|
case 1:
|
|
149
155
|
_a.sent();
|
|
150
156
|
expect(getTransitiveMatches).toHaveBeenCalledTimes(1);
|
|
@@ -155,7 +161,7 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
155
161
|
}); });
|
|
156
162
|
});
|
|
157
163
|
it('should pass dataTenants to getMatchesForDataTenantEntity when entity has dataTenant', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
158
|
-
var dataTenantEntity, dataTenants,
|
|
164
|
+
var dataTenantEntity, dataTenants, result;
|
|
159
165
|
return __generator(this, function (_a) {
|
|
160
166
|
switch (_a.label) {
|
|
161
167
|
case 0:
|
|
@@ -166,11 +172,13 @@ describe('Test useMatchesLoader hook', function () {
|
|
|
166
172
|
attributes: {}
|
|
167
173
|
};
|
|
168
174
|
dataTenants = [{ id: 'tenantId4', name: 'tenant', idBuilderSubscription: false }];
|
|
169
|
-
|
|
175
|
+
result = setUp({
|
|
170
176
|
props: __assign(__assign({}, defaultProps), { entity: dataTenantEntity }),
|
|
171
177
|
mdmValues: __assign(__assign({}, defaultMdmValues), { dataTenantsWithIdBuilder: dataTenants })
|
|
172
|
-
}).
|
|
173
|
-
return [4 /*yield*/,
|
|
178
|
+
}).result;
|
|
179
|
+
return [4 /*yield*/, waitFor(function () {
|
|
180
|
+
expect(result.current).toBeDefined();
|
|
181
|
+
})];
|
|
174
182
|
case 1:
|
|
175
183
|
_a.sent();
|
|
176
184
|
expect(getMatchesForDataTenantEntity).toHaveBeenCalledTimes(1);
|
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
|
-
import { renderHook } from '@testing-library/react
|
|
49
|
+
import { renderHook, waitFor } from '@testing-library/react';
|
|
50
50
|
import { SearchOperator, buildReadableQueryToString, buildReadableQuery, getKeywordFromSearchState, getUnresolvedLookupsListFromSearchGroups, resolveLookupsList, getGroupsFromSearchState } from '@reltio/mdm-sdk';
|
|
51
51
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
52
52
|
import { useReadableSearchState } from './useReadableSearchState';
|
|
@@ -117,7 +117,7 @@ describe('useReadableSearchState tests', function () {
|
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
it('should resolve unresolved lookups', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
-
var unresolvedLookups, lookupsList, searchState
|
|
120
|
+
var unresolvedLookups, lookupsList, searchState;
|
|
121
121
|
return __generator(this, function (_a) {
|
|
122
122
|
switch (_a.label) {
|
|
123
123
|
case 0:
|
|
@@ -129,7 +129,7 @@ describe('useReadableSearchState tests', function () {
|
|
|
129
129
|
getUnresolvedLookupsListFromSearchGroups.mockReturnValueOnce(unresolvedLookups);
|
|
130
130
|
resolveLookupsList.mockResolvedValue(lookupsList);
|
|
131
131
|
searchState = { version: '2.0', facets: [] };
|
|
132
|
-
|
|
132
|
+
setUp(searchState);
|
|
133
133
|
expect(resolveLookupsList).toHaveBeenCalledWith([
|
|
134
134
|
{ type: 'COUNTRY_CD', codeValue: 'RU' },
|
|
135
135
|
{ type: 'COUNTRY_CD', codeValue: 'IT' }
|
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React, { useState } from 'react';
|
|
49
|
-
import { renderHook, act } from '@testing-library/react
|
|
49
|
+
import { renderHook, act, waitFor } from '@testing-library/react';
|
|
50
50
|
import { ActivityFilter, Mode, getRelationsForEntity } from '@reltio/mdm-sdk';
|
|
51
51
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
52
52
|
import { useRelationsLoader } from './useRelationsLoader';
|
|
@@ -144,20 +144,20 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
144
144
|
jest.clearAllMocks();
|
|
145
145
|
});
|
|
146
146
|
it('should call getRelationsForEntity if reload is called', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
|
-
var metadata, mdmValues,
|
|
148
|
-
return __generator(this, function (
|
|
149
|
-
switch (
|
|
147
|
+
var metadata, mdmValues, result;
|
|
148
|
+
return __generator(this, function (_a) {
|
|
149
|
+
switch (_a.label) {
|
|
150
150
|
case 0:
|
|
151
151
|
metadata = createMetadata({ entityAccess: ['DELETE', 'READ', 'CREATE', 'UPDATE'] });
|
|
152
152
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
153
|
-
|
|
153
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
154
154
|
act(function () {
|
|
155
155
|
result.current.reload();
|
|
156
156
|
});
|
|
157
157
|
expect(getRelationsForEntity).toHaveBeenCalled();
|
|
158
158
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
159
159
|
case 1:
|
|
160
|
-
|
|
160
|
+
_a.sent();
|
|
161
161
|
expect(mdmActions.relationsLoaded).toHaveBeenCalledWith({
|
|
162
162
|
id: defaultConfig.id,
|
|
163
163
|
connections: connections,
|
|
@@ -169,13 +169,13 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
169
169
|
});
|
|
170
170
|
}); });
|
|
171
171
|
it('should call reload on change lastLoadedTime', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
|
-
var metadata, mdmValues, _a, result,
|
|
172
|
+
var metadata, mdmValues, _a, result, updateMdmValues, reloadFirst, reloadNext;
|
|
173
173
|
return __generator(this, function (_b) {
|
|
174
174
|
switch (_b.label) {
|
|
175
175
|
case 0:
|
|
176
176
|
metadata = createMetadata({ entityAccess: ['DELETE', 'READ', 'CREATE', 'UPDATE'] });
|
|
177
177
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
178
|
-
_a = setUp({ mdmValues: mdmValues }), result = _a.result,
|
|
178
|
+
_a = setUp({ mdmValues: mdmValues }), result = _a.result, updateMdmValues = _a.updateMdmValues;
|
|
179
179
|
reloadFirst = result.current.reload;
|
|
180
180
|
act(function () {
|
|
181
181
|
updateMdmValues(function (prev) { return (__assign(__assign({}, prev), { profileLastLoadedTime: 1674037143200 })); });
|
|
@@ -192,9 +192,9 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
192
192
|
}); });
|
|
193
193
|
describe('security related', function () {
|
|
194
194
|
it('should filter out relations current user does not have access to', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
195
|
-
var metadata, config, props, mdmValues,
|
|
196
|
-
return __generator(this, function (
|
|
197
|
-
switch (
|
|
195
|
+
var metadata, config, props, mdmValues, result;
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
switch (_a.label) {
|
|
198
198
|
case 0:
|
|
199
199
|
metadata = createMetadata({ entityAccess: ['DELETE', 'READ', 'CREATE', 'UPDATE'] });
|
|
200
200
|
config = {
|
|
@@ -213,7 +213,7 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
213
213
|
};
|
|
214
214
|
props = __assign(__assign({}, defaultProps), { config: config });
|
|
215
215
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
216
|
-
|
|
216
|
+
result = setUp({ props: props, mdmValues: mdmValues }).result;
|
|
217
217
|
expect(getRelationsForEntity).toHaveBeenCalledWith('123', [
|
|
218
218
|
{
|
|
219
219
|
activeness: { entity: 'all', relation: 'all' },
|
|
@@ -228,15 +228,15 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
228
228
|
], { searchByOv: false });
|
|
229
229
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
230
230
|
case 1:
|
|
231
|
-
|
|
231
|
+
_a.sent();
|
|
232
232
|
return [2 /*return*/];
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
}); });
|
|
236
236
|
it('should filter out relations if current user does not have access to on the nextEntry', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
237
|
-
var metadata, config, props, mdmValues,
|
|
238
|
-
return __generator(this, function (
|
|
239
|
-
switch (
|
|
237
|
+
var metadata, config, props, mdmValues, result;
|
|
238
|
+
return __generator(this, function (_a) {
|
|
239
|
+
switch (_a.label) {
|
|
240
240
|
case 0:
|
|
241
241
|
metadata = createMetadata();
|
|
242
242
|
config = {
|
|
@@ -272,7 +272,7 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
272
272
|
};
|
|
273
273
|
props = __assign(__assign({}, defaultProps), { config: config });
|
|
274
274
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
275
|
-
|
|
275
|
+
result = setUp({ props: props, mdmValues: mdmValues }).result;
|
|
276
276
|
expect(getRelationsForEntity).toHaveBeenCalledWith('123', [
|
|
277
277
|
{
|
|
278
278
|
activeness: { entity: 'all', relation: 'all' },
|
|
@@ -297,15 +297,15 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
297
297
|
], { searchByOv: false });
|
|
298
298
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
299
299
|
case 1:
|
|
300
|
-
|
|
300
|
+
_a.sent();
|
|
301
301
|
return [2 /*return*/];
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
}); });
|
|
305
305
|
it('should not make a request if all entity types are filtered out on nextEntry', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
306
|
-
var metadata, config, props, mdmValues,
|
|
307
|
-
return __generator(this, function (
|
|
308
|
-
switch (
|
|
306
|
+
var metadata, config, props, mdmValues, result;
|
|
307
|
+
return __generator(this, function (_a) {
|
|
308
|
+
switch (_a.label) {
|
|
309
309
|
case 0:
|
|
310
310
|
metadata = createMetadata();
|
|
311
311
|
config = {
|
|
@@ -341,19 +341,19 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
341
341
|
};
|
|
342
342
|
props = __assign(__assign({}, defaultProps), { config: config });
|
|
343
343
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
344
|
-
|
|
344
|
+
result = setUp({ props: props, mdmValues: mdmValues }).result;
|
|
345
345
|
expect(getRelationsForEntity).not.toHaveBeenCalled();
|
|
346
346
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
347
347
|
case 1:
|
|
348
|
-
|
|
348
|
+
_a.sent();
|
|
349
349
|
return [2 /*return*/];
|
|
350
350
|
}
|
|
351
351
|
});
|
|
352
352
|
}); });
|
|
353
353
|
it('should not make a request if all entity types are filtered out', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
354
|
-
var metadata, config, props, mdmValues,
|
|
355
|
-
return __generator(this, function (
|
|
356
|
-
switch (
|
|
354
|
+
var metadata, config, props, mdmValues, result;
|
|
355
|
+
return __generator(this, function (_a) {
|
|
356
|
+
switch (_a.label) {
|
|
357
357
|
case 0:
|
|
358
358
|
metadata = createMetadata();
|
|
359
359
|
config = {
|
|
@@ -375,19 +375,19 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
375
375
|
};
|
|
376
376
|
props = __assign(__assign({}, defaultProps), { config: config });
|
|
377
377
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
378
|
-
|
|
378
|
+
result = setUp({ props: props, mdmValues: mdmValues }).result;
|
|
379
379
|
expect(getRelationsForEntity).not.toHaveBeenCalled();
|
|
380
380
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
381
381
|
case 1:
|
|
382
|
-
|
|
382
|
+
_a.sent();
|
|
383
383
|
return [2 /*return*/];
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
386
|
}); });
|
|
387
387
|
it('should make a request if entity types are not specified in config.content', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
388
|
-
var metadata, config, props, mdmValues,
|
|
389
|
-
return __generator(this, function (
|
|
390
|
-
switch (
|
|
388
|
+
var metadata, config, props, mdmValues, result;
|
|
389
|
+
return __generator(this, function (_a) {
|
|
390
|
+
switch (_a.label) {
|
|
391
391
|
case 0:
|
|
392
392
|
metadata = createMetadata();
|
|
393
393
|
config = {
|
|
@@ -408,7 +408,7 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
408
408
|
};
|
|
409
409
|
props = __assign(__assign({}, defaultProps), { config: config });
|
|
410
410
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
411
|
-
|
|
411
|
+
result = setUp({ props: props, mdmValues: mdmValues }).result;
|
|
412
412
|
expect(getRelationsForEntity).toHaveBeenCalledWith('123', [
|
|
413
413
|
{
|
|
414
414
|
activeness: { entity: 'all', relation: 'all' },
|
|
@@ -422,7 +422,7 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
422
422
|
], { searchByOv: false });
|
|
423
423
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
424
424
|
case 1:
|
|
425
|
-
|
|
425
|
+
_a.sent();
|
|
426
426
|
return [2 /*return*/];
|
|
427
427
|
}
|
|
428
428
|
});
|
|
@@ -430,13 +430,13 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
430
430
|
});
|
|
431
431
|
describe('masking behaviour', function () {
|
|
432
432
|
it('should send correct masking options if relation has masking', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
433
|
-
var metadata, mdmValues,
|
|
434
|
-
return __generator(this, function (
|
|
435
|
-
switch (
|
|
433
|
+
var metadata, mdmValues, result;
|
|
434
|
+
return __generator(this, function (_a) {
|
|
435
|
+
switch (_a.label) {
|
|
436
436
|
case 0:
|
|
437
437
|
metadata = createMetadata({ masking: true });
|
|
438
438
|
mdmValues = __assign(__assign({}, defaultMdmValues), { metadata: metadata });
|
|
439
|
-
|
|
439
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
440
440
|
act(function () {
|
|
441
441
|
result.current.reload();
|
|
442
442
|
});
|
|
@@ -457,7 +457,7 @@ describe('useRelationsLoader behaviour', function () {
|
|
|
457
457
|
});
|
|
458
458
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isLoading).toBe(false); })];
|
|
459
459
|
case 1:
|
|
460
|
-
|
|
460
|
+
_a.sent();
|
|
461
461
|
return [2 /*return*/];
|
|
462
462
|
}
|
|
463
463
|
});
|
|
@@ -55,7 +55,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
57
|
import React from 'react';
|
|
58
|
-
import { renderHook, act } from '@testing-library/react
|
|
58
|
+
import { renderHook, act } from '@testing-library/react';
|
|
59
59
|
import { getSavedSearches, updateSavedSearch, deleteSavedSearch, getTotalsForQuery, createSavedSearch } from '@reltio/mdm-sdk';
|
|
60
60
|
import { showDefaultErrorMessage } from '../../helpers/errors';
|
|
61
61
|
import { PageRequestsAbortingContext } from '../../contexts/PageRequestsAbortingContext';
|
|
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import { renderHook, act } from '@testing-library/react
|
|
48
|
+
import { renderHook, act } from '@testing-library/react';
|
|
49
49
|
import { useSavedStateForEntityType } from './useSavedStateForEntityType';
|
|
50
50
|
describe('useSavedStateForEntityType test', function () {
|
|
51
51
|
var _a;
|
|
@@ -171,13 +171,15 @@ describe('useSavedStateForEntityType test', function () {
|
|
|
171
171
|
case 0: return [4 /*yield*/, resolveSavedState(savedState)];
|
|
172
172
|
case 1:
|
|
173
173
|
_a.sent();
|
|
174
|
-
result.current.updateSavedState({ visibleColumns: ['new'] });
|
|
175
174
|
return [2 /*return*/];
|
|
176
175
|
}
|
|
177
176
|
});
|
|
178
177
|
}); })];
|
|
179
178
|
case 1:
|
|
180
179
|
_b.sent();
|
|
180
|
+
act(function () {
|
|
181
|
+
result.current.updateSavedState({ visibleColumns: ['new'] });
|
|
182
|
+
});
|
|
181
183
|
expect(initialProps.saveState).toHaveBeenCalledWith((_a = {},
|
|
182
184
|
_a[entityTypeUri] = {
|
|
183
185
|
visibleColumns: ['new']
|
|
@@ -224,13 +226,15 @@ describe('useSavedStateForEntityType test', function () {
|
|
|
224
226
|
case 0: return [4 /*yield*/, resolveSavedState(savedState)];
|
|
225
227
|
case 1:
|
|
226
228
|
_a.sent();
|
|
227
|
-
result.current.updateSavedState({ visibleColumns: ['new'] });
|
|
228
229
|
return [2 /*return*/];
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
}); })];
|
|
232
233
|
case 1:
|
|
233
234
|
_d.sent();
|
|
235
|
+
act(function () {
|
|
236
|
+
result.current.updateSavedState({ visibleColumns: ['new'] });
|
|
237
|
+
});
|
|
234
238
|
expect(initialProps.saveState).toHaveBeenCalledWith((_b = {},
|
|
235
239
|
_b[entityTypeUri] = {
|
|
236
240
|
visibleColumns: ['new']
|
|
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import { renderHook } from '@testing-library/react
|
|
48
|
+
import { renderHook } from '@testing-library/react';
|
|
49
49
|
import { useScrollToAttributeError } from './useScrollToAttributeError';
|
|
50
50
|
import { ScrollType } from '../../contexts/ScrollToElementContext';
|
|
51
51
|
import { ErrorSeverity } from '@reltio/mdm-sdk';
|
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
|
-
import { renderHook } from '@testing-library/react
|
|
49
|
+
import { renderHook, waitFor } from '@testing-library/react';
|
|
50
50
|
import { getAllUsersForTenant } from '@reltio/mdm-sdk';
|
|
51
51
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
52
52
|
import { useUsers } from './useUsers';
|
|
@@ -67,34 +67,33 @@ describe('useUsers behaviour', function () {
|
|
|
67
67
|
jest.clearAllMocks();
|
|
68
68
|
});
|
|
69
69
|
it('should call getAllUsersForTenant and update users value', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
70
|
-
var response,
|
|
71
|
-
return __generator(this, function (
|
|
72
|
-
switch (
|
|
70
|
+
var response, result;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
switch (_a.label) {
|
|
73
73
|
case 0:
|
|
74
74
|
response = [{ username: 'username', email: 'email' }];
|
|
75
75
|
getAllUsersForTenant.mockResolvedValue(response);
|
|
76
|
-
|
|
76
|
+
result = setUp().result;
|
|
77
77
|
expect(result.current).toEqual([]);
|
|
78
78
|
expect(getAllUsersForTenant).toHaveBeenCalledWith({ tenant: tenant.id, servicesPath: servicesPath });
|
|
79
79
|
return [4 /*yield*/, waitFor(function () { return expect(result.current).toEqual(response); })];
|
|
80
80
|
case 1:
|
|
81
|
-
|
|
81
|
+
_a.sent();
|
|
82
82
|
return [2 /*return*/];
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}); });
|
|
86
86
|
it('should set users value as null in case of unsuccessful request', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
|
-
var
|
|
88
|
-
return __generator(this, function (
|
|
89
|
-
switch (
|
|
87
|
+
var result;
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
90
|
case 0:
|
|
91
91
|
getAllUsersForTenant.mockRejectedValue('Error');
|
|
92
|
-
|
|
92
|
+
result = setUp().result;
|
|
93
93
|
expect(getAllUsersForTenant).toHaveBeenCalled();
|
|
94
|
-
return [4 /*yield*/,
|
|
94
|
+
return [4 /*yield*/, waitFor(function () { return expect(result.current).toEqual([]); })];
|
|
95
95
|
case 1:
|
|
96
|
-
|
|
97
|
-
expect(result.current).toEqual([]);
|
|
96
|
+
_a.sent();
|
|
98
97
|
return [2 /*return*/];
|
|
99
98
|
}
|
|
100
99
|
});
|
|
@@ -13,7 +13,7 @@ import { useEffect, useRef } from 'react';
|
|
|
13
13
|
export var useWhyDidYouUpdate = function (name, props) {
|
|
14
14
|
// Get a mutable ref object where we can store props ...
|
|
15
15
|
// ... for comparison next time this hook runs.
|
|
16
|
-
var previousProps = useRef();
|
|
16
|
+
var previousProps = useRef(null);
|
|
17
17
|
useEffect(function () {
|
|
18
18
|
if (previousProps.current) {
|
|
19
19
|
// Get all keys from previous and current props
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2272",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
12
12
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
13
13
|
"@react-sigma/core": "3.4.0",
|
|
14
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
14
|
+
"@reltio/mdm-sdk": "^1.4.2051",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"react-dnd": "^9.4.0",
|
|
28
28
|
"react-dnd-html5-backend": "^10.0.2",
|
|
29
29
|
"react-grid-layout": "1.4.2",
|
|
30
|
-
"react-lifecycles-compat": "^3.0.4",
|
|
31
30
|
"react-mentions": "^4.3.0",
|
|
32
31
|
"react-number-format": "^4.9.2",
|
|
33
32
|
"react-resizable-panels": "^2.0.20",
|
|
@@ -36,7 +35,7 @@
|
|
|
36
35
|
"react-simple-maps": "^3.0.0",
|
|
37
36
|
"react-virtualized": "^9.22.5",
|
|
38
37
|
"react-window": "^1.8.10",
|
|
39
|
-
"recharts": "^2.15.
|
|
38
|
+
"recharts": "^2.15.1",
|
|
40
39
|
"sanitize-html": "^2.13.1",
|
|
41
40
|
"sigma": "^2.4.0",
|
|
42
41
|
"topojson-client": "^3.1.0"
|
|
@@ -52,8 +51,8 @@
|
|
|
52
51
|
"nanoid": "^3.3.8",
|
|
53
52
|
"prop-types": "^15.6.2",
|
|
54
53
|
"ramda": "^0.28.0",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-components": "bitbucket:reltio-ondemand/react-components#
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-components": "bitbucket:reltio-ondemand/react-components#v5.0.1",
|
|
57
56
|
"react-resize-detector": "^9.1.1",
|
|
58
57
|
"ui-i18n": "bitbucket:reltio-ondemand/ui-i18n#v1.4.0"
|
|
59
58
|
},
|
|
@@ -24,6 +24,9 @@ export var DndContextComponent = function (_a) {
|
|
|
24
24
|
});
|
|
25
25
|
}, [dispatchMonitorEvent, onDragStart]);
|
|
26
26
|
var handleDragOver = useCallback(function (nodeId) {
|
|
27
|
+
if (!dragActiveIdRef.current) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
27
30
|
dragOverIdRef.current = nodeId;
|
|
28
31
|
var draggableNode = draggableNodesRef.current.get(dragActiveIdRef.current);
|
|
29
32
|
var droppableNode = droppableNodesRef.current.get(nodeId);
|
|
@@ -11,6 +11,7 @@ export declare const mockDndKit: {
|
|
|
11
11
|
onMouseUp(): void;
|
|
12
12
|
};
|
|
13
13
|
setNodeRef: (element: HTMLElement | null) => void;
|
|
14
|
+
setActivatorNodeRef: (element: HTMLElement | null) => void;
|
|
14
15
|
};
|
|
15
16
|
useDroppable: (props: import("./type").MockUseDraggableArguments) => {
|
|
16
17
|
setNodeRef: (element: HTMLElement | null) => void;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const useDndMonitorProvider: () => readonly [({ type, event }:
|
|
1
|
+
export declare const useDndMonitorProvider: () => readonly [({ type, event }: {
|
|
2
|
+
type: any;
|
|
3
|
+
event: any;
|
|
4
|
+
}) => void, (listener: any) => () => boolean];
|
|
@@ -9,6 +9,12 @@ export var useDraggable = function (props) {
|
|
|
9
9
|
}
|
|
10
10
|
}, [props.id]);
|
|
11
11
|
var _b = useNodeRef(onChangeNode), node = _b[0], setNodeRef = _b[1];
|
|
12
|
+
var onChangeActivatorNode = useCallback(function (newElement) {
|
|
13
|
+
if (newElement) {
|
|
14
|
+
newElement.setAttribute('data-test-dnd-activator-id', props.id);
|
|
15
|
+
}
|
|
16
|
+
}, [props.id]);
|
|
17
|
+
var _c = useNodeRef(onChangeActivatorNode), setActivatorNodeRef = _c[1];
|
|
12
18
|
var data = useRef(props.data);
|
|
13
19
|
useEffect(function () {
|
|
14
20
|
draggableNodesRef.current.set(props.id, { id: props.id, data: data, node: node });
|
|
@@ -34,6 +40,7 @@ export var useDraggable = function (props) {
|
|
|
34
40
|
return {
|
|
35
41
|
attributes: {},
|
|
36
42
|
listeners: listeners,
|
|
37
|
-
setNodeRef: setNodeRef
|
|
43
|
+
setNodeRef: setNodeRef,
|
|
44
|
+
setActivatorNodeRef: setActivatorNodeRef
|
|
38
45
|
};
|
|
39
46
|
};
|
package/test-utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { mockUseSelector, mockUseDispatch } from './mockStoreHooks';
|
|
1
2
|
export declare const awaitMockPromises: () => Promise<unknown>;
|
|
2
3
|
export declare const deepFreeze: (obj: any) => any;
|
|
3
4
|
export declare const rerenderWrapper: (wrapper: any) => any;
|
|
@@ -29,4 +30,3 @@ interface MouseEventWithOffsets extends MouseEventInit {
|
|
|
29
30
|
export declare class FakeMouseEvent extends MouseEvent {
|
|
30
31
|
constructor(type: string, values: MouseEventWithOffsets);
|
|
31
32
|
}
|
|
32
|
-
export {};
|
package/test-utils/index.js
CHANGED
|
@@ -72,6 +72,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
72
72
|
return t;
|
|
73
73
|
};
|
|
74
74
|
import { queryHelpers } from '@testing-library/react';
|
|
75
|
+
export { mockUseSelector, mockUseDispatch } from './mockStoreHooks';
|
|
75
76
|
export var awaitMockPromises = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
77
|
return __generator(this, function (_a) {
|
|
77
78
|
return [2 /*return*/, new Promise(function (resolve) { return setImmediate(resolve); })];
|