mirror of
https://github.com/apache/superset.git
synced 2026-04-14 13:44:46 +00:00
chore: Upgrade react-dnd to 11.1.3 (#12815)
This commit is contained in:
committed by
GitHub
parent
34549cb5b7
commit
fcaa0acad5
@@ -21,6 +21,8 @@ import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import Chart from 'src/dashboard/containers/Chart';
|
||||
import ChartHolder from 'src/dashboard/components/gridComponents/ChartHolder';
|
||||
@@ -33,7 +35,6 @@ import { getMockStore } from 'spec/fixtures/mockStore';
|
||||
import { sliceId } from 'spec/fixtures/mockChartQueries';
|
||||
import dashboardInfo from 'spec/fixtures/mockDashboardInfo';
|
||||
import { dashboardLayout as mockLayout } from 'spec/fixtures/mockDashboardLayout';
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { sliceEntitiesForChart } from 'spec/fixtures/mockSliceEntities';
|
||||
|
||||
describe('ChartHolder', () => {
|
||||
@@ -65,9 +66,9 @@ describe('ChartHolder', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStore}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<ChartHolder {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
{
|
||||
wrappingComponent: ThemeProvider,
|
||||
|
||||
@@ -21,6 +21,8 @@ import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import BackgroundStyleDropdown from 'src/dashboard/components/menu/BackgroundStyleDropdown';
|
||||
import Column from 'src/dashboard/components/gridComponents/Column';
|
||||
@@ -32,7 +34,6 @@ import IconButton from 'src/dashboard/components/IconButton';
|
||||
import ResizableContainer from 'src/dashboard/components/resizable/ResizableContainer';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { mockStore } from 'spec/fixtures/mockStore';
|
||||
import { dashboardLayout as mockLayout } from 'spec/fixtures/mockDashboardLayout';
|
||||
|
||||
@@ -66,9 +67,9 @@ describe('Column', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStore}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Column {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
{
|
||||
wrappingComponent: ThemeProvider,
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
@@ -30,8 +32,6 @@ import {
|
||||
DASHBOARD_GRID_TYPE,
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
|
||||
describe('Divider', () => {
|
||||
const props = {
|
||||
id: 'id',
|
||||
@@ -49,9 +49,9 @@ describe('Divider', () => {
|
||||
// We have to wrap provide DragDropContext for the underlying DragDroppable
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Divider {...props} {...overrideProps} />
|
||||
</WithDragDropContext>,
|
||||
</DndProvider>,
|
||||
);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { styledMount as mount } from 'spec/helpers/theming';
|
||||
import sinon from 'sinon';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import EditableTitle from 'src/components/EditableTitle';
|
||||
@@ -33,7 +35,6 @@ import {
|
||||
DASHBOARD_GRID_TYPE,
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { mockStoreWithTabs } from 'spec/fixtures/mockStore';
|
||||
|
||||
describe('Header', () => {
|
||||
@@ -56,9 +57,9 @@ describe('Header', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStoreWithTabs}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Header {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
);
|
||||
return wrapper;
|
||||
|
||||
@@ -21,6 +21,9 @@ import React from 'react';
|
||||
import { styledMount as mount } from 'spec/helpers/theming';
|
||||
import sinon from 'sinon';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { MarkdownEditor } from 'src/components/AsyncAceEditor';
|
||||
import Markdown from 'src/dashboard/components/gridComponents/Markdown';
|
||||
@@ -31,7 +34,6 @@ import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
import ResizableContainer from 'src/dashboard/components/resizable/ResizableContainer';
|
||||
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { mockStore } from 'spec/fixtures/mockStore';
|
||||
import { dashboardLayout as mockLayout } from 'spec/fixtures/mockDashboardLayout';
|
||||
|
||||
@@ -63,9 +65,9 @@ describe('Markdown', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStore}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Markdown {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
);
|
||||
return wrapper;
|
||||
|
||||
@@ -20,6 +20,8 @@ import { Provider } from 'react-redux';
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import BackgroundStyleDropdown from 'src/dashboard/components/menu/BackgroundStyleDropdown';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
@@ -32,7 +34,6 @@ import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
import { DASHBOARD_GRID_ID } from 'src/dashboard/util/constants';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { mockStore } from 'spec/fixtures/mockStore';
|
||||
import { dashboardLayout as mockLayout } from 'spec/fixtures/mockDashboardLayout';
|
||||
|
||||
@@ -62,9 +63,9 @@ describe('Row', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStore}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Row {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
{
|
||||
wrappingComponent: ThemeProvider,
|
||||
|
||||
@@ -20,6 +20,8 @@ import { Provider } from 'react-redux';
|
||||
import React from 'react';
|
||||
import { styledMount as mount } from 'spec/helpers/theming';
|
||||
import sinon from 'sinon';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
@@ -28,7 +30,6 @@ import Tab, {
|
||||
RENDER_TAB,
|
||||
RENDER_TAB_CONTENT,
|
||||
} from 'src/dashboard/components/gridComponents/Tab';
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { dashboardLayoutWithTabs } from 'spec/fixtures/mockDashboardLayout';
|
||||
import { mockStoreWithTabs } from 'spec/fixtures/mockStore';
|
||||
|
||||
@@ -63,9 +64,9 @@ describe('Tabs', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStoreWithTabs}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Tab {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
);
|
||||
return wrapper;
|
||||
|
||||
@@ -20,6 +20,9 @@ import { Provider } from 'react-redux';
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import { LineEditableTabs } from 'src/common/components/Tabs';
|
||||
import { Modal } from 'src/common/components';
|
||||
import fetchMock from 'fetch-mock';
|
||||
@@ -30,7 +33,6 @@ import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import Tabs from 'src/dashboard/components/gridComponents/Tabs';
|
||||
import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants';
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
import { dashboardLayoutWithTabs } from 'spec/fixtures/mockDashboardLayout';
|
||||
import { mockStoreWithTabs } from 'spec/fixtures/mockStore';
|
||||
|
||||
@@ -64,9 +66,9 @@ describe('Tabs', () => {
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<Provider store={mockStoreWithTabs}>
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Tabs {...props} {...overrideProps} />
|
||||
</WithDragDropContext>
|
||||
</DndProvider>
|
||||
</Provider>,
|
||||
);
|
||||
return wrapper;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
@@ -26,7 +28,6 @@ import {
|
||||
NEW_COMPONENT_SOURCE_TYPE,
|
||||
CHART_TYPE,
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
import WithDragDropContext from 'spec/helpers/WithDragDropContext';
|
||||
|
||||
describe('DraggableNewComponent', () => {
|
||||
const props = {
|
||||
@@ -40,9 +41,9 @@ describe('DraggableNewComponent', () => {
|
||||
// We have to wrap provide DragDropContext for the underlying DragDroppable
|
||||
// otherwise we cannot assert on DragDroppable children
|
||||
const wrapper = mount(
|
||||
<WithDragDropContext>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<DraggableNewComponent {...props} {...overrideProps} />
|
||||
</WithDragDropContext>,
|
||||
</DndProvider>,
|
||||
);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user