@reltio/components 1.4.1944 → 1.4.1946
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AttributeListItem/AttributeListItem.spec.js +4 -4
- package/cjs/AttributesErrorsPanel/components/Error/Error.specs.js +1 -1
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +8 -8
- package/cjs/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +2 -2
- package/cjs/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +3 -3
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.test.js +1 -1
- package/cjs/AttributesView/AttributesView.d.ts +2 -1
- package/cjs/AttributesView/AttributesView.js +4 -2
- package/cjs/AttributesView/AttributesView.test.js +32 -0
- package/cjs/AutoSizeList/AutoSizeList.test.js +27 -30
- package/cjs/BasicTable/BasicTable.test.js +26 -5
- package/cjs/BasicTable/IntegrationBasicTable.test.js +16 -5
- package/cjs/BasicTable/helpers.test.js +1 -1
- package/cjs/CollapseRowButton/CollapseRowButton.test.js +3 -3
- package/cjs/CommentsContainer/CommentsContainer.test.js +2 -2
- package/cjs/CustomDateRangeEditor/CustomDateRangeEditor.test.js +2 -2
- package/cjs/DataTypeValue/DataTypeValue.test.js +2 -25
- package/cjs/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/cjs/DependentLookupEditor/DependentLookupEditor.test.js +116 -70
- package/cjs/DropDownEditor/DropDownEditor.test.js +1 -1
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +4 -27
- package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +1 -1
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +16 -5
- package/cjs/EditModeAttributesList/EditModeAttributesList.test.js +7 -4
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.js +1 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +4 -1
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +28 -37
- package/cjs/EntitySelector/EntitySelector.test.js +13 -42
- package/cjs/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +1 -1
- package/cjs/EntitySelector/components/EntityOption/EntityOption.test.js +1 -1
- package/cjs/EntitySelector/components/Group/Group.test.js +1 -1
- package/cjs/EntityUriLink/EntityUriLink.test.js +1 -0
- package/cjs/ErrorBoundary/ErrorBoundary.test.js +2 -0
- package/cjs/ExpandedValueTooltip/ExpandedValueTooltip.test.js +4 -1
- package/cjs/FilterButton/FilterButton.test.js +1 -1
- package/cjs/HOCs/withFilter/components/ColumnFilter/ColumnFilter.spec.js +3 -3
- package/cjs/HOCs/withTableContext/withTableContext.test.js +1 -1
- package/cjs/HierarchyNodeTitle/HierarchyNodeTitle.test.js +4 -27
- package/cjs/HierarchyNodeTitle/useEntityDetails.test.js +18 -32
- package/cjs/ImageAttributesGallery/ImageAttributesGallery.test.js +6 -4
- package/cjs/ImageAttributesGallery/components/HeaderRight/HeaderRight.test.js +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.test.js +110 -68
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +4 -4
- package/cjs/ImageGalleryDialog/ImageGalleryDialog.specs.js +3 -3
- package/cjs/ImportButton/ImportButton.test.js +1 -1
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +1 -1
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +1 -1
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +3 -3
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +31 -22
- package/cjs/LineChart/LineChart.test.js +1 -1
- package/cjs/Link/Link.test.js +1 -0
- package/cjs/LookupEditor/LookupEditor.test.js +3 -3
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +1 -1
- package/cjs/MapChart/MapChart.test.js +3 -3
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +3 -3
- package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +1 -1
- package/cjs/MultipleInput/MultipleInput.test.js +11 -11
- package/cjs/MultipliableSelect/MultipliableSelect.test.js +14 -8
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +4 -27
- package/cjs/NumberEditor/NumberEditor.test.js +4 -4
- package/cjs/PieChart/PieChart.test.js +1 -1
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +11 -34
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +4 -30
- package/cjs/PivotingUriLink/PivotingUriLink.spec.js +1 -0
- package/cjs/ProfileBandNavigation/useSearchNavigation.test.js +3 -3
- package/cjs/ProfilesList/ProfilesList.spec.js +1 -1
- package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +1 -1
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.d.ts +2 -2
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +6 -4
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +1 -1
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +11 -2
- package/cjs/ReadOnlyAttributesPager/components/EmptyRenderer/EmptyRenderer.d.ts +9 -0
- package/cjs/ReadOnlyAttributesPager/components/EmptyRenderer/EmptyRenderer.js +20 -0
- package/cjs/ReadOnlyAttributesPager/components/EmptyRenderer/index.d.ts +1 -0
- package/cjs/ReadOnlyAttributesPager/components/EmptyRenderer/index.js +5 -0
- package/cjs/ReadOnlyAttributesPager/styles.d.ts +1 -0
- package/cjs/ReadOnlyAttributesPager/styles.js +5 -1
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +6 -30
- package/cjs/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/cjs/RelationEditor/RelationEditor.test.js +20 -44
- package/cjs/ReltioMap/ReltioMap.spec.js +10 -8
- package/cjs/ReltioMap/components/EntityMarker/EntityMarker.spec.js +2 -26
- package/cjs/ScrollableTabs/ScrollableTabs.test.js +1 -1
- package/cjs/SearchInput/SearchInput.spec.js +2 -2
- package/cjs/SelectionPopup/SelectionPopup.spec.js +9 -12
- package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +4 -4
- package/cjs/ShowLess/ShowLess.test.js +1 -1
- package/cjs/ShowMore/ShowMore.test.js +2 -2
- package/cjs/SideButtonsPanel/SideButtonsPanel.spec.js +3 -3
- package/cjs/SimpleAttribute/IntegrationSimpleAttribute.test.js +15 -34
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +1 -1
- package/cjs/TableWithBars/TableWithBars.test.js +1 -1
- package/cjs/TreeChart/TreeChart.test.js +1 -1
- package/cjs/TypeaheadEditor/TypeaheadEditor.test.js +8 -1
- package/cjs/UploadFileButton/UploadFileButton.spec.js +103 -69
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +4 -1
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +3 -1
- package/cjs/constants/attributes.d.ts +1 -1
- package/cjs/constants/attributes.js +2 -2
- package/cjs/constants/index.d.ts +1 -1
- package/cjs/constants/index.js +2 -2
- package/cjs/contexts/AllwaysVisibleAttributesContext/index.d.ts +2 -0
- package/cjs/contexts/AllwaysVisibleAttributesContext/index.js +6 -0
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +2 -2
- package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +1 -25
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +1 -25
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +4 -0
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +1 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +1 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +13 -13
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +5 -5
- package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +4 -4
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +5 -5
- package/cjs/features/crosswalks/AttributesTable/components/WinnerSourcesRenderer/WinnerSourcesRenderer.test.js +2 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.d.ts +2 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +27 -4
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +15 -16
- package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +1 -1
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +2 -2
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +95 -118
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +38 -61
- package/cjs/features/crosswalks/hooks/useModifiedEntity.test.js +8 -8
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +2 -2
- package/cjs/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js +5 -26
- package/cjs/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +2 -2
- package/cjs/features/history/HistoryRow/HistoryRow.specs.js +2 -26
- package/cjs/features/history/HistoryTree/HistoryTree.specs.js +1 -1
- package/cjs/features/history/HistoryView/HistoryView.specs.js +1 -1
- package/cjs/features/history/helpers/filters.test.js +6 -6
- package/cjs/features/history/hooks/useHistory.test.js +23 -48
- package/cjs/features/workflow/AddWorkflowDialog/AddWorkflowDialog.spec.js +24 -8
- package/cjs/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -26
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +4 -30
- package/cjs/features/workflow/hooks/useChangeRequest.specs.js +11 -36
- package/cjs/helpers/attributesView.d.ts +1 -1
- package/cjs/helpers/attributesView.js +2 -2
- package/cjs/helpers/customScript.test.js +19 -19
- package/cjs/hooks/useAPI/useAPI.test.js +12 -12
- package/cjs/hooks/useBasicTableCellRenderer/CellRenderer.test.js +2 -1
- package/cjs/hooks/useCollapsibleTableRows/dataHelpers.test.js +1 -1
- package/cjs/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/cjs/hooks/useConfigPermissions/useConfigPermissions.specs.js +5 -29
- package/cjs/hooks/useCustomScripts/useCustomScripts.test.js +8 -8
- package/cjs/hooks/useLayoutResetter/useLayoutResetter.test.js +8 -8
- package/cjs/hooks/useMarkers/helpers.js +1 -2
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.test.js +14 -44
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.specs.js +3 -4
- package/cjs/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +4 -4
- package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/cjs/hooks/useSnackbar/useSnackbar.test.js +24 -17
- package/esm/AttributeListItem/AttributeListItem.spec.js +4 -4
- package/esm/AttributesErrorsPanel/components/Error/Error.specs.js +1 -1
- package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +8 -8
- package/esm/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +2 -2
- package/esm/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +3 -3
- package/esm/AttributesFiltersButton/AttributesFiltersButton.test.js +1 -1
- package/esm/AttributesView/AttributesView.d.ts +2 -1
- package/esm/AttributesView/AttributesView.js +4 -2
- package/esm/AttributesView/AttributesView.test.js +32 -0
- package/esm/AutoSizeList/AutoSizeList.test.js +28 -31
- package/esm/BasicTable/BasicTable.test.js +26 -5
- package/esm/BasicTable/IntegrationBasicTable.test.js +17 -6
- package/esm/BasicTable/helpers.test.js +1 -1
- package/esm/CollapseRowButton/CollapseRowButton.test.js +3 -3
- package/esm/CommentsContainer/CommentsContainer.test.js +2 -2
- package/esm/CustomDateRangeEditor/CustomDateRangeEditor.test.js +2 -2
- package/esm/DataTypeValue/DataTypeValue.test.js +2 -2
- package/esm/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/esm/DependentLookupEditor/DependentLookupEditor.test.js +116 -70
- package/esm/DropDownEditor/DropDownEditor.test.js +1 -1
- package/esm/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +4 -4
- package/esm/EditModeAttributesList/EditModeAttributesList.d.ts +1 -1
- package/esm/EditModeAttributesList/EditModeAttributesList.js +17 -6
- package/esm/EditModeAttributesList/EditModeAttributesList.test.js +5 -2
- package/esm/EditModeAttributesPager/EditModeAttributesPager.js +1 -2
- package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +4 -1
- package/esm/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +30 -16
- package/esm/EntitySelector/EntitySelector.test.js +13 -19
- package/esm/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +1 -1
- package/esm/EntitySelector/components/EntityOption/EntityOption.test.js +1 -1
- package/esm/EntitySelector/components/Group/Group.test.js +1 -1
- package/esm/EntityUriLink/EntityUriLink.test.js +1 -0
- package/esm/ErrorBoundary/ErrorBoundary.test.js +2 -0
- package/esm/ExpandedValueTooltip/ExpandedValueTooltip.test.js +4 -1
- package/esm/FilterButton/FilterButton.test.js +1 -1
- package/esm/HOCs/withFilter/components/ColumnFilter/ColumnFilter.spec.js +3 -3
- package/esm/HOCs/withTableContext/withTableContext.test.js +1 -1
- package/esm/HierarchyNodeTitle/HierarchyNodeTitle.test.js +4 -4
- package/esm/HierarchyNodeTitle/useEntityDetails.test.js +19 -10
- package/esm/ImageAttributesGallery/ImageAttributesGallery.test.js +6 -4
- package/esm/ImageAttributesGallery/components/HeaderRight/HeaderRight.test.js +1 -1
- package/esm/ImageAttributesLine/ImageAttributesLine.test.js +110 -68
- package/esm/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +4 -4
- package/esm/ImageGalleryDialog/ImageGalleryDialog.specs.js +3 -3
- package/esm/ImportButton/ImportButton.test.js +1 -1
- package/esm/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +1 -1
- package/esm/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +1 -1
- package/esm/InlineComplexAttribute/InlineComplexAttribute.test.js +3 -3
- package/esm/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +32 -23
- package/esm/LineChart/LineChart.test.js +1 -1
- package/esm/Link/Link.test.js +1 -0
- package/esm/LookupEditor/LookupEditor.test.js +3 -3
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +1 -1
- package/esm/MapChart/MapChart.test.js +3 -3
- package/esm/MetadataTypesSelector/MetadataTypesSelector.test.js +3 -3
- package/esm/MoreAttributesButton/MoreAttributesButton.test.js +1 -1
- package/esm/MultipleInput/MultipleInput.test.js +11 -11
- package/esm/MultipliableSelect/MultipliableSelect.test.js +14 -8
- package/esm/NestedAttributeEditor/NestedAttributeEditor.test.js +4 -4
- package/esm/NumberEditor/NumberEditor.test.js +4 -4
- package/esm/PieChart/PieChart.test.js +1 -1
- package/esm/PivotingTooltip/IntegrationPivotingTooltip.test.js +11 -11
- package/esm/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +4 -7
- package/esm/PivotingUriLink/PivotingUriLink.spec.js +1 -0
- package/esm/ProfileBandNavigation/useSearchNavigation.test.js +3 -3
- package/esm/ProfilesList/ProfilesList.spec.js +1 -1
- package/esm/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +1 -1
- package/esm/ReadOnlyAttributesList/ReadOnlyAttributesList.d.ts +2 -2
- package/esm/ReadOnlyAttributesList/ReadOnlyAttributesList.js +7 -5
- package/esm/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +1 -1
- package/esm/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +12 -3
- package/esm/ReadOnlyAttributesPager/components/EmptyRenderer/EmptyRenderer.d.ts +9 -0
- package/esm/ReadOnlyAttributesPager/components/EmptyRenderer/EmptyRenderer.js +13 -0
- package/esm/ReadOnlyAttributesPager/components/EmptyRenderer/index.d.ts +1 -0
- package/esm/ReadOnlyAttributesPager/components/EmptyRenderer/index.js +1 -0
- package/esm/ReadOnlyAttributesPager/styles.d.ts +1 -0
- package/esm/ReadOnlyAttributesPager/styles.js +4 -0
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +7 -8
- package/esm/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/esm/RelationEditor/RelationEditor.test.js +21 -22
- package/esm/ReltioMap/ReltioMap.spec.js +11 -9
- package/esm/ReltioMap/components/EntityMarker/EntityMarker.spec.js +3 -4
- package/esm/ScrollableTabs/ScrollableTabs.test.js +1 -1
- package/esm/SearchInput/SearchInput.spec.js +2 -2
- package/esm/SelectionPopup/SelectionPopup.spec.js +9 -12
- package/esm/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +4 -4
- package/esm/ShowLess/ShowLess.test.js +1 -1
- package/esm/ShowMore/ShowMore.test.js +2 -2
- package/esm/SideButtonsPanel/SideButtonsPanel.spec.js +3 -3
- package/esm/SimpleAttribute/IntegrationSimpleAttribute.test.js +16 -12
- package/esm/SimpleDropDownSelector/SimpleDropDownSelector.test.js +1 -1
- package/esm/TableWithBars/TableWithBars.test.js +1 -1
- package/esm/TreeChart/TreeChart.test.js +1 -1
- package/esm/TypeaheadEditor/TypeaheadEditor.test.js +8 -1
- package/esm/UploadFileButton/UploadFileButton.spec.js +103 -69
- package/esm/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +4 -1
- package/esm/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +3 -1
- package/esm/constants/attributes.d.ts +1 -1
- package/esm/constants/attributes.js +1 -1
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/contexts/AllwaysVisibleAttributesContext/index.d.ts +2 -0
- package/esm/contexts/AllwaysVisibleAttributesContext/index.js +3 -0
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +2 -2
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +1 -2
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +2 -3
- package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +4 -0
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +1 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +1 -2
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +13 -13
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +5 -5
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +4 -4
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +5 -5
- package/esm/features/crosswalks/AttributesTable/components/WinnerSourcesRenderer/WinnerSourcesRenderer.test.js +2 -2
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.d.ts +2 -2
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +4 -3
- package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +15 -16
- package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +1 -1
- package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +2 -2
- package/esm/features/crosswalks/hooks/useAttributeActions.test.js +95 -95
- package/esm/features/crosswalks/hooks/useCrosswalkActions.test.js +38 -38
- package/esm/features/crosswalks/hooks/useModifiedEntity.test.js +8 -8
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +2 -2
- package/esm/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js +5 -3
- package/esm/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +2 -2
- package/esm/features/history/HistoryRow/HistoryRow.specs.js +2 -3
- package/esm/features/history/HistoryTree/HistoryTree.specs.js +1 -1
- package/esm/features/history/HistoryView/HistoryView.specs.js +1 -1
- package/esm/features/history/helpers/filters.test.js +6 -6
- package/esm/features/history/hooks/useHistory.test.js +23 -25
- package/esm/features/workflow/AddWorkflowDialog/AddWorkflowDialog.spec.js +25 -9
- package/esm/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -3
- package/esm/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +5 -8
- package/esm/features/workflow/hooks/useChangeRequest.specs.js +11 -13
- package/esm/helpers/attributesView.d.ts +1 -1
- package/esm/helpers/attributesView.js +2 -2
- package/esm/helpers/customScript.test.js +19 -19
- package/esm/hooks/useAPI/useAPI.test.js +12 -12
- package/esm/hooks/useBasicTableCellRenderer/CellRenderer.test.js +2 -1
- package/esm/hooks/useCollapsibleTableRows/dataHelpers.test.js +1 -1
- package/esm/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/esm/hooks/useConfigPermissions/useConfigPermissions.specs.js +6 -7
- package/esm/hooks/useCustomScripts/useCustomScripts.test.js +8 -8
- package/esm/hooks/useLayoutResetter/useLayoutResetter.test.js +9 -9
- package/esm/hooks/useMarkers/helpers.js +1 -2
- package/esm/hooks/useReadableSearchState/useReadableSearchState.test.js +8 -15
- package/esm/hooks/useRelationsLoader/useRelationsLoader.specs.js +1 -2
- package/esm/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +4 -4
- package/esm/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/esm/hooks/useSnackbar/useSnackbar.test.js +25 -18
- package/package.json +2 -2
|
@@ -49,7 +49,6 @@ import React from 'react';
|
|
|
49
49
|
import { mount, ReactWrapper, shallow } from 'enzyme';
|
|
50
50
|
import { act } from 'react-dom/test-utils';
|
|
51
51
|
import { debounce } from '@reltio/mdm-sdk';
|
|
52
|
-
import { delayPromise } from '../test-utils';
|
|
53
52
|
import { ReactSelect } from '../ReactSelect';
|
|
54
53
|
import { DependentLookupAutopopulationContext } from '../contexts/DependentLookupAutopopulationContext';
|
|
55
54
|
import { ReactSelectOptionWithCheckIcon } from '../ReactSelectOptionWithCheckIcon';
|
|
@@ -129,7 +128,7 @@ describe('DependentLookupEditor', function () {
|
|
|
129
128
|
wrapper.update();
|
|
130
129
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(newInputValue);
|
|
131
130
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
132
|
-
expect(props.getLookups).
|
|
131
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
133
132
|
type: 'COUNTRY_CD',
|
|
134
133
|
parents: [],
|
|
135
134
|
displayNamePrefix: newInputValue,
|
|
@@ -142,7 +141,7 @@ describe('DependentLookupEditor', function () {
|
|
|
142
141
|
wrapper.update();
|
|
143
142
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe('');
|
|
144
143
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
145
|
-
expect(props.getLookups).
|
|
144
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
146
145
|
type: 'COUNTRY_CD',
|
|
147
146
|
parents: [],
|
|
148
147
|
displayNamePrefix: '',
|
|
@@ -188,7 +187,7 @@ describe('DependentLookupEditor', function () {
|
|
|
188
187
|
wrapper.update();
|
|
189
188
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(newInputValue);
|
|
190
189
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
191
|
-
expect(props.getLookups).
|
|
190
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
192
191
|
type: 'COUNTRY_CD',
|
|
193
192
|
parents: [],
|
|
194
193
|
displayNamePrefix: newInputValue,
|
|
@@ -201,7 +200,7 @@ describe('DependentLookupEditor', function () {
|
|
|
201
200
|
wrapper.update();
|
|
202
201
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(getOptionLabel(value));
|
|
203
202
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
204
|
-
expect(props.getLookups).
|
|
203
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
205
204
|
type: 'COUNTRY_CD',
|
|
206
205
|
parents: [],
|
|
207
206
|
displayNamePrefix: '',
|
|
@@ -223,7 +222,7 @@ describe('DependentLookupEditor', function () {
|
|
|
223
222
|
wrapper.update();
|
|
224
223
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(newInputValue);
|
|
225
224
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
226
|
-
expect(props.getLookups).
|
|
225
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
227
226
|
type: 'COUNTRY_CD',
|
|
228
227
|
parents: [],
|
|
229
228
|
displayNamePrefix: newInputValue,
|
|
@@ -236,7 +235,7 @@ describe('DependentLookupEditor', function () {
|
|
|
236
235
|
wrapper.update();
|
|
237
236
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(getOptionLabel(value));
|
|
238
237
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
239
|
-
expect(props.getLookups).
|
|
238
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
240
239
|
type: 'COUNTRY_CD',
|
|
241
240
|
parents: [],
|
|
242
241
|
displayNamePrefix: '',
|
|
@@ -328,7 +327,7 @@ describe('DependentLookupEditor', function () {
|
|
|
328
327
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
329
328
|
return __generator(this, function (_a) {
|
|
330
329
|
switch (_a.label) {
|
|
331
|
-
case 0: return [4 /*yield*/,
|
|
330
|
+
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
332
331
|
case 1:
|
|
333
332
|
_a.sent();
|
|
334
333
|
return [2 /*return*/];
|
|
@@ -354,16 +353,13 @@ describe('DependentLookupEditor', function () {
|
|
|
354
353
|
case 2:
|
|
355
354
|
_a.sent();
|
|
356
355
|
// loaded options length is equal to (max + 1) so there are more options exist
|
|
357
|
-
expect(getLookups).
|
|
356
|
+
expect(getLookups).toHaveBeenCalledWith({
|
|
358
357
|
type: props.lookupCode,
|
|
359
358
|
parents: props.parents,
|
|
360
359
|
displayNamePrefix: '',
|
|
361
360
|
max: 3,
|
|
362
361
|
offset: 2
|
|
363
362
|
});
|
|
364
|
-
return [4 /*yield*/, Promise.resolve()];
|
|
365
|
-
case 3:
|
|
366
|
-
_a.sent();
|
|
367
363
|
wrapper.update();
|
|
368
364
|
expect(wrapper.find(ReactSelect).prop('options').length).toBe(4);
|
|
369
365
|
expect(findLoadMoreButton(wrapper).exists()).toBeTruthy();
|
|
@@ -387,7 +383,7 @@ describe('DependentLookupEditor', function () {
|
|
|
387
383
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
388
384
|
return __generator(this, function (_a) {
|
|
389
385
|
switch (_a.label) {
|
|
390
|
-
case 0: return [4 /*yield*/,
|
|
386
|
+
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
391
387
|
case 1:
|
|
392
388
|
_a.sent();
|
|
393
389
|
return [2 /*return*/];
|
|
@@ -411,9 +407,6 @@ describe('DependentLookupEditor', function () {
|
|
|
411
407
|
});
|
|
412
408
|
}); })];
|
|
413
409
|
case 2:
|
|
414
|
-
_a.sent();
|
|
415
|
-
return [4 /*yield*/, Promise.resolve()];
|
|
416
|
-
case 3:
|
|
417
410
|
_a.sent();
|
|
418
411
|
wrapper.update();
|
|
419
412
|
expect(wrapper.find(ReactSelect).prop('options').length).toBe(4);
|
|
@@ -477,7 +470,7 @@ describe('DependentLookupEditor', function () {
|
|
|
477
470
|
case 0:
|
|
478
471
|
wrapper = mount(React.createElement(DependentLookupEditor, __assign({}, props)));
|
|
479
472
|
expect(wrapper.find(ReactSelect).prop('options')).toEqual([]);
|
|
480
|
-
expect(props.getLookups).
|
|
473
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
481
474
|
type: props.lookupCode,
|
|
482
475
|
parents: props.parents,
|
|
483
476
|
displayNamePrefix: '',
|
|
@@ -514,7 +507,7 @@ describe('DependentLookupEditor', function () {
|
|
|
514
507
|
wrapper.setProps({
|
|
515
508
|
lookupCode: 'SPEC'
|
|
516
509
|
});
|
|
517
|
-
expect(props.getLookups).
|
|
510
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
518
511
|
type: 'SPEC',
|
|
519
512
|
parents: [],
|
|
520
513
|
displayNamePrefix: '',
|
|
@@ -559,9 +552,9 @@ describe('DependentLookupEditor', function () {
|
|
|
559
552
|
case 1:
|
|
560
553
|
_a.sent();
|
|
561
554
|
wrapper.find('input').simulate('keyDown', { key: 'ArrowDown' });
|
|
562
|
-
expect(props.onChange).not.
|
|
555
|
+
expect(props.onChange).not.toHaveBeenCalled();
|
|
563
556
|
wrapper.find(ReactSelectOptionWithCheckIcon).at(1).find('div').at(0).simulate('click');
|
|
564
|
-
expect(props.onChange).
|
|
557
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
565
558
|
value: 'Russia',
|
|
566
559
|
lookupCode: 'RU'
|
|
567
560
|
});
|
|
@@ -569,20 +562,32 @@ describe('DependentLookupEditor', function () {
|
|
|
569
562
|
}
|
|
570
563
|
});
|
|
571
564
|
}); });
|
|
572
|
-
it('should call props.getLookups with correct values on select input change', function () {
|
|
573
|
-
var wrapper
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
565
|
+
it('should call props.getLookups with correct values on select input change', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
566
|
+
var wrapper, newInputValue;
|
|
567
|
+
return __generator(this, function (_a) {
|
|
568
|
+
switch (_a.label) {
|
|
569
|
+
case 0:
|
|
570
|
+
wrapper = mount(React.createElement(DependentLookupEditor, __assign({}, props)));
|
|
571
|
+
newInputValue = 'Ch';
|
|
572
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
573
|
+
return __generator(this, function (_a) {
|
|
574
|
+
wrapper.find('Select').prop('onInputChange')(newInputValue, { action: 'input-change' });
|
|
575
|
+
return [2 /*return*/];
|
|
576
|
+
});
|
|
577
|
+
}); })];
|
|
578
|
+
case 1:
|
|
579
|
+
_a.sent();
|
|
580
|
+
expect(props.getLookups).toHaveBeenCalledWith({
|
|
581
|
+
type: props.lookupCode,
|
|
582
|
+
parents: props.parents,
|
|
583
|
+
displayNamePrefix: newInputValue,
|
|
584
|
+
max: 51,
|
|
585
|
+
offset: 0
|
|
586
|
+
});
|
|
587
|
+
return [2 /*return*/];
|
|
588
|
+
}
|
|
584
589
|
});
|
|
585
|
-
});
|
|
590
|
+
}); });
|
|
586
591
|
it('should call props.getLookups with correct values on select input change and set offset to default', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
587
592
|
var getLookups, value, wrapper, newInputValue, nextNewInputValue;
|
|
588
593
|
return __generator(this, function (_a) {
|
|
@@ -600,7 +605,16 @@ describe('DependentLookupEditor', function () {
|
|
|
600
605
|
act(function () {
|
|
601
606
|
wrapper.find('Select').prop('onInputChange')(newInputValue, { action: 'input-change' });
|
|
602
607
|
});
|
|
603
|
-
return [4 /*yield*/,
|
|
608
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
609
|
+
return __generator(this, function (_a) {
|
|
610
|
+
switch (_a.label) {
|
|
611
|
+
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
612
|
+
case 1:
|
|
613
|
+
_a.sent();
|
|
614
|
+
return [2 /*return*/];
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
}); })];
|
|
604
618
|
case 1:
|
|
605
619
|
_a.sent();
|
|
606
620
|
wrapper.update();
|
|
@@ -626,7 +640,7 @@ describe('DependentLookupEditor', function () {
|
|
|
626
640
|
case 2:
|
|
627
641
|
_a.sent();
|
|
628
642
|
// offset === max
|
|
629
|
-
expect(getLookups).
|
|
643
|
+
expect(getLookups).toHaveBeenCalledWith({
|
|
630
644
|
type: props.lookupCode,
|
|
631
645
|
parents: props.parents,
|
|
632
646
|
displayNamePrefix: newInputValue,
|
|
@@ -649,7 +663,7 @@ describe('DependentLookupEditor', function () {
|
|
|
649
663
|
}
|
|
650
664
|
});
|
|
651
665
|
}); });
|
|
652
|
-
|
|
666
|
+
xit('should call props.getLookups with default offset = 0 after LookupCode updated', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
653
667
|
var getLookups, wrapper, newLookupCode;
|
|
654
668
|
return __generator(this, function (_a) {
|
|
655
669
|
switch (_a.label) {
|
|
@@ -661,7 +675,16 @@ describe('DependentLookupEditor', function () {
|
|
|
661
675
|
RU: { displayName: 'Russia' }
|
|
662
676
|
}));
|
|
663
677
|
wrapper = mount(React.createElement(DependentLookupEditor, __assign({}, props, { getLookups: getLookups, max: 2 })));
|
|
664
|
-
return [4 /*yield*/,
|
|
678
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
679
|
+
return __generator(this, function (_a) {
|
|
680
|
+
switch (_a.label) {
|
|
681
|
+
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
682
|
+
case 1:
|
|
683
|
+
_a.sent();
|
|
684
|
+
return [2 /*return*/];
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
}); })];
|
|
665
688
|
case 1:
|
|
666
689
|
_a.sent();
|
|
667
690
|
wrapper.update();
|
|
@@ -686,7 +709,7 @@ describe('DependentLookupEditor', function () {
|
|
|
686
709
|
}); })];
|
|
687
710
|
case 2:
|
|
688
711
|
_a.sent();
|
|
689
|
-
expect(getLookups).
|
|
712
|
+
expect(getLookups).toHaveBeenCalledWith({
|
|
690
713
|
type: props.lookupCode,
|
|
691
714
|
parents: props.parents,
|
|
692
715
|
displayNamePrefix: '',
|
|
@@ -722,10 +745,12 @@ describe('DependentLookupEditor', function () {
|
|
|
722
745
|
getLookups.mockReturnValue(Promise.resolve({}));
|
|
723
746
|
wrapper = mount(React.createElement(DependentLookupEditor, __assign({}, props, { getLookups: getLookups })));
|
|
724
747
|
newInputValue = 'Ch';
|
|
725
|
-
act(function () {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
748
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
749
|
+
return __generator(this, function (_a) {
|
|
750
|
+
wrapper.find('Select').prop('onInputChange')(newInputValue, { action: 'input-change' });
|
|
751
|
+
return [2 /*return*/];
|
|
752
|
+
});
|
|
753
|
+
}); })];
|
|
729
754
|
case 1:
|
|
730
755
|
_a.sent();
|
|
731
756
|
wrapper.update();
|
|
@@ -766,16 +791,18 @@ describe('DependentLookupEditor', function () {
|
|
|
766
791
|
wrapper = mount(React.createElement(DependentLookupEditor, __assign({}, props, { getLookups: getLookups, value: value, multiple: false })));
|
|
767
792
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe('USA (US)');
|
|
768
793
|
newInputValue = 'u';
|
|
769
|
-
act(function () {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
794
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
795
|
+
return __generator(this, function (_a) {
|
|
796
|
+
wrapper.find(ReactSelect).prop('onInputChange')(newInputValue, { action: 'input-change' });
|
|
797
|
+
return [2 /*return*/];
|
|
798
|
+
});
|
|
799
|
+
}); })];
|
|
773
800
|
case 1:
|
|
774
801
|
_a.sent();
|
|
775
802
|
wrapper.update();
|
|
776
803
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(newInputValue);
|
|
777
804
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
778
|
-
expect(getLookups).
|
|
805
|
+
expect(getLookups).toHaveBeenCalledWith({
|
|
779
806
|
type: 'COUNTRY_CD',
|
|
780
807
|
parents: [],
|
|
781
808
|
displayNamePrefix: newInputValue,
|
|
@@ -800,16 +827,18 @@ describe('DependentLookupEditor', function () {
|
|
|
800
827
|
wrapper = mount(React.createElement(DependentLookupEditor, __assign({}, props, { getLookups: getLookups, value: value, multiple: false })));
|
|
801
828
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe('USA (US)');
|
|
802
829
|
newInputValue = '';
|
|
803
|
-
act(function () {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
830
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
831
|
+
return __generator(this, function (_a) {
|
|
832
|
+
wrapper.find(ReactSelect).prop('onInputChange')(newInputValue, { action: 'input-change' });
|
|
833
|
+
return [2 /*return*/];
|
|
834
|
+
});
|
|
835
|
+
}); })];
|
|
807
836
|
case 1:
|
|
808
837
|
_a.sent();
|
|
809
838
|
wrapper.update();
|
|
810
839
|
expect(wrapper.find(ReactSelect).find('Input').last().prop('value')).toBe(newInputValue);
|
|
811
840
|
expect(props.onChange).toHaveBeenCalledWith('');
|
|
812
|
-
expect(getLookups).
|
|
841
|
+
expect(getLookups).toHaveBeenCalledWith({
|
|
813
842
|
type: 'COUNTRY_CD',
|
|
814
843
|
parents: [],
|
|
815
844
|
displayNamePrefix: '',
|
|
@@ -830,7 +859,7 @@ describe('DependentLookupEditor', function () {
|
|
|
830
859
|
};
|
|
831
860
|
var value = { lookupCode: 'DE', value: '' };
|
|
832
861
|
mount(React.createElement(DependentLookupEditor, __assign({}, props, { lookups: lookups, value: value })));
|
|
833
|
-
expect(props.onChange).
|
|
862
|
+
expect(props.onChange).toHaveBeenCalledWith({
|
|
834
863
|
lookupCode: 'DE',
|
|
835
864
|
value: 'Germany'
|
|
836
865
|
});
|
|
@@ -838,20 +867,21 @@ describe('DependentLookupEditor', function () {
|
|
|
838
867
|
it('should call props.resolveLookups if lookup is unresolved and has no resolved value in lookups', function () {
|
|
839
868
|
var value = { lookupCode: 'DE', value: '' };
|
|
840
869
|
mount(React.createElement(DependentLookupEditor, __assign({}, props, { value: value })));
|
|
841
|
-
expect(props.resolveLookups).
|
|
870
|
+
expect(props.resolveLookups).toHaveBeenCalledWith(props.lookupCode, ['DE']);
|
|
842
871
|
});
|
|
843
872
|
it('should call props.resolveLookups once if lookup is unresolved and has no resolved value in lookups and has no resolved value in response', function () {
|
|
844
873
|
var value = { lookupCode: 'DE', value: '' };
|
|
845
874
|
var component = mount(React.createElement(DependentLookupEditor, __assign({}, props, { value: value })));
|
|
846
875
|
component.setProps({ value: __assign({}, value) });
|
|
847
876
|
expect(props.resolveLookups).toHaveBeenCalledTimes(1);
|
|
848
|
-
expect(props.resolveLookups).
|
|
877
|
+
expect(props.resolveLookups).toHaveBeenCalledWith(props.lookupCode, ['DE']);
|
|
849
878
|
});
|
|
850
879
|
it('should use debounced variant of loadOptions on input change', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
851
880
|
var getLookups, component, select;
|
|
852
881
|
return __generator(this, function (_a) {
|
|
853
882
|
switch (_a.label) {
|
|
854
883
|
case 0:
|
|
884
|
+
jest.useFakeTimers();
|
|
855
885
|
debounce.mockImplementation(originalDebounce);
|
|
856
886
|
getLookups = jest.fn().mockReturnValue(Promise.resolve({
|
|
857
887
|
US: { displayName: 'USA' },
|
|
@@ -859,13 +889,16 @@ describe('DependentLookupEditor', function () {
|
|
|
859
889
|
}));
|
|
860
890
|
component = shallow(React.createElement(DependentLookupEditor, __assign({}, props, { getLookups: getLookups })));
|
|
861
891
|
select = component.find(ReactSelect);
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
892
|
+
act(function () {
|
|
893
|
+
select.prop('onInputChange')('u', { action: 'input-change' });
|
|
894
|
+
});
|
|
895
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
896
|
+
return __generator(this, function (_a) {
|
|
897
|
+
jest.advanceTimersByTime(DEBOUNCE_INTERVAL);
|
|
898
|
+
return [2 /*return*/];
|
|
899
|
+
});
|
|
900
|
+
}); })];
|
|
865
901
|
case 1:
|
|
866
|
-
_a.sent();
|
|
867
|
-
return [4 /*yield*/, delayPromise(1)];
|
|
868
|
-
case 2:
|
|
869
902
|
_a.sent();
|
|
870
903
|
expect(getLookups).toHaveBeenCalledTimes(1);
|
|
871
904
|
expect(component.find(ReactSelect).prop('options')).toEqual([
|
|
@@ -876,6 +909,7 @@ describe('DependentLookupEditor', function () {
|
|
|
876
909
|
{ lookupCode: 'US', value: 'USA' }
|
|
877
910
|
]);
|
|
878
911
|
expect(debounce).toHaveBeenCalled();
|
|
912
|
+
jest.useRealTimers();
|
|
879
913
|
return [2 /*return*/];
|
|
880
914
|
}
|
|
881
915
|
});
|
|
@@ -895,7 +929,9 @@ describe('DependentLookupEditor', function () {
|
|
|
895
929
|
];
|
|
896
930
|
var component = shallow(React.createElement(DependentLookupEditor, __assign({}, props, { parents: parents })));
|
|
897
931
|
var select = component.find(ReactSelect);
|
|
898
|
-
|
|
932
|
+
act(function () {
|
|
933
|
+
select.prop('onInputChange')('u', { action: 'input-change' });
|
|
934
|
+
});
|
|
899
935
|
expect(component.prop('isDisabled')).toBeFalsy();
|
|
900
936
|
expect(props.getLookups).toHaveBeenCalledTimes(1);
|
|
901
937
|
expect(props.getLookups).toHaveBeenCalledWith({
|
|
@@ -914,14 +950,15 @@ describe('DependentLookupEditor', function () {
|
|
|
914
950
|
parents = null;
|
|
915
951
|
component = shallow(React.createElement(DependentLookupEditor, __assign({}, props, { parents: parents })));
|
|
916
952
|
select = component.find(ReactSelect);
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
953
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
954
|
+
return __generator(this, function (_a) {
|
|
955
|
+
select.prop('onInputChange')('u', { action: 'input-change' });
|
|
956
|
+
return [2 /*return*/];
|
|
957
|
+
});
|
|
958
|
+
}); })];
|
|
920
959
|
case 1:
|
|
921
960
|
_a.sent();
|
|
922
|
-
|
|
923
|
-
case 2:
|
|
924
|
-
_a.sent();
|
|
961
|
+
expect(props.getLookups).not.toHaveBeenCalled();
|
|
925
962
|
expect(component.find(ReactSelect).prop('options')).toEqual([]);
|
|
926
963
|
return [2 /*return*/];
|
|
927
964
|
}
|
|
@@ -931,7 +968,9 @@ describe('DependentLookupEditor', function () {
|
|
|
931
968
|
var parents = undefined;
|
|
932
969
|
var component = shallow(React.createElement(DependentLookupEditor, __assign({}, props, { parents: parents })));
|
|
933
970
|
var select = component.find(ReactSelect);
|
|
934
|
-
|
|
971
|
+
act(function () {
|
|
972
|
+
select.prop('onInputChange')('u', { action: 'input-change' });
|
|
973
|
+
});
|
|
935
974
|
expect(props.getLookups).toHaveBeenCalledTimes(1);
|
|
936
975
|
expect(props.getLookups).toHaveBeenCalledWith({
|
|
937
976
|
displayNamePrefix: 'u',
|
|
@@ -1084,7 +1123,14 @@ describe('DependentLookupEditor', function () {
|
|
|
1084
1123
|
case 1:
|
|
1085
1124
|
_a.sent();
|
|
1086
1125
|
select = component.find(ReactSelect);
|
|
1087
|
-
|
|
1126
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1127
|
+
return __generator(this, function (_a) {
|
|
1128
|
+
select.prop('onInputChange')('Ru', { action: 'input-change' });
|
|
1129
|
+
return [2 /*return*/];
|
|
1130
|
+
});
|
|
1131
|
+
}); })];
|
|
1132
|
+
case 2:
|
|
1133
|
+
_a.sent();
|
|
1088
1134
|
expect(getLookups).toHaveBeenCalledTimes(2);
|
|
1089
1135
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
1090
1136
|
return [2 /*return*/];
|
|
@@ -28,6 +28,6 @@ describe('DropDownEditor', function () {
|
|
|
28
28
|
var onChange = jest.fn(), value = 'Enum2';
|
|
29
29
|
var wrapper = shallow(React.createElement(DropDownEditor, { onChange: onChange, entries: entries }));
|
|
30
30
|
wrapper.find(MultipliableSelect).simulate('change', value);
|
|
31
|
-
expect(onChange).
|
|
31
|
+
expect(onChange).toHaveBeenCalledWith(value);
|
|
32
32
|
});
|
|
33
33
|
});
|
package/esm/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js
CHANGED
|
@@ -22,12 +22,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { shallow } from 'enzyme';
|
|
25
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
26
25
|
import { EditModeAttribute } from './EditModeAttribute';
|
|
26
|
+
import { isReltioCrosswalk } from '@reltio/mdm-sdk';
|
|
27
27
|
import { SimpleAttributeEditor } from '../../../SimpleAttributeEditor';
|
|
28
28
|
import { NestedAttributeEditor } from '../../../NestedAttributeEditor';
|
|
29
29
|
import { ReferenceAttributeEditor } from '../../../ReferenceAttributeEditor';
|
|
30
|
-
jest.mock('@reltio/mdm-sdk');
|
|
30
|
+
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { isReltioCrosswalk: jest.fn() })); });
|
|
31
31
|
describe('EditModeAttribute', function () {
|
|
32
32
|
it('should render Simple attribute', function () {
|
|
33
33
|
var props = {
|
|
@@ -93,7 +93,7 @@ describe('EditModeAttribute', function () {
|
|
|
93
93
|
errors: [],
|
|
94
94
|
error: {}
|
|
95
95
|
};
|
|
96
|
-
|
|
96
|
+
isReltioCrosswalk.mockReturnValue(true);
|
|
97
97
|
var component = shallow(React.createElement(EditModeAttribute, __assign({}, props)));
|
|
98
98
|
expect(component.find(SimpleAttributeEditor).length).toBe(1);
|
|
99
99
|
expect(component.find(NestedAttributeEditor).length).toBe(0);
|
|
@@ -101,6 +101,6 @@ describe('EditModeAttribute', function () {
|
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
102
102
|
var showEmptyEditors = props.showEmptyEditors, onAddAttributes = props.onAddAttributes, lazy = props.lazy, crosswalks = props.crosswalks, errors = props.errors, filteredProps = __rest(props, ["showEmptyEditors", "onAddAttributes", "lazy", "crosswalks", "errors"]); //eslint-disable-line no-unused-vars
|
|
103
103
|
expect(component.find(SimpleAttributeEditor).props()).toEqual(__assign(__assign({}, filteredProps), { isReltioCrosswalk: true }));
|
|
104
|
-
expect(
|
|
104
|
+
expect(isReltioCrosswalk).toHaveBeenCalledWith(props.crosswalks, props.attributeValue);
|
|
105
105
|
});
|
|
106
106
|
});
|
|
@@ -10,7 +10,7 @@ declare const _default: React.ComponentType<{
|
|
|
10
10
|
showEmptyEditors?: boolean;
|
|
11
11
|
showNonOv?: boolean;
|
|
12
12
|
className?: string;
|
|
13
|
-
|
|
13
|
+
fixedTypeUris?: string[];
|
|
14
14
|
highlightAttribute?: (element: AttributeType, type: ScrollType) => void;
|
|
15
15
|
} & Pick<EditModeAttributesPagerProps<AttributeValue>, "mode" | "crosswalks" | "parentUri" | "drawLines" | "onAddAttributes" | "onDeleteAttribute" | "onChangeAttribute" | "additionalControlsRenderer" | "showEmptyEditors">>;
|
|
16
16
|
export default _default;
|
|
@@ -16,7 +16,7 @@ import { last, path } from 'ramda';
|
|
|
16
16
|
import { EditModeAttributesPager } from '../EditModeAttributesPager';
|
|
17
17
|
import { BranchDecorator } from '../BranchDecorator';
|
|
18
18
|
import { MoreAttributesButton } from '../MoreAttributesButton';
|
|
19
|
-
import {
|
|
19
|
+
import { FIXED_TYPE_URIS } from '../constants';
|
|
20
20
|
import { splitPagersData } from '../helpers/attributesView';
|
|
21
21
|
import { getMoreAttrTypes } from './helpers';
|
|
22
22
|
import { PinnedAttributesContext } from '../contexts/PinnedAttributesContext';
|
|
@@ -25,11 +25,13 @@ import { withContext } from '../HOCs/withContext';
|
|
|
25
25
|
import { ConfigPermissionsContext } from '../contexts/ConfigPermissionsContext';
|
|
26
26
|
import { ScrollType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
27
27
|
import { HiddenAttributesContext } from '../contexts/HiddenAttributesContext';
|
|
28
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AllwaysVisibleAttributesContext';
|
|
28
29
|
var EditModeAttributesList = function (_a) {
|
|
29
|
-
var parentAttributeType = _a.parentAttributeType, attrTypes = _a.attrTypes, entity = _a.entity, parentUri = _a.parentUri, showEmptyEditors = _a.showEmptyEditors, mode = _a.mode, crosswalks = _a.crosswalks, drawLines = _a.drawLines, children = _a.children, className = _a.className, _b = _a.
|
|
30
|
+
var parentAttributeType = _a.parentAttributeType, attrTypes = _a.attrTypes, entity = _a.entity, parentUri = _a.parentUri, showEmptyEditors = _a.showEmptyEditors, mode = _a.mode, crosswalks = _a.crosswalks, drawLines = _a.drawLines, children = _a.children, className = _a.className, _b = _a.fixedTypeUris, fixedTypeUris = _b === void 0 ? FIXED_TYPE_URIS : _b, onAddAttributes = _a.onAddAttributes, onChangeAttribute = _a.onChangeAttribute, onDeleteAttribute = _a.onDeleteAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, showNonOv = _a.showNonOv, highlightAttribute = _a.highlightAttribute;
|
|
30
31
|
var hiddenAttributes = useContext(HiddenAttributesContext);
|
|
31
32
|
var entityUri = parentUri && getBaseUri(parentUri);
|
|
32
33
|
var currentEntityHiddenAttributes = useMemo(function () { return hiddenAttributes[entityUri] || []; }, [hiddenAttributes, entityUri]);
|
|
34
|
+
var alwaysVisibleAttributes = useContext(AlwaysVisibleAttributesContext);
|
|
33
35
|
var filteredAttrTypes = useMemo(function () { return attrTypes.filter(function (attrType) { return !currentEntityHiddenAttributes.includes(attrType.uri); }); }, [attrTypes, currentEntityHiddenAttributes]);
|
|
34
36
|
var _c = entity.attributes, attributes = _c === void 0 ? {} : _c;
|
|
35
37
|
var _d = useState({}), hasDeletionsMap = _d[0], setHasDeletionsMap = _d[1];
|
|
@@ -48,9 +50,18 @@ var EditModeAttributesList = function (_a) {
|
|
|
48
50
|
var moreAttrTypes = getMoreAttrTypes(creatableAttrTypes, entity, showEmptyEditors, hasDeletionsMap);
|
|
49
51
|
var pinnedAttributes = useContext(PinnedAttributesContext);
|
|
50
52
|
var pagersData = useMemo(function () {
|
|
51
|
-
return getAttributesListForEditMode(filteredAttrTypes, mode, entity, showEmptyEditors, showNonOv, pinnedAttributes, canCreate);
|
|
52
|
-
}, [
|
|
53
|
-
|
|
53
|
+
return getAttributesListForEditMode(filteredAttrTypes, mode, entity, showEmptyEditors, showNonOv, pinnedAttributes, canCreate, alwaysVisibleAttributes);
|
|
54
|
+
}, [
|
|
55
|
+
filteredAttrTypes,
|
|
56
|
+
mode,
|
|
57
|
+
entity,
|
|
58
|
+
showEmptyEditors,
|
|
59
|
+
showNonOv,
|
|
60
|
+
pinnedAttributes,
|
|
61
|
+
canCreate,
|
|
62
|
+
alwaysVisibleAttributes
|
|
63
|
+
]);
|
|
64
|
+
var _e = useMemo(function () { return splitPagersData(fixedTypeUris, pagersData); }, [pagersData, fixedTypeUris]), fixedPagersData = _e[0], regularPagersData = _e[1];
|
|
54
65
|
var onAddMoreAttributes = useCallback(function (attributeTypes) {
|
|
55
66
|
onAddAttributes(attributeTypes.map(function (attributeType) { return ({
|
|
56
67
|
attributeType: attributeType,
|
|
@@ -68,7 +79,7 @@ var EditModeAttributesList = function (_a) {
|
|
|
68
79
|
return (React.createElement("div", { className: className },
|
|
69
80
|
children && React.createElement(BranchDecorator, __assign({}, decoratorProps), children),
|
|
70
81
|
React.createElement(BranchDecorator, __assign({}, decoratorProps, { plain: true }), moreAttrTypes.length > 0 && mode !== Mode.Viewing && (React.createElement(MoreAttributesButton, { label: i18n.text('More attributes'), onApply: onAddMoreAttributes, dense: drawLines, data: moreAttrTypes, parent: canCreateParentAttrType && parentAttributeType }))),
|
|
71
|
-
React.createElement(HasDeletionsContext.Provider, { value: hasDeletionsContextValue }, regularPagersData.concat(
|
|
82
|
+
React.createElement(HasDeletionsContext.Provider, { value: hasDeletionsContextValue }, regularPagersData.concat(fixedPagersData).map(function (_a) {
|
|
72
83
|
var attrType = _a.attrType, values = _a.values;
|
|
73
84
|
return (React.createElement(EditModeAttributesPager, { key: "".concat(attrType.uri, "_").concat(parentUri), attributeType: attrType, drawLines: drawLines, values: values, paging: path(['paging', attrType.uri], attributes), parentUri: parentUri, showEmptyEditors: showEmptyEditors, mode: mode, crosswalks: crosswalks, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onDeleteAttribute, additionalControlsRenderer: additionalControlsRenderer, showNonOv: showNonOv }));
|
|
74
85
|
}))));
|
|
@@ -20,6 +20,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
20
20
|
};
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import { mount } from 'enzyme';
|
|
23
|
+
import { act } from 'react-dom/test-utils';
|
|
23
24
|
import EditModeAttributesList from './EditModeAttributesList';
|
|
24
25
|
import { MoreAttributesButton } from '../MoreAttributesButton';
|
|
25
26
|
import { EditModeAttributesPager } from '../EditModeAttributesPager';
|
|
@@ -129,7 +130,9 @@ describe('EditModeAttributesList tests', function () {
|
|
|
129
130
|
var component = mount(React.createElement(EditModeAttributesList, { attrTypes: attrTypes, entity: entity, parentUri: parentUri, showEmptyEditors: true }));
|
|
130
131
|
var _b = component.find(HasDeletionsContext.Provider).prop('value'), hasDeletionsMap = _b.hasDeletionsMap, setHasDeletions = _b.setHasDeletions;
|
|
131
132
|
expect(hasDeletionsMap).toEqual({});
|
|
132
|
-
|
|
133
|
+
act(function () {
|
|
134
|
+
setHasDeletions(attrTypes[0].uri, true);
|
|
135
|
+
});
|
|
133
136
|
rerenderWrapper(component);
|
|
134
137
|
expect(component.find(MoreAttributesButton).length).toBe(1);
|
|
135
138
|
expect(component.find(MoreAttributesButton).prop('data')).toEqual([attrTypes[0]]);
|
|
@@ -348,6 +351,6 @@ describe('EditModeAttributesList tests', function () {
|
|
|
348
351
|
mount(React.createElement(PinnedAttributesContext.Provider, { value: pinnedAttributes },
|
|
349
352
|
React.createElement(EditModeAttributesList, { mode: Mode.Editing, attrTypes: attributesList, entity: entity, parentUri: parentUri },
|
|
350
353
|
React.createElement(Child, null))));
|
|
351
|
-
expect(getAttributesListForEditMode).toHaveBeenCalledWith(attributesList, Mode.Editing, entity, undefined, undefined, pinnedAttributes, true);
|
|
354
|
+
expect(getAttributesListForEditMode).toHaveBeenCalledWith(attributesList, Mode.Editing, entity, undefined, undefined, pinnedAttributes, true, []);
|
|
352
355
|
});
|
|
353
356
|
});
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React, { useContext, useMemo } from 'react';
|
|
13
|
-
import { getAttributeErrorByTypeUri, getAttributePagerActiveTypeErrorMessage, getBaseUri, isAttributeTypeError, isImage, isOv, isSpecialAttribute, Mode } from '@reltio/mdm-sdk';
|
|
13
|
+
import { getAttributeErrorByTypeUri, getAttributePagerActiveTypeErrorMessage, getBaseUri, isAttributeTypeError, isImage, isOv, isSpecialAttribute, Mode, filterErrorsForHiddenAttributes } from '@reltio/mdm-sdk';
|
|
14
14
|
import { always, cond, T, partition } from 'ramda';
|
|
15
15
|
import { BranchDecorator } from '../BranchDecorator';
|
|
16
16
|
import { AttributeRenderer } from './components/AttributeRenderer';
|
|
@@ -21,7 +21,6 @@ import { RENDERER_TYPES } from './types';
|
|
|
21
21
|
import { isHighlightedAttributeType, isHighlightedErrorType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
22
22
|
import { useMdmAction, useMdmActiveErrorsForAttributesPager, useMdmMaxValuesInResponse, useMdmProfileErrors } from '../contexts/MdmModuleContext';
|
|
23
23
|
import { HiddenAttributesContext } from '../contexts/HiddenAttributesContext';
|
|
24
|
-
import { filterErrorsForHiddenAttributes } from '@reltio/mdm-sdk';
|
|
25
24
|
var EditModeAttributesPager = function (_a) {
|
|
26
25
|
var _b;
|
|
27
26
|
var values = _a.values, attributeType = _a.attributeType, _c = _a.mode, mode = _c === void 0 ? Mode.Viewing : _c, crosswalks = _a.crosswalks, drawLines = _a.drawLines, _d = _a.paging, paging = _d === void 0 ? {} : _d, parentUri = _a.parentUri, maxProp = _a.max, showEmptyEditors = _a.showEmptyEditors, showNonOv = _a.showNonOv, highlightedError = _a.highlightedError, highlightedAttribute = _a.highlightedAttribute, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, additionalControlsRenderer = _a.additionalControlsRenderer;
|
|
@@ -11,6 +11,7 @@ import { ShowMore } from '../../../ShowMore';
|
|
|
11
11
|
import { EditModeAttribute } from '../../../EditModeAttributesFactory';
|
|
12
12
|
import { CardinalityMessage } from '../../../CardinalityMessage';
|
|
13
13
|
import { PinnedAttributesContext } from '../../../contexts/PinnedAttributesContext';
|
|
14
|
+
import { AlwaysVisibleAttributesContext } from '../../../contexts/AllwaysVisibleAttributesContext';
|
|
14
15
|
import { DescriptionIcon } from '../../../DescriptionIcon';
|
|
15
16
|
import { ControlAttributeIcon } from '../../../ControlAttributeIcon';
|
|
16
17
|
import { useScrollToAttribute } from '../../../hooks/useScrollToAttribute';
|
|
@@ -28,9 +29,11 @@ var AttributeRenderer = function (_a) {
|
|
|
28
29
|
var _d = useScrollToAttributeError({ highlightedError: highlightedError }), errorRef = _d.ref, errorClassName = _d.errorClassName;
|
|
29
30
|
var _e = useScrollToAttribute(highlightedAttribute), attributeRef = _e.ref, highlightedClassName = _e.highlightedClassName;
|
|
30
31
|
var pinnedAttributes = useContext(PinnedAttributesContext);
|
|
32
|
+
var alwaysVisibleAttributes = useContext(AlwaysVisibleAttributesContext);
|
|
31
33
|
var isPinned = useMemo(function () { return pinnedAttributes === null || pinnedAttributes === void 0 ? void 0 : pinnedAttributes.includes(attributeTypeUri); }, [attributeTypeUri, pinnedAttributes]);
|
|
34
|
+
var isAlwaysVisible = useMemo(function () { return alwaysVisibleAttributes === null || alwaysVisibleAttributes === void 0 ? void 0 : alwaysVisibleAttributes.includes(attributeTypeUri); }, [attributeTypeUri, alwaysVisibleAttributes]);
|
|
32
35
|
var isEmptyValues = isEmptyValue(values);
|
|
33
|
-
var showEmpty = ((!hadDeletions && showEmptyEditors) || isRequired || isPinned) && isEmptyValues;
|
|
36
|
+
var showEmpty = ((!hadDeletions && showEmptyEditors) || isRequired || isPinned || isAlwaysVisible) && isEmptyValues;
|
|
34
37
|
var controlAttributes = useMdmControlAttributes();
|
|
35
38
|
var isControlAttribute = useMemo(function () { return controlAttributes.includes(attributeType.uri); }, [controlAttributes, attributeType.uri]);
|
|
36
39
|
var emptyEditorValue = useRef(createNewAttribute({
|