mirror of
https://github.com/apache/superset.git
synced 2026-05-11 02:45:46 +00:00
Re-enable rule prefer-destructuring (only for objects) (#10867)
This commit is contained in:
committed by
GitHub
parent
c51168a30a
commit
352e8a1afd
@@ -104,7 +104,7 @@ export default class AdhocFilterControl extends React.Component {
|
||||
})
|
||||
.then(({ json }) => {
|
||||
if (json && json.partitions) {
|
||||
const partitions = json.partitions;
|
||||
const { partitions } = json;
|
||||
// for now only show latest_partition option
|
||||
// when table datasource has only 1 partition key.
|
||||
if (
|
||||
|
||||
@@ -427,7 +427,7 @@ export default class AnnotationLayer extends React.PureComponent {
|
||||
intervalEndColumn,
|
||||
descriptionColumns,
|
||||
} = this.state;
|
||||
const slice = (valueOptions.find(x => x.value === value) || {}).slice;
|
||||
const { slice } = valueOptions.find(x => x.value === value) || {};
|
||||
if (sourceType !== ANNOTATION_SOURCE_TYPES.NATIVE && slice) {
|
||||
const columns = (slice.data.groupby || [])
|
||||
.concat(slice.data.all_columns || [])
|
||||
|
||||
@@ -97,7 +97,7 @@ class DatasourceControl extends React.PureComponent {
|
||||
}
|
||||
|
||||
renderDatasource() {
|
||||
const datasource = this.props.datasource;
|
||||
const { datasource } = this.props;
|
||||
return (
|
||||
<div className="m-t-10">
|
||||
<Well className="m-t-0">
|
||||
|
||||
@@ -207,7 +207,7 @@ class DateFilterControl extends React.Component {
|
||||
untilViewMode: 'days',
|
||||
};
|
||||
|
||||
const value = props.value;
|
||||
const { value } = props;
|
||||
if (value.indexOf(SEPARATOR) >= 0) {
|
||||
this.state = { ...this.state, ...getStateFromSeparator(value) };
|
||||
} else if (COMMON_TIME_FRAMES.indexOf(value) >= 0) {
|
||||
@@ -282,7 +282,7 @@ class DateFilterControl extends React.Component {
|
||||
}
|
||||
|
||||
handleClick(e) {
|
||||
const target = e.target;
|
||||
const { target } = e;
|
||||
// switch to `TYPES.CUSTOM_START_END` when the calendar is clicked
|
||||
if (this.startEndSectionRef && this.startEndSectionRef.contains(target)) {
|
||||
this.setTypeCustomStartEnd();
|
||||
|
||||
@@ -104,7 +104,7 @@ function coerceAdhocMetrics(value) {
|
||||
}
|
||||
|
||||
function getDefaultAggregateForColumn(column) {
|
||||
const type = column.type;
|
||||
const { type } = column;
|
||||
if (typeof type !== 'string') {
|
||||
return AGGREGATES.COUNT;
|
||||
} else if (type === '' || type === 'expression') {
|
||||
|
||||
@@ -173,7 +173,7 @@ export default class SelectControl extends React.PureComponent {
|
||||
}
|
||||
|
||||
handleKeyDownForCreate(event) {
|
||||
const key = event.key;
|
||||
const { key } = event;
|
||||
if (key === 'Tab' || (this.props.commaChoosesOption && key === ',')) {
|
||||
// simulate an Enter event
|
||||
if (this.select) {
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class SpatialControl extends React.Component {
|
||||
this.onChange();
|
||||
}
|
||||
onChange() {
|
||||
const type = this.state.type;
|
||||
const { type } = this.state;
|
||||
const value = { type };
|
||||
const errors = [];
|
||||
const errMsg = t('Invalid lat/long configuration.');
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class TextControl extends React.Component<TextControlProps> {
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
onChange(event: any) {
|
||||
let value = event.target.value;
|
||||
let { value } = event.target;
|
||||
|
||||
// Validation & casting
|
||||
const errors = [];
|
||||
|
||||
Reference in New Issue
Block a user