diff --git a/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx b/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx index 5fcb77b80e..aed44f7fcb 100644 --- a/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx @@ -21,8 +21,10 @@ import sinon from 'sinon'; import configureStore from 'redux-mock-store'; import { shallow } from 'enzyme'; import { Menu } from 'src/common/components'; -import DatasourceModal from 'src/datasource/DatasourceModal'; -import ChangeDatasourceModal from 'src/datasource/ChangeDatasourceModal'; +import { + DatasourceModal, + ChangeDatasourceModal, +} from 'src/components/Datasource'; import DatasourceControl from 'src/explore/components/controls/DatasourceControl'; import Icons from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; diff --git a/superset-frontend/src/datasource/ChangeDatasourceModal.test.jsx b/superset-frontend/src/components/Datasource/ChangeDatasourceModal.test.jsx similarity index 98% rename from superset-frontend/src/datasource/ChangeDatasourceModal.test.jsx rename to superset-frontend/src/components/Datasource/ChangeDatasourceModal.test.jsx index 77a35eba89..419af6e3cf 100644 --- a/superset-frontend/src/datasource/ChangeDatasourceModal.test.jsx +++ b/superset-frontend/src/components/Datasource/ChangeDatasourceModal.test.jsx @@ -25,7 +25,7 @@ import { act } from 'react-dom/test-utils'; import sinon from 'sinon'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; import Modal from 'src/components/Modal'; -import ChangeDatasourceModal from 'src/datasource/ChangeDatasourceModal'; +import { ChangeDatasourceModal } from 'src/components/Datasource'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; import mockDatasource from 'spec/fixtures/mockDatasource'; diff --git a/superset-frontend/src/datasource/ChangeDatasourceModal.tsx b/superset-frontend/src/components/Datasource/ChangeDatasourceModal.tsx similarity index 99% rename from superset-frontend/src/datasource/ChangeDatasourceModal.tsx rename to superset-frontend/src/components/Datasource/ChangeDatasourceModal.tsx index 7aa80bb12a..1a655c71e7 100644 --- a/superset-frontend/src/datasource/ChangeDatasourceModal.tsx +++ b/superset-frontend/src/components/Datasource/ChangeDatasourceModal.tsx @@ -41,7 +41,7 @@ import { SORT_BY as DATASET_SORT_BY, } from 'src/views/CRUD/data/dataset/constants'; import withToasts from 'src/components/MessageToasts/withToasts'; -import FacePile from '../components/FacePile'; +import FacePile from '../FacePile'; const CONFIRM_WARNING_MESSAGE = t( 'Warning! Changing the dataset may break the chart if the metadata does not exist.', diff --git a/superset-frontend/src/datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx similarity index 100% rename from superset-frontend/src/datasource/DatasourceEditor.jsx rename to superset-frontend/src/components/Datasource/DatasourceEditor.jsx diff --git a/superset-frontend/src/datasource/DatasourceEditor.test.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx similarity index 99% rename from superset-frontend/src/datasource/DatasourceEditor.test.jsx rename to superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx index 247d04a706..10f3d52c7c 100644 --- a/superset-frontend/src/datasource/DatasourceEditor.test.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx @@ -28,7 +28,7 @@ import { Radio } from 'src/components/Radio'; import Icons from 'src/components/Icons'; import Tabs from 'src/components/Tabs'; -import DatasourceEditor from 'src/datasource/DatasourceEditor'; +import DatasourceEditor from 'src/components/Datasource/DatasourceEditor'; import Field from 'src/CRUD/Field'; import mockDatasource from 'spec/fixtures/mockDatasource'; import * as featureFlags from 'src/featureFlags'; diff --git a/superset-frontend/src/datasource/DatasourceModal.test.jsx b/superset-frontend/src/components/Datasource/DatasourceModal.test.jsx similarity index 96% rename from superset-frontend/src/datasource/DatasourceModal.test.jsx rename to superset-frontend/src/components/Datasource/DatasourceModal.test.jsx index d965aec720..fdf0a515cf 100644 --- a/superset-frontend/src/datasource/DatasourceModal.test.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal.test.jsx @@ -28,8 +28,8 @@ import { supersetTheme, ThemeProvider } from '@superset-ui/core'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; import Modal from 'src/components/Modal'; -import DatasourceModal from 'src/datasource/DatasourceModal'; -import DatasourceEditor from 'src/datasource/DatasourceEditor'; +import { DatasourceModal } from 'src/components/Datasource'; +import DatasourceEditor from 'src/components/Datasource/DatasourceEditor'; import * as featureFlags from 'src/featureFlags'; import mockDatasource from 'spec/fixtures/mockDatasource'; diff --git a/superset-frontend/src/datasource/DatasourceModal.tsx b/superset-frontend/src/components/Datasource/DatasourceModal.tsx similarity index 100% rename from superset-frontend/src/datasource/DatasourceModal.tsx rename to superset-frontend/src/components/Datasource/DatasourceModal.tsx diff --git a/superset-frontend/src/components/Datasource/index.tsx b/superset-frontend/src/components/Datasource/index.tsx new file mode 100644 index 0000000000..de28b24c4c --- /dev/null +++ b/superset-frontend/src/components/Datasource/index.tsx @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import ChangeDatasourceModal from './ChangeDatasourceModal'; +import DatasourceModal from './DatasourceModal'; + +export { ChangeDatasourceModal, DatasourceModal }; diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx index 3df55323d1..913311de4e 100644 --- a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx @@ -24,8 +24,10 @@ import { t, styled, supersetTheme } from '@superset-ui/core'; import { Dropdown, Menu } from 'src/common/components'; import { Tooltip } from 'src/components/Tooltip'; import Icons from 'src/components/Icons'; -import ChangeDatasourceModal from 'src/datasource/ChangeDatasourceModal'; -import DatasourceModal from 'src/datasource/DatasourceModal'; +import { + ChangeDatasourceModal, + DatasourceModal, +} from 'src/components/Datasource'; import { postForm } from 'src/explore/exploreUtils'; import Button from 'src/components/Button'; import ErrorAlert from 'src/components/ErrorMessage/ErrorAlert'; diff --git a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx index bdc9f4084d..4eb7724721 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx @@ -32,7 +32,7 @@ import { import { ColumnObject } from 'src/views/CRUD/data/dataset/types'; import { useListViewResource } from 'src/views/CRUD/hooks'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; -import DatasourceModal from 'src/datasource/DatasourceModal'; +import { DatasourceModal } from 'src/components/Datasource'; import DeleteModal from 'src/components/DeleteModal'; import handleResourceExport from 'src/utils/export'; import ListView, {