diff --git a/superset-frontend/spec/fixtures/mockState.js b/superset-frontend/spec/fixtures/mockState.js index 36870045eecf9..a31e2ab926b7b 100644 --- a/superset-frontend/spec/fixtures/mockState.js +++ b/superset-frontend/spec/fixtures/mockState.js @@ -17,7 +17,7 @@ * under the License. */ import datasources from 'spec/fixtures/mockDatasource'; -import messageToasts from 'spec/javascripts/messageToasts/mockMessageToasts'; +import messageToasts from 'src/components/MessageToasts/mockMessageToasts'; import { nativeFiltersInfo, mockDataMaskInfo, diff --git a/superset-frontend/spec/fixtures/mockStateWithoutUser.tsx b/superset-frontend/spec/fixtures/mockStateWithoutUser.tsx index bc92df4df75d0..3dab2b57595e6 100644 --- a/superset-frontend/spec/fixtures/mockStateWithoutUser.tsx +++ b/superset-frontend/spec/fixtures/mockStateWithoutUser.tsx @@ -17,7 +17,7 @@ * under the License. */ import datasources from 'spec/fixtures/mockDatasource'; -import messageToasts from 'spec/javascripts/messageToasts/mockMessageToasts'; +import messageToasts from 'src/components/MessageToasts/mockMessageToasts'; import { nativeFiltersInfo, mockDataMaskInfo, diff --git a/superset-frontend/spec/helpers/reducerIndex.ts b/superset-frontend/spec/helpers/reducerIndex.ts index 113368389509a..5073d9fd6894a 100644 --- a/superset-frontend/spec/helpers/reducerIndex.ts +++ b/superset-frontend/spec/helpers/reducerIndex.ts @@ -25,7 +25,7 @@ import nativeFilters from 'src/dashboard/reducers/nativeFilters'; import datasources from 'src/dashboard/reducers/datasources'; import sliceEntities from 'src/dashboard/reducers/sliceEntities'; import dashboardLayout from 'src/dashboard/reducers/undoableDashboardLayout'; -import messageToasts from 'src/messageToasts/reducers'; +import messageToasts from 'src/components/MessageToasts/reducers'; import saveModal from 'src/explore/reducers/saveModalReducer'; import explore from 'src/explore/reducers/exploreReducer'; import sqlLab from 'src/SqlLab/reducers/sqlLab'; diff --git a/superset-frontend/spec/javascripts/dashboard/actions/dashboardLayout_spec.js b/superset-frontend/spec/javascripts/dashboard/actions/dashboardLayout_spec.js index 5779b9ec888bd..aaf85dd0d2168 100644 --- a/superset-frontend/spec/javascripts/dashboard/actions/dashboardLayout_spec.js +++ b/superset-frontend/spec/javascripts/dashboard/actions/dashboardLayout_spec.js @@ -40,7 +40,7 @@ import { import { setUnsavedChanges } from 'src/dashboard/actions/dashboardState'; import * as dashboardFilters from 'src/dashboard/actions/dashboardFilters'; -import { ADD_TOAST } from 'src/messageToasts/actions'; +import { ADD_TOAST } from 'src/components/MessageToasts/actions'; import { DASHBOARD_GRID_TYPE, diff --git a/superset-frontend/spec/javascripts/messageToasts/.eslintrc b/superset-frontend/spec/javascripts/messageToasts/.eslintrc deleted file mode 100644 index 7a8a576a8c56d..0000000000000 --- a/superset-frontend/spec/javascripts/messageToasts/.eslintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "prettier", - "plugins": ["prettier"], - "rules": { - "prefer-template": 2, - "new-cap": 2, - "no-restricted-syntax": 2, - "guard-for-in": 2, - "prefer-arrow-callback": 2, - "func-names": 2, - "react/jsx-no-bind": 2, - "no-confusing-arrow": 2, - "jsx-a11y/no-static-element-interactions": 2, - "jsx-a11y/anchor-has-content": 2, - "react/require-default-props": 2, - "no-plusplus": 2, - "no-mixed-operators": 0, - "no-continue": 2, - "no-bitwise": 2, - "no-multi-assign": 2, - "no-restricted-properties": 2, - "no-prototype-builtins": 2, - "class-methods-use-this": 2, - "import/no-named-as-default": 2, - "react/no-unescaped-entities": 2, - "react/no-string-refs": 2, - "react/jsx-indent": 0, - "prettier/prettier": "error" - } -} diff --git a/superset-frontend/spec/javascripts/sqllab/actions/sqlLab_spec.js b/superset-frontend/spec/javascripts/sqllab/actions/sqlLab_spec.js index 0c424db35fb1b..3eb5aa086213c 100644 --- a/superset-frontend/spec/javascripts/sqllab/actions/sqlLab_spec.js +++ b/superset-frontend/spec/javascripts/sqllab/actions/sqlLab_spec.js @@ -23,7 +23,7 @@ import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import shortid from 'shortid'; import * as featureFlags from 'src/featureFlags'; -import { ADD_TOAST } from 'src/messageToasts/actions'; +import { ADD_TOAST } from 'src/components/MessageToasts/actions'; import * as actions from 'src/SqlLab/actions/sqlLab'; import { defaultQueryEditor, query } from '../fixtures'; diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js index 2cccb2e899247..6f27ff231adcb 100644 --- a/superset-frontend/src/SqlLab/actions/sqlLab.js +++ b/superset-frontend/src/SqlLab/actions/sqlLab.js @@ -23,15 +23,15 @@ import invert from 'lodash/invert'; import mapKeys from 'lodash/mapKeys'; import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; -import { now } from '../../modules/dates'; +import { now } from 'src/modules/dates'; import { addDangerToast as addDangerToastAction, addInfoToast as addInfoToastAction, addSuccessToast as addSuccessToastAction, addWarningToast as addWarningToastAction, -} from '../../messageToasts/actions/index'; -import { getClientErrorObject } from '../../utils/getClientErrorObject'; -import COMMON_ERR_MESSAGES from '../../utils/errorMessages'; +} from 'src/components/MessageToasts/actions'; +import { getClientErrorObject } from 'src/utils/getClientErrorObject'; +import COMMON_ERR_MESSAGES from 'src/utils/errorMessages'; export const RESET_STATE = 'RESET_STATE'; export const ADD_QUERY_EDITOR = 'ADD_QUERY_EDITOR'; diff --git a/superset-frontend/src/SqlLab/components/App.jsx b/superset-frontend/src/SqlLab/components/App.jsx index e0c58a787e3fe..3521d7c24261f 100644 --- a/superset-frontend/src/SqlLab/components/App.jsx +++ b/superset-frontend/src/SqlLab/components/App.jsx @@ -23,16 +23,16 @@ import { connect } from 'react-redux'; import { t, supersetTheme, ThemeProvider } from '@superset-ui/core'; import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags'; import throttle from 'lodash/throttle'; -import TabbedSqlEditors from './TabbedSqlEditors'; -import QueryAutoRefresh from './QueryAutoRefresh'; -import QuerySearch from './QuerySearch'; -import ToastPresenter from '../../messageToasts/containers/ToastPresenter'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import { LOCALSTORAGE_MAX_USAGE_KB, LOCALSTORAGE_WARNING_THRESHOLD, LOCALSTORAGE_WARNING_MESSAGE_THROTTLE_MS, -} from '../constants'; -import * as Actions from '../actions/sqlLab'; +} from 'src/SqlLab/constants'; +import * as Actions from 'src/SqlLab/actions/sqlLab'; +import TabbedSqlEditors from './TabbedSqlEditors'; +import QueryAutoRefresh from './QueryAutoRefresh'; +import QuerySearch from './QuerySearch'; class App extends React.PureComponent { constructor(props) { @@ -109,7 +109,7 @@ class App extends React.PureComponent {
{content} - +
); diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx index 5f6c89c7b73cf..717fca6a1c7fd 100644 --- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx +++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx @@ -18,10 +18,9 @@ */ import React from 'react'; import { t, useTheme, styled } from '@superset-ui/core'; - import Button from 'src/components/Button'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; import Icons from 'src/components/Icons'; +import withToasts from 'src/components/MessageToasts/withToasts'; import CopyToClipboard from 'src/components/CopyToClipboard'; import { storeQuery } from 'src/utils/common'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; diff --git a/superset-frontend/src/SqlLab/reducers/getInitialState.js b/superset-frontend/src/SqlLab/reducers/getInitialState.js index 92ffa0d6decf6..0eceebfa3ad2b 100644 --- a/superset-frontend/src/SqlLab/reducers/getInitialState.js +++ b/superset-frontend/src/SqlLab/reducers/getInitialState.js @@ -17,7 +17,7 @@ * under the License. */ import { t } from '@superset-ui/core'; -import getToastsFromPyFlashMessages from '../../messageToasts/utils/getToastsFromPyFlashMessages'; +import getToastsFromPyFlashMessages from 'src/components/MessageToasts/getToastsFromPyFlashMessages'; export default function getInitialState({ defaultDbId, diff --git a/superset-frontend/src/SqlLab/reducers/index.js b/superset-frontend/src/SqlLab/reducers/index.js index 904b306073e81..8ae0608ef6154 100644 --- a/superset-frontend/src/SqlLab/reducers/index.js +++ b/superset-frontend/src/SqlLab/reducers/index.js @@ -17,10 +17,9 @@ * under the License. */ import { combineReducers } from 'redux'; - +import messageToasts from 'src/components/MessageToasts/reducers'; import sqlLab from './sqlLab'; import localStorageUsageInKilobytes from './localStorageUsage'; -import messageToasts from '../../messageToasts/reducers/index'; import common from './common'; export default combineReducers({ diff --git a/superset-frontend/src/chart/chartAction.js b/superset-frontend/src/chart/chartAction.js index 5052416df37ee..5410caa5a52ef 100644 --- a/superset-frontend/src/chart/chartAction.js +++ b/superset-frontend/src/chart/chartAction.js @@ -21,7 +21,7 @@ import moment from 'moment'; import { t, SupersetClient } from '@superset-ui/core'; import { getControlsState } from 'src/explore/store'; -import { isFeatureEnabled, FeatureFlag } from '../featureFlags'; +import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; import { getAnnotationJsonUrl, getExploreUrl, @@ -30,19 +30,19 @@ import { postForm, shouldUseLegacyApi, getChartDataUri, -} from '../explore/exploreUtils'; +} from 'src/explore/exploreUtils'; import { requiresQuery, ANNOTATION_SOURCE_TYPES, -} from '../modules/AnnotationTypes'; - -import { addDangerToast } from '../messageToasts/actions'; -import { logEvent } from '../logger/actions'; -import { Logger, LOG_ACTIONS_LOAD_CHART } from '../logger/LogUtils'; -import { getClientErrorObject } from '../utils/getClientErrorObject'; -import { allowCrossDomain as domainShardingEnabled } from '../utils/hostNamesConfig'; -import { updateDataMask } from '../dataMask/actions'; -import { waitForAsyncData } from '../middleware/asyncEvent'; +} from 'src/modules/AnnotationTypes'; + +import { addDangerToast } from 'src/components/MessageToasts/actions'; +import { logEvent } from 'src/logger/actions'; +import { Logger, LOG_ACTIONS_LOAD_CHART } from 'src/logger/LogUtils'; +import { getClientErrorObject } from 'src/utils/getClientErrorObject'; +import { allowCrossDomain as domainShardingEnabled } from 'src/utils/hostNamesConfig'; +import { updateDataMask } from 'src/dataMask/actions'; +import { waitForAsyncData } from 'src/middleware/asyncEvent'; export const CHART_UPDATE_STARTED = 'CHART_UPDATE_STARTED'; export function chartUpdateStarted(queryController, latestQueryFormData, key) { diff --git a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx index 875d5f734d878..adb44a36f6556 100644 --- a/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx +++ b/superset-frontend/src/components/CopyToClipboard/CopyToClipboard.stories.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { useTheme } from '@superset-ui/core'; import Button from 'src/components/Button'; import Icons from 'src/components/Icons'; -import ToastPresenter from 'src/messageToasts/containers/ToastPresenter'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import CopyToClipboard from '.'; export default { @@ -39,7 +39,7 @@ export const InteractiveCopyToClipboard = ({ copyNode, ...rest }: any) => { return ( <> - + ); }; diff --git a/superset-frontend/src/components/CopyToClipboard/index.jsx b/superset-frontend/src/components/CopyToClipboard/index.jsx index 8f384bcaa46cf..cfd607bdef306 100644 --- a/superset-frontend/src/components/CopyToClipboard/index.jsx +++ b/superset-frontend/src/components/CopyToClipboard/index.jsx @@ -20,7 +20,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { t } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import copyTextToClipboard from 'src/utils/copy'; const propTypes = { diff --git a/superset-frontend/src/components/FlashProvider/index.tsx b/superset-frontend/src/components/FlashProvider/index.tsx index 21c1fff5475a0..61690c9209cd6 100644 --- a/superset-frontend/src/components/FlashProvider/index.tsx +++ b/superset-frontend/src/components/FlashProvider/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useToasts } from 'src/messageToasts/enhancers/withToasts'; +import { useToasts } from 'src/components/MessageToasts/withToasts'; import { useComponentDidMount } from 'src/common/hooks/useComponentDidMount'; type FlashMessageType = 'info' | 'alert' | 'danger' | 'warning' | 'success'; diff --git a/superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx b/superset-frontend/src/components/MessageToasts/Toast.test.jsx similarity index 94% rename from superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx rename to superset-frontend/src/components/MessageToasts/Toast.test.jsx index 0686f82f9fd70..f0280c4851e73 100644 --- a/superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx +++ b/superset-frontend/src/components/MessageToasts/Toast.test.jsx @@ -19,9 +19,9 @@ import React from 'react'; import { mount } from 'enzyme'; import { ThemeProvider, supersetTheme } from '@superset-ui/core'; -import Toast from 'src/messageToasts/components/Toast'; +import Toast from 'src/components/MessageToasts/Toast'; import { act } from 'react-dom/test-utils'; -import mockMessageToasts from '../mockMessageToasts'; +import mockMessageToasts from './mockMessageToasts'; const props = { toast: mockMessageToasts[0], diff --git a/superset-frontend/src/messageToasts/components/Toast.tsx b/superset-frontend/src/components/MessageToasts/Toast.tsx similarity index 97% rename from superset-frontend/src/messageToasts/components/Toast.tsx rename to superset-frontend/src/components/MessageToasts/Toast.tsx index 5f7416aa4dd15..82a57e199d30c 100644 --- a/superset-frontend/src/messageToasts/components/Toast.tsx +++ b/superset-frontend/src/components/MessageToasts/Toast.tsx @@ -21,8 +21,7 @@ import cx from 'classnames'; import Interweave from 'interweave'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import Icons from 'src/components/Icons'; -import { ToastType } from 'src/messageToasts/constants'; -import { ToastMeta } from '../types'; +import { ToastType, ToastMeta } from './types'; const ToastContainer = styled.div` display: flex; diff --git a/superset-frontend/src/messageToasts/containers/ToastPresenter.jsx b/superset-frontend/src/components/MessageToasts/ToastContainer.jsx similarity index 91% rename from superset-frontend/src/messageToasts/containers/ToastPresenter.jsx rename to superset-frontend/src/components/MessageToasts/ToastContainer.jsx index 97506cc400572..d61920de579ee 100644 --- a/superset-frontend/src/messageToasts/containers/ToastPresenter.jsx +++ b/superset-frontend/src/components/MessageToasts/ToastContainer.jsx @@ -18,9 +18,9 @@ */ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import ToastPresenter from '../components/ToastPresenter'; +import ToastPresenter from './ToastPresenter'; -import { removeToast } from '../actions'; +import { removeToast } from './actions'; export default connect( ({ messageToasts: toasts }) => ({ toasts }), diff --git a/superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx b/superset-frontend/src/components/MessageToasts/ToastPresenter.test.jsx similarity index 90% rename from superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx rename to superset-frontend/src/components/MessageToasts/ToastPresenter.test.jsx index bd9b6cf980992..c1e2875563e5b 100644 --- a/superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx +++ b/superset-frontend/src/components/MessageToasts/ToastPresenter.test.jsx @@ -18,10 +18,9 @@ */ import React from 'react'; import { shallow } from 'enzyme'; -import Toast from 'src/messageToasts/components/Toast'; -import ToastPresenter from 'src/messageToasts/components/ToastPresenter'; - -import mockMessageToasts from '../mockMessageToasts'; +import Toast from 'src/components/MessageToasts/Toast'; +import ToastPresenter from 'src/components/MessageToasts/ToastPresenter'; +import mockMessageToasts from './mockMessageToasts'; describe('ToastPresenter', () => { const props = { diff --git a/superset-frontend/src/messageToasts/components/ToastPresenter.tsx b/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx similarity index 97% rename from superset-frontend/src/messageToasts/components/ToastPresenter.tsx rename to superset-frontend/src/components/MessageToasts/ToastPresenter.tsx index 05e3cee2c5d9f..18f2ed9fc1705 100644 --- a/superset-frontend/src/messageToasts/components/ToastPresenter.tsx +++ b/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; import { styled } from '@superset-ui/core'; -import { ToastMeta } from 'src/messageToasts/types'; +import { ToastMeta } from 'src/components/MessageToasts/types'; import Toast from './Toast'; const StyledToastPresenter = styled.div` diff --git a/superset-frontend/src/messageToasts/actions/index.ts b/superset-frontend/src/components/MessageToasts/actions.ts similarity index 98% rename from superset-frontend/src/messageToasts/actions/index.ts rename to superset-frontend/src/components/MessageToasts/actions.ts index 3eaf51c3cee0d..37fcf80f178c4 100644 --- a/superset-frontend/src/messageToasts/actions/index.ts +++ b/superset-frontend/src/components/MessageToasts/actions.ts @@ -17,7 +17,7 @@ * under the License. */ import shortid from 'shortid'; -import { ToastType, ToastMeta } from '../types'; +import { ToastType, ToastMeta } from './types'; type ToastOptions = Partial>; diff --git a/superset-frontend/src/messageToasts/utils/getToastsFromPyFlashMessages.js b/superset-frontend/src/components/MessageToasts/getToastsFromPyFlashMessages.js similarity index 93% rename from superset-frontend/src/messageToasts/utils/getToastsFromPyFlashMessages.js rename to superset-frontend/src/components/MessageToasts/getToastsFromPyFlashMessages.js index 6f921c4953532..982df17100792 100644 --- a/superset-frontend/src/messageToasts/utils/getToastsFromPyFlashMessages.js +++ b/superset-frontend/src/components/MessageToasts/getToastsFromPyFlashMessages.js @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { addToast } from '../actions'; -import { ToastType } from '../constants'; +import { addToast } from './actions'; +import { ToastType } from './types'; export default function toastsFromPyFlashMessages(flashMessages = []) { const toasts = []; diff --git a/superset-frontend/spec/javascripts/messageToasts/utils/getToastsFromPyFlashMessages_spec.js b/superset-frontend/src/components/MessageToasts/getToastsFromPyFlashMessages.test.js similarity index 90% rename from superset-frontend/spec/javascripts/messageToasts/utils/getToastsFromPyFlashMessages_spec.js rename to superset-frontend/src/components/MessageToasts/getToastsFromPyFlashMessages.test.js index 59f8a45d27b4f..d19ac0c5d5ee2 100644 --- a/superset-frontend/spec/javascripts/messageToasts/utils/getToastsFromPyFlashMessages_spec.js +++ b/superset-frontend/src/components/MessageToasts/getToastsFromPyFlashMessages.test.js @@ -16,9 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ToastType } from 'src/messageToasts/constants'; - -import getToastsFromPyFlashMessages from 'src/messageToasts/utils/getToastsFromPyFlashMessages'; +import { ToastType } from 'src/components/MessageToasts/types'; +import getToastsFromPyFlashMessages from 'src/components/MessageToasts/getToastsFromPyFlashMessages'; describe('getToastsFromPyFlashMessages', () => { it('should return an info toast', () => { diff --git a/superset-frontend/spec/javascripts/messageToasts/mockMessageToasts.js b/superset-frontend/src/components/MessageToasts/mockMessageToasts.js similarity index 93% rename from superset-frontend/spec/javascripts/messageToasts/mockMessageToasts.js rename to superset-frontend/src/components/MessageToasts/mockMessageToasts.js index 311e626629f36..4604e5de6cd99 100644 --- a/superset-frontend/spec/javascripts/messageToasts/mockMessageToasts.js +++ b/superset-frontend/src/components/MessageToasts/mockMessageToasts.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { ToastType } from 'src/messageToasts/constants'; +import { ToastType } from 'src/components/MessageToasts/types'; export default [ { id: 'info_id', toastType: ToastType.INFO, text: 'info toast' }, diff --git a/superset-frontend/src/messageToasts/reducers/index.js b/superset-frontend/src/components/MessageToasts/reducers.js similarity index 96% rename from superset-frontend/src/messageToasts/reducers/index.js rename to superset-frontend/src/components/MessageToasts/reducers.js index 2203bf8373c1f..e999d12adbad0 100644 --- a/superset-frontend/src/messageToasts/reducers/index.js +++ b/superset-frontend/src/components/MessageToasts/reducers.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { ADD_TOAST, REMOVE_TOAST } from '../actions'; +import { ADD_TOAST, REMOVE_TOAST } from './actions'; export default function messageToastsReducer(toasts = [], action) { switch (action.type) { diff --git a/superset-frontend/spec/javascripts/messageToasts/reducers/messageToasts_spec.js b/superset-frontend/src/components/MessageToasts/reducers.test.js similarity index 90% rename from superset-frontend/spec/javascripts/messageToasts/reducers/messageToasts_spec.js rename to superset-frontend/src/components/MessageToasts/reducers.test.js index 11a509e7bdac7..d3d5d61dec488 100644 --- a/superset-frontend/spec/javascripts/messageToasts/reducers/messageToasts_spec.js +++ b/superset-frontend/src/components/MessageToasts/reducers.test.js @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ADD_TOAST, REMOVE_TOAST } from 'src/messageToasts/actions'; -import messageToastsReducer from 'src/messageToasts/reducers'; +import { ADD_TOAST, REMOVE_TOAST } from 'src/components/MessageToasts/actions'; +import messageToastsReducer from 'src/components/MessageToasts/reducers'; describe('messageToasts reducer', () => { it('should return initial state', () => { diff --git a/superset-frontend/src/messageToasts/types.ts b/superset-frontend/src/components/MessageToasts/types.ts similarity index 100% rename from superset-frontend/src/messageToasts/types.ts rename to superset-frontend/src/components/MessageToasts/types.ts diff --git a/superset-frontend/src/messageToasts/enhancers/withToasts.tsx b/superset-frontend/src/components/MessageToasts/withToasts.tsx similarity index 98% rename from superset-frontend/src/messageToasts/enhancers/withToasts.tsx rename to superset-frontend/src/components/MessageToasts/withToasts.tsx index 50d98513f3b60..2d0486a65e347 100644 --- a/superset-frontend/src/messageToasts/enhancers/withToasts.tsx +++ b/superset-frontend/src/components/MessageToasts/withToasts.tsx @@ -26,7 +26,7 @@ import { addInfoToast, addSuccessToast, addWarningToast, -} from '../actions'; +} from './actions'; export interface ToastProps { addDangerToast: typeof addDangerToast; diff --git a/superset-frontend/src/components/ReportModal/index.tsx b/superset-frontend/src/components/ReportModal/index.tsx index e24d1d756c63f..178e394125746 100644 --- a/superset-frontend/src/components/ReportModal/index.tsx +++ b/superset-frontend/src/components/ReportModal/index.tsx @@ -33,7 +33,7 @@ import { AlertObject } from 'src/views/CRUD/alert/types'; import TimezoneSelector from 'src/components/TimezoneSelector'; import LabeledErrorBoundInput from 'src/components/Form/LabeledErrorBoundInput'; import Icons from 'src/components/Icons'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { CronError } from 'src/components/CronPicker'; import { RadioChangeEvent } from 'src/common/components'; import { diff --git a/superset-frontend/src/components/TableLoader/TableLoader.test.tsx b/superset-frontend/src/components/TableLoader/TableLoader.test.tsx index c0c46878f9df3..d8de53c2e6b5a 100644 --- a/superset-frontend/src/components/TableLoader/TableLoader.test.tsx +++ b/superset-frontend/src/components/TableLoader/TableLoader.test.tsx @@ -21,7 +21,7 @@ import { render, screen } from 'spec/helpers/testing-library'; import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import { storeWithState } from 'spec/fixtures/mockStore'; -import ToastPresenter from 'src/messageToasts/containers/ToastPresenter'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import TableLoader, { TableLoaderProps } from '.'; fetchMock.get('glob:*/api/v1/mock', [ @@ -38,7 +38,7 @@ function renderWithProps(props: TableLoaderProps = defaultProps) { return render( - + , ); } diff --git a/superset-frontend/src/components/TableLoader/index.tsx b/superset-frontend/src/components/TableLoader/index.tsx index c6224499d38b7..2956df3f75dce 100644 --- a/superset-frontend/src/components/TableLoader/index.tsx +++ b/superset-frontend/src/components/TableLoader/index.tsx @@ -19,7 +19,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import { t, SupersetClient, JsonObject } from '@superset-ui/core'; import TableView, { EmptyWrapperType } from 'src/components/TableView'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import Loading from 'src/components/Loading'; import 'stylesheets/reactable-pagination.less'; diff --git a/superset-frontend/src/components/URLShortLinkButton/URLShortLinkButton.test.tsx b/superset-frontend/src/components/URLShortLinkButton/URLShortLinkButton.test.tsx index 6bba1dee4105a..f54a2ba364fbb 100644 --- a/superset-frontend/src/components/URLShortLinkButton/URLShortLinkButton.test.tsx +++ b/superset-frontend/src/components/URLShortLinkButton/URLShortLinkButton.test.tsx @@ -21,7 +21,7 @@ import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import fetchMock from 'fetch-mock'; import URLShortLinkButton from 'src/components/URLShortLinkButton'; -import ToastPresenter from 'src/messageToasts/containers/ToastPresenter'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; const fakeUrl = 'http://fakeurl.com'; @@ -65,7 +65,7 @@ test('renders error message on short url error', async () => { render( <> - + , { useRedux: true }, ); diff --git a/superset-frontend/src/components/URLShortLinkButton/index.jsx b/superset-frontend/src/components/URLShortLinkButton/index.jsx index f204985753bed..1678471b61f79 100644 --- a/superset-frontend/src/components/URLShortLinkButton/index.jsx +++ b/superset-frontend/src/components/URLShortLinkButton/index.jsx @@ -22,7 +22,7 @@ import { t } from '@superset-ui/core'; import Popover from 'src/components/Popover'; import CopyToClipboard from 'src/components/CopyToClipboard'; import { getShortUrl } from 'src/utils/urlUtils'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; const propTypes = { url: PropTypes.string, diff --git a/superset-frontend/src/dashboard/actions/dashboardLayout.js b/superset-frontend/src/dashboard/actions/dashboardLayout.js index 51df31503b18a..fc64f8c6756ad 100644 --- a/superset-frontend/src/dashboard/actions/dashboardLayout.js +++ b/superset-frontend/src/dashboard/actions/dashboardLayout.js @@ -18,19 +18,18 @@ */ import { ActionCreators as UndoActionCreators } from 'redux-undo'; import { t } from '@superset-ui/core'; - -import { addWarningToast } from '../../messageToasts/actions'; -import { updateLayoutComponents } from './dashboardFilters'; -import { setUnsavedChanges } from './dashboardState'; -import { TABS_TYPE, ROW_TYPE } from '../util/componentTypes'; +import { addWarningToast } from 'src/components/MessageToasts/actions'; +import { TABS_TYPE, ROW_TYPE } from 'src/dashboard/util/componentTypes'; import { DASHBOARD_ROOT_ID, NEW_COMPONENTS_SOURCE_ID, DASHBOARD_HEADER_ID, -} from '../util/constants'; -import dropOverflowsParent from '../util/dropOverflowsParent'; -import findParentId from '../util/findParentId'; -import isInDifferentFilterScopes from '../util/isInDifferentFilterScopes'; +} from 'src/dashboard/util/constants'; +import dropOverflowsParent from 'src/dashboard/util/dropOverflowsParent'; +import findParentId from 'src/dashboard/util/findParentId'; +import isInDifferentFilterScopes from 'src/dashboard/util/isInDifferentFilterScopes'; +import { updateLayoutComponents } from './dashboardFilters'; +import { setUnsavedChanges } from './dashboardState'; // Component CRUD ------------------------------------------------------------- export const UPDATE_COMPONENTS = 'UPDATE_COMPONENTS'; diff --git a/superset-frontend/src/dashboard/actions/dashboardState.js b/superset-frontend/src/dashboard/actions/dashboardState.js index 36868b85d56de..15d68feed7ae6 100644 --- a/superset-frontend/src/dashboard/actions/dashboardState.js +++ b/superset-frontend/src/dashboard/actions/dashboardState.js @@ -19,30 +19,29 @@ /* eslint camelcase: 0 */ import { ActionCreators as UndoActionCreators } from 'redux-undo'; import { t, SupersetClient } from '@superset-ui/core'; - -import { addChart, removeChart, refreshChart } from '../../chart/chartAction'; -import { chart as initChart } from '../../chart/chartReducer'; -import { fetchDatasourceMetadata } from './datasources'; -import { - addFilter, - removeFilter, - updateDirectPathToFilter, -} from './dashboardFilters'; -import { applyDefaultFormData } from '../../explore/store'; -import { getClientErrorObject } from '../../utils/getClientErrorObject'; -import { SAVE_TYPE_OVERWRITE } from '../util/constants'; +import { addChart, removeChart, refreshChart } from 'src/chart/chartAction'; +import { chart as initChart } from 'src/chart/chartReducer'; +import { applyDefaultFormData } from 'src/explore/store'; +import { getClientErrorObject } from 'src/utils/getClientErrorObject'; +import { SAVE_TYPE_OVERWRITE } from 'src/dashboard/util/constants'; import { addSuccessToast, addWarningToast, addDangerToast, -} from '../../messageToasts/actions'; +} from 'src/components/MessageToasts/actions'; +import serializeActiveFilterValues from 'src/dashboard/util/serializeActiveFilterValues'; +import serializeFilterScopes from 'src/dashboard/util/serializeFilterScopes'; +import { getActiveFilters } from 'src/dashboard/util/activeDashboardFilters'; +import { safeStringify } from 'src/utils/safeStringify'; +import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags'; import { UPDATE_COMPONENTS_PARENTS_LIST } from './dashboardLayout'; -import serializeActiveFilterValues from '../util/serializeActiveFilterValues'; -import serializeFilterScopes from '../util/serializeFilterScopes'; -import { getActiveFilters } from '../util/activeDashboardFilters'; -import { safeStringify } from '../../utils/safeStringify'; -import { FeatureFlag, isFeatureEnabled } from '../../featureFlags'; import { setChartConfiguration } from './dashboardInfo'; +import { fetchDatasourceMetadata } from './datasources'; +import { + addFilter, + removeFilter, + updateDirectPathToFilter, +} from './dashboardFilters'; export const SET_UNSAVED_CHANGES = 'SET_UNSAVED_CHANGES'; export function setUnsavedChanges(hasUnsavedChanges) { diff --git a/superset-frontend/src/dashboard/actions/sliceEntities.js b/superset-frontend/src/dashboard/actions/sliceEntities.js index 441968d9867e0..388fddedda484 100644 --- a/superset-frontend/src/dashboard/actions/sliceEntities.js +++ b/superset-frontend/src/dashboard/actions/sliceEntities.js @@ -20,7 +20,7 @@ import { t, SupersetClient } from '@superset-ui/core'; import rison from 'rison'; -import { addDangerToast } from 'src/messageToasts/actions'; +import { addDangerToast } from 'src/components/MessageToasts/actions'; import { getDatasourceParameter } from 'src/modules/utils'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx b/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx index 6ca3830634316..4d464fe07f4d4 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx @@ -37,7 +37,7 @@ import { JsonEditor } from 'src/components/AsyncAceEditor'; import ColorSchemeControlWrapper from 'src/dashboard/components/ColorSchemeControlWrapper'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags'; const StyledJsonEditor = styled(JsonEditor)` diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx index 8fc4cc4b9cd68..693e604109cd4 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx @@ -21,7 +21,7 @@ import { FormInstance } from 'antd/lib/form'; import { Column, ensureIsArray, SupersetClient, t } from '@superset-ui/core'; import { useChangeEffect } from 'src/common/hooks/useChangeEffect'; import { Select } from 'src/components'; -import { useToasts } from 'src/messageToasts/enhancers/withToasts'; +import { useToasts } from 'src/components/MessageToasts/withToasts'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; import { cacheWrapper } from 'src/utils/cacheWrapper'; import { NativeFiltersForm } from '../types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx index dba9cc66b9060..0721f81c82b56 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx @@ -51,7 +51,7 @@ import { Select } from 'src/components'; import { cacheWrapper } from 'src/utils/cacheWrapper'; import AdhocFilterControl from 'src/explore/components/controls/FilterControl/AdhocFilterControl'; import DateFilterControl from 'src/explore/components/controls/DateFilterControl'; -import { addDangerToast } from 'src/messageToasts/actions'; +import { addDangerToast } from 'src/components/MessageToasts/actions'; import { ClientErrorObject } from 'src/utils/getClientErrorObject'; import Collapse from 'src/components/Collapse'; import { getChartDataRequest } from 'src/chart/chartAction'; diff --git a/superset-frontend/src/dashboard/containers/Chart.jsx b/superset-frontend/src/dashboard/containers/Chart.jsx index c629209d42541..09bd59f2bd539 100644 --- a/superset-frontend/src/dashboard/containers/Chart.jsx +++ b/superset-frontend/src/dashboard/containers/Chart.jsx @@ -18,24 +18,26 @@ */ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; - import { toggleExpandSlice, setFocusedFilterField, unsetFocusedFilterField, -} from '../actions/dashboardState'; -import { updateComponents } from '../actions/dashboardLayout'; -import { changeFilter } from '../actions/dashboardFilters'; -import { addSuccessToast, addDangerToast } from '../../messageToasts/actions'; -import { refreshChart } from '../../chart/chartAction'; -import { logEvent } from '../../logger/actions'; +} from 'src/dashboard/actions/dashboardState'; +import { updateComponents } from 'src/dashboard/actions/dashboardLayout'; +import { changeFilter } from 'src/dashboard/actions/dashboardFilters'; +import { + addSuccessToast, + addDangerToast, +} from 'src/components/MessageToasts/actions'; +import { refreshChart } from 'src/chart/chartAction'; +import { logEvent } from 'src/logger/actions'; import { getActiveFilters, getAppliedFilterValues, -} from '../util/activeDashboardFilters'; -import getFormDataWithExtraFilters from '../util/charts/getFormDataWithExtraFilters'; -import Chart from '../components/gridComponents/Chart'; -import { PLACEHOLDER_DATASOURCE } from '../constants'; +} from 'src/dashboard/util/activeDashboardFilters'; +import getFormDataWithExtraFilters from 'src/dashboard/util/charts/getFormDataWithExtraFilters'; +import Chart from 'src/dashboard/components/gridComponents/Chart'; +import { PLACEHOLDER_DATASOURCE } from 'src/dashboard/constants'; const EMPTY_OBJECT = {}; diff --git a/superset-frontend/src/dashboard/containers/DashboardComponent.jsx b/superset-frontend/src/dashboard/containers/DashboardComponent.jsx index 12397eaae5e66..08b7ed9f82d90 100644 --- a/superset-frontend/src/dashboard/containers/DashboardComponent.jsx +++ b/superset-frontend/src/dashboard/containers/DashboardComponent.jsx @@ -20,26 +20,24 @@ import React from 'react'; import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; - import { logEvent } from 'src/logger/actions'; -import { addDangerToast } from 'src/messageToasts/actions'; -import { componentLookup } from '../components/gridComponents'; -import getDetailedComponentWidth from '../util/getDetailedComponentWidth'; -import { getActiveFilters } from '../util/activeDashboardFilters'; -import { componentShape } from '../util/propShapes'; -import { COLUMN_TYPE, ROW_TYPE } from '../util/componentTypes'; - +import { addDangerToast } from 'src/components/MessageToasts/actions'; +import { componentLookup } from 'src/dashboard/components/gridComponents'; +import getDetailedComponentWidth from 'src/dashboard/util/getDetailedComponentWidth'; +import { getActiveFilters } from 'src/dashboard/util/activeDashboardFilters'; +import { componentShape } from 'src/dashboard/util/propShapes'; +import { COLUMN_TYPE, ROW_TYPE } from 'src/dashboard/util/componentTypes'; import { createComponent, deleteComponent, updateComponents, handleComponentDrop, -} from '../actions/dashboardLayout'; +} from 'src/dashboard/actions/dashboardLayout'; import { setDirectPathToChild, setActiveTabs, setFullSizeChartId, -} from '../actions/dashboardState'; +} from 'src/dashboard/actions/dashboardState'; const propTypes = { id: PropTypes.string, diff --git a/superset-frontend/src/dashboard/containers/DashboardHeader.jsx b/superset-frontend/src/dashboard/containers/DashboardHeader.jsx index bcd6caf9daec0..e8d68bad0f2a5 100644 --- a/superset-frontend/src/dashboard/containers/DashboardHeader.jsx +++ b/superset-frontend/src/dashboard/containers/DashboardHeader.jsx @@ -20,10 +20,10 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { updateDataMask } from 'src/dataMask/actions'; -import DashboardHeader from '../components/Header'; -import isDashboardLoading from '../util/isDashboardLoading'; +import DashboardHeader from 'src/dashboard/components/Header'; +import isDashboardLoading from 'src/dashboard/util/isDashboardLoading'; -import { dashboardInfoChanged } from '../actions/dashboardInfo'; +import { dashboardInfoChanged } from 'src/dashboard/actions/dashboardInfo'; import { setEditMode, @@ -40,28 +40,27 @@ import { maxUndoHistoryToast, setRefreshFrequency, onRefresh, -} from '../actions/dashboardState'; +} from 'src/dashboard/actions/dashboardState'; import { undoLayoutAction, redoLayoutAction, updateDashboardTitle, dashboardTitleChanged, -} from '../actions/dashboardLayout'; - +} from 'src/dashboard/actions/dashboardLayout'; import { addSuccessToast, addDangerToast, addWarningToast, -} from '../../messageToasts/actions'; +} from 'src/components/MessageToasts/actions'; -import { logEvent } from '../../logger/actions'; -import { DASHBOARD_HEADER_ID } from '../util/constants'; +import { logEvent } from 'src/logger/actions'; +import { DASHBOARD_HEADER_ID } from 'src/dashboard/util/constants'; import { fetchUISpecificReport, toggleActive, deleteActiveReport, -} from '../../reports/actions/reports'; +} from 'src/reports/actions/reports'; function mapStateToProps({ dashboardLayout: undoableLayout, diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx index 878d2117ec7b7..01f488684f16d 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -20,7 +20,7 @@ import React, { useEffect, FC } from 'react'; import { t } from '@superset-ui/core'; import { useDispatch } from 'react-redux'; import { useParams } from 'react-router-dom'; -import { useToasts } from 'src/messageToasts/enhancers/withToasts'; +import { useToasts } from 'src/components/MessageToasts/withToasts'; import Loading from 'src/components/Loading'; import { useDashboard, diff --git a/superset-frontend/src/datasource/ChangeDatasourceModal.tsx b/superset-frontend/src/datasource/ChangeDatasourceModal.tsx index 2980d4019c6e9..7aa80bb12ace1 100644 --- a/superset-frontend/src/datasource/ChangeDatasourceModal.tsx +++ b/superset-frontend/src/datasource/ChangeDatasourceModal.tsx @@ -35,12 +35,12 @@ import { useDebouncedEffect } from 'src/explore/exploreUtils'; import { SLOW_DEBOUNCE } from 'src/constants'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; import Loading from 'src/components/Loading'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; import { Input, AntdInput } from 'src/common/components'; import { PAGE_SIZE as DATASET_PAGE_SIZE, 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'; const CONFIRM_WARNING_MESSAGE = t( diff --git a/superset-frontend/src/datasource/DatasourceEditor.jsx b/superset-frontend/src/datasource/DatasourceEditor.jsx index e11b8310bb75c..cc736ca07d804 100644 --- a/superset-frontend/src/datasource/DatasourceEditor.jsx +++ b/superset-frontend/src/datasource/DatasourceEditor.jsx @@ -49,7 +49,7 @@ import CollectionTable from 'src/CRUD/CollectionTable'; import Fieldset from 'src/CRUD/Fieldset'; import Field from 'src/CRUD/Field'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags'; import Icons from 'src/components/Icons'; diff --git a/superset-frontend/src/datasource/DatasourceModal.tsx b/superset-frontend/src/datasource/DatasourceModal.tsx index 0b85d462e4927..8f23b93afc90a 100644 --- a/superset-frontend/src/datasource/DatasourceModal.tsx +++ b/superset-frontend/src/datasource/DatasourceModal.tsx @@ -26,7 +26,7 @@ import AsyncEsmComponent from 'src/components/AsyncEsmComponent'; import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; const DatasourceEditor = AsyncEsmComponent(() => import('./DatasourceEditor')); diff --git a/superset-frontend/src/explore/App.jsx b/superset-frontend/src/explore/App.jsx index e7973fe91f479..86e04020ae497 100644 --- a/superset-frontend/src/explore/App.jsx +++ b/superset-frontend/src/explore/App.jsx @@ -23,13 +23,13 @@ import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import { ThemeProvider } from '@superset-ui/core'; import { DynamicPluginProvider } from 'src/components/DynamicPlugins'; -import ToastPresenter from '../messageToasts/containers/ToastPresenter'; -import ExploreViewContainer from './components/ExploreViewContainer'; -import setupApp from '../setup/setupApp'; -import setupPlugins from '../setup/setupPlugins'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; +import setupApp from 'src/setup/setupApp'; +import setupPlugins from 'src/setup/setupPlugins'; import './main.less'; -import '../../stylesheets/reactable-pagination.less'; -import { theme } from '../preamble'; +import 'stylesheets/reactable-pagination.less'; +import { theme } from 'src/preamble'; +import ExploreViewContainer from './components/ExploreViewContainer'; setupApp(); setupPlugins(); @@ -40,7 +40,7 @@ const App = ({ store }) => ( - + diff --git a/superset-frontend/src/explore/actions/exploreActions.ts b/superset-frontend/src/explore/actions/exploreActions.ts index c4faf793b1155..2528bc06027bb 100644 --- a/superset-frontend/src/explore/actions/exploreActions.ts +++ b/superset-frontend/src/explore/actions/exploreActions.ts @@ -25,7 +25,10 @@ import { QueryFormData, } from '@superset-ui/core'; import { Dispatch } from 'redux'; -import { addDangerToast, toastActions } from 'src/messageToasts/actions'; +import { + addDangerToast, + toastActions, +} from 'src/components/MessageToasts/actions'; import { Slice } from 'src/types/Chart'; const FAVESTAR_BASE_URL = '/superset/favstar/slice'; diff --git a/superset-frontend/src/explore/components/ExploreActionButtons.tsx b/superset-frontend/src/explore/components/ExploreActionButtons.tsx index 3b020ae170009..c01305a691917 100644 --- a/superset-frontend/src/explore/components/ExploreActionButtons.tsx +++ b/superset-frontend/src/explore/components/ExploreActionButtons.tsx @@ -22,7 +22,7 @@ import { t } from '@superset-ui/core'; import Icons from 'src/components/Icons'; import { Tooltip } from 'src/components/Tooltip'; import copyTextToClipboard from 'src/utils/copy'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { useUrlShortener } from 'src/common/hooks/useUrlShortener'; import EmbedCodeButton from './EmbedCodeButton'; import { exportChart, getExploreLongUrl } from '../exploreUtils'; diff --git a/superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.jsx b/superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.jsx index b0acad2298095..20f8854cdddfa 100644 --- a/superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.jsx +++ b/superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.jsx @@ -18,12 +18,11 @@ */ import React from 'react'; import PropTypes from 'prop-types'; - -import withToasts from 'src/messageToasts/enhancers/withToasts'; import { StyledColumnOption, StyledMetricOption, } from 'src/explore/components/optionRenderers'; +import withToasts from 'src/components/MessageToasts/withToasts'; import AggregateOption from './AggregateOption'; import columnType from './columnType'; import aggregateOptionType from './aggregateOptionType'; diff --git a/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.jsx b/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.jsx index 092498d09f3f2..db7075513625b 100644 --- a/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.jsx @@ -22,7 +22,7 @@ import { t } from '@superset-ui/core'; import Select from 'src/components/AsyncSelect'; import ControlHeader from 'src/explore/components/ControlHeader'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; const propTypes = { dataEndpoint: PropTypes.string.isRequired, diff --git a/superset-frontend/src/explore/reducers/getInitialState.ts b/superset-frontend/src/explore/reducers/getInitialState.ts index 28a270d2f906f..b7f8a62f94080 100644 --- a/superset-frontend/src/explore/reducers/getInitialState.ts +++ b/superset-frontend/src/explore/reducers/getInitialState.ts @@ -26,7 +26,7 @@ import { CommonBootstrapData, UserWithPermissionsAndRoles, } from 'src/types/bootstrapTypes'; -import getToastsFromPyFlashMessages from 'src/messageToasts/utils/getToastsFromPyFlashMessages'; +import getToastsFromPyFlashMessages from 'src/components/MessageToasts/getToastsFromPyFlashMessages'; import { ChartState, Slice } from 'src/explore/types'; import { getChartKey } from 'src/explore/exploreUtils'; diff --git a/superset-frontend/src/explore/reducers/index.js b/superset-frontend/src/explore/reducers/index.js index e387c49c18a41..555922dd0a47d 100644 --- a/superset-frontend/src/explore/reducers/index.js +++ b/superset-frontend/src/explore/reducers/index.js @@ -19,11 +19,11 @@ import { combineReducers } from 'redux'; import reports from 'src/reports/reducers/reports'; -import charts from '../../chart/chartReducer'; +import charts from 'src/chart/chartReducer'; +import dataMask from 'src/dataMask/reducer'; +import messageToasts from 'src/components/MessageToasts/reducers'; import saveModal from './saveModalReducer'; import explore from './exploreReducer'; -import dataMask from '../../dataMask/reducer'; -import messageToasts from '../../messageToasts/reducers'; const impressionId = (state = '') => state; diff --git a/superset-frontend/src/messageToasts/constants.ts b/superset-frontend/src/messageToasts/constants.ts deleted file mode 100644 index e22616c8a549d..0000000000000 --- a/superset-frontend/src/messageToasts/constants.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. - */ -// Toast types -import { ToastType } from './types'; - -export { ToastType } from './types'; - -// for backward compatibility -export const INFO_TOAST = ToastType.INFO; -export const SUCCES_TOAST = ToastType.SUCCESS; -export const WARNING_TOAST = ToastType.WARNING; -export const DANGER_TOAST = ToastType.DANGER; diff --git a/superset-frontend/src/profile/App.tsx b/superset-frontend/src/profile/App.tsx index d3c5e43c99461..85f4ccc831fa0 100644 --- a/superset-frontend/src/profile/App.tsx +++ b/superset-frontend/src/profile/App.tsx @@ -23,12 +23,12 @@ import { createStore, applyMiddleware, compose, combineReducers } from 'redux'; import { Provider } from 'react-redux'; import { ThemeProvider } from '@superset-ui/core'; import App from 'src/profile/components/App'; -import messageToastReducer from 'src/messageToasts/reducers'; +import messageToastReducer from 'src/components/MessageToasts/reducers'; import { initEnhancer } from 'src/reduxUtils'; import setupApp from 'src/setup/setupApp'; import './main.less'; import { theme } from 'src/preamble'; -import ToastPresenter from 'src/messageToasts/containers/ToastPresenter'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; setupApp(); @@ -49,7 +49,7 @@ const Application = () => ( - + ); diff --git a/superset-frontend/src/reports/actions/reports.js b/superset-frontend/src/reports/actions/reports.js index 7b3bc814ca0e8..345cfa1e40644 100644 --- a/superset-frontend/src/reports/actions/reports.js +++ b/superset-frontend/src/reports/actions/reports.js @@ -20,7 +20,10 @@ import { t, SupersetClient } from '@superset-ui/core'; import rison from 'rison'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; -import { addDangerToast, addSuccessToast } from '../../messageToasts/actions'; +import { + addDangerToast, + addSuccessToast, +} from 'src/components/MessageToasts/actions'; export const SET_REPORT = 'SET_REPORT'; export function setReport(report) { diff --git a/superset-frontend/src/utils/downloadAsImage.ts b/superset-frontend/src/utils/downloadAsImage.ts index 8ec472f4081f3..b19dfe29a37d3 100644 --- a/superset-frontend/src/utils/downloadAsImage.ts +++ b/superset-frontend/src/utils/downloadAsImage.ts @@ -20,7 +20,7 @@ import { SyntheticEvent } from 'react'; import domToImage, { Options } from 'dom-to-image'; import kebabCase from 'lodash/kebabCase'; import { t } from '@superset-ui/core'; -import { addWarningToast } from 'src/messageToasts/actions'; +import { addWarningToast } from 'src/components/MessageToasts/actions'; /** * @remark diff --git a/superset-frontend/src/views/App.tsx b/superset-frontend/src/views/App.tsx index d04b08d93f147..e23695c9d0688 100644 --- a/superset-frontend/src/views/App.tsx +++ b/superset-frontend/src/views/App.tsx @@ -36,7 +36,7 @@ import Loading from 'src/components/Loading'; import Menu from 'src/components/Menu/Menu'; import FlashProvider from 'src/components/FlashProvider'; import { theme } from 'src/preamble'; -import ToastPresenter from 'src/messageToasts/containers/ToastPresenter'; +import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import setupApp from 'src/setup/setupApp'; import { routes, isFrontendRoute } from 'src/views/routes'; import { Logger } from 'src/logger/LogUtils'; @@ -98,7 +98,7 @@ const App = () => ( ))} - + ); diff --git a/superset-frontend/src/views/CRUD/alert/AlertList.tsx b/superset-frontend/src/views/CRUD/alert/AlertList.tsx index 29be77b5d73f6..e775bcd082e86 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertList.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertList.tsx @@ -33,7 +33,7 @@ import ListView, { import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import { Switch } from 'src/components/Switch'; import { DATETIME_WITH_TIME_ZONE } from 'src/constants'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import AlertStatusIcon from 'src/views/CRUD/alert/components/AlertStatusIcon'; import RecipientIcon from 'src/views/CRUD/alert/components/RecipientIcon'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; diff --git a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx index 56e1eba7fbd96..a3944184d675c 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx @@ -40,7 +40,7 @@ import TimezoneSelector from 'src/components/TimezoneSelector'; import { Radio } from 'src/components/Radio'; import { Select } from 'src/components'; import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import Owner from 'src/types/Owner'; import TextAreaControl from 'src/explore/components/controls/TextAreaControl'; import { useCommonConf } from 'src/views/CRUD/data/database/state'; diff --git a/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx b/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx index 7ea859075d585..e9c7baff21d55 100644 --- a/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx +++ b/superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx @@ -23,7 +23,7 @@ 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 withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { fDuration } from 'src/modules/dates'; import AlertStatusIcon from 'src/views/CRUD/alert/components/AlertStatusIcon'; import { diff --git a/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx b/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx index e207da03d5fd1..aeebb2bf24205 100644 --- a/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx +++ b/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx @@ -30,7 +30,7 @@ import DeleteModal from 'src/components/DeleteModal'; import ListView, { ListViewProps } from 'src/components/ListView'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import { getClientErrorObject } from 'src/utils/getClientErrorObject'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { createErrorHandler } from 'src/views/CRUD/utils'; diff --git a/superset-frontend/src/views/CRUD/annotation/AnnotationModal.tsx b/superset-frontend/src/views/CRUD/annotation/AnnotationModal.tsx index cf0c2411f3ed4..bab4d2f7e774c 100644 --- a/superset-frontend/src/views/CRUD/annotation/AnnotationModal.tsx +++ b/superset-frontend/src/views/CRUD/annotation/AnnotationModal.tsx @@ -23,8 +23,8 @@ import { RangePicker } from 'src/components/DatePicker'; import moment from 'moment'; import Icons from 'src/components/Icons'; import Modal from 'src/components/Modal'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; import { StyledIcon } from 'src/views/CRUD/utils'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { JsonEditor } from 'src/components/AsyncAceEditor'; import { AnnotationObject } from './types'; diff --git a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayerModal.tsx b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayerModal.tsx index 118f9117a05c7..d683448ab5619 100644 --- a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayerModal.tsx +++ b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayerModal.tsx @@ -23,7 +23,7 @@ import { useSingleViewResource } from 'src/views/CRUD/hooks'; import Icons from 'src/components/Icons'; import { StyledIcon } from 'src/views/CRUD/utils'; import Modal from 'src/components/Modal'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { AnnotationLayerObject } from './types'; diff --git a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx index 55f7da5a4c33d..60683ceefeb1f 100644 --- a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx +++ b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx @@ -24,7 +24,7 @@ import { Link, useHistory } from 'react-router-dom'; import moment from 'moment'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { createFetchRelated, createErrorHandler } from 'src/views/CRUD/utils'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import ActionsBar, { ActionProps } from 'src/components/ListView/ActionsBar'; import ListView, { diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.tsx b/superset-frontend/src/views/CRUD/chart/ChartList.tsx index 76e3809d69811..cf573e581874e 100644 --- a/superset-frontend/src/views/CRUD/chart/ChartList.tsx +++ b/superset-frontend/src/views/CRUD/chart/ChartList.tsx @@ -50,7 +50,7 @@ import ListView, { } from 'src/components/ListView'; import Loading from 'src/components/Loading'; import { getFromLocalStorage } from 'src/utils/localStorageHelpers'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import PropertiesModal from 'src/explore/components/PropertiesModal'; import ImportModelsModal from 'src/components/ImportModal/index'; import Chart from 'src/types/Chart'; diff --git a/superset-frontend/src/views/CRUD/csstemplates/CssTemplateModal.tsx b/superset-frontend/src/views/CRUD/csstemplates/CssTemplateModal.tsx index 4b4baa61f3b89..c1d15a766ba45 100644 --- a/superset-frontend/src/views/CRUD/csstemplates/CssTemplateModal.tsx +++ b/superset-frontend/src/views/CRUD/csstemplates/CssTemplateModal.tsx @@ -23,7 +23,7 @@ import { useSingleViewResource } from 'src/views/CRUD/hooks'; import Icons from 'src/components/Icons'; import { StyledIcon } from 'src/views/CRUD/utils'; import Modal from 'src/components/Modal'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { CssEditor } from 'src/components/AsyncAceEditor'; import { TemplateObject } from './types'; diff --git a/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx b/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx index 02ce896987182..8c002da186824 100644 --- a/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx +++ b/superset-frontend/src/views/CRUD/csstemplates/CssTemplatesList.tsx @@ -24,7 +24,7 @@ import rison from 'rison'; import moment from 'moment'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { createFetchRelated, createErrorHandler } from 'src/views/CRUD/utils'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import DeleteModal from 'src/components/DeleteModal'; import { Tooltip } from 'src/components/Tooltip'; diff --git a/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx b/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx index efb15440451e3..cd089e014d0c8 100644 --- a/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx +++ b/superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx @@ -39,7 +39,7 @@ import ListView, { } from 'src/components/ListView'; import { getFromLocalStorage } from 'src/utils/localStorageHelpers'; import Owner from 'src/types/Owner'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import FacePile from 'src/components/FacePile'; import Icons from 'src/components/Icons'; import FaveStar from 'src/components/FaveStar'; diff --git a/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx b/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx index e8d693d679c8a..73a0f8e9cc080 100644 --- a/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx +++ b/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx @@ -25,8 +25,8 @@ import markdownSyntax from 'react-syntax-highlighter/dist/cjs/languages/hljs/mar import jsonSyntax from 'react-syntax-highlighter/dist/cjs/languages/hljs/json'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light'; -import { ToastProps } from 'src/messageToasts/enhancers/withToasts'; import Icons from 'src/components/Icons'; +import { ToastProps } from 'src/components/MessageToasts/withToasts'; import copyTextToClipboard from 'src/utils/copy'; SyntaxHighlighter.registerLanguage('sql', sqlSyntax); diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx index 560ab1f5cd68b..8c83b7f5bf663 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx @@ -22,7 +22,7 @@ import Loading from 'src/components/Loading'; import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { createErrorHandler } from 'src/views/CRUD/utils'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import DeleteModal from 'src/components/DeleteModal'; import { Tooltip } from 'src/components/Tooltip'; diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx index 82db9e7f17da6..1cb3082680537 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -36,7 +36,7 @@ import Modal from 'src/components/Modal'; import Button from 'src/components/Button'; import IconButton from 'src/components/IconButton'; import InfoTooltip from 'src/components/InfoTooltip'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { testDatabaseConnection, useSingleViewResource, diff --git a/superset-frontend/src/views/CRUD/data/dataset/AddDatasetModal.tsx b/superset-frontend/src/views/CRUD/data/dataset/AddDatasetModal.tsx index ec6eaa2317a31..3fa1a94d14574 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/AddDatasetModal.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/AddDatasetModal.tsx @@ -22,7 +22,7 @@ import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { isEmpty, isNil } from 'lodash'; import Modal from 'src/components/Modal'; import TableSelector from 'src/components/TableSelector'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; type DatasetAddObject = { id: number; diff --git a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx index 496decf71e774..bf8b548ad958b 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx @@ -46,7 +46,7 @@ import SubMenu, { } from 'src/components/Menu/SubMenu'; import { commonMenuData } from 'src/views/CRUD/data/common'; import Owner from 'src/types/Owner'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { Tooltip } from 'src/components/Tooltip'; import Icons from 'src/components/Icons'; import FacePile from 'src/components/FacePile'; diff --git a/superset-frontend/src/views/CRUD/data/query/QueryList.tsx b/superset-frontend/src/views/CRUD/data/query/QueryList.tsx index 1cfe5c2349c80..230b2bb78abfe 100644 --- a/superset-frontend/src/views/CRUD/data/query/QueryList.tsx +++ b/superset-frontend/src/views/CRUD/data/query/QueryList.tsx @@ -25,7 +25,7 @@ import { createErrorHandler, shortenSQL, } from 'src/views/CRUD/utils'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { useListViewResource } from 'src/views/CRUD/hooks'; import SubMenu, { SubMenuProps } from 'src/components/Menu/SubMenu'; import Popover from 'src/components/Popover'; diff --git a/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.tsx b/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.tsx index cea45a9f76c03..458b8c1fbb1a2 100644 --- a/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.tsx +++ b/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.tsx @@ -21,7 +21,9 @@ import { styled, t } from '@superset-ui/core'; import Modal from 'src/components/Modal'; import cx from 'classnames'; import Button from 'src/components/Button'; -import withToasts, { ToastProps } from 'src/messageToasts/enhancers/withToasts'; +import withToasts, { + ToastProps, +} from 'src/components/MessageToasts/withToasts'; import SyntaxHighlighterCopy from 'src/views/CRUD/data/components/SyntaxHighlighterCopy'; import { useQueryPreviewState } from 'src/views/CRUD/data/hooks'; import { QueryObject } from 'src/views/CRUD/types'; diff --git a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx index 9c18e9df19f3a..25eb4933eddd1 100644 --- a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx +++ b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx @@ -27,7 +27,7 @@ import { createErrorHandler, } from 'src/views/CRUD/utils'; import Popover from 'src/components/Popover'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { useListViewResource } from 'src/views/CRUD/hooks'; import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; import handleResourceExport from 'src/utils/export'; diff --git a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryPreviewModal.tsx b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryPreviewModal.tsx index 6f556b279d6f7..d14b32166230a 100644 --- a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryPreviewModal.tsx +++ b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryPreviewModal.tsx @@ -21,7 +21,9 @@ import { styled, t } from '@superset-ui/core'; import Modal from 'src/components/Modal'; import Button from 'src/components/Button'; import SyntaxHighlighterCopy from 'src/views/CRUD/data/components/SyntaxHighlighterCopy'; -import withToasts, { ToastProps } from 'src/messageToasts/enhancers/withToasts'; +import withToasts, { + ToastProps, +} from 'src/components/MessageToasts/withToasts'; import { useQueryPreviewState } from 'src/views/CRUD/data/hooks'; const QueryTitle = styled.div` diff --git a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx index d487e8a246c8b..b7d81b37f3906 100644 --- a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx @@ -28,7 +28,7 @@ import { setInLocalStorage, getFromLocalStorage, } from 'src/utils/localStorageHelpers'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { useHistory } from 'react-router-dom'; import { TableTabTypes } from 'src/views/CRUD/types'; import PropertiesModal from 'src/explore/components/PropertiesModal'; diff --git a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx index a6c470aae9a42..4f8c1ff008349 100644 --- a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx @@ -38,8 +38,7 @@ import { PAGE_SIZE, } from 'src/views/CRUD/utils'; import { HOMEPAGE_DASHBOARD_FILTER } from 'src/views/CRUD/storageKeys'; - -import withToasts from 'src/messageToasts/enhancers/withToasts'; +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'; diff --git a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx index 4a20b389f532e..6bf50fa17af24 100644 --- a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx +++ b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx @@ -21,8 +21,8 @@ import { t, SupersetClient, styled, useTheme } from '@superset-ui/core'; import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light'; import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; import { LoadingCards } from 'src/views/CRUD/welcome/Welcome'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { Dropdown, Menu } from 'src/common/components'; import { useListViewResource, copyQueryLink } from 'src/views/CRUD/hooks'; import ListViewCard from 'src/components/ListViewCard'; diff --git a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx index 63d7776178b3b..8b59fbcad32dd 100644 --- a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx +++ b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx @@ -26,7 +26,7 @@ import { setInLocalStorage, } from 'src/utils/localStorageHelpers'; import ListViewCard from 'src/components/ListViewCard'; -import withToasts from 'src/messageToasts/enhancers/withToasts'; +import withToasts from 'src/components/MessageToasts/withToasts'; import { createErrorHandler, getRecentAcitivtyObjs, diff --git a/superset-frontend/src/views/store.ts b/superset-frontend/src/views/store.ts index 4704da8d0394e..651b50fa640b2 100644 --- a/superset-frontend/src/views/store.ts +++ b/superset-frontend/src/views/store.ts @@ -18,7 +18,7 @@ */ import { applyMiddleware, combineReducers, compose, createStore } from 'redux'; import thunk from 'redux-thunk'; -import messageToastReducer from 'src/messageToasts/reducers'; +import messageToastReducer from 'src/components/MessageToasts/reducers'; import { initEnhancer } from 'src/reduxUtils'; import charts from 'src/chart/chartReducer'; import dataMask from 'src/dataMask/reducer';