You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gr...@apache.org on 2020/09/24 18:20:07 UTC
[incubator-superset] branch
revert-10868-eslint/default-props-match-prop-types created (now c3b6d4f)
This is an automated email from the ASF dual-hosted git repository.
graceguo pushed a change to branch revert-10868-eslint/default-props-match-prop-types
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.
at c3b6d4f Revert "ESLint: Re-enable rule default-props-match-prop-types (#10868)"
This branch includes the following new commits:
new c3b6d4f Revert "ESLint: Re-enable rule default-props-match-prop-types (#10868)"
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-superset] 01/01: Revert "ESLint: Re-enable rule
default-props-match-prop-types (#10868)"
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
graceguo pushed a commit to branch revert-10868-eslint/default-props-match-prop-types
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit c3b6d4fa7faa351109dee91cfd80ee9ce42fa96b
Author: Grace Guo <gr...@airbnb.com>
AuthorDate: Thu Sep 24 11:19:49 2020 -0700
Revert "ESLint: Re-enable rule default-props-match-prop-types (#10868)"
This reverts commit 9f01a7fdf8dd834c9aaa04cfe06d512ead6a19ef.
---
superset-frontend/.eslintrc.js | 2 ++
.../dashboard/components/DashboardBuilder_spec.jsx | 3 +++
superset-frontend/src/CRUD/Field.jsx | 3 ++-
.../src/SqlLab/components/ExploreCtasResultsButton.jsx | 5 +++++
.../src/SqlLab/components/SqlEditorLeftBar.jsx | 2 +-
.../src/SqlLab/components/TemplateParamsEditor.jsx | 2 ++
superset-frontend/src/components/Hotkeys.jsx | 5 +++++
.../src/components/Select/OnPasteSelect.jsx | 6 +++---
.../dashboard/components/ColorSchemeControlWrapper.jsx | 4 ++--
.../src/dashboard/components/DashboardBuilder.jsx | 17 ++++++++++++++++-
.../src/dashboard/components/PropertiesModal.jsx | 2 +-
.../src/dashboard/components/SliceAdder.jsx | 2 +-
.../src/dashboard/components/SliceHeader.jsx | 1 +
.../src/dashboard/components/gridComponents/Row.jsx | 5 +++++
.../src/dashboard/components/gridComponents/Tabs.jsx | 1 +
.../src/dashboard/components/menu/WithPopoverMenu.jsx | 1 +
.../src/dashboard/containers/DashboardBuilder.jsx | 4 ++++
.../src/dashboard/containers/DashboardComponent.jsx | 1 +
.../src/explore/components/QueryAndSaveBtns.jsx | 1 +
.../explore/components/controls/ColorSchemeControl.jsx | 4 ++--
.../src/explore/components/controls/ViewportControl.jsx | 2 +-
21 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js
index 0ee3856..c2f9184 100644
--- a/superset-frontend/.eslintrc.js
+++ b/superset-frontend/.eslintrc.js
@@ -122,6 +122,7 @@ module.exports = {
'padded-blocks': 0,
'prefer-arrow-callback': 0,
'prefer-destructuring': ['error', { object: true, array: false }],
+ 'react/default-props-match-prop-types': 0, // disabled temporarily
'react/destructuring-assignment': 0, // re-enable up for discussion
'react/forbid-prop-types': 0,
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
@@ -232,6 +233,7 @@ module.exports = {
'prefer-arrow-callback': 0,
'prefer-object-spread': 1,
'prefer-destructuring': ['error', { object: true, array: false }],
+ 'react/default-props-match-prop-types': 0, // disabled temporarily
'react/destructuring-assignment': 0, // re-enable up for discussion
'react/forbid-prop-types': 0,
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
diff --git a/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx b/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
index 5de2135..82211c4 100644
--- a/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
+++ b/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
@@ -62,6 +62,9 @@ describe('DashboardBuilder', () => {
dashboardLayout,
deleteTopLevelTabs() {},
editMode: false,
+ showBuilderPane() {},
+ setColorSchemeAndUnsavedChanges() {},
+ colorScheme: undefined,
handleComponentDrop() {},
setDirectPathToChild: sinon.spy(),
};
diff --git a/superset-frontend/src/CRUD/Field.jsx b/superset-frontend/src/CRUD/Field.jsx
index 3ed439f..3d56019 100644
--- a/superset-frontend/src/CRUD/Field.jsx
+++ b/superset-frontend/src/CRUD/Field.jsx
@@ -39,9 +39,10 @@ const propTypes = {
compact: PropTypes.bool,
};
const defaultProps = {
+ controlProps: {},
onChange: () => {},
compact: false,
- description: null,
+ desc: null,
};
export default class Field extends React.PureComponent {
diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx
index 3c3e203..0fac3d1 100644
--- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx
+++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx
@@ -37,6 +37,10 @@ const propTypes = {
templateParams: PropTypes.string,
};
+const defaultProps = {
+ vizRequest: {},
+};
+
class ExploreCtasResultsButton extends React.PureComponent {
constructor(props) {
super(props);
@@ -109,6 +113,7 @@ class ExploreCtasResultsButton extends React.PureComponent {
}
}
ExploreCtasResultsButton.propTypes = propTypes;
+ExploreCtasResultsButton.defaultProps = defaultProps;
function mapStateToProps({ sqlLab, common }) {
return {
diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar.jsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar.jsx
index 66a5385..552ba4c 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar.jsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar.jsx
@@ -25,7 +25,7 @@ import TableSelector from '../../components/TableSelector';
const propTypes = {
queryEditor: PropTypes.object.isRequired,
- height: PropTypes.number,
+ height: PropTypes.number.isRequired,
tables: PropTypes.array,
actions: PropTypes.object,
database: PropTypes.object,
diff --git a/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx b/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx
index 4552576..a15f563 100644
--- a/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx
+++ b/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx
@@ -33,6 +33,8 @@ const propTypes = {
};
const defaultProps = {
+ label: null,
+ description: null,
onChange: () => {},
code: '{}',
};
diff --git a/superset-frontend/src/components/Hotkeys.jsx b/superset-frontend/src/components/Hotkeys.jsx
index 546d3ed..c0d4707 100644
--- a/superset-frontend/src/components/Hotkeys.jsx
+++ b/superset-frontend/src/components/Hotkeys.jsx
@@ -33,6 +33,10 @@ const propTypes = {
placement: PropTypes.string,
};
+const defaultProps = {
+ hotkeys: [],
+};
+
export default class Hotkeys extends React.PureComponent {
componentDidMount() {
this.props.hotkeys.forEach(keyConfig => {
@@ -82,3 +86,4 @@ export default class Hotkeys extends React.PureComponent {
}
Hotkeys.propTypes = propTypes;
+Hotkeys.defaultProps = defaultProps;
diff --git a/superset-frontend/src/components/Select/OnPasteSelect.jsx b/superset-frontend/src/components/Select/OnPasteSelect.jsx
index e7d08ae..fcf1e10 100644
--- a/superset-frontend/src/components/Select/OnPasteSelect.jsx
+++ b/superset-frontend/src/components/Select/OnPasteSelect.jsx
@@ -81,12 +81,12 @@ export default class OnPasteSelect extends React.Component {
}
OnPasteSelect.propTypes = {
- separator: PropTypes.array,
+ separator: PropTypes.array.isRequired,
selectWrap: PropTypes.elementType,
selectRef: PropTypes.func,
onChange: PropTypes.func.isRequired,
- valueKey: PropTypes.string,
- labelKey: PropTypes.string,
+ valueKey: PropTypes.string.isRequired,
+ labelKey: PropTypes.string.isRequired,
options: PropTypes.array,
isMulti: PropTypes.bool,
value: PropTypes.any,
diff --git a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
index d607946..b2e14d1 100644
--- a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
+++ b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
@@ -24,13 +24,13 @@ import { getCategoricalSchemeRegistry, t } from '@superset-ui/core';
import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl';
const propTypes = {
- onChange: PropTypes.func,
+ onChange: PropTypes.func.isRequired,
colorScheme: PropTypes.string,
};
const defaultProps = {
- onChange: () => {},
colorScheme: undefined,
+ onChange: () => {},
};
class ColorSchemeControlWrapper extends React.PureComponent {
diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder.jsx b/superset-frontend/src/dashboard/components/DashboardBuilder.jsx
index 3f798c1..ecaf3cf 100644
--- a/superset-frontend/src/dashboard/components/DashboardBuilder.jsx
+++ b/superset-frontend/src/dashboard/components/DashboardBuilder.jsx
@@ -54,6 +54,9 @@ const propTypes = {
dashboardLayout: PropTypes.object.isRequired,
deleteTopLevelTabs: PropTypes.func.isRequired,
editMode: PropTypes.bool.isRequired,
+ showBuilderPane: PropTypes.func.isRequired,
+ colorScheme: PropTypes.string,
+ setColorSchemeAndUnsavedChanges: PropTypes.func.isRequired,
handleComponentDrop: PropTypes.func.isRequired,
directPathToChild: PropTypes.arrayOf(PropTypes.string),
setDirectPathToChild: PropTypes.func.isRequired,
@@ -61,7 +64,9 @@ const propTypes = {
};
const defaultProps = {
+ showBuilderPane: false,
directPathToChild: [],
+ colorScheme: undefined,
};
class DashboardBuilder extends React.Component {
@@ -150,7 +155,14 @@ class DashboardBuilder extends React.Component {
}
render() {
- const { handleComponentDrop, dashboardLayout, editMode } = this.props;
+ const {
+ handleComponentDrop,
+ dashboardLayout,
+ editMode,
+ showBuilderPane,
+ setColorSchemeAndUnsavedChanges,
+ colorScheme,
+ } = this.props;
const { tabIndex } = this.state;
const dashboardRoot = dashboardLayout[DASHBOARD_ROOT_ID];
const rootChildId = dashboardRoot.children[0];
@@ -260,6 +272,9 @@ class DashboardBuilder extends React.Component {
{editMode && (
<BuilderComponentPane
topOffset={HEADER_HEIGHT + (topLevelTabs ? TABS_HEIGHT : 0)}
+ showBuilderPane={showBuilderPane}
+ setColorSchemeAndUnsavedChanges={setColorSchemeAndUnsavedChanges}
+ colorScheme={colorScheme}
/>
)}
</div>
diff --git a/superset-frontend/src/dashboard/components/PropertiesModal.jsx b/superset-frontend/src/dashboard/components/PropertiesModal.jsx
index 2637f51..57f3482 100644
--- a/superset-frontend/src/dashboard/components/PropertiesModal.jsx
+++ b/superset-frontend/src/dashboard/components/PropertiesModal.jsx
@@ -35,7 +35,7 @@ import '../stylesheets/buttons.less';
const propTypes = {
dashboardId: PropTypes.number.isRequired,
- show: PropTypes.bool,
+ show: PropTypes.bool.isRequired,
onHide: PropTypes.func,
colorScheme: PropTypes.object,
setColorSchemeAndUnsavedChanges: PropTypes.func,
diff --git a/superset-frontend/src/dashboard/components/SliceAdder.jsx b/superset-frontend/src/dashboard/components/SliceAdder.jsx
index 80d80cb..9034a81 100644
--- a/superset-frontend/src/dashboard/components/SliceAdder.jsx
+++ b/superset-frontend/src/dashboard/components/SliceAdder.jsx
@@ -39,7 +39,7 @@ const propTypes = {
lastUpdated: PropTypes.number.isRequired,
errorMessage: PropTypes.string,
userId: PropTypes.string.isRequired,
- selectedSliceIds: PropTypes.arrayOf(PropTypes.number),
+ selectedSliceIds: PropTypes.arrayOf(PropTypes.number).isRequired,
editMode: PropTypes.bool,
height: PropTypes.number,
};
diff --git a/superset-frontend/src/dashboard/components/SliceHeader.jsx b/superset-frontend/src/dashboard/components/SliceHeader.jsx
index 276d36a..941c0ad 100644
--- a/superset-frontend/src/dashboard/components/SliceHeader.jsx
+++ b/superset-frontend/src/dashboard/components/SliceHeader.jsx
@@ -53,6 +53,7 @@ const propTypes = {
const defaultProps = {
innerRef: null,
forceRefresh: () => ({}),
+ removeSlice: () => ({}),
updateSliceName: () => ({}),
toggleExpandSlice: () => ({}),
exploreChart: () => ({}),
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Row.jsx b/superset-frontend/src/dashboard/components/gridComponents/Row.jsx
index f98cac9..f9076bc 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Row.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Row.jsx
@@ -56,6 +56,10 @@ const propTypes = {
updateComponents: PropTypes.func.isRequired,
};
+const defaultProps = {
+ rowHeight: null,
+};
+
class Row extends React.PureComponent {
constructor(props) {
super(props);
@@ -188,5 +192,6 @@ class Row extends React.PureComponent {
}
Row.propTypes = propTypes;
+Row.defaultProps = defaultProps;
export default Row;
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
index 1765ebb..b765cbf 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
@@ -69,6 +69,7 @@ const propTypes = {
};
const defaultProps = {
+ children: null,
renderTabContent: true,
renderHoverMenu: true,
availableColumnCount: 0,
diff --git a/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.jsx b/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.jsx
index eb43901..42158dc 100644
--- a/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.jsx
+++ b/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.jsx
@@ -35,6 +35,7 @@ const defaultProps = {
children: null,
disableClick: false,
onChangeFocus: null,
+ onPressDelete() {},
menuItems: [],
isFocused: false,
shouldFocus: (event, container) =>
diff --git a/superset-frontend/src/dashboard/containers/DashboardBuilder.jsx b/superset-frontend/src/dashboard/containers/DashboardBuilder.jsx
index 9d06e77..dacdb7b 100644
--- a/superset-frontend/src/dashboard/containers/DashboardBuilder.jsx
+++ b/superset-frontend/src/dashboard/containers/DashboardBuilder.jsx
@@ -21,6 +21,7 @@ import { connect } from 'react-redux';
import DashboardBuilder from '../components/DashboardBuilder';
import {
+ setColorSchemeAndUnsavedChanges,
showBuilderPane,
setDirectPathToChild,
setMountedTab,
@@ -34,7 +35,9 @@ function mapStateToProps({ dashboardLayout: undoableLayout, dashboardState }) {
return {
dashboardLayout: undoableLayout.present,
editMode: dashboardState.editMode,
+ showBuilderPane: dashboardState.showBuilderPane,
directPathToChild: dashboardState.directPathToChild,
+ colorScheme: dashboardState.colorScheme,
};
}
@@ -44,6 +47,7 @@ function mapDispatchToProps(dispatch) {
deleteTopLevelTabs,
handleComponentDrop,
showBuilderPane,
+ setColorSchemeAndUnsavedChanges,
setDirectPathToChild,
setMountedTab,
},
diff --git a/superset-frontend/src/dashboard/containers/DashboardComponent.jsx b/superset-frontend/src/dashboard/containers/DashboardComponent.jsx
index aaa7da3..d4a403f 100644
--- a/superset-frontend/src/dashboard/containers/DashboardComponent.jsx
+++ b/superset-frontend/src/dashboard/containers/DashboardComponent.jsx
@@ -53,6 +53,7 @@ const propTypes = {
const defaultProps = {
directPathToChild: [],
directPathLastUpdated: 0,
+ isComponentVisible: true,
};
function mapStateToProps(
diff --git a/superset-frontend/src/explore/components/QueryAndSaveBtns.jsx b/superset-frontend/src/explore/components/QueryAndSaveBtns.jsx
index d04cf9d..e169dc4 100644
--- a/superset-frontend/src/explore/components/QueryAndSaveBtns.jsx
+++ b/superset-frontend/src/explore/components/QueryAndSaveBtns.jsx
@@ -37,6 +37,7 @@ const propTypes = {
const defaultProps = {
onStop: () => {},
onSave: () => {},
+ disabled: false,
};
// Prolly need to move this to a global context
diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx
index 0d3a56e..4b9d6e4 100644
--- a/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx
+++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl.jsx
@@ -35,8 +35,8 @@ const propTypes = {
choices: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.array),
PropTypes.func,
- ]),
- schemes: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
+ ]).isRequired,
+ schemes: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired,
isLinear: PropTypes.bool,
};
diff --git a/superset-frontend/src/explore/components/controls/ViewportControl.jsx b/superset-frontend/src/explore/components/controls/ViewportControl.jsx
index 11731b1..9aa6be1 100644
--- a/superset-frontend/src/explore/components/controls/ViewportControl.jsx
+++ b/superset-frontend/src/explore/components/controls/ViewportControl.jsx
@@ -37,7 +37,7 @@ export const DEFAULT_VIEWPORT = {
const PARAMS = ['longitude', 'latitude', 'zoom', 'bearing', 'pitch'];
const propTypes = {
- onChange: PropTypes.func,
+ onChange: PropTypes.func.isRequired,
value: PropTypes.shape({
longitude: PropTypes.number,
latitude: PropTypes.number,