From 603c8f07848e58c7178808c00380d97559ebb71f Mon Sep 17 00:00:00 2001 From: EugeneTorap Date: Thu, 12 Jan 2023 21:56:27 +0300 Subject: [PATCH] Refactoring --- .../ChartCreation/ChartCreation.test.tsx | 2 +- .../{ChartCreation.tsx => index.tsx} | 0 .../src/pages/ChartList/ChartList.test.jsx | 2 +- .../ChartList/{ChartList.tsx => index.tsx} | 0 .../src/pages/ChartList/types.ts | 28 ------------------- superset-frontend/src/views/routes.tsx | 7 ++--- 6 files changed, 4 insertions(+), 35 deletions(-) rename superset-frontend/src/pages/ChartCreation/{ChartCreation.tsx => index.tsx} (100%) rename superset-frontend/src/pages/ChartList/{ChartList.tsx => index.tsx} (100%) delete mode 100644 superset-frontend/src/pages/ChartList/types.ts diff --git a/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx b/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx index 8754af7f5bd60..2c3c7b5d639e7 100644 --- a/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx +++ b/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx @@ -25,7 +25,7 @@ import { ChartCreation, ChartCreationProps, ChartCreationState, -} from 'src/pages/ChartCreation/ChartCreation'; +} from 'src/pages/ChartCreation'; import VizTypeGallery from 'src/explore/components/controls/VizTypeControl/VizTypeGallery'; import { act } from 'spec/helpers/testing-library'; import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes'; diff --git a/superset-frontend/src/pages/ChartCreation/ChartCreation.tsx b/superset-frontend/src/pages/ChartCreation/index.tsx similarity index 100% rename from superset-frontend/src/pages/ChartCreation/ChartCreation.tsx rename to superset-frontend/src/pages/ChartCreation/index.tsx diff --git a/superset-frontend/src/pages/ChartList/ChartList.test.jsx b/superset-frontend/src/pages/ChartList/ChartList.test.jsx index c60005b0c6a39..fc216e617dd95 100644 --- a/superset-frontend/src/pages/ChartList/ChartList.test.jsx +++ b/superset-frontend/src/pages/ChartList/ChartList.test.jsx @@ -30,7 +30,7 @@ import userEvent from '@testing-library/user-event'; import { QueryParamProvider } from 'use-query-params'; import { act } from 'react-dom/test-utils'; -import ChartList from 'src/pages/ChartList/ChartList'; +import ChartList from 'src/pages/ChartList'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; import ListView from 'src/components/ListView'; import PropertiesModal from 'src/explore/components/PropertiesModal'; diff --git a/superset-frontend/src/pages/ChartList/ChartList.tsx b/superset-frontend/src/pages/ChartList/index.tsx similarity index 100% rename from superset-frontend/src/pages/ChartList/ChartList.tsx rename to superset-frontend/src/pages/ChartList/index.tsx diff --git a/superset-frontend/src/pages/ChartList/types.ts b/superset-frontend/src/pages/ChartList/types.ts deleted file mode 100644 index e16b42a23f185..0000000000000 --- a/superset-frontend/src/pages/ChartList/types.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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. - */ -export type ChartObject = { - slice_name?: string; - description?: string; - viz_type?: string; - params?: string; - cache_timeout?: number; - datasource_id?: number; - datasource_type?: number; - is_managed_externally: boolean; -}; diff --git a/superset-frontend/src/views/routes.tsx b/superset-frontend/src/views/routes.tsx index f4facf8e07d65..da4b8312c9b81 100644 --- a/superset-frontend/src/views/routes.tsx +++ b/superset-frontend/src/views/routes.tsx @@ -23,9 +23,7 @@ import Welcome from 'src/views/CRUD/welcome/Welcome'; const ChartCreation = lazy( () => - import( - /* webpackChunkName: "ChartCreation" */ 'src/pages/ChartCreation/ChartCreation' - ), + import(/* webpackChunkName: "ChartCreation" */ 'src/pages/ChartCreation'), ); const AnnotationLayersList = lazy( () => @@ -46,8 +44,7 @@ const AnnotationList = lazy( ), ); const ChartList = lazy( - () => - import(/* webpackChunkName: "ChartList" */ 'src/pages/ChartList/ChartList'), + () => import(/* webpackChunkName: "ChartList" */ 'src/pages/ChartList'), ); const CssTemplatesList = lazy( () =>