This reverts commit 9f01a7fdf8.
This commit is contained in:
parent
eded51b2f8
commit
f99753a800
|
|
@ -122,6 +122,7 @@ module.exports = {
|
||||||
'padded-blocks': 0,
|
'padded-blocks': 0,
|
||||||
'prefer-arrow-callback': 0,
|
'prefer-arrow-callback': 0,
|
||||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
'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/destructuring-assignment': 0, // re-enable up for discussion
|
||||||
'react/forbid-prop-types': 0,
|
'react/forbid-prop-types': 0,
|
||||||
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
|
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
|
||||||
|
|
@ -232,6 +233,7 @@ module.exports = {
|
||||||
'prefer-arrow-callback': 0,
|
'prefer-arrow-callback': 0,
|
||||||
'prefer-object-spread': 1,
|
'prefer-object-spread': 1,
|
||||||
'prefer-destructuring': ['error', { object: true, array: false }],
|
'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/destructuring-assignment': 0, // re-enable up for discussion
|
||||||
'react/forbid-prop-types': 0,
|
'react/forbid-prop-types': 0,
|
||||||
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
|
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ describe('DashboardBuilder', () => {
|
||||||
dashboardLayout,
|
dashboardLayout,
|
||||||
deleteTopLevelTabs() {},
|
deleteTopLevelTabs() {},
|
||||||
editMode: false,
|
editMode: false,
|
||||||
|
showBuilderPane() {},
|
||||||
|
setColorSchemeAndUnsavedChanges() {},
|
||||||
|
colorScheme: undefined,
|
||||||
handleComponentDrop() {},
|
handleComponentDrop() {},
|
||||||
setDirectPathToChild: sinon.spy(),
|
setDirectPathToChild: sinon.spy(),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,10 @@ const propTypes = {
|
||||||
compact: PropTypes.bool,
|
compact: PropTypes.bool,
|
||||||
};
|
};
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
controlProps: {},
|
||||||
onChange: () => {},
|
onChange: () => {},
|
||||||
compact: false,
|
compact: false,
|
||||||
description: null,
|
desc: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class Field extends React.PureComponent {
|
export default class Field extends React.PureComponent {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@ const propTypes = {
|
||||||
templateParams: PropTypes.string,
|
templateParams: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultProps = {
|
||||||
|
vizRequest: {},
|
||||||
|
};
|
||||||
|
|
||||||
class ExploreCtasResultsButton extends React.PureComponent {
|
class ExploreCtasResultsButton extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -109,6 +113,7 @@ class ExploreCtasResultsButton extends React.PureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExploreCtasResultsButton.propTypes = propTypes;
|
ExploreCtasResultsButton.propTypes = propTypes;
|
||||||
|
ExploreCtasResultsButton.defaultProps = defaultProps;
|
||||||
|
|
||||||
function mapStateToProps({ sqlLab, common }) {
|
function mapStateToProps({ sqlLab, common }) {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import TableSelector from '../../components/TableSelector';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
queryEditor: PropTypes.object.isRequired,
|
queryEditor: PropTypes.object.isRequired,
|
||||||
height: PropTypes.number,
|
height: PropTypes.number.isRequired,
|
||||||
tables: PropTypes.array,
|
tables: PropTypes.array,
|
||||||
actions: PropTypes.object,
|
actions: PropTypes.object,
|
||||||
database: PropTypes.object,
|
database: PropTypes.object,
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ const propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
label: null,
|
||||||
|
description: null,
|
||||||
onChange: () => {},
|
onChange: () => {},
|
||||||
code: '{}',
|
code: '{}',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ const propTypes = {
|
||||||
placement: PropTypes.string,
|
placement: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultProps = {
|
||||||
|
hotkeys: [],
|
||||||
|
};
|
||||||
|
|
||||||
export default class Hotkeys extends React.PureComponent {
|
export default class Hotkeys extends React.PureComponent {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.hotkeys.forEach(keyConfig => {
|
this.props.hotkeys.forEach(keyConfig => {
|
||||||
|
|
@ -82,3 +86,4 @@ export default class Hotkeys extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
Hotkeys.propTypes = propTypes;
|
Hotkeys.propTypes = propTypes;
|
||||||
|
Hotkeys.defaultProps = defaultProps;
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ export default class OnPasteSelect extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
OnPasteSelect.propTypes = {
|
OnPasteSelect.propTypes = {
|
||||||
separator: PropTypes.array,
|
separator: PropTypes.array.isRequired,
|
||||||
selectWrap: PropTypes.elementType,
|
selectWrap: PropTypes.elementType,
|
||||||
selectRef: PropTypes.func,
|
selectRef: PropTypes.func,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
valueKey: PropTypes.string,
|
valueKey: PropTypes.string.isRequired,
|
||||||
labelKey: PropTypes.string,
|
labelKey: PropTypes.string.isRequired,
|
||||||
options: PropTypes.array,
|
options: PropTypes.array,
|
||||||
isMulti: PropTypes.bool,
|
isMulti: PropTypes.bool,
|
||||||
value: PropTypes.any,
|
value: PropTypes.any,
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,13 @@ import { getCategoricalSchemeRegistry, t } from '@superset-ui/core';
|
||||||
import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl';
|
import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func.isRequired,
|
||||||
colorScheme: PropTypes.string,
|
colorScheme: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
onChange: () => {},
|
|
||||||
colorScheme: undefined,
|
colorScheme: undefined,
|
||||||
|
onChange: () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
class ColorSchemeControlWrapper extends React.PureComponent {
|
class ColorSchemeControlWrapper extends React.PureComponent {
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,9 @@ const propTypes = {
|
||||||
dashboardLayout: PropTypes.object.isRequired,
|
dashboardLayout: PropTypes.object.isRequired,
|
||||||
deleteTopLevelTabs: PropTypes.func.isRequired,
|
deleteTopLevelTabs: PropTypes.func.isRequired,
|
||||||
editMode: PropTypes.bool.isRequired,
|
editMode: PropTypes.bool.isRequired,
|
||||||
|
showBuilderPane: PropTypes.func.isRequired,
|
||||||
|
colorScheme: PropTypes.string,
|
||||||
|
setColorSchemeAndUnsavedChanges: PropTypes.func.isRequired,
|
||||||
handleComponentDrop: PropTypes.func.isRequired,
|
handleComponentDrop: PropTypes.func.isRequired,
|
||||||
directPathToChild: PropTypes.arrayOf(PropTypes.string),
|
directPathToChild: PropTypes.arrayOf(PropTypes.string),
|
||||||
setDirectPathToChild: PropTypes.func.isRequired,
|
setDirectPathToChild: PropTypes.func.isRequired,
|
||||||
|
|
@ -61,7 +64,9 @@ const propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
showBuilderPane: false,
|
||||||
directPathToChild: [],
|
directPathToChild: [],
|
||||||
|
colorScheme: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
class DashboardBuilder extends React.Component {
|
class DashboardBuilder extends React.Component {
|
||||||
|
|
@ -150,7 +155,14 @@ class DashboardBuilder extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { handleComponentDrop, dashboardLayout, editMode } = this.props;
|
const {
|
||||||
|
handleComponentDrop,
|
||||||
|
dashboardLayout,
|
||||||
|
editMode,
|
||||||
|
showBuilderPane,
|
||||||
|
setColorSchemeAndUnsavedChanges,
|
||||||
|
colorScheme,
|
||||||
|
} = this.props;
|
||||||
const { tabIndex } = this.state;
|
const { tabIndex } = this.state;
|
||||||
const dashboardRoot = dashboardLayout[DASHBOARD_ROOT_ID];
|
const dashboardRoot = dashboardLayout[DASHBOARD_ROOT_ID];
|
||||||
const rootChildId = dashboardRoot.children[0];
|
const rootChildId = dashboardRoot.children[0];
|
||||||
|
|
@ -260,6 +272,9 @@ class DashboardBuilder extends React.Component {
|
||||||
{editMode && (
|
{editMode && (
|
||||||
<BuilderComponentPane
|
<BuilderComponentPane
|
||||||
topOffset={HEADER_HEIGHT + (topLevelTabs ? TABS_HEIGHT : 0)}
|
topOffset={HEADER_HEIGHT + (topLevelTabs ? TABS_HEIGHT : 0)}
|
||||||
|
showBuilderPane={showBuilderPane}
|
||||||
|
setColorSchemeAndUnsavedChanges={setColorSchemeAndUnsavedChanges}
|
||||||
|
colorScheme={colorScheme}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ import '../stylesheets/buttons.less';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
dashboardId: PropTypes.number.isRequired,
|
dashboardId: PropTypes.number.isRequired,
|
||||||
show: PropTypes.bool,
|
show: PropTypes.bool.isRequired,
|
||||||
onHide: PropTypes.func,
|
onHide: PropTypes.func,
|
||||||
colorScheme: PropTypes.object,
|
colorScheme: PropTypes.object,
|
||||||
setColorSchemeAndUnsavedChanges: PropTypes.func,
|
setColorSchemeAndUnsavedChanges: PropTypes.func,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ const propTypes = {
|
||||||
lastUpdated: PropTypes.number.isRequired,
|
lastUpdated: PropTypes.number.isRequired,
|
||||||
errorMessage: PropTypes.string,
|
errorMessage: PropTypes.string,
|
||||||
userId: PropTypes.string.isRequired,
|
userId: PropTypes.string.isRequired,
|
||||||
selectedSliceIds: PropTypes.arrayOf(PropTypes.number),
|
selectedSliceIds: PropTypes.arrayOf(PropTypes.number).isRequired,
|
||||||
editMode: PropTypes.bool,
|
editMode: PropTypes.bool,
|
||||||
height: PropTypes.number,
|
height: PropTypes.number,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ const propTypes = {
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
innerRef: null,
|
innerRef: null,
|
||||||
forceRefresh: () => ({}),
|
forceRefresh: () => ({}),
|
||||||
|
removeSlice: () => ({}),
|
||||||
updateSliceName: () => ({}),
|
updateSliceName: () => ({}),
|
||||||
toggleExpandSlice: () => ({}),
|
toggleExpandSlice: () => ({}),
|
||||||
exploreChart: () => ({}),
|
exploreChart: () => ({}),
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ const propTypes = {
|
||||||
updateComponents: PropTypes.func.isRequired,
|
updateComponents: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultProps = {
|
||||||
|
rowHeight: null,
|
||||||
|
};
|
||||||
|
|
||||||
class Row extends React.PureComponent {
|
class Row extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -188,5 +192,6 @@ class Row extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
Row.propTypes = propTypes;
|
Row.propTypes = propTypes;
|
||||||
|
Row.defaultProps = defaultProps;
|
||||||
|
|
||||||
export default Row;
|
export default Row;
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ const propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
children: null,
|
||||||
renderTabContent: true,
|
renderTabContent: true,
|
||||||
renderHoverMenu: true,
|
renderHoverMenu: true,
|
||||||
availableColumnCount: 0,
|
availableColumnCount: 0,
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ const defaultProps = {
|
||||||
children: null,
|
children: null,
|
||||||
disableClick: false,
|
disableClick: false,
|
||||||
onChangeFocus: null,
|
onChangeFocus: null,
|
||||||
|
onPressDelete() {},
|
||||||
menuItems: [],
|
menuItems: [],
|
||||||
isFocused: false,
|
isFocused: false,
|
||||||
shouldFocus: (event, container) =>
|
shouldFocus: (event, container) =>
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import { connect } from 'react-redux';
|
||||||
import DashboardBuilder from '../components/DashboardBuilder';
|
import DashboardBuilder from '../components/DashboardBuilder';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
setColorSchemeAndUnsavedChanges,
|
||||||
showBuilderPane,
|
showBuilderPane,
|
||||||
setDirectPathToChild,
|
setDirectPathToChild,
|
||||||
setMountedTab,
|
setMountedTab,
|
||||||
|
|
@ -34,7 +35,9 @@ function mapStateToProps({ dashboardLayout: undoableLayout, dashboardState }) {
|
||||||
return {
|
return {
|
||||||
dashboardLayout: undoableLayout.present,
|
dashboardLayout: undoableLayout.present,
|
||||||
editMode: dashboardState.editMode,
|
editMode: dashboardState.editMode,
|
||||||
|
showBuilderPane: dashboardState.showBuilderPane,
|
||||||
directPathToChild: dashboardState.directPathToChild,
|
directPathToChild: dashboardState.directPathToChild,
|
||||||
|
colorScheme: dashboardState.colorScheme,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,6 +47,7 @@ function mapDispatchToProps(dispatch) {
|
||||||
deleteTopLevelTabs,
|
deleteTopLevelTabs,
|
||||||
handleComponentDrop,
|
handleComponentDrop,
|
||||||
showBuilderPane,
|
showBuilderPane,
|
||||||
|
setColorSchemeAndUnsavedChanges,
|
||||||
setDirectPathToChild,
|
setDirectPathToChild,
|
||||||
setMountedTab,
|
setMountedTab,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ const propTypes = {
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
directPathToChild: [],
|
directPathToChild: [],
|
||||||
directPathLastUpdated: 0,
|
directPathLastUpdated: 0,
|
||||||
|
isComponentVisible: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
function mapStateToProps(
|
function mapStateToProps(
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ const propTypes = {
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
onStop: () => {},
|
onStop: () => {},
|
||||||
onSave: () => {},
|
onSave: () => {},
|
||||||
|
disabled: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Prolly need to move this to a global context
|
// Prolly need to move this to a global context
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ const propTypes = {
|
||||||
choices: PropTypes.oneOfType([
|
choices: PropTypes.oneOfType([
|
||||||
PropTypes.arrayOf(PropTypes.array),
|
PropTypes.arrayOf(PropTypes.array),
|
||||||
PropTypes.func,
|
PropTypes.func,
|
||||||
]),
|
]).isRequired,
|
||||||
schemes: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
schemes: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired,
|
||||||
isLinear: PropTypes.bool,
|
isLinear: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export const DEFAULT_VIEWPORT = {
|
||||||
const PARAMS = ['longitude', 'latitude', 'zoom', 'bearing', 'pitch'];
|
const PARAMS = ['longitude', 'latitude', 'zoom', 'bearing', 'pitch'];
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func.isRequired,
|
||||||
value: PropTypes.shape({
|
value: PropTypes.shape({
|
||||||
longitude: PropTypes.number,
|
longitude: PropTypes.number,
|
||||||
latitude: PropTypes.number,
|
latitude: PropTypes.number,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue