You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/08/23 14:02:33 UTC

[superset] branch master updated: chore: Organizes the files of the ReportModal feature (#25046)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 0dadf06245 chore: Organizes the files of the ReportModal feature (#25046)
0dadf06245 is described below

commit 0dadf062450903397d35e3f4415d392604bc0553
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Wed Aug 23 11:02:25 2023 -0300

    chore: Organizes the files of the ReportModal feature (#25046)
---
 superset-frontend/spec/helpers/reducerIndex.ts                     | 2 +-
 superset-frontend/src/dashboard/components/Header/Header.test.tsx  | 1 -
 .../dashboard/components/Header/HeaderActionsDropdown/index.jsx    | 2 +-
 superset-frontend/src/dashboard/containers/DashboardHeader.jsx     | 2 --
 .../explore/components/useExploreAdditionalActionsMenu/index.jsx   | 2 +-
 superset-frontend/src/features/alerts/AlertReportModal.tsx         | 2 +-
 superset-frontend/src/features/alerts/types.ts                     | 2 +-
 .../reports}/ReportModal/HeaderReportDropdown/index.test.tsx       | 0
 .../reports}/ReportModal/HeaderReportDropdown/index.tsx            | 4 ++--
 .../reports}/ReportModal/ReportModal.test.tsx                      | 2 +-
 .../actions/reports.js => features/reports/ReportModal/actions.js} | 0
 .../src/{components => features/reports}/ReportModal/index.tsx     | 7 +++++--
 .../reports.js => features/reports/ReportModal/reducer.js}         | 7 +------
 .../src/{components => features/reports}/ReportModal/styles.tsx    | 0
 superset-frontend/src/{ => features}/reports/types.ts              | 0
 superset-frontend/src/features/rls/RowLevelSecurityModal.tsx       | 2 +-
 superset-frontend/src/views/store.ts                               | 2 +-
 17 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/superset-frontend/spec/helpers/reducerIndex.ts b/superset-frontend/spec/helpers/reducerIndex.ts
index 459a112e22..a9cadc4f81 100644
--- a/superset-frontend/spec/helpers/reducerIndex.ts
+++ b/superset-frontend/spec/helpers/reducerIndex.ts
@@ -30,7 +30,7 @@ import saveModal from 'src/explore/reducers/saveModalReducer';
 import explore from 'src/explore/reducers/exploreReducer';
 import sqlLab from 'src/SqlLab/reducers/sqlLab';
 import localStorageUsageInKilobytes from 'src/SqlLab/reducers/localStorageUsage';
-import reports from 'src/reports/reducers/reports';
+import reports from 'src/features/reports/ReportModal/reducer';
 import getBootstrapData from 'src/utils/getBootstrapData';
 
 const impressionId = (state = '') => state;
diff --git a/superset-frontend/src/dashboard/components/Header/Header.test.tsx b/superset-frontend/src/dashboard/components/Header/Header.test.tsx
index 4f8bf64f68..f8c474272e 100644
--- a/superset-frontend/src/dashboard/components/Header/Header.test.tsx
+++ b/superset-frontend/src/dashboard/components/Header/Header.test.tsx
@@ -73,7 +73,6 @@ const createProps = () => ({
   fetchFaveStar: jest.fn(),
   fetchCharts: jest.fn(),
   onRefresh: jest.fn(),
-  fetchUISpecificReport: jest.fn(),
   saveFaveStar: jest.fn(),
   savePublished: jest.fn(),
   isPublished: false,
diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx
index 3f2caab72a..1073d73ab0 100644
--- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx
+++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx
@@ -31,7 +31,7 @@ import ShareMenuItems from 'src/dashboard/components/menu/ShareMenuItems';
 import CssEditor from 'src/dashboard/components/CssEditor';
 import RefreshIntervalModal from 'src/dashboard/components/RefreshIntervalModal';
 import SaveModal from 'src/dashboard/components/SaveModal';
-import HeaderReportDropdown from 'src/components/ReportModal/HeaderReportDropdown';
+import HeaderReportDropdown from 'src/features/reports/ReportModal/HeaderReportDropdown';
 import injectCustomCss from 'src/dashboard/util/injectCustomCss';
 import { SAVE_TYPE_NEWDASHBOARD } from 'src/dashboard/util/constants';
 import FilterScopeModal from 'src/dashboard/components/filterscope/FilterScopeModal';
diff --git a/superset-frontend/src/dashboard/containers/DashboardHeader.jsx b/superset-frontend/src/dashboard/containers/DashboardHeader.jsx
index a38b121e5d..cc05916dcc 100644
--- a/superset-frontend/src/dashboard/containers/DashboardHeader.jsx
+++ b/superset-frontend/src/dashboard/containers/DashboardHeader.jsx
@@ -57,7 +57,6 @@ import {
 
 import { logEvent } from 'src/logger/actions';
 import { DASHBOARD_HEADER_ID } from 'src/dashboard/util/constants';
-import { fetchUISpecificReport } from 'src/reports/actions/reports';
 
 function mapStateToProps({
   dashboardLayout: undoableLayout,
@@ -130,7 +129,6 @@ function mapDispatchToProps(dispatch) {
       dashboardInfoChanged,
       dashboardTitleChanged,
       updateDataMask,
-      fetchUISpecificReport,
     },
     dispatch,
   );
diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
index 9dd0bc0ef0..45d8d3efab 100644
--- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
+++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
@@ -35,7 +35,7 @@ import { exportChart, getChartKey } from 'src/explore/exploreUtils';
 import downloadAsImage from 'src/utils/downloadAsImage';
 import { getChartPermalink } from 'src/utils/urlUtils';
 import copyTextToClipboard from 'src/utils/copy';
-import HeaderReportDropDown from 'src/components/ReportModal/HeaderReportDropdown';
+import HeaderReportDropDown from 'src/features/reports/ReportModal/HeaderReportDropdown';
 import ViewQueryModal from '../controls/ViewQueryModal';
 import EmbedCodeContent from '../EmbedCodeContent';
 import DashboardsSubMenu from './DashboardsSubMenu';
diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx
index 497c4d7b76..571c7b1b2a 100644
--- a/superset-frontend/src/features/alerts/AlertReportModal.tsx
+++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx
@@ -47,7 +47,7 @@ import Owner from 'src/types/Owner';
 import { AntdCheckbox, AsyncSelect, Select } from 'src/components';
 import TextAreaControl from 'src/explore/components/controls/TextAreaControl';
 import { useCommonConf } from 'src/features/databases/state';
-import { CustomWidthHeaderStyle } from 'src/components/ReportModal/styles';
+import { CustomWidthHeaderStyle } from 'src/features/reports/ReportModal/styles';
 import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
 import {
   NotificationMethodOption,
diff --git a/superset-frontend/src/features/alerts/types.ts b/superset-frontend/src/features/alerts/types.ts
index 34eb7fd261..e01cf6f438 100644
--- a/superset-frontend/src/features/alerts/types.ts
+++ b/superset-frontend/src/features/alerts/types.ts
@@ -18,7 +18,7 @@
  */
 
 import Owner from 'src/types/Owner';
-import { NOTIFICATION_FORMATS } from 'src/reports/types';
+import { NOTIFICATION_FORMATS } from 'src/features/reports/types';
 
 type user = {
   id: number;
diff --git a/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.test.tsx b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
similarity index 100%
rename from superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.test.tsx
rename to superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
diff --git a/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.tsx b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx
similarity index 98%
rename from superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.tsx
rename to superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx
index b2e47cc53c..cd428b0abb 100644
--- a/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.tsx
+++ b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx
@@ -38,14 +38,14 @@ import Checkbox from 'src/components/Checkbox';
 import { noOp } from 'src/utils/common';
 import { NoAnimationDropdown } from 'src/components/Dropdown';
 import DeleteModal from 'src/components/DeleteModal';
-import ReportModal from 'src/components/ReportModal';
+import ReportModal from 'src/features/reports/ReportModal';
 import { ChartState } from 'src/explore/types';
 import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
 import {
   fetchUISpecificReport,
   toggleActive,
   deleteActiveReport,
-} from 'src/reports/actions/reports';
+} from 'src/features/reports/ReportModal/actions';
 import { reportSelector } from 'src/views/CRUD/hooks';
 import { MenuItemWithCheckboxContainer } from 'src/explore/components/useExploreAdditionalActionsMenu/index';
 
diff --git a/superset-frontend/src/components/ReportModal/ReportModal.test.tsx b/superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
similarity index 98%
rename from superset-frontend/src/components/ReportModal/ReportModal.test.tsx
rename to superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
index 63365a6bac..c5508b3c2b 100644
--- a/superset-frontend/src/components/ReportModal/ReportModal.test.tsx
+++ b/superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
@@ -22,7 +22,7 @@ import sinon from 'sinon';
 import fetchMock from 'fetch-mock';
 import { render, screen, waitFor } from 'spec/helpers/testing-library';
 import * as uiCore from '@superset-ui/core';
-import * as actions from 'src/reports/actions/reports';
+import * as actions from 'src/features/reports/ReportModal/actions';
 import { FeatureFlag } from '@superset-ui/core';
 import ReportModal from '.';
 
diff --git a/superset-frontend/src/reports/actions/reports.js b/superset-frontend/src/features/reports/ReportModal/actions.js
similarity index 100%
rename from superset-frontend/src/reports/actions/reports.js
rename to superset-frontend/src/features/reports/ReportModal/actions.js
diff --git a/superset-frontend/src/components/ReportModal/index.tsx b/superset-frontend/src/features/reports/ReportModal/index.tsx
similarity index 98%
rename from superset-frontend/src/components/ReportModal/index.tsx
rename to superset-frontend/src/features/reports/ReportModal/index.tsx
index f98cddd66c..ed48a8a611 100644
--- a/superset-frontend/src/components/ReportModal/index.tsx
+++ b/superset-frontend/src/features/reports/ReportModal/index.tsx
@@ -26,7 +26,10 @@ import React, {
 import { t, SupersetTheme } from '@superset-ui/core';
 import { useDispatch, useSelector } from 'react-redux';
 import { getClientErrorObject } from 'src/utils/getClientErrorObject';
-import { addReport, editReport } from 'src/reports/actions/reports';
+import {
+  addReport,
+  editReport,
+} from 'src/features/reports/ReportModal/actions';
 import Alert from 'src/components/Alert';
 import TimezoneSelector from 'src/components/TimezoneSelector';
 import LabeledErrorBoundInput from 'src/components/Form/LabeledErrorBoundInput';
@@ -40,7 +43,7 @@ import {
   ReportCreationMethod,
   ReportObject,
   NOTIFICATION_FORMATS,
-} from 'src/reports/types';
+} from 'src/features/reports/types';
 import { reportSelector } from 'src/views/CRUD/hooks';
 import {
   TRANSLATIONS,
diff --git a/superset-frontend/src/reports/reducers/reports.js b/superset-frontend/src/features/reports/ReportModal/reducer.js
similarity index 96%
rename from superset-frontend/src/reports/reducers/reports.js
rename to superset-frontend/src/features/reports/ReportModal/reducer.js
index 823660b645..0c53dbc600 100644
--- a/superset-frontend/src/reports/reducers/reports.js
+++ b/superset-frontend/src/features/reports/ReportModal/reducer.js
@@ -19,12 +19,7 @@
 /* eslint-disable camelcase */
 // eslint-disable-next-line import/no-extraneous-dependencies
 import { omit } from 'lodash';
-import {
-  SET_REPORT,
-  ADD_REPORT,
-  EDIT_REPORT,
-  DELETE_REPORT,
-} from '../actions/reports';
+import { SET_REPORT, ADD_REPORT, EDIT_REPORT, DELETE_REPORT } from './actions';
 
 export default function reportsReducer(state = {}, action) {
   const actionHandlers = {
diff --git a/superset-frontend/src/components/ReportModal/styles.tsx b/superset-frontend/src/features/reports/ReportModal/styles.tsx
similarity index 100%
rename from superset-frontend/src/components/ReportModal/styles.tsx
rename to superset-frontend/src/features/reports/ReportModal/styles.tsx
diff --git a/superset-frontend/src/reports/types.ts b/superset-frontend/src/features/reports/types.ts
similarity index 100%
rename from superset-frontend/src/reports/types.ts
rename to superset-frontend/src/features/reports/types.ts
diff --git a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
index 84d8ca11d0..98ab55fa42 100644
--- a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
+++ b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
@@ -31,7 +31,7 @@ import Select from 'src/components/Select/Select';
 import AsyncSelect from 'src/components/Select/AsyncSelect';
 import rison from 'rison';
 import { LabeledErrorBoundInput } from 'src/components/Form';
-import { noBottomMargin } from 'src/components/ReportModal/styles';
+import { noBottomMargin } from 'src/features/reports/ReportModal/styles';
 import InfoTooltip from 'src/components/InfoTooltip';
 import { useSingleViewResource } from 'src/views/CRUD/hooks';
 import { FilterOptions } from './constants';
diff --git a/superset-frontend/src/views/store.ts b/superset-frontend/src/views/store.ts
index b4fa3b4055..3a46f31dab 100644
--- a/superset-frontend/src/views/store.ts
+++ b/superset-frontend/src/views/store.ts
@@ -22,7 +22,7 @@ import { api } from 'src/hooks/apiResources/queryApi';
 import messageToastReducer from 'src/components/MessageToasts/reducers';
 import charts from 'src/components/Chart/chartReducer';
 import dataMask from 'src/dataMask/reducer';
-import reports from 'src/reports/reducers/reports';
+import reports from 'src/features/reports/ReportModal/reducer';
 import dashboardInfo from 'src/dashboard/reducers/dashboardInfo';
 import dashboardState from 'src/dashboard/reducers/dashboardState';
 import dashboardFilters from 'src/dashboard/reducers/dashboardFilters';