From bc96aff8c4a7082f11cc7de15e1993aa11cfeb1d Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Thu, 30 Dec 2021 08:04:07 -0300 Subject: [PATCH] chore: Moves the Menu to views/components folder --- superset-frontend/src/common/components/index.tsx | 1 + superset-frontend/src/views/App.tsx | 2 +- .../src/views/CRUD/alert/AlertList.test.jsx | 2 +- superset-frontend/src/views/CRUD/alert/AlertList.tsx | 2 +- superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx | 2 +- .../src/views/CRUD/annotation/AnnotationList.test.jsx | 2 +- .../views/CRUD/annotationlayers/AnnotationLayersList.tsx | 2 +- superset-frontend/src/views/CRUD/chart/ChartList.tsx | 2 +- .../views/CRUD/csstemplates/CssTemplatesList.test.jsx | 2 +- .../src/views/CRUD/data/database/DatabaseList.test.jsx | 2 +- .../src/views/CRUD/data/database/DatabaseList.tsx | 2 +- .../src/views/CRUD/data/dataset/DatasetList.tsx | 2 +- .../views/CRUD/data/savedquery/SavedQueryList.test.jsx | 2 +- .../src/views/CRUD/data/savedquery/SavedQueryList.tsx | 2 +- .../src/views/CRUD/welcome/ActivityTable.tsx | 2 +- superset-frontend/src/views/CRUD/welcome/ChartTable.tsx | 2 +- .../src/views/CRUD/welcome/DashboardTable.tsx | 2 +- .../src/views/CRUD/welcome/SavedQueries.test.tsx | 2 +- .../src/views/CRUD/welcome/SavedQueries.tsx | 2 +- .../Menu => views/components}/LanguagePicker.test.tsx | 0 .../Menu => views/components}/LanguagePicker.tsx | 0 .../{components/Menu => views/components}/Menu.test.tsx | 0 .../src/{components/Menu => views/components}/Menu.tsx | 9 +++++++-- .../{components/Menu => views/components}/MenuRight.tsx | 0 .../Menu => views/components}/SubMenu.test.tsx | 0 .../{components/Menu => views/components}/SubMenu.tsx | 3 +-- superset-frontend/src/views/menu.tsx | 2 +- 27 files changed, 28 insertions(+), 23 deletions(-) rename superset-frontend/src/{components/Menu => views/components}/LanguagePicker.test.tsx (100%) rename superset-frontend/src/{components/Menu => views/components}/LanguagePicker.tsx (100%) rename superset-frontend/src/{components/Menu => views/components}/Menu.test.tsx (100%) rename superset-frontend/src/{components/Menu => views/components}/Menu.tsx (98%) rename superset-frontend/src/{components/Menu => views/components}/MenuRight.tsx (100%) rename superset-frontend/src/{components/Menu => views/components}/SubMenu.test.tsx (100%) rename superset-frontend/src/{components/Menu => views/components}/SubMenu.tsx (98%) diff --git a/superset-frontend/src/common/components/index.tsx b/superset-frontend/src/common/components/index.tsx index 3deeff20ec5f7..e03194c40db38 100644 --- a/superset-frontend/src/common/components/index.tsx +++ b/superset-frontend/src/common/components/index.tsx @@ -41,6 +41,7 @@ export { Divider, Dropdown, Form, + Grid, Empty, Typography, Tree, diff --git a/superset-frontend/src/views/App.tsx b/superset-frontend/src/views/App.tsx index e23695c9d0688..7bbc40e531aee 100644 --- a/superset-frontend/src/views/App.tsx +++ b/superset-frontend/src/views/App.tsx @@ -33,7 +33,7 @@ import { ThemeProvider } from '@superset-ui/core'; import { DynamicPluginProvider } from 'src/components/DynamicPlugins'; import ErrorBoundary from 'src/components/ErrorBoundary'; import Loading from 'src/components/Loading'; -import Menu from 'src/components/Menu/Menu'; +import Menu from 'src/views/components/Menu'; import FlashProvider from 'src/components/FlashProvider'; import { theme } from 'src/preamble'; import ToastContainer from 'src/components/MessageToasts/ToastContainer'; diff --git a/superset-frontend/src/views/CRUD/alert/AlertList.test.jsx b/superset-frontend/src/views/CRUD/alert/AlertList.test.jsx index b92e36cbefd80..5cf9483a526e0 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertList.test.jsx +++ b/superset-frontend/src/views/CRUD/alert/AlertList.test.jsx @@ -25,7 +25,7 @@ import { styledMount as mount } from 'spec/helpers/theming'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; import { Switch } from 'src/components/Switch'; import ListView from 'src/components/ListView'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import AlertList from 'src/views/CRUD/alert/AlertList'; import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox'; import { act } from 'react-dom/test-utils'; diff --git a/superset-frontend/src/views/CRUD/alert/AlertList.tsx b/superset-frontend/src/views/CRUD/alert/AlertList.tsx index 7068787650657..2d84cb0b976df 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertList.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertList.tsx @@ -30,7 +30,7 @@ import ListView, { Filters, ListViewProps, } from 'src/components/ListView'; -import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; +import SubMenu, { SubMenuProps } from 'src/views/components/SubMenu'; import { Switch } from 'src/components/Switch'; import { DATETIME_WITH_TIME_ZONE } from 'src/constants'; import withToasts from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx b/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx index 64e665aeb4c13..580d923141492 100644 --- a/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx +++ b/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx @@ -22,7 +22,7 @@ import moment from 'moment'; import React, { useEffect, useMemo } from 'react'; import { Link, useParams } from 'react-router-dom'; import ListView from 'src/components/ListView'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import withToasts from 'src/components/MessageToasts/withToasts'; import { fDuration } from 'src/modules/dates'; import AlertStatusIcon from 'src/views/CRUD/alert/components/AlertStatusIcon'; diff --git a/superset-frontend/src/views/CRUD/annotation/AnnotationList.test.jsx b/superset-frontend/src/views/CRUD/annotation/AnnotationList.test.jsx index 4bc664432c394..e4ddfb3695aa4 100644 --- a/superset-frontend/src/views/CRUD/annotation/AnnotationList.test.jsx +++ b/superset-frontend/src/views/CRUD/annotation/AnnotationList.test.jsx @@ -27,7 +27,7 @@ import AnnotationList from 'src/views/CRUD/annotation/AnnotationList'; import DeleteModal from 'src/components/DeleteModal'; import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox'; import ListView from 'src/components/ListView'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; import { act } from 'react-dom/test-utils'; diff --git a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx index 4fc77576458e4..b93e31d38017b 100644 --- a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx +++ b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx @@ -25,7 +25,7 @@ import moment from 'moment'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { createFetchRelated, createErrorHandler } from 'src/views/CRUD/utils'; import withToasts from 'src/components/MessageToasts/withToasts'; -import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; +import SubMenu, { SubMenuProps } from 'src/views/components/SubMenu'; import ActionsBar, { ActionProps } from 'src/components/ListView/ActionsBar'; import ListView, { ListViewProps, diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.tsx b/superset-frontend/src/views/CRUD/chart/ChartList.tsx index 3b125c78f35e5..1de33088dfe11 100644 --- a/superset-frontend/src/views/CRUD/chart/ChartList.tsx +++ b/superset-frontend/src/views/CRUD/chart/ChartList.tsx @@ -39,7 +39,7 @@ import { } from 'src/views/CRUD/hooks'; import handleResourceExport from 'src/utils/export'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; -import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; +import SubMenu, { SubMenuProps } from 'src/views/components/SubMenu'; import FaveStar from 'src/components/FaveStar'; import ListView, { Filter, diff --git a/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.test.jsx b/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.test.jsx index b0d29d3ccc8f7..e0b6df9ddf486 100644 --- a/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.test.jsx +++ b/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.test.jsx @@ -24,7 +24,7 @@ import fetchMock from 'fetch-mock'; import { styledMount as mount } from 'spec/helpers/theming'; import CssTemplatesList from 'src/views/CRUD/csstemplates/CssTemplatesList'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import ListView from 'src/components/ListView'; import Filters from 'src/components/ListView/Filters'; import DeleteModal from 'src/components/DeleteModal'; diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx b/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx index 9a3eb9a1c47d7..2c01e6c106e22 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx @@ -30,7 +30,7 @@ import * as featureFlags from 'src/featureFlags'; import DatabaseList from 'src/views/CRUD/data/database/DatabaseList'; import DatabaseModal from 'src/views/CRUD/data/database/DatabaseModal'; import DeleteModal from 'src/components/DeleteModal'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import ListView from 'src/components/ListView'; import Filters from 'src/components/ListView/Filters'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx index c5a0183fbd17d..355d8335ee15a 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx @@ -23,7 +23,7 @@ import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { createErrorHandler } from 'src/views/CRUD/utils'; import withToasts from 'src/components/MessageToasts/withToasts'; -import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; +import SubMenu, { SubMenuProps } from 'src/views/components/SubMenu'; import DeleteModal from 'src/components/DeleteModal'; import { Tooltip } from 'src/components/Tooltip'; import Icons from 'src/components/Icons'; diff --git a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx index 39f8ba0e0265a..0fa2697ed6dda 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx @@ -44,7 +44,7 @@ import Loading from 'src/components/Loading'; import SubMenu, { SubMenuProps, ButtonProps, -} from 'src/components/Menu/SubMenu'; +} from 'src/views/components/SubMenu'; import { commonMenuData } from 'src/views/CRUD/data/common'; import Owner from 'src/types/Owner'; import withToasts from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.test.jsx b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.test.jsx index d3512311c2555..456fe2f394f5e 100644 --- a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.test.jsx +++ b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.test.jsx @@ -28,7 +28,7 @@ import { QueryParamProvider } from 'use-query-params'; import { act } from 'react-dom/test-utils'; import * as featureFlags from 'src/featureFlags'; import SavedQueryList from 'src/views/CRUD/data/savedquery/SavedQueryList'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import ListView from 'src/components/ListView'; import Filters from 'src/components/ListView/Filters'; import ActionsBar from 'src/components/ListView/ActionsBar'; diff --git a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx index f6d27a463e5b3..1baa674d46542 100644 --- a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx +++ b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx @@ -34,7 +34,7 @@ import handleResourceExport from 'src/utils/export'; import SubMenu, { SubMenuProps, ButtonProps, -} from 'src/components/Menu/SubMenu'; +} from 'src/views/components/SubMenu'; import ListView, { ListViewProps, Filters, diff --git a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx index 53c9840a119c8..540c033419009 100644 --- a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx @@ -22,7 +22,7 @@ import { styled, t } from '@superset-ui/core'; import { setItem, LocalStorageKeys } from 'src/utils/localStorageHelpers'; import ListViewCard from 'src/components/ListViewCard'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import { ActivityData, LoadingCards } from 'src/views/CRUD/welcome/Welcome'; import { CardContainer, diff --git a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx index dfda6e58b98d5..cd42ae6210791 100644 --- a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx @@ -41,7 +41,7 @@ import Chart from 'src/types/Chart'; import handleResourceExport from 'src/utils/export'; import Loading from 'src/components/Loading'; import ErrorBoundary from 'src/components/ErrorBoundary'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import EmptyState from './EmptyState'; import { WelcomeTable } from './types'; diff --git a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx index 9e992ad54ea41..e6539b2ad71be 100644 --- a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx @@ -42,7 +42,7 @@ import withToasts from 'src/components/MessageToasts/withToasts'; import Loading from 'src/components/Loading'; import PropertiesModal from 'src/dashboard/components/PropertiesModal'; import DashboardCard from 'src/views/CRUD/dashboard/DashboardCard'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import EmptyState from './EmptyState'; import { WelcomeTable } from './types'; diff --git a/superset-frontend/src/views/CRUD/welcome/SavedQueries.test.tsx b/superset-frontend/src/views/CRUD/welcome/SavedQueries.test.tsx index 058e990887eeb..dd883a1aa1ab4 100644 --- a/superset-frontend/src/views/CRUD/welcome/SavedQueries.test.tsx +++ b/superset-frontend/src/views/CRUD/welcome/SavedQueries.test.tsx @@ -24,7 +24,7 @@ import configureStore from 'redux-mock-store'; import { act } from 'react-dom/test-utils'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import SavedQueries from 'src/views/CRUD/welcome/SavedQueries'; // store needed for withToasts(DashboardTable) diff --git a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx index b8eeab51cfc5f..f9bce955d0c7c 100644 --- a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx +++ b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx @@ -28,7 +28,7 @@ import { copyQueryLink, useListViewResource } from 'src/views/CRUD/hooks'; import ListViewCard from 'src/components/ListViewCard'; import DeleteModal from 'src/components/DeleteModal'; import Icons from 'src/components/Icons'; -import SubMenu from 'src/components/Menu/SubMenu'; +import SubMenu from 'src/views/components/SubMenu'; import EmptyState from './EmptyState'; import { CardContainer, diff --git a/superset-frontend/src/components/Menu/LanguagePicker.test.tsx b/superset-frontend/src/views/components/LanguagePicker.test.tsx similarity index 100% rename from superset-frontend/src/components/Menu/LanguagePicker.test.tsx rename to superset-frontend/src/views/components/LanguagePicker.test.tsx diff --git a/superset-frontend/src/components/Menu/LanguagePicker.tsx b/superset-frontend/src/views/components/LanguagePicker.tsx similarity index 100% rename from superset-frontend/src/components/Menu/LanguagePicker.tsx rename to superset-frontend/src/views/components/LanguagePicker.tsx diff --git a/superset-frontend/src/components/Menu/Menu.test.tsx b/superset-frontend/src/views/components/Menu.test.tsx similarity index 100% rename from superset-frontend/src/components/Menu/Menu.test.tsx rename to superset-frontend/src/views/components/Menu.test.tsx diff --git a/superset-frontend/src/components/Menu/Menu.tsx b/superset-frontend/src/views/components/Menu.tsx similarity index 98% rename from superset-frontend/src/components/Menu/Menu.tsx rename to superset-frontend/src/views/components/Menu.tsx index 13d19fb26922f..fd998b3b2b437 100644 --- a/superset-frontend/src/components/Menu/Menu.tsx +++ b/superset-frontend/src/views/components/Menu.tsx @@ -21,10 +21,15 @@ import { styled, css } from '@superset-ui/core'; import { debounce } from 'lodash'; import { Global } from '@emotion/react'; import { getUrlParam } from 'src/utils/urlUtils'; -import { MainNav as DropdownMenu, MenuMode } from 'src/common/components'; +import { + MainNav as DropdownMenu, + MenuMode, + Row, + Col, + Grid, +} from 'src/common/components'; import { Tooltip } from 'src/components/Tooltip'; import { Link } from 'react-router-dom'; -import { Row, Col, Grid } from 'antd'; import Icons from 'src/components/Icons'; import { URL_PARAMS } from 'src/constants'; import RightMenu from './MenuRight'; diff --git a/superset-frontend/src/components/Menu/MenuRight.tsx b/superset-frontend/src/views/components/MenuRight.tsx similarity index 100% rename from superset-frontend/src/components/Menu/MenuRight.tsx rename to superset-frontend/src/views/components/MenuRight.tsx diff --git a/superset-frontend/src/components/Menu/SubMenu.test.tsx b/superset-frontend/src/views/components/SubMenu.test.tsx similarity index 100% rename from superset-frontend/src/components/Menu/SubMenu.test.tsx rename to superset-frontend/src/views/components/SubMenu.test.tsx diff --git a/superset-frontend/src/components/Menu/SubMenu.tsx b/superset-frontend/src/views/components/SubMenu.tsx similarity index 98% rename from superset-frontend/src/components/Menu/SubMenu.tsx rename to superset-frontend/src/views/components/SubMenu.tsx index 83ed92b4aa298..917adfab703f2 100644 --- a/superset-frontend/src/components/Menu/SubMenu.tsx +++ b/superset-frontend/src/views/components/SubMenu.tsx @@ -21,8 +21,7 @@ import { Link, useHistory } from 'react-router-dom'; import { styled } from '@superset-ui/core'; import cx from 'classnames'; import { debounce } from 'lodash'; -import { Row } from 'antd'; -import { Menu, MenuMode } from 'src/common/components'; +import { Menu, MenuMode, Row } from 'src/common/components'; import Button, { OnClickHandler } from 'src/components/Button'; const StyledHeader = styled.div` diff --git a/superset-frontend/src/views/menu.tsx b/superset-frontend/src/views/menu.tsx index 68b72d70ec68d..166516569198c 100644 --- a/superset-frontend/src/views/menu.tsx +++ b/superset-frontend/src/views/menu.tsx @@ -24,7 +24,7 @@ import ReactDOM from 'react-dom'; import { CacheProvider } from '@emotion/react'; import createCache from '@emotion/cache'; import { ThemeProvider } from '@superset-ui/core'; -import Menu from 'src/components/Menu/Menu'; +import Menu from 'src/views/components/Menu'; import { theme } from 'src/preamble'; import { Provider } from 'react-redux';