@reltio/components 1.4.2018 → 1.4.2020
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/BarChart/helpers.d.ts +2 -2
- package/BasicTable/IntegrationBasicTable.test.js +6 -18
- package/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +2 -5
- package/HierarchyNodeTitle/useEntityDetails.js +3 -0
- package/HierarchyNodeTitle/useEntityDetails.test.js +28 -0
- package/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +2 -5
- package/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.js +33 -22
- package/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +120 -112
- package/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/LineChart/helpers.d.ts +2 -2
- package/PieChart/PieChart.test.js +4 -0
- package/ProfileBandNavigation/useSearchNavigation.js +11 -3
- package/ProfileBandNavigation/useSearchNavigation.test.js +176 -0
- package/UploadImageDialog/UploadImageDialog.specs.js +1 -4
- package/UploadImageDialog/components/TargetBox/TargetBox.js +31 -20
- package/UploadImageDialog/components/TargetBox/TargetBox.specs.d.ts +1 -1
- package/UploadImageDialog/components/TargetBox/TargetBox.specs.js +57 -16
- package/UploadImageDialog/components/TargetBox/styles.js +2 -1
- package/VerticalHeadingsTable/DndVerticalHeadingsTable.test.js +114 -0
- package/VerticalHeadingsTable/VerticalHeadingsTable.d.ts +2 -1
- package/VerticalHeadingsTable/VerticalHeadingsTable.js +10 -13
- package/VerticalHeadingsTable/VerticalHeadingsTable.test.js +74 -269
- package/VerticalHeadingsTable/components/DndComponent/DndComponent.d.ts +14 -0
- package/VerticalHeadingsTable/components/DndComponent/DndComponent.js +96 -0
- package/VerticalHeadingsTable/components/DndComponent/helpers.d.ts +3 -0
- package/VerticalHeadingsTable/components/DndComponent/helpers.js +35 -0
- package/VerticalHeadingsTable/components/DndComponent/index.d.ts +1 -0
- package/VerticalHeadingsTable/components/DndComponent/index.js +1 -0
- package/VerticalHeadingsTable/components/{TableColumnDragLayer → DndComponent}/styles.d.ts +1 -1
- package/VerticalHeadingsTable/components/DndComponent/styles.js +10 -0
- package/VerticalHeadingsTable/components/DndComponent/types.d.ts +14 -0
- package/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.d.ts +7 -0
- package/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.js +13 -0
- package/VerticalHeadingsTable/components/DndMeasurer/index.d.ts +1 -0
- package/VerticalHeadingsTable/components/DndMeasurer/index.js +1 -0
- package/VerticalHeadingsTable/components/TableCell/TableCell.d.ts +2 -2
- package/VerticalHeadingsTable/components/TableCell/TableCell.js +2 -2
- package/VerticalHeadingsTable/components/TableCell/TableCell.test.js +101 -43
- package/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.d.ts +10 -0
- package/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.js +32 -0
- package/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.d.ts +2 -4
- package/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.js +30 -59
- package/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +126 -56
- package/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.d.ts +3 -3
- package/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.js +16 -6
- package/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.d.ts +9 -0
- package/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.js +30 -0
- package/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.d.ts +4 -4
- package/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.js +3 -4
- package/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.test.js +44 -29
- package/VerticalHeadingsTable/components/TableRow/TableRow.d.ts +4 -5
- package/VerticalHeadingsTable/components/TableRow/TableRow.js +3 -3
- package/VerticalHeadingsTable/components/TableRow/TableRow.test.js +35 -57
- package/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.d.ts +12 -0
- package/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.js +16 -0
- package/VerticalHeadingsTable/components/TableRowDragPreview/index.d.ts +1 -0
- package/VerticalHeadingsTable/components/TableRowDragPreview/index.js +1 -0
- package/{cjs/VerticalHeadingsTable/components/TableColumnDragLayer → VerticalHeadingsTable/components/TableRowDragPreview}/styles.d.ts +1 -1
- package/VerticalHeadingsTable/components/TableRowDragPreview/styles.js +8 -0
- package/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.d.ts +2 -8
- package/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.js +22 -53
- package/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +53 -83
- package/cjs/BarChart/helpers.d.ts +2 -2
- package/cjs/BasicTable/IntegrationBasicTable.test.js +6 -18
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +2 -5
- package/cjs/HierarchyNodeTitle/useEntityDetails.js +3 -0
- package/cjs/HierarchyNodeTitle/useEntityDetails.test.js +28 -0
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +2 -5
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.js +55 -21
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +120 -135
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/cjs/LineChart/helpers.d.ts +2 -2
- package/cjs/PieChart/PieChart.test.js +4 -0
- package/cjs/ProfileBandNavigation/useSearchNavigation.js +11 -3
- package/cjs/ProfileBandNavigation/useSearchNavigation.test.js +176 -0
- package/cjs/UploadImageDialog/UploadImageDialog.specs.js +1 -4
- package/cjs/UploadImageDialog/components/TargetBox/TargetBox.js +54 -20
- package/cjs/UploadImageDialog/components/TargetBox/TargetBox.specs.d.ts +1 -1
- package/cjs/UploadImageDialog/components/TargetBox/TargetBox.specs.js +57 -16
- package/cjs/UploadImageDialog/components/TargetBox/styles.js +2 -1
- package/cjs/VerticalHeadingsTable/DndVerticalHeadingsTable.test.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/DndVerticalHeadingsTable.test.js +119 -0
- package/cjs/VerticalHeadingsTable/VerticalHeadingsTable.d.ts +2 -1
- package/cjs/VerticalHeadingsTable/VerticalHeadingsTable.js +9 -12
- package/cjs/VerticalHeadingsTable/VerticalHeadingsTable.test.js +74 -269
- package/cjs/VerticalHeadingsTable/components/DndComponent/DndComponent.d.ts +14 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/DndComponent.js +123 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/helpers.d.ts +3 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/helpers.js +40 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/index.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/index.js +5 -0
- package/{features/crosswalks/CrosswalkDragLayer → cjs/VerticalHeadingsTable/components/DndComponent}/styles.d.ts +1 -1
- package/cjs/VerticalHeadingsTable/components/DndComponent/styles.js +13 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/types.d.ts +14 -0
- package/cjs/VerticalHeadingsTable/components/DndComponent/types.js +2 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.d.ts +7 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/DndMeasurer.js +40 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/index.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/components/DndMeasurer/index.js +5 -0
- package/cjs/VerticalHeadingsTable/components/TableCell/TableCell.d.ts +2 -2
- package/cjs/VerticalHeadingsTable/components/TableCell/TableCell.js +2 -2
- package/cjs/VerticalHeadingsTable/components/TableCell/TableCell.test.js +101 -43
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.d.ts +10 -0
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/ColumnDragIndicator.js +39 -0
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.d.ts +2 -4
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.js +29 -58
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +128 -58
- package/cjs/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.d.ts +3 -3
- package/cjs/VerticalHeadingsTable/components/TableColumnDragPreview/TableColumnDragPreview.js +38 -9
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.d.ts +9 -0
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/RowDragIndicator.js +37 -0
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.d.ts +4 -4
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.js +3 -4
- package/cjs/VerticalHeadingsTable/components/TableHeadCell/TableHeadCell.test.js +43 -51
- package/cjs/VerticalHeadingsTable/components/TableRow/TableRow.d.ts +4 -5
- package/cjs/VerticalHeadingsTable/components/TableRow/TableRow.js +3 -3
- package/cjs/VerticalHeadingsTable/components/TableRow/TableRow.test.js +35 -57
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.d.ts +12 -0
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/TableRowDragPreview.js +42 -0
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/index.d.ts +1 -0
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/index.js +5 -0
- package/cjs/{features/crosswalks/CrosswalkDragLayer → VerticalHeadingsTable/components/TableRowDragPreview}/styles.d.ts +1 -1
- package/cjs/VerticalHeadingsTable/components/TableRowDragPreview/styles.js +11 -0
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.d.ts +2 -8
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.js +21 -52
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +55 -85
- package/cjs/contexts/CrosswalksDisplayContext/index.d.ts +2 -2
- package/cjs/contexts/CrosswalksDisplayContext/index.js +6 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.d.ts +3 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +2 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +17 -10
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.d.ts +3 -2
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +13 -2
- package/cjs/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.d.ts +8 -0
- package/cjs/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.js +51 -0
- package/cjs/features/crosswalks/CrosswalkDndComponent/index.d.ts +1 -0
- package/cjs/features/crosswalks/CrosswalkDndComponent/index.js +5 -0
- package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/CrosswalkDragPreview.js +16 -5
- package/cjs/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +1 -0
- package/cjs/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.js +97 -0
- package/{features/crosswalks/CrosswalkDragLayer/components → cjs/features/crosswalks}/CrosswalkDragPreview/styles.d.ts +1 -1
- package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/styles.js +6 -1
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.js +25 -16
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +7 -33
- package/cjs/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.d.ts +1 -0
- package/cjs/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.js +134 -0
- package/cjs/features/crosswalks/CrosswalkRow/styles.d.ts +1 -1
- package/cjs/features/crosswalks/CrosswalkRow/styles.js +10 -1
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +0 -1
- package/cjs/features/crosswalks/hooks/useDraggingCrosswalk.d.ts +6 -0
- package/cjs/features/crosswalks/hooks/useDraggingCrosswalk.js +19 -0
- package/cjs/features/crosswalks/hooks/useModifiedEntity.js +6 -6
- package/cjs/features/crosswalks/index.d.ts +1 -1
- package/cjs/features/crosswalks/index.js +3 -3
- package/cjs/hooks/useDndBasicTableScrollModifier/index.d.ts +1 -0
- package/cjs/hooks/useDndBasicTableScrollModifier/index.js +5 -0
- package/cjs/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.d.ts +10 -0
- package/cjs/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +57 -0
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/test-utils/dndKit/DndContext.d.ts +12 -0
- package/cjs/test-utils/dndKit/DndContext.js +5 -0
- package/cjs/test-utils/dndKit/DndContextComponent.d.ts +5 -0
- package/cjs/test-utils/dndKit/DndContextComponent.js +97 -0
- package/cjs/test-utils/dndKit/DndMonitorContext.d.ts +2 -0
- package/cjs/test-utils/dndKit/DndMonitorContext.js +5 -0
- package/cjs/test-utils/dndKit/DragOverlay.d.ts +5 -0
- package/cjs/test-utils/dndKit/DragOverlay.js +14 -0
- package/cjs/test-utils/dndKit/index.d.ts +32 -0
- package/cjs/test-utils/dndKit/index.js +22 -0
- package/cjs/test-utils/dndKit/type.d.ts +17 -0
- package/cjs/test-utils/dndKit/type.js +2 -0
- package/cjs/test-utils/dndKit/useDndContext.d.ts +8 -0
- package/cjs/test-utils/dndKit/useDndContext.js +13 -0
- package/cjs/test-utils/dndKit/useDndMonitor.d.ts +2 -0
- package/cjs/test-utils/dndKit/useDndMonitor.js +13 -0
- package/cjs/test-utils/dndKit/useDndMonitorProvider.d.ts +1 -0
- package/cjs/test-utils/dndKit/useDndMonitorProvider.js +17 -0
- package/cjs/test-utils/dndKit/useDraggable.d.ts +12 -0
- package/cjs/test-utils/dndKit/useDraggable.js +43 -0
- package/cjs/test-utils/dndKit/useDroppable.d.ts +4 -0
- package/cjs/test-utils/dndKit/useDroppable.js +45 -0
- package/cjs/types/basicTable.d.ts +4 -0
- package/contexts/CrosswalksDisplayContext/index.d.ts +2 -2
- package/contexts/CrosswalksDisplayContext/index.js +6 -2
- package/features/crosswalks/AttributesTable/AttributesTable.d.ts +3 -1
- package/features/crosswalks/AttributesTable/AttributesTable.js +2 -2
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +17 -10
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.d.ts +3 -2
- package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +13 -2
- package/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.d.ts +8 -0
- package/features/crosswalks/CrosswalkDndComponent/CrosswalkDndComponent.js +24 -0
- package/features/crosswalks/CrosswalkDndComponent/index.d.ts +1 -0
- package/features/crosswalks/CrosswalkDndComponent/index.js +1 -0
- package/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.js +30 -0
- package/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +1 -0
- package/features/crosswalks/CrosswalkDragPreview/CrosswalkDragPreview.test.js +69 -0
- package/{cjs/features/crosswalks/CrosswalkDragLayer/components → features/crosswalks}/CrosswalkDragPreview/styles.d.ts +1 -1
- package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/styles.js +6 -1
- package/features/crosswalks/CrosswalkRow/CrosswalkRow.js +25 -16
- package/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +7 -33
- package/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.d.ts +1 -0
- package/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.js +129 -0
- package/features/crosswalks/CrosswalkRow/styles.d.ts +1 -1
- package/features/crosswalks/CrosswalkRow/styles.js +10 -1
- package/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +0 -1
- package/features/crosswalks/hooks/useDraggingCrosswalk.d.ts +6 -0
- package/features/crosswalks/hooks/useDraggingCrosswalk.js +15 -0
- package/features/crosswalks/hooks/useModifiedEntity.js +6 -6
- package/features/crosswalks/index.d.ts +1 -1
- package/features/crosswalks/index.js +1 -1
- package/hooks/useDndBasicTableScrollModifier/index.d.ts +1 -0
- package/hooks/useDndBasicTableScrollModifier/index.js +1 -0
- package/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.d.ts +10 -0
- package/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +53 -0
- package/index.d.ts +2 -1
- package/index.js +1 -0
- package/package.json +3 -3
- package/test-utils/dndKit/DndContext.d.ts +12 -0
- package/test-utils/dndKit/DndContext.js +2 -0
- package/test-utils/dndKit/DndContextComponent.d.ts +5 -0
- package/test-utils/dndKit/DndContextComponent.js +70 -0
- package/test-utils/dndKit/DndMonitorContext.d.ts +2 -0
- package/test-utils/dndKit/DndMonitorContext.js +2 -0
- package/test-utils/dndKit/DragOverlay.d.ts +5 -0
- package/test-utils/dndKit/DragOverlay.js +7 -0
- package/test-utils/dndKit/index.d.ts +32 -0
- package/test-utils/dndKit/index.js +19 -0
- package/test-utils/dndKit/type.d.ts +17 -0
- package/test-utils/dndKit/type.js +1 -0
- package/test-utils/dndKit/useDndContext.d.ts +8 -0
- package/test-utils/dndKit/useDndContext.js +9 -0
- package/test-utils/dndKit/useDndMonitor.d.ts +2 -0
- package/test-utils/dndKit/useDndMonitor.js +9 -0
- package/test-utils/dndKit/useDndMonitorProvider.d.ts +1 -0
- package/test-utils/dndKit/useDndMonitorProvider.js +13 -0
- package/test-utils/dndKit/useDraggable.d.ts +12 -0
- package/test-utils/dndKit/useDraggable.js +39 -0
- package/test-utils/dndKit/useDroppable.d.ts +4 -0
- package/test-utils/dndKit/useDroppable.js +41 -0
- package/types/basicTable.d.ts +4 -0
- package/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.d.ts +0 -6
- package/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.js +0 -23
- package/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.d.ts +0 -6
- package/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.js +0 -11
- package/VerticalHeadingsTable/components/TableColumnDragLayer/index.d.ts +0 -1
- package/VerticalHeadingsTable/components/TableColumnDragLayer/index.js +0 -1
- package/VerticalHeadingsTable/components/TableColumnDragLayer/styles.js +0 -13
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.d.ts +0 -6
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/TableColumnDragLayer.js +0 -50
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.d.ts +0 -6
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/helpers.js +0 -15
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/index.d.ts +0 -1
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/index.js +0 -5
- package/cjs/VerticalHeadingsTable/components/TableColumnDragLayer/styles.js +0 -16
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.d.ts +0 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.js +0 -51
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +0 -93
- package/cjs/features/crosswalks/CrosswalkDragLayer/index.d.ts +0 -1
- package/cjs/features/crosswalks/CrosswalkDragLayer/index.js +0 -5
- package/cjs/features/crosswalks/CrosswalkDragLayer/styles.js +0 -17
- package/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.d.ts +0 -2
- package/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.js +0 -25
- package/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +0 -65
- package/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +0 -19
- package/features/crosswalks/CrosswalkDragLayer/index.d.ts +0 -1
- package/features/crosswalks/CrosswalkDragLayer/index.js +0 -1
- package/features/crosswalks/CrosswalkDragLayer/styles.js +0 -14
- /package/{cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.d.ts → VerticalHeadingsTable/DndVerticalHeadingsTable.test.d.ts} +0 -0
- /package/{features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.d.ts → VerticalHeadingsTable/components/DndComponent/types.js} +0 -0
- /package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/CrosswalkDragPreview.d.ts +0 -0
- /package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.d.ts +0 -0
- /package/cjs/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.js +0 -0
- /package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/CrosswalkDragPreview.d.ts +0 -0
- /package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.d.ts +0 -0
- /package/features/crosswalks/{CrosswalkDragLayer/components/CrosswalkDragPreview → CrosswalkDragPreview}/index.js +0 -0
|
@@ -53,16 +53,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
53
53
|
var react_1 = __importDefault(require("react"));
|
|
54
54
|
var react_2 = require("@testing-library/react");
|
|
55
55
|
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
-
var
|
|
57
|
-
|
|
56
|
+
var dndKit_1 = require("../test-utils/dndKit");
|
|
57
|
+
jest.mock('@dnd-kit/core', function () { return dndKit_1.mockDndKit; });
|
|
58
58
|
var BasicTable_1 = require("./BasicTable");
|
|
59
59
|
var CollapseRowButton_1 = require("../CollapseRowButton");
|
|
60
60
|
var test_utils_1 = require("../test-utils");
|
|
61
61
|
var FirstColumnRenderer = function (_a) {
|
|
62
|
-
var value = _a.value, rowValue = _a.rowValue, rowIndex = _a.rowIndex,
|
|
62
|
+
var value = _a.value, rowValue = _a.rowValue, rowIndex = _a.rowIndex, draggableProps = _a.draggableProps;
|
|
63
63
|
return (react_1.default.createElement("div", null,
|
|
64
64
|
react_1.default.createElement(CollapseRowButton_1.CollapseRowButton, { rowIndex: rowIndex, rowValue: rowValue }),
|
|
65
|
-
react_1.default.createElement("div", {
|
|
65
|
+
react_1.default.createElement("div", __assign({}, draggableProps), "drag el"),
|
|
66
66
|
react_1.default.createElement("div", null, value.name)));
|
|
67
67
|
};
|
|
68
68
|
var SecondColumnRenderer = function (_a) {
|
|
@@ -122,11 +122,7 @@ var defaultProps = {
|
|
|
122
122
|
};
|
|
123
123
|
var setUp = function (props) {
|
|
124
124
|
var user = user_event_1.default.setup();
|
|
125
|
-
|
|
126
|
-
var children = _a.children;
|
|
127
|
-
return react_1.default.createElement(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.default }, children);
|
|
128
|
-
};
|
|
129
|
-
return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(BasicTable_1.BasicTable, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
125
|
+
return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(BasicTable_1.BasicTable, __assign({}, props)))), { user: user });
|
|
130
126
|
};
|
|
131
127
|
describe('basic table tests', function () {
|
|
132
128
|
it('should collapse all rows after start dragging', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -158,7 +154,7 @@ describe('basic table tests', function () {
|
|
|
158
154
|
dragIndicator = (0, react_2.within)(getCellByIndexes(1, 0)).queryByText('drag el');
|
|
159
155
|
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
156
|
return __generator(this, function (_a) {
|
|
161
|
-
react_2.fireEvent.
|
|
157
|
+
react_2.fireEvent.mouseDown(dragIndicator);
|
|
162
158
|
return [2 /*return*/];
|
|
163
159
|
});
|
|
164
160
|
}); })];
|
|
@@ -169,14 +165,6 @@ describe('basic table tests', function () {
|
|
|
169
165
|
expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('row 1 value 3')).not.toBeInTheDocument();
|
|
170
166
|
expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('row 2 value 1')).toBeInTheDocument();
|
|
171
167
|
expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('row 2 value 2')).not.toBeInTheDocument();
|
|
172
|
-
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
173
|
-
return __generator(this, function (_a) {
|
|
174
|
-
react_2.fireEvent.dragEnd(getCellByIndexes(1, 0));
|
|
175
|
-
return [2 /*return*/];
|
|
176
|
-
});
|
|
177
|
-
}); })];
|
|
178
|
-
case 4:
|
|
179
|
-
_a.sent();
|
|
180
168
|
unmockTableSizing();
|
|
181
169
|
return [2 /*return*/];
|
|
182
170
|
}
|
|
@@ -53,8 +53,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
53
53
|
var react_1 = __importDefault(require("react"));
|
|
54
54
|
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
55
55
|
var react_2 = require("@testing-library/react");
|
|
56
|
-
var react_dnd_1 = require("react-dnd");
|
|
57
|
-
var react_dnd_html5_backend_1 = __importDefault(require("react-dnd-html5-backend"));
|
|
58
56
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
59
57
|
var EditModeAttributesView_1 = require("./EditModeAttributesView");
|
|
60
58
|
var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
|
|
@@ -111,9 +109,8 @@ describe('EditModeAttributesView tests', function () {
|
|
|
111
109
|
var user = user_event_1.default.setup(userOptions);
|
|
112
110
|
var Providers = function (_a) {
|
|
113
111
|
var children = _a.children;
|
|
114
|
-
return (react_1.default.createElement(
|
|
115
|
-
react_1.default.createElement(
|
|
116
|
-
react_1.default.createElement(ScrollToElementContext_1.ScrollToElementProvider, null, children))));
|
|
112
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues, actions: mdmActions },
|
|
113
|
+
react_1.default.createElement(ScrollToElementContext_1.ScrollToElementProvider, null, children)));
|
|
117
114
|
};
|
|
118
115
|
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(EditModeAttributesView_1.EditModeAttributesView, __assign({}, props)), { wrapper: Providers }));
|
|
119
116
|
};
|
|
@@ -13,6 +13,9 @@ var useEntityDetails = function (entityUri) {
|
|
|
13
13
|
setIsLoading(true);
|
|
14
14
|
safePromise((0, mdm_sdk_1.getEntity)(entityUri))
|
|
15
15
|
.then(setEntityDetails)
|
|
16
|
+
.catch(function (error) {
|
|
17
|
+
console.warn('Failed to load entity', error);
|
|
18
|
+
})
|
|
16
19
|
.finally(function () { return setIsLoading(false); });
|
|
17
20
|
}, 1000), [entityUri, safePromise]);
|
|
18
21
|
var hideEntityDetails = (0, react_1.useCallback)(function () {
|
|
@@ -196,4 +196,32 @@ describe('useEntityDetails', function () {
|
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
198
|
}); });
|
|
199
|
+
it('should catch and handle error when getEntity returns error', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
+
var warnSpy, result;
|
|
201
|
+
return __generator(this, function (_a) {
|
|
202
|
+
switch (_a.label) {
|
|
203
|
+
case 0:
|
|
204
|
+
warnSpy = jest.spyOn(global.console, 'warn');
|
|
205
|
+
mdm_sdk_1.getEntity.mockRejectedValue({ errorCode: 403, errorMessage: 'Access is denied' });
|
|
206
|
+
result = (0, react_hooks_1.renderHook)(useEntityDetails_1.useEntityDetails, { initialProps: entity.uri }).result;
|
|
207
|
+
(0, react_hooks_1.act)(function () {
|
|
208
|
+
result.current.showEntityDetails();
|
|
209
|
+
jest.runAllTimers();
|
|
210
|
+
});
|
|
211
|
+
expect(mdm_sdk_1.getEntity).toHaveBeenCalled();
|
|
212
|
+
return [4 /*yield*/, (0, react_hooks_1.act)(function () {
|
|
213
|
+
return Promise.resolve();
|
|
214
|
+
})];
|
|
215
|
+
case 1:
|
|
216
|
+
_a.sent();
|
|
217
|
+
expect(result.current.isLoading).toBe(false);
|
|
218
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to load entity', {
|
|
219
|
+
errorCode: 403,
|
|
220
|
+
errorMessage: 'Access is denied'
|
|
221
|
+
});
|
|
222
|
+
warnSpy.mockRestore();
|
|
223
|
+
return [2 /*return*/];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}); });
|
|
199
227
|
});
|
|
@@ -18,8 +18,6 @@ var react_1 = __importDefault(require("react"));
|
|
|
18
18
|
var test_utils_1 = require("react-dom/test-utils");
|
|
19
19
|
var react_resize_detector_1 = __importDefault(require("react-resize-detector"));
|
|
20
20
|
var enzyme_1 = require("enzyme");
|
|
21
|
-
var react_dnd_1 = require("react-dnd");
|
|
22
|
-
var react_dnd_html5_backend_1 = __importDefault(require("react-dnd-html5-backend"));
|
|
23
21
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
24
22
|
var Image_1 = require("../Image");
|
|
25
23
|
var EmptyStub_1 = require("../EmptyStub");
|
|
@@ -96,9 +94,8 @@ var defaultProps = {
|
|
|
96
94
|
};
|
|
97
95
|
var setUp = function (_a) {
|
|
98
96
|
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d, _e = _b.mdmActions, mdmActions = _e === void 0 ? defaultMdmActions : _e;
|
|
99
|
-
return (0, enzyme_1.mount)(react_1.default.createElement(
|
|
100
|
-
react_1.default.createElement(
|
|
101
|
-
react_1.default.createElement(ImageAttributesLineEditor_1.ImageAttributesLineEditor, __assign({}, props)))));
|
|
97
|
+
return (0, enzyme_1.mount)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues, actions: mdmActions },
|
|
98
|
+
react_1.default.createElement(ImageAttributesLineEditor_1.ImageAttributesLineEditor, __assign({}, props))));
|
|
102
99
|
};
|
|
103
100
|
describe('ImageAttributesLineEditor edit tests', function () {
|
|
104
101
|
beforeAll(function () {
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,37 +49,48 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
49
|
};
|
|
27
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
51
|
exports.InlineSimpleAttributesBlock = void 0;
|
|
29
|
-
var react_1 =
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
30
53
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
31
|
-
var
|
|
54
|
+
var core_1 = require("@dnd-kit/core");
|
|
32
55
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
33
56
|
var InlineSimpleAttribute_1 = require("../../../InlineSimpleAttribute");
|
|
34
57
|
var styles_1 = require("./styles");
|
|
35
58
|
var InlineSimpleAttributesBlock = function (_a) {
|
|
36
59
|
var attributeValues = _a.attributeValues, attributeType = _a.attributeType, parentUri = _a.parentUri, disableEdit = _a.disableEdit, crosswalksMap = _a.crosswalksMap, onAdd = _a.onAdd, emptyTempAttributeUris = _a.emptyTempAttributeUris, props = __rest(_a, ["attributeValues", "attributeType", "parentUri", "disableEdit", "crosswalksMap", "onAdd", "emptyTempAttributeUris"]);
|
|
37
60
|
var styles = (0, styles_1.useStyles)();
|
|
38
|
-
var _b = (0,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
var _b = (0, react_1.useState)(false), isDragItemOver = _b[0], setIsDragItemOver = _b[1];
|
|
62
|
+
var checkCanAddCrosswalk = (0, react_1.useCallback)(function (event) {
|
|
63
|
+
var _a;
|
|
64
|
+
var draggingData = event.active.data.current;
|
|
65
|
+
var crosswalk = draggingData === null || draggingData === void 0 ? void 0 : draggingData.crosswalk;
|
|
66
|
+
return (!disableEdit &&
|
|
67
|
+
(draggingData === null || draggingData === void 0 ? void 0 : draggingData.type) === 'Crosswalk' &&
|
|
68
|
+
attributeType.uri === ((_a = event.over) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
69
|
+
crosswalk &&
|
|
70
|
+
(0, mdm_sdk_1.canAddCrosswalk)(crosswalk, attributeType));
|
|
71
|
+
}, [disableEdit, attributeType]);
|
|
72
|
+
(0, core_1.useDndMonitor)({
|
|
73
|
+
onDragOver: function (event) {
|
|
74
|
+
setIsDragItemOver(checkCanAddCrosswalk(event));
|
|
48
75
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
76
|
+
onDragEnd: function (event) {
|
|
77
|
+
var draggingData = event.active.data.current;
|
|
78
|
+
var crosswalk = draggingData === null || draggingData === void 0 ? void 0 : draggingData.crosswalk;
|
|
79
|
+
if (checkCanAddCrosswalk(event)) {
|
|
80
|
+
onAdd({ attributeType: attributeType, crosswalk: crosswalk, parentUri: parentUri, index: attributeValues.length });
|
|
81
|
+
}
|
|
82
|
+
setIsDragItemOver(false);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
var setNodeRef = (0, core_1.useDroppable)({
|
|
86
|
+
id: attributeType.uri,
|
|
87
|
+
data: {
|
|
88
|
+
type: 'Crosswalk',
|
|
89
|
+
attributeType: attributeType
|
|
56
90
|
}
|
|
57
|
-
})
|
|
91
|
+
}).setNodeRef;
|
|
58
92
|
var attributeIndex = 0;
|
|
59
|
-
return (react_1.default.createElement("div", { ref:
|
|
93
|
+
return (react_1.default.createElement("div", { ref: setNodeRef, className: styles.simpleAttributesWrapper, "data-reltio-id": 'simple-attributes-wrapper' },
|
|
60
94
|
attributeValues.map(function (value) {
|
|
61
95
|
var _a;
|
|
62
96
|
return (_a = crosswalksMap[value.uri]) === null || _a === void 0 ? void 0 : _a.map(function (crosswalk) { return (react_1.default.createElement(InlineSimpleAttribute_1.InlineSimpleAttribute, __assign({ key: value.uri + crosswalk.uri, attributeType: attributeType, attributeValue: value, crosswalk: crosswalk, disableEdit: disableEdit, isEmpty: emptyTempAttributeUris.includes(value.uri), dataReltioId: "value-index-".concat(attributeIndex++) }, props))); });
|
|
@@ -10,38 +10,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
var react_1 = __importDefault(require("react"));
|
|
41
|
-
var enzyme_1 = require("enzyme");
|
|
42
18
|
var InlineSimpleAttributesBlock_1 = require("./InlineSimpleAttributesBlock");
|
|
43
|
-
var
|
|
44
|
-
|
|
19
|
+
var core_1 = require("@dnd-kit/core");
|
|
20
|
+
var react_2 = require("@testing-library/react");
|
|
21
|
+
jest.mock('@dnd-kit/core', function () { return (__assign(__assign({}, jest.requireActual('@dnd-kit/core')), { useDndMonitor: jest.fn() })); });
|
|
45
22
|
describe('InlineSimpleAttributesBlock tests', function () {
|
|
46
23
|
var attributeType = {
|
|
47
24
|
uri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
@@ -101,43 +78,52 @@ describe('InlineSimpleAttributesBlock tests', function () {
|
|
|
101
78
|
onEdit: jest.fn(),
|
|
102
79
|
onDelete: jest.fn()
|
|
103
80
|
};
|
|
104
|
-
var
|
|
105
|
-
var
|
|
81
|
+
var defaultProps = __assign({ attributeValues: attributeValues, crosswalksMap: crosswalksMap, parentUri: 'entities/1', onAdd: jest.fn(), emptyTempAttributeUris: [] }, commonProps);
|
|
82
|
+
var getDragEvent = function (draggingData, attributeType) { return ({
|
|
83
|
+
active: {
|
|
84
|
+
data: {
|
|
85
|
+
current: __assign({}, draggingData)
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
over: {
|
|
89
|
+
id: attributeType.uri
|
|
90
|
+
}
|
|
91
|
+
}); };
|
|
92
|
+
var setUp = function (props) {
|
|
93
|
+
if (props === void 0) { props = defaultProps; }
|
|
94
|
+
var Providers = function (_a) {
|
|
95
|
+
var children = _a.children;
|
|
96
|
+
return react_1.default.createElement(core_1.DndContext, null, children);
|
|
97
|
+
};
|
|
98
|
+
return (0, react_2.render)(react_1.default.createElement(InlineSimpleAttributesBlock_1.InlineSimpleAttributesBlock, __assign({}, props)), { wrapper: Providers });
|
|
99
|
+
};
|
|
106
100
|
it('should render values for each crosswalk', function () {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
expect(
|
|
110
|
-
attributes.forEach(function (attribute) {
|
|
111
|
-
expect(attribute.props()).toMatchObject(commonProps);
|
|
112
|
-
});
|
|
113
|
-
expect(attributes.at(0).prop('attributeValue')).toBe(attributeValues[0]);
|
|
114
|
-
expect(attributes.at(0).prop('crosswalk')).toBe(crosswalks[0]);
|
|
115
|
-
expect(attributes.at(1).prop('attributeValue')).toBe(attributeValues[1]);
|
|
116
|
-
expect(attributes.at(1).prop('crosswalk')).toBe(crosswalks[0]);
|
|
117
|
-
expect(attributes.at(2).prop('attributeValue')).toBe(attributeValues[1]);
|
|
118
|
-
expect(attributes.at(2).prop('crosswalk')).toBe(crosswalks[1]);
|
|
101
|
+
setUp();
|
|
102
|
+
expect(react_2.screen.getByText(attributeValues[0].value)).toBeInTheDocument();
|
|
103
|
+
expect(react_2.screen.getAllByText(attributeValues[1].value)).toHaveLength(2);
|
|
119
104
|
});
|
|
120
|
-
describe('dnd', function () {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
expect(accept).toEqual('Crosswalk');
|
|
105
|
+
describe('dnd behavior', function () {
|
|
106
|
+
var onDragOver, onDragEnd;
|
|
107
|
+
beforeAll(function () {
|
|
108
|
+
core_1.useDndMonitor.mockImplementation(function (listeners) {
|
|
109
|
+
onDragOver = listeners.onDragOver;
|
|
110
|
+
onDragEnd = listeners.onDragEnd;
|
|
111
|
+
});
|
|
128
112
|
});
|
|
129
113
|
it('should not allow drop relation crosswalk on entity attribute', function () {
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
114
|
+
setUp();
|
|
115
|
+
(0, react_2.act)(function () {
|
|
116
|
+
onDragOver(getDragEvent({
|
|
117
|
+
type: 'Crosswalk',
|
|
118
|
+
crosswalk: {
|
|
119
|
+
uri: 'entities/1/crosswalks/1',
|
|
120
|
+
ownerType: 'relation',
|
|
121
|
+
type: 'configuration/sources/FB',
|
|
122
|
+
value: '123'
|
|
123
|
+
}
|
|
124
|
+
}, defaultProps.attributeType));
|
|
125
|
+
});
|
|
126
|
+
expect(react_2.screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
141
127
|
});
|
|
142
128
|
it('should allow drop relation crosswalk on relation attribute', function () {
|
|
143
129
|
var attributeType = {
|
|
@@ -160,26 +146,31 @@ describe('InlineSimpleAttributesBlock tests', function () {
|
|
|
160
146
|
ov: false
|
|
161
147
|
}
|
|
162
148
|
];
|
|
163
|
-
(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
149
|
+
setUp(__assign(__assign({}, defaultProps), { attributeType: attributeType, attributeValues: attributeValues }));
|
|
150
|
+
(0, react_2.act)(function () {
|
|
151
|
+
onDragOver(getDragEvent({
|
|
152
|
+
type: 'Crosswalk',
|
|
153
|
+
crosswalk: {
|
|
154
|
+
uri: 'relations/1/crosswalks/1',
|
|
155
|
+
ownerType: 'entity',
|
|
156
|
+
type: 'configuration/sources/FB',
|
|
157
|
+
value: '123'
|
|
158
|
+
}
|
|
159
|
+
}, attributeType));
|
|
160
|
+
});
|
|
161
|
+
expect(react_2.screen.getByText('Drop here')).toBeInTheDocument();
|
|
162
|
+
(0, react_2.act)(function () {
|
|
163
|
+
onDragOver(getDragEvent({
|
|
164
|
+
type: 'Crosswalk',
|
|
165
|
+
crosswalk: {
|
|
166
|
+
uri: 'entities/1/crosswalks/1',
|
|
167
|
+
ownerType: 'relation',
|
|
168
|
+
type: 'configuration/sources/FB',
|
|
169
|
+
value: '123'
|
|
170
|
+
}
|
|
171
|
+
}, attributeType));
|
|
172
|
+
});
|
|
173
|
+
expect(react_2.screen.getByText('Drop here')).toBeInTheDocument();
|
|
183
174
|
});
|
|
184
175
|
it('should not allow drop entity crosswalk on relation attribute', function () {
|
|
185
176
|
var attributeType = {
|
|
@@ -202,76 +193,70 @@ describe('InlineSimpleAttributesBlock tests', function () {
|
|
|
202
193
|
ov: false
|
|
203
194
|
}
|
|
204
195
|
];
|
|
205
|
-
(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
196
|
+
setUp(__assign(__assign({}, defaultProps), { attributeType: attributeType, attributeValues: attributeValues }));
|
|
197
|
+
(0, react_2.act)(function () {
|
|
198
|
+
onDragOver(getDragEvent({
|
|
199
|
+
type: 'Crosswalk',
|
|
200
|
+
crosswalk: {
|
|
201
|
+
uri: 'entities/1/crosswalks/1',
|
|
202
|
+
ownerType: 'entity',
|
|
203
|
+
type: 'configuration/sources/FB',
|
|
204
|
+
value: '123'
|
|
205
|
+
}
|
|
206
|
+
}, attributeType));
|
|
207
|
+
});
|
|
208
|
+
expect(react_2.screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
216
209
|
});
|
|
217
210
|
it('should not allow drop crosswalk on entity attribute without permission to create', function () {
|
|
218
211
|
var readOnlyAttrType = __assign(__assign({}, attributeType), { access: ['READ'] });
|
|
219
|
-
(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
212
|
+
setUp(__assign(__assign({}, defaultProps), { attributeType: readOnlyAttrType, attributeValues: attributeValues }));
|
|
213
|
+
(0, react_2.act)(function () {
|
|
214
|
+
onDragOver(getDragEvent({
|
|
215
|
+
type: 'Crosswalk',
|
|
216
|
+
crosswalk: {
|
|
217
|
+
uri: 'entities/1/crosswalks/1',
|
|
218
|
+
ownerType: 'entity',
|
|
219
|
+
type: 'configuration/sources/FB',
|
|
220
|
+
value: '123'
|
|
221
|
+
}
|
|
222
|
+
}, readOnlyAttrType));
|
|
223
|
+
});
|
|
224
|
+
expect(react_2.screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
230
225
|
});
|
|
231
226
|
it('should not allow drop crosswalk on attribute if parent attribute can not be edited', function () {
|
|
232
|
-
(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(InlineSimpleAttributesBlock_1.InlineSimpleAttributesBlock, __assign({}, props)));
|
|
246
|
-
var _a = useDropMock.mock.calls[0][0], canDrop = _a.canDrop, collect = _a.collect;
|
|
247
|
-
expect(canDrop({
|
|
248
|
-
type: 'Crosswalk',
|
|
249
|
-
crosswalk: {
|
|
250
|
-
uri: 'entities/1/crosswalks/1',
|
|
251
|
-
ownerType: 'entity',
|
|
252
|
-
type: 'configuration/sources/FB',
|
|
253
|
-
value: '123'
|
|
254
|
-
}
|
|
255
|
-
}, {})).toBe(true);
|
|
256
|
-
expect(wrapper.find('.dropIndicator')).toHaveLength(0);
|
|
257
|
-
collect({ isOver: function () { return true; }, canDrop: function () { return true; } });
|
|
258
|
-
expect(wrapper.find('.dropIndicator')).toHaveLength(0);
|
|
227
|
+
setUp(__assign(__assign({}, defaultProps), { disableEdit: true }));
|
|
228
|
+
(0, react_2.act)(function () {
|
|
229
|
+
onDragOver(getDragEvent({
|
|
230
|
+
type: 'Crosswalk',
|
|
231
|
+
crosswalk: {
|
|
232
|
+
uri: 'entities/1/crosswalks/1',
|
|
233
|
+
ownerType: 'entity',
|
|
234
|
+
type: 'configuration/sources/FB',
|
|
235
|
+
value: '123'
|
|
236
|
+
}
|
|
237
|
+
}, defaultProps.attributeType));
|
|
238
|
+
});
|
|
239
|
+
expect(react_2.screen.queryByText('Drop here')).not.toBeInTheDocument();
|
|
259
240
|
});
|
|
260
241
|
it('should call props.onAdd on crosswalk drop', function () {
|
|
261
|
-
(
|
|
262
|
-
var drop = useDropMock.mock.calls[0][0].drop;
|
|
242
|
+
setUp();
|
|
263
243
|
var crosswalk = {
|
|
264
244
|
uri: 'entities/1/crosswalks/1',
|
|
265
245
|
ownerType: 'entity',
|
|
266
246
|
type: 'configuration/sources/FB',
|
|
267
247
|
value: '123'
|
|
268
248
|
};
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
249
|
+
(0, react_2.act)(function () {
|
|
250
|
+
onDragEnd(getDragEvent({
|
|
251
|
+
type: 'Crosswalk',
|
|
252
|
+
crosswalk: crosswalk
|
|
253
|
+
}, defaultProps.attributeType));
|
|
254
|
+
});
|
|
255
|
+
expect(defaultProps.onAdd).toHaveBeenCalledWith({
|
|
256
|
+
parentUri: defaultProps.parentUri,
|
|
257
|
+
attributeType: defaultProps.attributeType,
|
|
273
258
|
crosswalk: crosswalk,
|
|
274
|
-
index:
|
|
259
|
+
index: defaultProps.attributeValues.length
|
|
275
260
|
});
|
|
276
261
|
});
|
|
277
262
|
});
|
|
@@ -65,7 +65,7 @@ var InlineSimpleAttribute = function (_a) {
|
|
|
65
65
|
var showIgnore = !isTemporary && ((!isReadingMode && hasBasicPermission) || attributeValue.ignored);
|
|
66
66
|
var showMaskingSwitcher = (isUnmaskingNeeded && !isTemporary && !isReadingMode) || isUnmasking;
|
|
67
67
|
(0, react_1.useEffect)(function () {
|
|
68
|
-
if (isTemporary &&
|
|
68
|
+
if (isTemporary && isEmpty) {
|
|
69
69
|
setEditingMode();
|
|
70
70
|
}
|
|
71
71
|
}, [isEmpty]);
|
|
@@ -3,8 +3,8 @@ import { LineChartOptions } from '@reltio/mdm-sdk';
|
|
|
3
3
|
import { CartesianGridProps, LineChart, LineProps, TooltipProps, XAxisProps, YAxisProps } from 'recharts';
|
|
4
4
|
type LineChartSettings = {
|
|
5
5
|
lineChart: React.ComponentProps<typeof LineChart>;
|
|
6
|
-
xAxis: XAxisProps
|
|
7
|
-
yAxis: YAxisProps
|
|
6
|
+
xAxis: Omit<XAxisProps, 'ref'>;
|
|
7
|
+
yAxis: Omit<YAxisProps, 'ref'>;
|
|
8
8
|
cartesianGrid: Omit<CartesianGridProps, 'ref'>;
|
|
9
9
|
tooltip: TooltipProps<number, string>;
|
|
10
10
|
line: Omit<LineProps, 'ref'>;
|
|
@@ -114,11 +114,15 @@ describe('PieChart', function () {
|
|
|
114
114
|
expect(wrapper.find(recharts_1.Pie).prop('innerRadius')).toBe('50%');
|
|
115
115
|
});
|
|
116
116
|
it('should call props.onItemClick on sector click', function () {
|
|
117
|
+
jest.useFakeTimers();
|
|
117
118
|
var onItemClick = jest.fn();
|
|
118
119
|
var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(PieChart_1.PieChart, { width: 600, height: 300, data: data, onItemClick: onItemClick }));
|
|
120
|
+
jest.runAllTimers();
|
|
121
|
+
wrapper.update();
|
|
119
122
|
var sector = wrapper.find('.recharts-pie-sector').first();
|
|
120
123
|
sector.simulate('click');
|
|
121
124
|
expect(onItemClick).toHaveBeenCalledWith('1');
|
|
125
|
+
jest.useRealTimers();
|
|
122
126
|
});
|
|
123
127
|
it('should render chart legend with percents correctly', function () {
|
|
124
128
|
var legendPayload = [
|
|
@@ -68,7 +68,11 @@ var useSearchNavigation = function () {
|
|
|
68
68
|
}, [listenToActions, updateNavigationData, searchNavigationListener]);
|
|
69
69
|
var requestNextPage = (0, react_1.useCallback)(function (cache, total, index) {
|
|
70
70
|
setLoading(true);
|
|
71
|
-
safeRequestTotalPromise(searchProvider.requestTotal())
|
|
71
|
+
safeRequestTotalPromise(searchProvider.requestTotal())
|
|
72
|
+
.then(function (total) { return updateNavigationData({ total: total }); })
|
|
73
|
+
.catch(function (error) {
|
|
74
|
+
console.warn('Failed to load total count of entities', error);
|
|
75
|
+
});
|
|
72
76
|
var newIndex = index + 1;
|
|
73
77
|
return safeRequestEntitiesPromise(searchProvider.requestEntities(constants_1.REQUEST_PAGE_SIZE, newIndex))
|
|
74
78
|
.then(function (entities) {
|
|
@@ -100,7 +104,11 @@ var useSearchNavigation = function () {
|
|
|
100
104
|
}, [searchProvider, updateNavigationData, openEntity]);
|
|
101
105
|
var requestPrevPage = (0, react_1.useCallback)(function (cache, index) {
|
|
102
106
|
setLoading(true);
|
|
103
|
-
safeRequestTotalPromise(searchProvider.requestTotal())
|
|
107
|
+
safeRequestTotalPromise(searchProvider.requestTotal())
|
|
108
|
+
.then(function (total) { return updateNavigationData({ total: total }); })
|
|
109
|
+
.catch(function (error) {
|
|
110
|
+
console.warn('Failed to load total count of entities', error);
|
|
111
|
+
});
|
|
104
112
|
var newIndex = index - 1;
|
|
105
113
|
var offset = Math.max(0, index - constants_1.REQUEST_PAGE_SIZE);
|
|
106
114
|
var max = constants_1.REQUEST_PAGE_SIZE + Math.min(0, index - constants_1.REQUEST_PAGE_SIZE);
|
|
@@ -210,7 +218,7 @@ var useSearchNavigation = function () {
|
|
|
210
218
|
if (cache && uri) {
|
|
211
219
|
var cacheIndex = cache.indexOf(uri) - 1;
|
|
212
220
|
stepBackWithCheck(cache, cacheIndex, total, index).catch(function (error) {
|
|
213
|
-
console.warn("Can't load
|
|
221
|
+
console.warn("Can't load previous page of search", error);
|
|
214
222
|
});
|
|
215
223
|
}
|
|
216
224
|
}, [stepBackWithCheck, cache, uri, total, index]);
|