diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index 95c687ddcc..37590b53f4 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -86,7 +86,6 @@ module.exports = { '.json': 'always', }, ], - 'import/no-named-as-default': 0, 'import/no-named-as-default-member': 0, 'import/prefer-default-export': 0, indent: 0, @@ -200,7 +199,6 @@ module.exports = { }, ], 'import/no-cycle': 0, // re-enable up for discussion, might require some major refactors - 'import/no-named-as-default': 0, 'import/prefer-default-export': 0, indent: 0, 'jsx-a11y/anchor-is-valid': 0, // disabled temporarily diff --git a/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx b/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx index aa33285cc5..ffcd43b480 100644 --- a/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx @@ -25,7 +25,7 @@ import { shallow } from 'enzyme'; import getInitialState from 'src/explore/reducers/getInitialState'; import ExploreViewContainer from 'src/explore/components/ExploreViewContainer'; import QueryAndSaveBtns from 'src/explore/components/QueryAndSaveBtns'; -import ControlPanelsContainer from 'src/explore/components/ControlPanelsContainer'; +import ConnectedControlPanelsContainer from 'src/explore/components/ControlPanelsContainer'; import ChartContainer from 'src/explore/components/ExploreChartPanel'; import * as featureFlags from 'src/featureFlags'; @@ -72,7 +72,7 @@ describe('ExploreViewContainer', () => { }); it('renders ControlPanelsContainer', () => { - expect(wrapper.find(ControlPanelsContainer)).toExist(); + expect(wrapper.find(ConnectedControlPanelsContainer)).toExist(); }); it('renders ChartContainer', () => { diff --git a/superset-frontend/spec/javascripts/sqllab/SqlEditor_spec.jsx b/superset-frontend/spec/javascripts/sqllab/SqlEditor_spec.jsx index 2498441ebb..15559c7cf8 100644 --- a/superset-frontend/spec/javascripts/sqllab/SqlEditor_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/SqlEditor_spec.jsx @@ -25,7 +25,7 @@ import { } from 'src/SqlLab/constants'; import AceEditorWrapper from 'src/SqlLab/components/AceEditorWrapper'; import LimitControl from 'src/SqlLab/components/LimitControl'; -import SouthPane from 'src/SqlLab/components/SouthPane'; +import ConnectedSouthPane from 'src/SqlLab/components/SouthPane'; import SqlEditor from 'src/SqlLab/components/SqlEditor'; import SqlEditorLeftBar from 'src/SqlLab/components/SqlEditorLeftBar'; @@ -64,15 +64,15 @@ describe('SqlEditor', () => { const wrapper = shallow(); expect(wrapper.find(AceEditorWrapper)).toExist(); }); - it('render an SouthPane', () => { + it('render a SouthPane', () => { const wrapper = shallow(); - expect(wrapper.find(SouthPane)).toExist(); + expect(wrapper.find(ConnectedSouthPane)).toExist(); }); it('does not overflow the editor window', () => { const wrapper = shallow(); const totalSize = parseFloat(wrapper.find(AceEditorWrapper).props().height) + - wrapper.find(SouthPane).props().height + + wrapper.find(ConnectedSouthPane).props().height + SQL_TOOLBAR_HEIGHT + SQL_EDITOR_GUTTER_MARGIN * 2 + SQL_EDITOR_GUTTER_HEIGHT; @@ -83,7 +83,7 @@ describe('SqlEditor', () => { wrapper.setState({ height: 450 }); const totalSize = parseFloat(wrapper.find(AceEditorWrapper).props().height) + - wrapper.find(SouthPane).props().height + + wrapper.find(ConnectedSouthPane).props().height + SQL_TOOLBAR_HEIGHT + SQL_EDITOR_GUTTER_MARGIN * 2 + SQL_EDITOR_GUTTER_HEIGHT; diff --git a/superset-frontend/src/SqlLab/components/App.jsx b/superset-frontend/src/SqlLab/components/App.jsx index f10c3f629f..5934542611 100644 --- a/superset-frontend/src/SqlLab/components/App.jsx +++ b/superset-frontend/src/SqlLab/components/App.jsx @@ -169,5 +169,4 @@ function mapDispatchToProps(dispatch) { }; } -export { App }; export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx index 5c6f78f2fe..0fac3d1159 100644 --- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx +++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx @@ -128,7 +128,6 @@ function mapDispatchToProps(dispatch) { }; } -export { ExploreCtasResultsButton }; export default connect( mapStateToProps, mapDispatchToProps, diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx index 0e3661d9a5..388e74f195 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx @@ -253,7 +253,6 @@ function mapDispatchToProps(dispatch) { }; } -export { ExploreResultsButton }; export default connect( mapStateToProps, mapDispatchToProps, diff --git a/superset-frontend/src/SqlLab/components/SqlEditor.jsx b/superset-frontend/src/SqlLab/components/SqlEditor.jsx index a95dbd038b..7a3455e225 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor.jsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor.jsx @@ -40,7 +40,7 @@ import Hotkeys from 'src/components/Hotkeys'; import LimitControl from './LimitControl'; import TemplateParamsEditor from './TemplateParamsEditor'; -import SouthPane from './SouthPane'; +import ConnectedSouthPane from './SouthPane'; import SaveQuery from './SaveQuery'; import ScheduleQueryButton from './ScheduleQueryButton'; import EstimateQueryCostButton from './EstimateQueryCostButton'; @@ -389,7 +389,7 @@ class SqlEditor extends React.PureComponent { /> {this.renderEditorBottomBar(hotkeys)} - {}, }; -export class DatasourceEditor extends React.PureComponent { +class DatasourceEditor extends React.PureComponent { constructor(props) { super(props); this.state = { diff --git a/superset-frontend/src/explore/components/ExploreActionButtons.jsx b/superset-frontend/src/explore/components/ExploreActionButtons.jsx index b509de9832..26ba334387 100644 --- a/superset-frontend/src/explore/components/ExploreActionButtons.jsx +++ b/superset-frontend/src/explore/components/ExploreActionButtons.jsx @@ -23,7 +23,7 @@ import { t } from '@superset-ui/core'; import URLShortLinkButton from '../../components/URLShortLinkButton'; import EmbedCodeButton from './EmbedCodeButton'; -import DisplayQueryButton from './DisplayQueryButton'; +import ConnectedDisplayQueryButton from './DisplayQueryButton'; import { exportChart, getExploreLongUrl } from '../exploreUtils'; const propTypes = { @@ -100,7 +100,7 @@ export default function ExploreActionButtons({ .csv )} - - ({}))(SaveModal); diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx b/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx index 8c0b750b2f..49e1fac313 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayer.jsx @@ -34,8 +34,9 @@ import SelectControl from './SelectControl'; import TextControl from './TextControl'; import CheckboxControl from './CheckboxControl'; -import ANNOTATION_TYPES, { +import { ANNOTATION_SOURCE_TYPES, + ANNOTATION_TYPES, ANNOTATION_TYPES_METADATA, DEFAULT_ANNOTATION_TYPE, requiresQuery, diff --git a/superset-frontend/src/explore/controls.jsx b/superset-frontend/src/explore/controls.jsx index 7b71015ef1..1c77938671 100644 --- a/superset-frontend/src/explore/controls.jsx +++ b/superset-frontend/src/explore/controls.jsx @@ -501,4 +501,3 @@ export const controls = { }), }, }; -export default controls; diff --git a/superset-frontend/src/explore/store.js b/superset-frontend/src/explore/store.js index 3ab2b07167..083ed5866f 100644 --- a/superset-frontend/src/explore/store.js +++ b/superset-frontend/src/explore/store.js @@ -19,7 +19,7 @@ /* eslint camelcase: 0 */ import { getChartControlPanelRegistry } from '@superset-ui/core'; import { getAllControlsState, getFormDataFromControls } from './controlUtils'; -import controls from './controls'; +import { controls } from './controls'; function handleDeprecatedControls(formData) { // Reacffectation / handling of deprecated controls diff --git a/superset-frontend/src/modules/AnnotationTypes.js b/superset-frontend/src/modules/AnnotationTypes.js index 99c639c538..5741788a6a 100644 --- a/superset-frontend/src/modules/AnnotationTypes.js +++ b/superset-frontend/src/modules/AnnotationTypes.js @@ -77,5 +77,3 @@ export function applyNativeColumns(annotation) { } return annotation; } - -export default ANNOTATION_TYPES; diff --git a/superset-frontend/src/utils/getControlsForVizType.js b/superset-frontend/src/utils/getControlsForVizType.js index 0dac5be088..ec6930f070 100644 --- a/superset-frontend/src/utils/getControlsForVizType.js +++ b/superset-frontend/src/utils/getControlsForVizType.js @@ -19,7 +19,7 @@ import memoize from 'lodash/memoize'; import { getChartControlPanelRegistry } from '@superset-ui/core'; -import controls from '../explore/controls'; +import { controls } from '../explore/controls'; const getControlsForVizType = memoize(vizType => { const controlsMap = {}; diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx index 311b717199..eb8c4bce7c 100644 --- a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx +++ b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx @@ -29,7 +29,7 @@ import FormLabel from 'src/components/FormLabel'; import DateFilterControl from 'src/explore/components/controls/DateFilterControl'; import ControlRow from 'src/explore/components/ControlRow'; import Control from 'src/explore/components/Control'; -import controls from 'src/explore/controls'; +import { controls } from 'src/explore/controls'; import { getExploreUrl } from 'src/explore/exploreUtils'; import OnPasteSelect from 'src/components/Select/OnPasteSelect'; import { getDashboardFilterKey } from 'src/dashboard/util/getDashboardFilterKey';