mirror of https://github.com/apache/superset.git
refactor: Organizes the pages in their own folder (#23241)
This commit is contained in:
parent
6076457b90
commit
d16eda6e56
|
@ -26,7 +26,7 @@ import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
||||||
import { Switch } from 'src/components/Switch';
|
import { Switch } from 'src/components/Switch';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
||||||
import SubMenu from 'src/views/components/SubMenu';
|
import SubMenu from 'src/views/components/SubMenu';
|
||||||
import AlertList from 'src/views/CRUD/alert/AlertList';
|
import AlertList from 'src/pages/AlertReportList';
|
||||||
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
|
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
|
@ -52,8 +52,8 @@ import {
|
||||||
import { createErrorHandler, createFetchRelated } from 'src/views/CRUD/utils';
|
import { createErrorHandler, createFetchRelated } from 'src/views/CRUD/utils';
|
||||||
import { isUserAdmin } from 'src/dashboard/util/permissionUtils';
|
import { isUserAdmin } from 'src/dashboard/util/permissionUtils';
|
||||||
import Owner from 'src/types/Owner';
|
import Owner from 'src/types/Owner';
|
||||||
import AlertReportModal from './AlertReportModal';
|
import AlertReportModal from 'src/views/CRUD/alert/AlertReportModal';
|
||||||
import { AlertObject, AlertState } from './types';
|
import { AlertObject, AlertState } from 'src/views/CRUD/alert/types';
|
||||||
|
|
||||||
const extensionsRegistry = getExtensionsRegistry();
|
const extensionsRegistry = getExtensionsRegistry();
|
||||||
|
|
|
@ -24,7 +24,7 @@ import AsyncSelect from 'src/components/Select/AsyncSelect';
|
||||||
import { SelectValue } from 'antd/lib/select';
|
import { SelectValue } from 'antd/lib/select';
|
||||||
import { loadTags } from 'src/components/Tags/utils';
|
import { loadTags } from 'src/components/Tags/utils';
|
||||||
import { getValue } from 'src/components/Select/utils';
|
import { getValue } from 'src/components/Select/utils';
|
||||||
import AllEntitiesTable from './AllEntitiesTable';
|
import AllEntitiesTable from 'src/views/CRUD/allentities/AllEntitiesTable';
|
||||||
|
|
||||||
const AllEntitiesContainer = styled.div`
|
const AllEntitiesContainer = styled.div`
|
||||||
${({ theme }) => `
|
${({ theme }) => `
|
|
@ -23,7 +23,7 @@ import fetchMock from 'fetch-mock';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
|
|
||||||
import AnnotationLayersList from 'src/views/CRUD/annotationlayers/AnnotationLayersList';
|
import AnnotationLayersList from 'src/pages/AnnotationLayerList';
|
||||||
import AnnotationLayerModal from 'src/views/CRUD/annotationlayers/AnnotationLayerModal';
|
import AnnotationLayerModal from 'src/views/CRUD/annotationlayers/AnnotationLayerModal';
|
||||||
import SubMenu from 'src/views/components/SubMenu';
|
import SubMenu from 'src/views/components/SubMenu';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
|
@ -34,8 +34,8 @@ import ListView, {
|
||||||
} from 'src/components/ListView';
|
} from 'src/components/ListView';
|
||||||
import DeleteModal from 'src/components/DeleteModal';
|
import DeleteModal from 'src/components/DeleteModal';
|
||||||
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
||||||
import AnnotationLayerModal from './AnnotationLayerModal';
|
import AnnotationLayerModal from 'src/views/CRUD/annotationlayers/AnnotationLayerModal';
|
||||||
import { AnnotationLayerObject } from './types';
|
import { AnnotationLayerObject } from 'src/views/CRUD/annotationlayers/types';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
const MOMENT_FORMAT = 'MMM DD, YYYY';
|
const MOMENT_FORMAT = 'MMM DD, YYYY';
|
|
@ -23,7 +23,7 @@ import fetchMock from 'fetch-mock';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
|
|
||||||
import AnnotationList from 'src/views/CRUD/annotation/AnnotationList';
|
import AnnotationList from 'src/pages/AnnotationList';
|
||||||
import DeleteModal from 'src/components/DeleteModal';
|
import DeleteModal from 'src/components/DeleteModal';
|
||||||
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
|
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
|
@ -33,8 +33,8 @@ import withToasts from 'src/components/MessageToasts/withToasts';
|
||||||
import { useListViewResource } from 'src/views/CRUD/hooks';
|
import { useListViewResource } from 'src/views/CRUD/hooks';
|
||||||
import { createErrorHandler } from 'src/views/CRUD/utils';
|
import { createErrorHandler } from 'src/views/CRUD/utils';
|
||||||
|
|
||||||
import { AnnotationObject } from './types';
|
import { AnnotationObject } from 'src/views/CRUD/annotation/types';
|
||||||
import AnnotationModal from './AnnotationModal';
|
import AnnotationModal from 'src/views/CRUD/annotation/AnnotationModal';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
|
|
|
@ -34,13 +34,13 @@ import { URL_PARAMS } from 'src/constants';
|
||||||
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
||||||
import getFormDataWithExtraFilters from 'src/dashboard/util/charts/getFormDataWithExtraFilters';
|
import getFormDataWithExtraFilters from 'src/dashboard/util/charts/getFormDataWithExtraFilters';
|
||||||
import { getAppliedFilterValues } from 'src/dashboard/util/activeDashboardFilters';
|
import { getAppliedFilterValues } from 'src/dashboard/util/activeDashboardFilters';
|
||||||
import { getParsedExploreURLParams } from './exploreUtils/getParsedExploreURLParams';
|
import { getParsedExploreURLParams } from 'src/explore/exploreUtils/getParsedExploreURLParams';
|
||||||
import { hydrateExplore } from './actions/hydrateExplore';
|
import { hydrateExplore } from 'src/explore/actions/hydrateExplore';
|
||||||
import ExploreViewContainer from './components/ExploreViewContainer';
|
import ExploreViewContainer from 'src/explore/components/ExploreViewContainer';
|
||||||
import { ExploreResponsePayload, SaveActionType } from './types';
|
import { ExploreResponsePayload, SaveActionType } from 'src/explore/types';
|
||||||
import { fallbackExploreInitialData } from './fixtures';
|
import { fallbackExploreInitialData } from 'src/explore/fixtures';
|
||||||
import { getItem, LocalStorageKeys } from '../utils/localStorageHelpers';
|
import { getItem, LocalStorageKeys } from 'src/utils/localStorageHelpers';
|
||||||
import { getFormDataWithDashboardContext } from './controlUtils/getFormDataWithDashboardContext';
|
import { getFormDataWithDashboardContext } from 'src/explore/controlUtils/getFormDataWithDashboardContext';
|
||||||
|
|
||||||
const isValidResult = (rv: JsonObject): boolean =>
|
const isValidResult = (rv: JsonObject): boolean =>
|
||||||
rv?.result?.form_data && isDefined(rv?.result?.dataset?.id);
|
rv?.result?.form_data && isDefined(rv?.result?.dataset?.id);
|
|
@ -70,7 +70,7 @@ import { GenericLink } from 'src/components/GenericLink/GenericLink';
|
||||||
import getBootstrapData from 'src/utils/getBootstrapData';
|
import getBootstrapData from 'src/utils/getBootstrapData';
|
||||||
import Owner from 'src/types/Owner';
|
import Owner from 'src/types/Owner';
|
||||||
import { loadTags } from 'src/components/Tags/utils';
|
import { loadTags } from 'src/components/Tags/utils';
|
||||||
import ChartCard from './ChartCard';
|
import ChartCard from 'src/views/CRUD/chart/ChartCard';
|
||||||
|
|
||||||
const FlexRowContainer = styled.div`
|
const FlexRowContainer = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { Provider } from 'react-redux';
|
||||||
import fetchMock from 'fetch-mock';
|
import fetchMock from 'fetch-mock';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
|
|
||||||
import CssTemplatesList from 'src/views/CRUD/csstemplates/CssTemplatesList';
|
import CssTemplatesList from 'src/pages/CssTemplateList';
|
||||||
import SubMenu from 'src/views/components/SubMenu';
|
import SubMenu from 'src/views/components/SubMenu';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
||||||
import Filters from 'src/components/ListView/Filters';
|
import Filters from 'src/components/ListView/Filters';
|
|
@ -35,8 +35,8 @@ import ListView, {
|
||||||
Filters,
|
Filters,
|
||||||
FilterOperator,
|
FilterOperator,
|
||||||
} from 'src/components/ListView';
|
} from 'src/components/ListView';
|
||||||
import CssTemplateModal from './CssTemplateModal';
|
import CssTemplateModal from 'src/views/CRUD/csstemplates/CssTemplateModal';
|
||||||
import { TemplateObject } from './types';
|
import { TemplateObject } from 'src/views/CRUD/csstemplates/types';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { DashboardPage } from './DashboardPage';
|
import { DashboardPage } from 'src/dashboard/containers/DashboardPage';
|
||||||
|
|
||||||
const DashboardRoute: FC = () => {
|
const DashboardRoute: FC = () => {
|
||||||
const { idOrSlug } = useParams<{ idOrSlug: string }>();
|
const { idOrSlug } = useParams<{ idOrSlug: string }>();
|
|
@ -32,7 +32,7 @@ import { QueryParamProvider } from 'use-query-params';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
||||||
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
||||||
import DashboardList from 'src/views/CRUD/dashboard/DashboardList';
|
import DashboardList from 'src/pages/DashboardList';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
||||||
import ListViewCard from 'src/components/ListViewCard';
|
import ListViewCard from 'src/components/ListViewCard';
|
||||||
import PropertiesModal from 'src/dashboard/components/PropertiesModal';
|
import PropertiesModal from 'src/dashboard/components/PropertiesModal';
|
|
@ -55,8 +55,8 @@ import { Dashboard as CRUDDashboard } from 'src/views/CRUD/types';
|
||||||
import CertifiedBadge from 'src/components/CertifiedBadge';
|
import CertifiedBadge from 'src/components/CertifiedBadge';
|
||||||
import { loadTags } from 'src/components/Tags/utils';
|
import { loadTags } from 'src/components/Tags/utils';
|
||||||
import getBootstrapData from 'src/utils/getBootstrapData';
|
import getBootstrapData from 'src/utils/getBootstrapData';
|
||||||
import DashboardCard from './DashboardCard';
|
import DashboardCard from 'src/views/CRUD/dashboard/DashboardCard';
|
||||||
import { DashboardStatus } from './types';
|
import { DashboardStatus } from 'src/views/CRUD/dashboard/types';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
const PASSWORDS_NEEDED_MESSAGE = t(
|
const PASSWORDS_NEEDED_MESSAGE = t(
|
|
@ -24,7 +24,7 @@ import fetchMock from 'fetch-mock';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
|
|
||||||
import DatabaseList from 'src/views/CRUD/data/database/DatabaseList';
|
import DatabaseList from 'src/pages/DatabaseList';
|
||||||
import DatabaseModal from 'src/views/CRUD/data/database/DatabaseModal';
|
import DatabaseModal from 'src/views/CRUD/data/database/DatabaseModal';
|
||||||
import DeleteModal from 'src/components/DeleteModal';
|
import DeleteModal from 'src/components/DeleteModal';
|
||||||
import SubMenu from 'src/views/components/SubMenu';
|
import SubMenu from 'src/views/components/SubMenu';
|
|
@ -40,9 +40,8 @@ import handleResourceExport from 'src/utils/export';
|
||||||
import { ExtensionConfigs } from 'src/views/components/types';
|
import { ExtensionConfigs } from 'src/views/components/types';
|
||||||
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
|
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
|
||||||
import type { MenuObjectProps } from 'src/types/bootstrapTypes';
|
import type { MenuObjectProps } from 'src/types/bootstrapTypes';
|
||||||
import DatabaseModal from './DatabaseModal';
|
import DatabaseModal from 'src/views/CRUD/data/database/DatabaseModal';
|
||||||
|
import { DatabaseObject } from 'src/views/CRUD/data/database/types';
|
||||||
import { DatabaseObject } from './types';
|
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render, screen } from 'spec/helpers/testing-library';
|
import { render, screen } from 'spec/helpers/testing-library';
|
||||||
import AddDataset from 'src/views/CRUD/data/dataset/AddDataset';
|
import AddDataset from 'src/pages/DatasetCreation';
|
||||||
|
|
||||||
const mockHistoryPush = jest.fn();
|
const mockHistoryPush = jest.fn();
|
||||||
jest.mock('react-router-dom', () => ({
|
jest.mock('react-router-dom', () => ({
|
|
@ -19,13 +19,17 @@
|
||||||
import React, { useReducer, Reducer, useEffect, useState } from 'react';
|
import React, { useReducer, Reducer, useEffect, useState } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { useDatasetsList } from 'src/views/CRUD/data/hooks';
|
import { useDatasetsList } from 'src/views/CRUD/data/hooks';
|
||||||
import Header from './Header';
|
import Header from 'src/views/CRUD/data/dataset/AddDataset/Header';
|
||||||
import EditPage from './EditDataset';
|
import EditPage from 'src/views/CRUD/data/dataset/AddDataset/EditDataset';
|
||||||
import DatasetPanel from './DatasetPanel';
|
import DatasetPanel from 'src/views/CRUD/data/dataset/AddDataset/DatasetPanel';
|
||||||
import LeftPanel from './LeftPanel';
|
import LeftPanel from 'src/views/CRUD/data/dataset/AddDataset/LeftPanel';
|
||||||
import Footer from './Footer';
|
import Footer from 'src/views/CRUD/data/dataset/AddDataset/Footer';
|
||||||
import { DatasetActionType, DatasetObject, DSReducerActionType } from './types';
|
import {
|
||||||
import DatasetLayout from '../DatasetLayout';
|
DatasetActionType,
|
||||||
|
DatasetObject,
|
||||||
|
DSReducerActionType,
|
||||||
|
} from 'src/views/CRUD/data/dataset/AddDataset/types';
|
||||||
|
import DatasetLayout from 'src/views/CRUD/data/dataset/DatasetLayout';
|
||||||
|
|
||||||
type Schema = {
|
type Schema = {
|
||||||
schema: string;
|
schema: string;
|
|
@ -27,7 +27,7 @@ import userEvent from '@testing-library/user-event';
|
||||||
import { QueryParamProvider } from 'use-query-params';
|
import { QueryParamProvider } from 'use-query-params';
|
||||||
import * as featureFlags from 'src/featureFlags';
|
import * as featureFlags from 'src/featureFlags';
|
||||||
|
|
||||||
import DatasetList from 'src/views/CRUD/data/dataset/DatasetList';
|
import DatasetList from 'src/pages/DatasetList';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
||||||
import Button from 'src/components/Button';
|
import Button from 'src/components/Button';
|
||||||
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
|
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
|
|
@ -64,8 +64,8 @@ import {
|
||||||
SORT_BY,
|
SORT_BY,
|
||||||
PASSWORDS_NEEDED_MESSAGE,
|
PASSWORDS_NEEDED_MESSAGE,
|
||||||
CONFIRM_OVERWRITE_MESSAGE,
|
CONFIRM_OVERWRITE_MESSAGE,
|
||||||
} from './constants';
|
} from 'src/views/CRUD/data/dataset/constants';
|
||||||
import DuplicateDatasetModal from './DuplicateDatasetModal';
|
import DuplicateDatasetModal from 'src/views/CRUD/data/dataset/DuplicateDatasetModal';
|
||||||
|
|
||||||
const FlexRowContainer = styled.div`
|
const FlexRowContainer = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
|
@ -24,7 +24,7 @@ import thunk from 'redux-thunk';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
||||||
import ExecutionLog from 'src/views/CRUD/alert/ExecutionLog';
|
import ExecutionLog from 'src/pages/ExecutionLogList';
|
||||||
|
|
||||||
// store needed for withToasts(ExecutionLog)
|
// store needed for withToasts(ExecutionLog)
|
||||||
const mockStore = configureStore([thunk]);
|
const mockStore = configureStore([thunk]);
|
|
@ -31,7 +31,7 @@ import {
|
||||||
useListViewResource,
|
useListViewResource,
|
||||||
useSingleViewResource,
|
useSingleViewResource,
|
||||||
} from 'src/views/CRUD/hooks';
|
} from 'src/views/CRUD/hooks';
|
||||||
import { AlertObject, LogObject } from './types';
|
import { AlertObject, LogObject } from 'src/views/CRUD/alert/types';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
|
|
|
@ -24,7 +24,7 @@ import fetchMock from 'fetch-mock';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
import * as featureFlags from 'src/featureFlags';
|
import * as featureFlags from 'src/featureFlags';
|
||||||
import Welcome from 'src/views/CRUD/welcome/Welcome';
|
import Welcome from 'src/pages/Home';
|
||||||
import { ReactWrapper } from 'enzyme';
|
import { ReactWrapper } from 'enzyme';
|
||||||
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
||||||
import { render, screen } from 'spec/helpers/testing-library';
|
import { render, screen } from 'spec/helpers/testing-library';
|
|
@ -49,11 +49,11 @@ import { AntdSwitch } from 'src/components';
|
||||||
import getBootstrapData from 'src/utils/getBootstrapData';
|
import getBootstrapData from 'src/utils/getBootstrapData';
|
||||||
import { TableTab } from 'src/views/CRUD/types';
|
import { TableTab } from 'src/views/CRUD/types';
|
||||||
import { canUserAccessSqlLab } from 'src/dashboard/util/permissionUtils';
|
import { canUserAccessSqlLab } from 'src/dashboard/util/permissionUtils';
|
||||||
import { WelcomePageLastTab } from './types';
|
import { WelcomePageLastTab } from 'src/views/CRUD/welcome/types';
|
||||||
import ActivityTable from './ActivityTable';
|
import ActivityTable from 'src/views/CRUD/welcome/ActivityTable';
|
||||||
import ChartTable from './ChartTable';
|
import ChartTable from 'src/views/CRUD/welcome/ChartTable';
|
||||||
import SavedQueries from './SavedQueries';
|
import SavedQueries from 'src/views/CRUD/welcome/SavedQueries';
|
||||||
import DashboardTable from './DashboardTable';
|
import DashboardTable from 'src/views/CRUD/welcome/DashboardTable';
|
||||||
|
|
||||||
const extensionsRegistry = getExtensionsRegistry();
|
const extensionsRegistry = getExtensionsRegistry();
|
||||||
|
|
|
@ -26,7 +26,7 @@ import { act } from 'react-dom/test-utils';
|
||||||
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
|
|
||||||
import QueryList from 'src/views/CRUD/data/query/QueryList';
|
import QueryList from 'src/pages/QueryHistoryList';
|
||||||
import QueryPreviewModal from 'src/views/CRUD/data/query/QueryPreviewModal';
|
import QueryPreviewModal from 'src/views/CRUD/data/query/QueryPreviewModal';
|
||||||
import { QueryObject } from 'src/views/CRUD/types';
|
import { QueryObject } from 'src/views/CRUD/types';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
|
@ -49,7 +49,7 @@ import { DATETIME_WITH_TIME_ZONE, TIME_WITH_MS } from 'src/constants';
|
||||||
import { QueryObject, QueryObjectColumns } from 'src/views/CRUD/types';
|
import { QueryObject, QueryObjectColumns } from 'src/views/CRUD/types';
|
||||||
|
|
||||||
import Icons from 'src/components/Icons';
|
import Icons from 'src/components/Icons';
|
||||||
import QueryPreviewModal from './QueryPreviewModal';
|
import QueryPreviewModal from 'src/views/CRUD/data/query/QueryPreviewModal';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
const SQL_PREVIEW_MAX_LINES = 4;
|
const SQL_PREVIEW_MAX_LINES = 4;
|
|
@ -28,7 +28,7 @@ import userEvent from '@testing-library/user-event';
|
||||||
import { QueryParamProvider } from 'use-query-params';
|
import { QueryParamProvider } from 'use-query-params';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
import * as featureFlags from 'src/featureFlags';
|
import * as featureFlags from 'src/featureFlags';
|
||||||
import SavedQueryList from 'src/views/CRUD/data/savedquery/SavedQueryList';
|
import SavedQueryList from 'src/pages/SavedQueryList';
|
||||||
import SubMenu from 'src/views/components/SubMenu';
|
import SubMenu from 'src/views/components/SubMenu';
|
||||||
import ListView from 'src/components/ListView';
|
import ListView from 'src/components/ListView';
|
||||||
import Filters from 'src/components/ListView/Filters';
|
import Filters from 'src/components/ListView/Filters';
|
|
@ -53,7 +53,7 @@ import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
|
||||||
import ImportModelsModal from 'src/components/ImportModal/index';
|
import ImportModelsModal from 'src/components/ImportModal/index';
|
||||||
import Icons from 'src/components/Icons';
|
import Icons from 'src/components/Icons';
|
||||||
import { BootstrapUser } from 'src/types/bootstrapTypes';
|
import { BootstrapUser } from 'src/types/bootstrapTypes';
|
||||||
import SavedQueryPreviewModal from './SavedQueryPreviewModal';
|
import SavedQueryPreviewModal from 'src/views/CRUD/data/savedquery/SavedQueryPreviewModal';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
const PASSWORDS_NEEDED_MESSAGE = t(
|
const PASSWORDS_NEEDED_MESSAGE = t(
|
|
@ -40,8 +40,8 @@ import FacePile from 'src/components/FacePile';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { deleteTags } from 'src/tags';
|
import { deleteTags } from 'src/tags';
|
||||||
import { Tag as AntdTag } from 'antd';
|
import { Tag as AntdTag } from 'antd';
|
||||||
import { Tag } from '../types';
|
import { Tag } from 'src/views/CRUD/types';
|
||||||
import TagCard from './TagCard';
|
import TagCard from 'src/views/CRUD/tags/TagCard';
|
||||||
|
|
||||||
const PAGE_SIZE = 25;
|
const PAGE_SIZE = 25;
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { Link } from 'react-router-dom';
|
||||||
import ListViewCard from 'src/components/ListViewCard';
|
import ListViewCard from 'src/components/ListViewCard';
|
||||||
import SubMenu from 'src/views/components/SubMenu';
|
import SubMenu from 'src/views/components/SubMenu';
|
||||||
import { Dashboard, SavedQueryObject, TableTab } from 'src/views/CRUD/types';
|
import { Dashboard, SavedQueryObject, TableTab } from 'src/views/CRUD/types';
|
||||||
import { ActivityData, LoadingCards } from 'src/views/CRUD/welcome/Welcome';
|
import { ActivityData, LoadingCards } from 'src/pages/Home';
|
||||||
import {
|
import {
|
||||||
CardContainer,
|
CardContainer,
|
||||||
CardStyles,
|
CardStyles,
|
||||||
|
|
|
@ -39,8 +39,8 @@ import {
|
||||||
getFilterValues,
|
getFilterValues,
|
||||||
PAGE_SIZE,
|
PAGE_SIZE,
|
||||||
} from 'src/views/CRUD/utils';
|
} from 'src/views/CRUD/utils';
|
||||||
import { LoadingCards } from 'src/views/CRUD/welcome/Welcome';
|
import { LoadingCards } from 'src/pages/Home';
|
||||||
import ChartCard from 'src/pages/ChartList/ChartCard';
|
import ChartCard from 'src/views/CRUD/chart/ChartCard';
|
||||||
import Chart from 'src/types/Chart';
|
import Chart from 'src/types/Chart';
|
||||||
import handleResourceExport from 'src/utils/export';
|
import handleResourceExport from 'src/utils/export';
|
||||||
import Loading from 'src/components/Loading';
|
import Loading from 'src/components/Loading';
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
LocalStorageKeys,
|
LocalStorageKeys,
|
||||||
setItem,
|
setItem,
|
||||||
} from 'src/utils/localStorageHelpers';
|
} from 'src/utils/localStorageHelpers';
|
||||||
import { LoadingCards } from 'src/views/CRUD/welcome/Welcome';
|
import { LoadingCards } from 'src/pages/Home';
|
||||||
import {
|
import {
|
||||||
CardContainer,
|
CardContainer,
|
||||||
createErrorHandler,
|
createErrorHandler,
|
||||||
|
|
|
@ -21,7 +21,7 @@ import { styled, SupersetClient, t, useTheme } from '@superset-ui/core';
|
||||||
import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light';
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light';
|
||||||
import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql';
|
import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql';
|
||||||
import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github';
|
import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github';
|
||||||
import { LoadingCards } from 'src/views/CRUD/welcome/Welcome';
|
import { LoadingCards } from 'src/pages/Home';
|
||||||
import { TableTab } from 'src/views/CRUD/types';
|
import { TableTab } from 'src/views/CRUD/types';
|
||||||
import withToasts from 'src/components/MessageToasts/withToasts';
|
import withToasts from 'src/components/MessageToasts/withToasts';
|
||||||
import { AntdDropdown } from 'src/components';
|
import { AntdDropdown } from 'src/components';
|
||||||
|
|
|
@ -23,9 +23,7 @@ jest.mock('src/featureFlags', () => ({
|
||||||
...jest.requireActual<object>('src/featureFlags'),
|
...jest.requireActual<object>('src/featureFlags'),
|
||||||
isFeatureEnabled: jest.fn().mockReturnValue(true),
|
isFeatureEnabled: jest.fn().mockReturnValue(true),
|
||||||
}));
|
}));
|
||||||
jest.mock('src/views/CRUD/welcome/Welcome', () => () => (
|
jest.mock('src/pages/Home', () => () => <div data-test="mock-home" />);
|
||||||
<div data-test="mock-welcome" />
|
|
||||||
));
|
|
||||||
|
|
||||||
describe('isFrontendRoute', () => {
|
describe('isFrontendRoute', () => {
|
||||||
it('returns true if a route matches', () => {
|
it('returns true if a route matches', () => {
|
||||||
|
|
|
@ -20,100 +20,96 @@ import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core';
|
||||||
import React, { lazy } from 'react';
|
import React, { lazy } from 'react';
|
||||||
|
|
||||||
// not lazy loaded since this is the home page.
|
// not lazy loaded since this is the home page.
|
||||||
import Welcome from 'src/views/CRUD/welcome/Welcome';
|
import Home from 'src/pages/Home';
|
||||||
|
|
||||||
const ChartCreation = lazy(
|
const ChartCreation = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(/* webpackChunkName: "ChartCreation" */ 'src/pages/ChartCreation'),
|
import(/* webpackChunkName: "ChartCreation" */ 'src/pages/ChartCreation'),
|
||||||
);
|
);
|
||||||
const AnnotationLayersList = lazy(
|
|
||||||
|
const AnnotationLayerList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
/* webpackChunkName: "AnnotationLayersList" */ 'src/views/CRUD/annotationlayers/AnnotationLayersList'
|
/* webpackChunkName: "AnnotationLayerList" */ 'src/pages/AnnotationLayerList'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const AlertList = lazy(
|
|
||||||
|
const AlertReportList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
/* webpackChunkName: "AlertList" */ 'src/views/CRUD/alert/AlertList'
|
/* webpackChunkName: "AlertReportList" */ 'src/pages/AlertReportList'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const AnnotationList = lazy(
|
const AnnotationList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(/* webpackChunkName: "AnnotationList" */ 'src/pages/AnnotationList'),
|
||||||
/* webpackChunkName: "AnnotationList" */ 'src/views/CRUD/annotation/AnnotationList'
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const ChartList = lazy(
|
const ChartList = lazy(
|
||||||
() => import(/* webpackChunkName: "ChartList" */ 'src/pages/ChartList'),
|
() => import(/* webpackChunkName: "ChartList" */ 'src/pages/ChartList'),
|
||||||
);
|
);
|
||||||
const CssTemplatesList = lazy(
|
|
||||||
|
const CssTemplateList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
/* webpackChunkName: "CssTemplatesList" */ 'src/views/CRUD/csstemplates/CssTemplatesList'
|
/* webpackChunkName: "CssTemplateList" */ 'src/pages/CssTemplateList'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const DashboardList = lazy(
|
const DashboardList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(/* webpackChunkName: "DashboardList" */ 'src/pages/DashboardList'),
|
||||||
/* webpackChunkName: "DashboardList" */ 'src/views/CRUD/dashboard/DashboardList'
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
const DashboardRoute = lazy(
|
|
||||||
() =>
|
const Dashboard = lazy(
|
||||||
import(
|
() => import(/* webpackChunkName: "Dashboard" */ 'src/pages/Dashboard'),
|
||||||
/* webpackChunkName: "DashboardRoute" */ 'src/dashboard/containers/DashboardRoute'
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const DatabaseList = lazy(
|
const DatabaseList = lazy(
|
||||||
() =>
|
() => import(/* webpackChunkName: "DatabaseList" */ 'src/pages/DatabaseList'),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "DatabaseList" */ 'src/views/CRUD/data/database/DatabaseList'
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const DatasetList = lazy(
|
const DatasetList = lazy(
|
||||||
|
() => import(/* webpackChunkName: "DatasetList" */ 'src/pages/DatasetList'),
|
||||||
|
);
|
||||||
|
|
||||||
|
const DatasetCreation = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
/* webpackChunkName: "DatasetList" */ 'src/views/CRUD/data/dataset/DatasetList'
|
/* webpackChunkName: "DatasetCreation" */ 'src/pages/DatasetCreation'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const AddDataset = lazy(
|
const ExecutionLogList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
/* webpackChunkName: "DatasetEditor" */ 'src/views/CRUD/data/dataset/AddDataset/index'
|
/* webpackChunkName: "ExecutionLogList" */ 'src/pages/ExecutionLogList'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const ExecutionLog = lazy(
|
const Chart = lazy(
|
||||||
|
() => import(/* webpackChunkName: "Chart" */ 'src/pages/Chart'),
|
||||||
|
);
|
||||||
|
|
||||||
|
const QueryHistoryList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
/* webpackChunkName: "ExecutionLog" */ 'src/views/CRUD/alert/ExecutionLog'
|
/* webpackChunkName: "QueryHistoryList" */ 'src/pages/QueryHistoryList'
|
||||||
),
|
|
||||||
);
|
|
||||||
const ExplorePage = lazy(
|
|
||||||
() => import(/* webpackChunkName: "ExplorePage" */ 'src/explore/ExplorePage'),
|
|
||||||
);
|
|
||||||
const QueryList = lazy(
|
|
||||||
() =>
|
|
||||||
import(
|
|
||||||
/* webpackChunkName: "QueryList" */ 'src/views/CRUD/data/query/QueryList'
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const SavedQueryList = lazy(
|
const SavedQueryList = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(/* webpackChunkName: "SavedQueryList" */ 'src/pages/SavedQueryList'),
|
||||||
/* webpackChunkName: "SavedQueryList" */ 'src/views/CRUD/data/savedquery/SavedQueryList'
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
const AllEntitiesPage = lazy(
|
|
||||||
() =>
|
const AllEntities = lazy(
|
||||||
import(
|
() => import(/* webpackChunkName: "AllEntities" */ 'src/pages/AllEntities'),
|
||||||
/* webpackChunkName: "AllEntities" */ 'src/views/CRUD/allentities/AllEntities'
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
const TagsPage = lazy(
|
|
||||||
() => import(/* webpackChunkName: "TagList" */ 'src/views/CRUD/tags/TagList'),
|
const Tags = lazy(
|
||||||
|
() => import(/* webpackChunkName: "Tags" */ 'src/pages/Tags'),
|
||||||
);
|
);
|
||||||
|
|
||||||
type Routes = {
|
type Routes = {
|
||||||
|
@ -126,7 +122,7 @@ type Routes = {
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '/superset/welcome/',
|
path: '/superset/welcome/',
|
||||||
Component: Welcome,
|
Component: Home,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dashboard/list/',
|
path: '/dashboard/list/',
|
||||||
|
@ -134,7 +130,7 @@ export const routes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/superset/dashboard/:idOrSlug/',
|
path: '/superset/dashboard/:idOrSlug/',
|
||||||
Component: DashboardRoute,
|
Component: Dashboard,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/chart/add',
|
path: '/chart/add',
|
||||||
|
@ -158,11 +154,11 @@ export const routes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/csstemplatemodelview/list/',
|
path: '/csstemplatemodelview/list/',
|
||||||
Component: CssTemplatesList,
|
Component: CssTemplateList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/annotationlayer/list/',
|
path: '/annotationlayer/list/',
|
||||||
Component: AnnotationLayersList,
|
Component: AnnotationLayerList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/annotationlayer/:annotationLayerId/annotation/',
|
path: '/annotationlayer/:annotationLayerId/annotation/',
|
||||||
|
@ -170,56 +166,56 @@ export const routes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/superset/sqllab/history/',
|
path: '/superset/sqllab/history/',
|
||||||
Component: QueryList,
|
Component: QueryHistoryList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/alert/list/',
|
path: '/alert/list/',
|
||||||
Component: AlertList,
|
Component: AlertReportList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/report/list/',
|
path: '/report/list/',
|
||||||
Component: AlertList,
|
Component: AlertReportList,
|
||||||
props: {
|
props: {
|
||||||
isReportEnabled: true,
|
isReportEnabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/alert/:alertId/log/',
|
path: '/alert/:alertId/log/',
|
||||||
Component: ExecutionLog,
|
Component: ExecutionLogList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/report/:alertId/log/',
|
path: '/report/:alertId/log/',
|
||||||
Component: ExecutionLog,
|
Component: ExecutionLogList,
|
||||||
props: {
|
props: {
|
||||||
isReportEnabled: true,
|
isReportEnabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/explore/',
|
path: '/explore/',
|
||||||
Component: ExplorePage,
|
Component: Chart,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/superset/explore/p',
|
path: '/superset/explore/p',
|
||||||
Component: ExplorePage,
|
Component: Chart,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dataset/add/',
|
path: '/dataset/add/',
|
||||||
Component: AddDataset,
|
Component: DatasetCreation,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dataset/:datasetId',
|
path: '/dataset/:datasetId',
|
||||||
Component: AddDataset,
|
Component: DatasetCreation,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isFeatureEnabled(FeatureFlag.TAGGING_SYSTEM)) {
|
if (isFeatureEnabled(FeatureFlag.TAGGING_SYSTEM)) {
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '/superset/all_entities/',
|
path: '/superset/all_entities/',
|
||||||
Component: AllEntitiesPage,
|
Component: AllEntities,
|
||||||
});
|
});
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '/superset/tags/',
|
path: '/superset/tags/',
|
||||||
Component: TagsPage,
|
Component: Tags,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue