@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
|
@@ -12,8 +12,8 @@ var getValues = function (controlAttribute, attributes) {
|
|
|
12
12
|
};
|
|
13
13
|
var getValuesHash = (0, ramda_1.pipe)((0, ramda_1.pluck)('value'), (0, ramda_1.join)('-'));
|
|
14
14
|
var useChangedAttributes = function (entityUri, attributes, controlAttributes) {
|
|
15
|
-
var previousEntityUri = (0, react_1.useRef)();
|
|
16
|
-
var previousAttributesValues = (0, react_1.useRef)();
|
|
15
|
+
var previousEntityUri = (0, react_1.useRef)(null);
|
|
16
|
+
var previousAttributesValues = (0, react_1.useRef)(null);
|
|
17
17
|
var attributeValues = (0, react_1.useMemo)(function () {
|
|
18
18
|
return controlAttributes.reduce(function (values, controlAttribute) {
|
|
19
19
|
values[controlAttribute] = (0, ramda_1.pipe)(getValues, getValuesHash)(controlAttribute, attributes);
|
|
@@ -12,22 +12,60 @@ export declare const useCollaboration: ({ objectIds, objectTypes, enabled, needs
|
|
|
12
12
|
getCommentState: (uri: string, commentUri: string) => any;
|
|
13
13
|
updateCommentState: (uri: string, commentUri: string, newState: CommentState) => void;
|
|
14
14
|
clearCommentState: (uri: string, commentUri: string) => void;
|
|
15
|
-
createComment: ({ content, namedUsers, objectType, uri, relatedObjectUris }:
|
|
16
|
-
|
|
15
|
+
createComment: ({ content, namedUsers, objectType, uri, relatedObjectUris }: {
|
|
16
|
+
content: any;
|
|
17
|
+
namedUsers: any;
|
|
18
|
+
objectType: any;
|
|
19
|
+
uri: any;
|
|
20
|
+
relatedObjectUris: any;
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
createReply: ({ content, namedUsers, commentId, action, uri }: {
|
|
23
|
+
content: any;
|
|
24
|
+
namedUsers: any;
|
|
25
|
+
commentId: any;
|
|
26
|
+
action: any;
|
|
27
|
+
uri: any;
|
|
28
|
+
}) => Promise<void>;
|
|
17
29
|
currentComment: Comment;
|
|
18
|
-
deleteComment: ({ uri, commentId }:
|
|
19
|
-
|
|
30
|
+
deleteComment: ({ uri, commentId }: {
|
|
31
|
+
uri: any;
|
|
32
|
+
commentId: any;
|
|
33
|
+
}) => void;
|
|
34
|
+
editComment: ({ content, namedUsers, objectType, uri, relatedObjectUris, commentId, replies }: {
|
|
35
|
+
content: any;
|
|
36
|
+
namedUsers: any;
|
|
37
|
+
objectType: any;
|
|
38
|
+
uri: any;
|
|
39
|
+
relatedObjectUris: any;
|
|
40
|
+
commentId: any;
|
|
41
|
+
replies: any;
|
|
42
|
+
}) => Promise<void>;
|
|
20
43
|
getComment: (commentId: string) => void;
|
|
21
44
|
getComments: (relatedObjectUri: string, pageToken?: string) => void;
|
|
22
|
-
getCommentsCount: (objectIds: string[], shouldResetCommentsMap?:
|
|
45
|
+
getCommentsCount: (objectIds: string[], shouldResetCommentsMap?: boolean) => void;
|
|
23
46
|
loading: boolean;
|
|
24
47
|
objectTypes: CollaborationObjectTypes[];
|
|
25
48
|
pageToken: string;
|
|
26
|
-
reOpenThread: ({ commentId, uri }:
|
|
27
|
-
|
|
49
|
+
reOpenThread: ({ commentId, uri }: {
|
|
50
|
+
commentId: any;
|
|
51
|
+
uri: any;
|
|
52
|
+
}) => void;
|
|
53
|
+
resolveThread: ({ commentId, uri }: {
|
|
54
|
+
commentId: any;
|
|
55
|
+
uri: any;
|
|
56
|
+
}) => void;
|
|
28
57
|
sending: boolean;
|
|
29
|
-
deleteReply: ({ uri, commentId, reply }:
|
|
30
|
-
|
|
58
|
+
deleteReply: ({ uri, commentId, reply }: {
|
|
59
|
+
uri: any;
|
|
60
|
+
commentId: any;
|
|
61
|
+
reply: any;
|
|
62
|
+
}) => void;
|
|
63
|
+
editReply: ({ content, namedUsers, commentId, replyId }: {
|
|
64
|
+
content: any;
|
|
65
|
+
namedUsers: any;
|
|
66
|
+
commentId: any;
|
|
67
|
+
replyId: any;
|
|
68
|
+
}) => Promise<void>;
|
|
31
69
|
totalCommentsCount: number;
|
|
32
70
|
};
|
|
33
71
|
export {};
|
|
@@ -126,24 +126,21 @@ var useCollaboration = function (_a) {
|
|
|
126
126
|
setCurrentComment(comment);
|
|
127
127
|
setComments((0, ramda_1.map)((0, ramda_1.when)((0, ramda_1.propEq)('commentId', comment.commentId), (0, ramda_1.always)(comment))));
|
|
128
128
|
};
|
|
129
|
-
var deleteCommentFromState = function (commentId, uri) {
|
|
130
|
-
var
|
|
131
|
-
var
|
|
129
|
+
var deleteCommentFromState = (0, react_1.useCallback)(function (commentId, uri) {
|
|
130
|
+
var _a, _b, _c;
|
|
131
|
+
var targetComment = comments.find(function (comment) { return comment.commentId === commentId; });
|
|
132
|
+
var repliesCountFromComments = targetComment === null || targetComment === void 0 ? void 0 : targetComment.replies.length;
|
|
133
|
+
var repliesCountFromCommentsMap = (_b = (_a = commentsMap === null || commentsMap === void 0 ? void 0 : commentsMap[uri]) === null || _a === void 0 ? void 0 : _a.find(function (c) { return c.commentId === commentId; })) === null || _b === void 0 ? void 0 : _b.replies;
|
|
134
|
+
var deletedRepliesCount = (_c = repliesCountFromComments !== null && repliesCountFromComments !== void 0 ? repliesCountFromComments : repliesCountFromCommentsMap) !== null && _c !== void 0 ? _c : 0;
|
|
132
135
|
setCurrentComment(null);
|
|
133
136
|
setCommentsMap(function (prevCommentsMap) {
|
|
134
137
|
var _a;
|
|
135
|
-
var _b, _c;
|
|
136
|
-
repliesCountFromCommentsMap = (_c = (_b = prevCommentsMap === null || prevCommentsMap === void 0 ? void 0 : prevCommentsMap[uri]) === null || _b === void 0 ? void 0 : _b.find(function (c) { return c.commentId === commentId; })) === null || _c === void 0 ? void 0 : _c.replies;
|
|
137
138
|
var comments = prevCommentsMap[uri] || [];
|
|
138
139
|
return __assign(__assign({}, prevCommentsMap), (_a = {}, _a[uri] = comments.filter(function (c) { return c.commentId !== commentId; }), _a));
|
|
139
140
|
});
|
|
140
|
-
setComments(function (prevComments) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return prevComments.filter(function (comment) { return comment.commentId !== commentId; });
|
|
144
|
-
});
|
|
145
|
-
setTotalCommentsCount(function (prevCount) { var _a; return Math.max((prevCount || 0) - (1 + ((_a = repliesCountFromComments !== null && repliesCountFromComments !== void 0 ? repliesCountFromComments : repliesCountFromCommentsMap) !== null && _a !== void 0 ? _a : 0)), 0); });
|
|
146
|
-
};
|
|
141
|
+
setComments(function (prevComments) { return prevComments.filter(function (comment) { return comment.commentId !== commentId; }); });
|
|
142
|
+
setTotalCommentsCount(function (prevCount) { return Math.max((prevCount || 0) - (1 + deletedRepliesCount), 0); });
|
|
143
|
+
}, [comments, commentsMap]);
|
|
147
144
|
var createComment = (0, react_1.useCallback)(function (_a) {
|
|
148
145
|
var content = _a.content, namedUsers = _a.namedUsers, objectType = _a.objectType, uri = _a.uri, relatedObjectUris = _a.relatedObjectUris;
|
|
149
146
|
setSending(true);
|
|
@@ -189,7 +186,7 @@ var useCollaboration = function (_a) {
|
|
|
189
186
|
.then(function () { return deleteCommentFromState(commentId, uri); })
|
|
190
187
|
.catch(catchErrorInRequest)
|
|
191
188
|
.finally(function () { return setSending(false); });
|
|
192
|
-
}, [collaborationPath, tenant]);
|
|
189
|
+
}, [collaborationPath, tenant, deleteCommentFromState]);
|
|
193
190
|
var updateReplyInState = (0, react_1.useCallback)(function (reply, uri, commentId, isDeleteReply) {
|
|
194
191
|
var newStatus = reply.action === 'resolve' ? 'resolved' : 'open';
|
|
195
192
|
var replyId = reply.replyId;
|
|
@@ -60,7 +60,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
62
|
var react_1 = __importDefault(require("react"));
|
|
63
|
-
var
|
|
63
|
+
var react_2 = require("@testing-library/react");
|
|
64
64
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
65
65
|
var MdmModuleContext_1 = require("../../contexts/MdmModuleContext");
|
|
66
66
|
var useCollaboration_1 = require("./useCollaboration");
|
|
@@ -79,7 +79,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
79
79
|
var children = _a.children;
|
|
80
80
|
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues }, children));
|
|
81
81
|
};
|
|
82
|
-
return (0,
|
|
82
|
+
return (0, react_2.renderHook)(useCollaboration_1.useCollaboration, { initialProps: props, wrapper: Providers });
|
|
83
83
|
};
|
|
84
84
|
beforeEach(function () {
|
|
85
85
|
mdm_sdk_1.getComment.mockResolvedValue({ commentId: 'commentId' });
|
|
@@ -105,7 +105,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
105
105
|
mdm_sdk_1.getCommentsCount.mockResolvedValueOnce([]);
|
|
106
106
|
mdm_sdk_1.getTotalCommentsCount.mockResolvedValueOnce({ total: 1 });
|
|
107
107
|
result = setUp().result;
|
|
108
|
-
return [4 /*yield*/, (0,
|
|
108
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
109
109
|
return __generator(this, function (_a) {
|
|
110
110
|
switch (_a.label) {
|
|
111
111
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -143,7 +143,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
143
143
|
tenant: 'alenat',
|
|
144
144
|
collaborationPath: defaultMdmValues.collaborationPath
|
|
145
145
|
});
|
|
146
|
-
return [4 /*yield*/, (0,
|
|
146
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
147
|
return __generator(this, function (_a) {
|
|
148
148
|
switch (_a.label) {
|
|
149
149
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -168,7 +168,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
168
168
|
mdm_sdk_1.getCommentsCount.mockRejectedValueOnce(null);
|
|
169
169
|
result = setUp().result;
|
|
170
170
|
expect(mdm_sdk_1.getCommentsCount).toHaveBeenCalled();
|
|
171
|
-
return [4 /*yield*/, (0,
|
|
171
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
172
|
return __generator(this, function (_a) {
|
|
173
173
|
switch (_a.label) {
|
|
174
174
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -207,7 +207,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
207
207
|
tenant: 'alenat',
|
|
208
208
|
collaborationPath: defaultMdmValues.collaborationPath
|
|
209
209
|
});
|
|
210
|
-
return [4 /*yield*/, (0,
|
|
210
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
211
211
|
return __generator(this, function (_a) {
|
|
212
212
|
result.current.getCommentsCount(['uri2']);
|
|
213
213
|
return [2 /*return*/];
|
|
@@ -247,7 +247,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
247
247
|
tenant: 'alenat',
|
|
248
248
|
collaborationPath: defaultMdmValues.collaborationPath
|
|
249
249
|
});
|
|
250
|
-
return [4 /*yield*/, (0,
|
|
250
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
251
251
|
return __generator(this, function (_a) {
|
|
252
252
|
switch (_a.label) {
|
|
253
253
|
case 0:
|
|
@@ -283,7 +283,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
283
283
|
result = setUp().result;
|
|
284
284
|
expect(result.current.comments).toEqual([]);
|
|
285
285
|
expect(result.current.pageToken).toBe(null);
|
|
286
|
-
(0,
|
|
286
|
+
(0, react_2.act)(function () {
|
|
287
287
|
result.current.getComments('uri');
|
|
288
288
|
});
|
|
289
289
|
expect(mdm_sdk_1.getComments).toHaveBeenCalledWith({
|
|
@@ -291,7 +291,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
291
291
|
tenant: 'alenat',
|
|
292
292
|
relatedObjectUri: 'uri'
|
|
293
293
|
});
|
|
294
|
-
return [4 /*yield*/, (0,
|
|
294
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
295
295
|
return __generator(this, function (_a) {
|
|
296
296
|
switch (_a.label) {
|
|
297
297
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -309,7 +309,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
309
309
|
items: [{ commentId: 'commentId2' }, { commentId: 'commentId3' }],
|
|
310
310
|
nextPageToken: 'token2'
|
|
311
311
|
});
|
|
312
|
-
return [4 /*yield*/, (0,
|
|
312
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
313
|
return __generator(this, function (_a) {
|
|
314
314
|
result.current.getComments('uri', 'token');
|
|
315
315
|
return [2 /*return*/];
|
|
@@ -327,7 +327,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
327
327
|
items: [{ commentId: 'commentId1' }, { commentId: 'commentId2' }],
|
|
328
328
|
nextPageToken: 'token'
|
|
329
329
|
});
|
|
330
|
-
return [4 /*yield*/, (0,
|
|
330
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
331
331
|
return __generator(this, function (_a) {
|
|
332
332
|
result.current.getComments('uri');
|
|
333
333
|
return [2 /*return*/];
|
|
@@ -349,7 +349,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
349
349
|
result = setUp().result;
|
|
350
350
|
expect(result.current.currentComment).toBe(null);
|
|
351
351
|
expect(result.current.loading).toBe(false);
|
|
352
|
-
(0,
|
|
352
|
+
(0, react_2.act)(function () {
|
|
353
353
|
result.current.getComment('commentId');
|
|
354
354
|
});
|
|
355
355
|
expect(result.current.loading).toBe(true);
|
|
@@ -358,7 +358,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
358
358
|
tenant: 'alenat',
|
|
359
359
|
commentId: 'commentId'
|
|
360
360
|
});
|
|
361
|
-
return [4 /*yield*/, (0,
|
|
361
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
362
362
|
return __generator(this, function (_a) {
|
|
363
363
|
switch (_a.label) {
|
|
364
364
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -399,7 +399,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
399
399
|
mdm_sdk_1.getCommentsCount.mockResolvedValueOnce([{ objectId: 'uri1', comments: comments }]);
|
|
400
400
|
mdm_sdk_1.createComment.mockResolvedValueOnce([{ commentId: 'commentId' }]);
|
|
401
401
|
result = setUp().result;
|
|
402
|
-
return [4 /*yield*/, (0,
|
|
402
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
403
403
|
return __generator(this, function (_a) {
|
|
404
404
|
switch (_a.label) {
|
|
405
405
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -414,7 +414,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
414
414
|
expect(result.current.commentsMap).toEqual({ uri1: comments });
|
|
415
415
|
expect(result.current.currentComment).toBe(null);
|
|
416
416
|
expect(result.current.sending).toBe(false);
|
|
417
|
-
(0,
|
|
417
|
+
(0, react_2.act)(function () {
|
|
418
418
|
result.current.createComment({
|
|
419
419
|
content: 'content',
|
|
420
420
|
namedUsers: [],
|
|
@@ -437,7 +437,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
437
437
|
permanentLink: 'https://tst-01.reltio.com/nui/alenat/profile?entityUri=entities%2F2jWtLtNc&commentId=%7BcommentId%7D'
|
|
438
438
|
}
|
|
439
439
|
});
|
|
440
|
-
return [4 /*yield*/, (0,
|
|
440
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
441
441
|
return __generator(this, function (_a) {
|
|
442
442
|
switch (_a.label) {
|
|
443
443
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -457,13 +457,14 @@ describe('useCollaboration behaviour', function () {
|
|
|
457
457
|
uri1: __spreadArray(__spreadArray([], comments, true), [{ commentId: 'commentId', replies: 0, status: 'open' }], false)
|
|
458
458
|
});
|
|
459
459
|
mdm_sdk_1.createComment.mockResolvedValueOnce([{ commentId: 'commentId2' }]);
|
|
460
|
-
return [4 /*yield*/, (0,
|
|
460
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
461
461
|
return __generator(this, function (_a) {
|
|
462
462
|
result.current.createComment({
|
|
463
463
|
content: 'content',
|
|
464
464
|
namedUsers: [],
|
|
465
465
|
objectType: 'entity',
|
|
466
|
-
uri: 'uri2'
|
|
466
|
+
uri: 'uri2',
|
|
467
|
+
relatedObjectUris: []
|
|
467
468
|
});
|
|
468
469
|
return [2 /*return*/];
|
|
469
470
|
});
|
|
@@ -502,7 +503,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
502
503
|
});
|
|
503
504
|
mdm_sdk_1.createReply.mockResolvedValueOnce([{ content: 'reply message' }]);
|
|
504
505
|
result = setUp().result;
|
|
505
|
-
return [4 /*yield*/, (0,
|
|
506
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
506
507
|
return __generator(this, function (_a) {
|
|
507
508
|
result.current.getComments('uri');
|
|
508
509
|
result.current.getComment('commentId');
|
|
@@ -518,7 +519,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
518
519
|
expect(result.current.commentsMap).toEqual({ uri1: commentsCount });
|
|
519
520
|
expect(result.current.comments).toEqual(comments);
|
|
520
521
|
expect(result.current.sending).toBe(false);
|
|
521
|
-
(0,
|
|
522
|
+
(0, react_2.act)(function () {
|
|
522
523
|
result.current.createReply({
|
|
523
524
|
content: 'reply message',
|
|
524
525
|
namedUsers: [],
|
|
@@ -538,7 +539,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
538
539
|
namedUsers: []
|
|
539
540
|
}
|
|
540
541
|
});
|
|
541
|
-
return [4 /*yield*/, (0,
|
|
542
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
542
543
|
return __generator(this, function (_a) {
|
|
543
544
|
switch (_a.label) {
|
|
544
545
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -578,7 +579,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
578
579
|
action: 'resolve'
|
|
579
580
|
}
|
|
580
581
|
]));
|
|
581
|
-
return [4 /*yield*/, (0,
|
|
582
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
582
583
|
return __generator(this, function (_a) {
|
|
583
584
|
result.current.createReply({
|
|
584
585
|
content: '',
|
|
@@ -632,7 +633,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
632
633
|
mdm_sdk_1.getComments.mockResolvedValue({ items: comments });
|
|
633
634
|
mdm_sdk_1.createReply.mockResolvedValueOnce([{ content: '', action: 'resolve' }]);
|
|
634
635
|
result = setUp().result;
|
|
635
|
-
return [4 /*yield*/, (0,
|
|
636
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
636
637
|
return __generator(this, function (_a) {
|
|
637
638
|
result.current.getComments('uri');
|
|
638
639
|
result.current.getComment('commentId');
|
|
@@ -648,7 +649,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
648
649
|
});
|
|
649
650
|
expect(result.current.comments).toEqual(comments);
|
|
650
651
|
expect(result.current.sending).toBe(false);
|
|
651
|
-
(0,
|
|
652
|
+
(0, react_2.act)(function () {
|
|
652
653
|
result.current.resolveThread({ commentId: 'id2', uri: 'uri1' });
|
|
653
654
|
});
|
|
654
655
|
expect(result.current.sending).toBe(true);
|
|
@@ -662,7 +663,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
662
663
|
namedUsers: []
|
|
663
664
|
}
|
|
664
665
|
});
|
|
665
|
-
return [4 /*yield*/, (0,
|
|
666
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
666
667
|
return __generator(this, function (_a) {
|
|
667
668
|
switch (_a.label) {
|
|
668
669
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -707,7 +708,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
707
708
|
});
|
|
708
709
|
mdm_sdk_1.createReply.mockResolvedValueOnce([{ content: '', action: 'reopen' }]);
|
|
709
710
|
result = setUp().result;
|
|
710
|
-
return [4 /*yield*/, (0,
|
|
711
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
711
712
|
return __generator(this, function (_a) {
|
|
712
713
|
result.current.getComments('uri');
|
|
713
714
|
result.current.getComment('commentId');
|
|
@@ -723,7 +724,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
723
724
|
});
|
|
724
725
|
expect(result.current.comments).toEqual(comments);
|
|
725
726
|
expect(result.current.sending).toBe(false);
|
|
726
|
-
(0,
|
|
727
|
+
(0, react_2.act)(function () {
|
|
727
728
|
result.current.reOpenThread({ commentId: 'id2', uri: 'uri1' });
|
|
728
729
|
});
|
|
729
730
|
expect(result.current.sending).toBe(true);
|
|
@@ -737,7 +738,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
737
738
|
namedUsers: []
|
|
738
739
|
}
|
|
739
740
|
});
|
|
740
|
-
return [4 /*yield*/, (0,
|
|
741
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
741
742
|
return __generator(this, function (_a) {
|
|
742
743
|
switch (_a.label) {
|
|
743
744
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -771,7 +772,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
771
772
|
switch (_a.label) {
|
|
772
773
|
case 0:
|
|
773
774
|
result = setUp().result;
|
|
774
|
-
return [4 /*yield*/, (0,
|
|
775
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
775
776
|
return __generator(this, function (_a) {
|
|
776
777
|
result.current.getComment('commentId');
|
|
777
778
|
return [2 /*return*/];
|
|
@@ -782,7 +783,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
782
783
|
expect(result.current.currentComment).toEqual({
|
|
783
784
|
commentId: 'commentId'
|
|
784
785
|
});
|
|
785
|
-
(0,
|
|
786
|
+
(0, react_2.act)(function () {
|
|
786
787
|
result.current.clearCurrentComment();
|
|
787
788
|
});
|
|
788
789
|
expect(result.current.currentComment).toBe(null);
|
|
@@ -812,7 +813,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
812
813
|
mdm_sdk_1.getComment.mockResolvedValue(initialComment);
|
|
813
814
|
mdm_sdk_1.getComments.mockResolvedValue({ items: initialComments });
|
|
814
815
|
result = setUp().result;
|
|
815
|
-
return [4 /*yield*/, (0,
|
|
816
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
816
817
|
return __generator(this, function (_a) {
|
|
817
818
|
result.current.getComment(initialComment.commentId);
|
|
818
819
|
result.current.getComments('uri');
|
|
@@ -824,7 +825,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
824
825
|
expect(result.current.currentComment).toEqual(initialComment);
|
|
825
826
|
expect(result.current.comments).toEqual(initialComments);
|
|
826
827
|
expect(result.current.sending).toBe(false);
|
|
827
|
-
(0,
|
|
828
|
+
(0, react_2.act)(function () {
|
|
828
829
|
result.current.editComment({
|
|
829
830
|
commentId: 'id1',
|
|
830
831
|
content: 'edited comment',
|
|
@@ -841,7 +842,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
841
842
|
tenant: 'alenat',
|
|
842
843
|
data: editedComment
|
|
843
844
|
});
|
|
844
|
-
return [4 /*yield*/, (0,
|
|
845
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
845
846
|
return __generator(this, function (_a) {
|
|
846
847
|
switch (_a.label) {
|
|
847
848
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -879,7 +880,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
879
880
|
mdm_sdk_1.getComments.mockResolvedValueOnce({ items: comments });
|
|
880
881
|
mdm_sdk_1.deleteComment.mockResolvedValueOnce('');
|
|
881
882
|
result = setUp().result;
|
|
882
|
-
return [4 /*yield*/, (0,
|
|
883
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
883
884
|
return __generator(this, function (_a) {
|
|
884
885
|
result.current.getComments('uri');
|
|
885
886
|
return [2 /*return*/];
|
|
@@ -890,7 +891,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
890
891
|
expect(result.current.comments).toEqual(comments);
|
|
891
892
|
expect(result.current.commentsMap).toEqual({ uri1: commentsCount });
|
|
892
893
|
expect(result.current.sending).toBe(false);
|
|
893
|
-
(0,
|
|
894
|
+
(0, react_2.act)(function () {
|
|
894
895
|
result.current.deleteComment({ commentId: 'id1', uri: 'uri1' });
|
|
895
896
|
});
|
|
896
897
|
expect(result.current.sending).toBe(true);
|
|
@@ -899,7 +900,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
899
900
|
tenant: 'alenat',
|
|
900
901
|
commentId: 'id1'
|
|
901
902
|
});
|
|
902
|
-
return [4 /*yield*/, (0,
|
|
903
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
903
904
|
return __generator(this, function (_a) {
|
|
904
905
|
switch (_a.label) {
|
|
905
906
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -932,7 +933,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
932
933
|
mdm_sdk_1.getCommentsCount.mockResolvedValueOnce([{ objectId: 'uri1', comments: commentsCount }]);
|
|
933
934
|
mdm_sdk_1.createReply.mockResolvedValueOnce([{ content: 'reply message' }]);
|
|
934
935
|
result = setUp().result;
|
|
935
|
-
return [4 /*yield*/, (0,
|
|
936
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
936
937
|
return __generator(this, function (_a) {
|
|
937
938
|
Promise.resolve();
|
|
938
939
|
return [2 /*return*/];
|
|
@@ -941,7 +942,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
941
942
|
case 1:
|
|
942
943
|
_a.sent();
|
|
943
944
|
expect(result.current.commentsMap).toEqual({ uri1: commentsCount });
|
|
944
|
-
return [4 /*yield*/, (0,
|
|
945
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
945
946
|
return __generator(this, function (_a) {
|
|
946
947
|
switch (_a.label) {
|
|
947
948
|
case 0: return [4 /*yield*/, result.current.createReply({
|
|
@@ -982,7 +983,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
982
983
|
mdm_sdk_1.getComments.mockResolvedValue({ items: comments });
|
|
983
984
|
mdm_sdk_1.deleteReply.mockResolvedValueOnce('');
|
|
984
985
|
result = setUp().result;
|
|
985
|
-
return [4 /*yield*/, (0,
|
|
986
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
986
987
|
return __generator(this, function (_a) {
|
|
987
988
|
result.current.getComments('uri');
|
|
988
989
|
return [2 /*return*/];
|
|
@@ -993,7 +994,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
993
994
|
expect(result.current.comments).toEqual(comments);
|
|
994
995
|
expect(result.current.commentsMap).toEqual({ uri1: commentsCount });
|
|
995
996
|
expect(result.current.sending).toBe(false);
|
|
996
|
-
(0,
|
|
997
|
+
(0, react_2.act)(function () {
|
|
997
998
|
result.current.deleteReply({
|
|
998
999
|
commentId: 'id1',
|
|
999
1000
|
uri: 'uri1',
|
|
@@ -1007,7 +1008,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1007
1008
|
commentId: 'id1',
|
|
1008
1009
|
replyId: 'replyId1'
|
|
1009
1010
|
});
|
|
1010
|
-
return [4 /*yield*/, (0,
|
|
1011
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1011
1012
|
return __generator(this, function (_a) {
|
|
1012
1013
|
switch (_a.label) {
|
|
1013
1014
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -1052,7 +1053,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1052
1053
|
mdm_sdk_1.getComment.mockResolvedValueOnce(initialComment);
|
|
1053
1054
|
mdm_sdk_1.getComments.mockResolvedValueOnce({ items: initialComments });
|
|
1054
1055
|
result = setUp().result;
|
|
1055
|
-
return [4 /*yield*/, (0,
|
|
1056
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1056
1057
|
return __generator(this, function (_a) {
|
|
1057
1058
|
result.current.getComment(initialComment.commentId);
|
|
1058
1059
|
result.current.getComments('uri');
|
|
@@ -1064,7 +1065,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1064
1065
|
expect(result.current.currentComment).toEqual(initialComment);
|
|
1065
1066
|
expect(result.current.comments).toEqual(initialComments);
|
|
1066
1067
|
expect(result.current.sending).toBe(false);
|
|
1067
|
-
(0,
|
|
1068
|
+
(0, react_2.act)(function () {
|
|
1068
1069
|
result.current.editReply({
|
|
1069
1070
|
commentId: 'id1',
|
|
1070
1071
|
content: editedReplyContent,
|
|
@@ -1083,7 +1084,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1083
1084
|
namedUsers: editedReply.namedUsers
|
|
1084
1085
|
}
|
|
1085
1086
|
});
|
|
1086
|
-
return [4 /*yield*/, (0,
|
|
1087
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1087
1088
|
return __generator(this, function (_a) {
|
|
1088
1089
|
switch (_a.label) {
|
|
1089
1090
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -1109,7 +1110,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1109
1110
|
case 0:
|
|
1110
1111
|
result = setUp().result;
|
|
1111
1112
|
expect(result.current.getCommentState('attrUri', 'commentUri')).toEqual({});
|
|
1112
|
-
return [4 /*yield*/, (0,
|
|
1113
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1113
1114
|
return __generator(this, function (_a) {
|
|
1114
1115
|
result.current.updateCommentState('attrUri', 'commentUri', {
|
|
1115
1116
|
value: 'value',
|
|
@@ -1126,7 +1127,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1126
1127
|
plainTextValue: 'value',
|
|
1127
1128
|
mentions: []
|
|
1128
1129
|
});
|
|
1129
|
-
return [4 /*yield*/, (0,
|
|
1130
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1130
1131
|
return __generator(this, function (_a) {
|
|
1131
1132
|
result.current.updateCommentState('attrUri', 'commentUri', { isEditing: true });
|
|
1132
1133
|
return [2 /*return*/];
|
|
@@ -1150,7 +1151,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1150
1151
|
switch (_a.label) {
|
|
1151
1152
|
case 0:
|
|
1152
1153
|
result = setUp().result;
|
|
1153
|
-
return [4 /*yield*/, (0,
|
|
1154
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1154
1155
|
return __generator(this, function (_a) {
|
|
1155
1156
|
result.current.updateCommentState('attrUri', 'commentUri', {
|
|
1156
1157
|
value: 'value',
|
|
@@ -1167,7 +1168,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1167
1168
|
plainTextValue: 'value',
|
|
1168
1169
|
mentions: []
|
|
1169
1170
|
});
|
|
1170
|
-
return [4 /*yield*/, (0,
|
|
1171
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1171
1172
|
return __generator(this, function (_a) {
|
|
1172
1173
|
result.current.clearCommentState('attrUri', 'commentUri');
|
|
1173
1174
|
return [2 /*return*/];
|
|
@@ -1186,7 +1187,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1186
1187
|
switch (_a.label) {
|
|
1187
1188
|
case 0:
|
|
1188
1189
|
result = setUp().result;
|
|
1189
|
-
return [4 /*yield*/, (0,
|
|
1190
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1190
1191
|
return __generator(this, function (_a) {
|
|
1191
1192
|
result.current.updateCommentState('attrUri1', 'commentUri1', {
|
|
1192
1193
|
value: 'value1',
|
|
@@ -1203,7 +1204,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1203
1204
|
plainTextValue: 'value1',
|
|
1204
1205
|
mentions: []
|
|
1205
1206
|
});
|
|
1206
|
-
return [4 /*yield*/, (0,
|
|
1207
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1207
1208
|
return __generator(this, function (_a) {
|
|
1208
1209
|
result.current.updateCommentState('attrUri1', 'commentUri2', {
|
|
1209
1210
|
value: 'value2',
|
|
@@ -1220,7 +1221,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1220
1221
|
plainTextValue: 'value2',
|
|
1221
1222
|
mentions: []
|
|
1222
1223
|
});
|
|
1223
|
-
return [4 /*yield*/, (0,
|
|
1224
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1224
1225
|
return __generator(this, function (_a) {
|
|
1225
1226
|
result.current.updateCommentState('attrUri2', 'commentUri1', {
|
|
1226
1227
|
value: 'value3',
|
|
@@ -1255,7 +1256,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1255
1256
|
mdm_sdk_1.getTotalCommentsCount.mockResolvedValueOnce({ total: 15 });
|
|
1256
1257
|
setUp();
|
|
1257
1258
|
expect(mdm_sdk_1.getTotalCommentsCount).not.toHaveBeenCalled();
|
|
1258
|
-
return [4 /*yield*/, (0,
|
|
1259
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1259
1260
|
return __generator(this, function (_a) {
|
|
1260
1261
|
switch (_a.label) {
|
|
1261
1262
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -1284,7 +1285,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1284
1285
|
collaborationPath: '123',
|
|
1285
1286
|
tenant: 'alenat'
|
|
1286
1287
|
});
|
|
1287
|
-
return [4 /*yield*/, (0,
|
|
1288
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1288
1289
|
return __generator(this, function (_a) {
|
|
1289
1290
|
switch (_a.label) {
|
|
1290
1291
|
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
@@ -1309,7 +1310,7 @@ describe('useCollaboration behaviour', function () {
|
|
|
1309
1310
|
mdm_sdk_1.getTotalCommentsCount.mockRejectedValueOnce(new Error('Network error'));
|
|
1310
1311
|
result = setUp({ props: { needsTotalCount: true } }).result;
|
|
1311
1312
|
expect(mdm_sdk_1.getTotalCommentsCount).toHaveBeenCalled();
|
|
1312
|
-
return [4 /*yield*/, (0,
|
|
1313
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1313
1314
|
return __generator(this, function (_a) {
|
|
1314
1315
|
switch (_a.label) {
|
|
1315
1316
|
case 0: return [4 /*yield*/, Promise.resolve()];
|