mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
Re-enable rule line-between-class-members (#10862)
This commit is contained in:
committed by
GitHub
parent
91b8c8afc9
commit
e28f3d6220
@@ -45,6 +45,7 @@ export default class BoundsControl extends React.Component {
|
||||
this.onMinChange = this.onMinChange.bind(this);
|
||||
this.onMaxChange = this.onMaxChange.bind(this);
|
||||
}
|
||||
|
||||
onMinChange(event) {
|
||||
this.setState(
|
||||
{
|
||||
@@ -53,6 +54,7 @@ export default class BoundsControl extends React.Component {
|
||||
this.onChange,
|
||||
);
|
||||
}
|
||||
|
||||
onMaxChange(event) {
|
||||
this.setState(
|
||||
{
|
||||
@@ -61,6 +63,7 @@ export default class BoundsControl extends React.Component {
|
||||
this.onChange,
|
||||
);
|
||||
}
|
||||
|
||||
onChange() {
|
||||
const mm = this.state.minMax;
|
||||
const errors = [];
|
||||
@@ -76,6 +79,7 @@ export default class BoundsControl extends React.Component {
|
||||
this.props.onChange([null, null], errors);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -38,6 +38,7 @@ export default class CheckboxControl extends React.Component {
|
||||
onChange() {
|
||||
this.props.onChange(!this.props.value);
|
||||
}
|
||||
|
||||
renderCheckbox() {
|
||||
return (
|
||||
<Checkbox
|
||||
@@ -47,6 +48,7 @@ export default class CheckboxControl extends React.Component {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.label) {
|
||||
return (
|
||||
|
||||
@@ -68,19 +68,24 @@ export default class CollectionControl extends React.Component {
|
||||
super(props);
|
||||
this.onAdd = this.onAdd.bind(this);
|
||||
}
|
||||
|
||||
onChange(i, value) {
|
||||
Object.assign(this.props.value[i], value);
|
||||
this.props.onChange(this.props.value);
|
||||
}
|
||||
|
||||
onAdd() {
|
||||
this.props.onChange(this.props.value.concat([this.props.itemGenerator()]));
|
||||
}
|
||||
|
||||
onSortEnd({ oldIndex, newIndex }) {
|
||||
this.props.onChange(arrayMove(this.props.value, oldIndex, newIndex));
|
||||
}
|
||||
|
||||
removeItem(i) {
|
||||
this.props.onChange(this.props.value.filter((o, ix) => i !== ix));
|
||||
}
|
||||
|
||||
renderList() {
|
||||
if (this.props.value.length === 0) {
|
||||
return <div className="text-muted">{this.props.placeholder}</div>;
|
||||
@@ -126,6 +131,7 @@ export default class CollectionControl extends React.Component {
|
||||
</SortableListGroup>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="CollectionControl">
|
||||
|
||||
@@ -69,9 +69,11 @@ export default class ColorPickerControl extends React.Component {
|
||||
super(props);
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
|
||||
onChange(col) {
|
||||
this.props.onChange(col.rgb);
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
const presetColors = getCategoricalSchemeRegistry()
|
||||
.get()
|
||||
@@ -86,6 +88,7 @@ export default class ColorPickerControl extends React.Component {
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const c = this.props.value || { r: 0, g: 0, b: 0, a: 0 };
|
||||
const colStyle = {
|
||||
|
||||
@@ -238,11 +238,13 @@ class DateFilterControl extends React.Component {
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('click', this.handleClick);
|
||||
}
|
||||
|
||||
onEnter(event) {
|
||||
if (event.key === 'Enter') {
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
setCustomRange(key, value) {
|
||||
const updatedState = { ...this.state, [key]: value };
|
||||
const combinedValue = [
|
||||
@@ -252,6 +254,7 @@ class DateFilterControl extends React.Component {
|
||||
].join(' ');
|
||||
this.setState(getStateFromCustomRange(combinedValue));
|
||||
}
|
||||
|
||||
setCustomStartEnd(key, value) {
|
||||
const closeCalendar =
|
||||
(key === 'since' && this.state.sinceViewMode === 'days') ||
|
||||
@@ -265,9 +268,11 @@ class DateFilterControl extends React.Component {
|
||||
untilViewMode: closeCalendar ? 'days' : this.state.untilViewMode,
|
||||
});
|
||||
}
|
||||
|
||||
setTypeCustomRange() {
|
||||
this.setState({ type: TYPES.CUSTOM_RANGE });
|
||||
}
|
||||
|
||||
setTypeCustomStartEnd() {
|
||||
this.setState({ type: TYPES.CUSTOM_START_END });
|
||||
}
|
||||
@@ -325,18 +330,21 @@ class DateFilterControl extends React.Component {
|
||||
this.refs.trigger.hide();
|
||||
this.setState({ showSinceCalendar: false, showUntilCalendar: false });
|
||||
}
|
||||
|
||||
isValidSince(date) {
|
||||
return (
|
||||
!isValidMoment(this.state.until) ||
|
||||
date <= moment(this.state.until, MOMENT_FORMAT)
|
||||
);
|
||||
}
|
||||
|
||||
isValidUntil(date) {
|
||||
return (
|
||||
!isValidMoment(this.state.since) ||
|
||||
date >= moment(this.state.since, MOMENT_FORMAT)
|
||||
);
|
||||
}
|
||||
|
||||
toggleCalendar(key) {
|
||||
const nextState = {};
|
||||
if (key === 'showSinceCalendar') {
|
||||
@@ -352,6 +360,7 @@ class DateFilterControl extends React.Component {
|
||||
}
|
||||
this.setState(nextState);
|
||||
}
|
||||
|
||||
renderInput(props, key) {
|
||||
return (
|
||||
<FormGroup>
|
||||
@@ -372,6 +381,7 @@ class DateFilterControl extends React.Component {
|
||||
</FormGroup>
|
||||
);
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
const grainOptions = TIME_GRAIN_OPTIONS.map(grain => (
|
||||
<MenuItem
|
||||
@@ -575,6 +585,7 @@ class DateFilterControl extends React.Component {
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const timeRange = this.props.value || defaultProps.value;
|
||||
return (
|
||||
|
||||
@@ -95,9 +95,11 @@ export default class FilterBoxItemControl extends React.Component {
|
||||
this.onChange = this.onChange.bind(this);
|
||||
this.onControlChange = this.onControlChange.bind(this);
|
||||
}
|
||||
|
||||
onChange() {
|
||||
this.props.onChange(this.state);
|
||||
}
|
||||
|
||||
onControlChange(attr, value) {
|
||||
let typedValue = value;
|
||||
const { column: selectedColumnName, multiple } = this.state;
|
||||
@@ -122,10 +124,13 @@ export default class FilterBoxItemControl extends React.Component {
|
||||
}
|
||||
this.setState({ [attr]: typedValue }, this.onChange);
|
||||
}
|
||||
|
||||
setType() {}
|
||||
|
||||
textSummary() {
|
||||
return this.state.column || 'N/A';
|
||||
}
|
||||
|
||||
renderForm() {
|
||||
return (
|
||||
<div>
|
||||
@@ -257,6 +262,7 @@ export default class FilterBoxItemControl extends React.Component {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
return (
|
||||
<Popover id="ts-col-popo" title={t('Filter Configuration')}>
|
||||
@@ -264,6 +270,7 @@ export default class FilterBoxItemControl extends React.Component {
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<span>
|
||||
|
||||
@@ -66,6 +66,7 @@ export default class FixedOrMetricControl extends React.Component {
|
||||
metricValue: type === controlTypes.metric ? value : null,
|
||||
};
|
||||
}
|
||||
|
||||
onChange() {
|
||||
this.props.onChange({
|
||||
type: this.state.type,
|
||||
@@ -75,12 +76,15 @@ export default class FixedOrMetricControl extends React.Component {
|
||||
: this.state.metricValue,
|
||||
});
|
||||
}
|
||||
|
||||
setType(type) {
|
||||
this.setState({ type }, this.onChange);
|
||||
}
|
||||
|
||||
setFixedValue(fixedValue) {
|
||||
this.setState({ fixedValue }, this.onChange);
|
||||
}
|
||||
|
||||
setMetric(metricValue) {
|
||||
this.setState({ metricValue }, this.onChange);
|
||||
}
|
||||
|
||||
@@ -70,9 +70,11 @@ export default class SpatialControl extends React.Component {
|
||||
this.onChange = this.onChange.bind(this);
|
||||
this.renderReverseCheckbox = this.renderReverseCheckbox.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.onChange();
|
||||
}
|
||||
|
||||
onChange() {
|
||||
const { type } = this.state;
|
||||
const value = { type };
|
||||
@@ -101,18 +103,22 @@ export default class SpatialControl extends React.Component {
|
||||
this.setState({ value, errors });
|
||||
this.props.onChange(value, errors);
|
||||
}
|
||||
|
||||
setType(type) {
|
||||
this.setState({ type }, this.onChange);
|
||||
}
|
||||
|
||||
close() {
|
||||
this.refs.trigger.hide();
|
||||
}
|
||||
|
||||
toggleCheckbox() {
|
||||
this.setState(
|
||||
{ reverseCheckbox: !this.state.reverseCheckbox },
|
||||
this.onChange,
|
||||
);
|
||||
}
|
||||
|
||||
renderLabelContent() {
|
||||
if (this.state.errors.length > 0) {
|
||||
return 'N/A';
|
||||
@@ -128,6 +134,7 @@ export default class SpatialControl extends React.Component {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
renderSelect(name, type) {
|
||||
return (
|
||||
<SelectControl
|
||||
@@ -144,6 +151,7 @@ export default class SpatialControl extends React.Component {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
renderReverseCheckbox() {
|
||||
return (
|
||||
<span>
|
||||
@@ -155,6 +163,7 @@ export default class SpatialControl extends React.Component {
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
return (
|
||||
<Popover id="filter-popover">
|
||||
@@ -219,6 +228,7 @@ export default class SpatialControl extends React.Component {
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -68,9 +68,11 @@ export default class TextAreaControl extends React.Component {
|
||||
onControlChange(event) {
|
||||
this.props.onChange(event.target.value);
|
||||
}
|
||||
|
||||
onAceChange(value) {
|
||||
this.props.onChange(value);
|
||||
}
|
||||
|
||||
renderEditor(inModal = false) {
|
||||
const value = this.props.value || '';
|
||||
if (this.props.language) {
|
||||
@@ -103,6 +105,7 @@ export default class TextAreaControl extends React.Component {
|
||||
</FormGroup>
|
||||
);
|
||||
}
|
||||
|
||||
renderModalBody() {
|
||||
return (
|
||||
<div>
|
||||
@@ -111,6 +114,7 @@ export default class TextAreaControl extends React.Component {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const controlHeader = <ControlHeader {...this.props} />;
|
||||
return (
|
||||
|
||||
@@ -36,6 +36,7 @@ export default class TextControl extends React.Component<TextControlProps> {
|
||||
super(props);
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
|
||||
onChange(event: any) {
|
||||
let { value } = event.target;
|
||||
|
||||
@@ -59,6 +60,7 @@ export default class TextControl extends React.Component<TextControlProps> {
|
||||
}
|
||||
this.props.onChange(value, errors);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { value: rawValue } = this.props;
|
||||
const value =
|
||||
|
||||
@@ -102,29 +102,39 @@ export default class TimeSeriesColumnControl extends React.Component {
|
||||
this.state = state;
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
|
||||
onChange() {
|
||||
this.props.onChange(this.state);
|
||||
}
|
||||
|
||||
onSelectChange(attr, opt) {
|
||||
this.setState({ [attr]: opt.value }, this.onChange);
|
||||
}
|
||||
|
||||
onTextInputChange(attr, event) {
|
||||
this.setState({ [attr]: event.target.value }, this.onChange);
|
||||
}
|
||||
|
||||
onCheckboxChange(attr, value) {
|
||||
this.setState({ [attr]: value }, this.onChange);
|
||||
}
|
||||
|
||||
onBoundsChange(bounds) {
|
||||
this.setState({ bounds }, this.onChange);
|
||||
}
|
||||
|
||||
onYAxisBoundsChange(yAxisBounds) {
|
||||
this.setState({ yAxisBounds }, this.onChange);
|
||||
}
|
||||
|
||||
setType() {}
|
||||
|
||||
textSummary() {
|
||||
return `${this.state.label}`;
|
||||
}
|
||||
|
||||
edit() {}
|
||||
|
||||
formRow(label, tooltip, ttLabel, control) {
|
||||
return (
|
||||
<Row style={{ marginTop: '5px' }}>
|
||||
@@ -140,6 +150,7 @@ export default class TimeSeriesColumnControl extends React.Component {
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
return (
|
||||
<Popover id="ts-col-popo" title="Column Configuration">
|
||||
@@ -297,6 +308,7 @@ export default class TimeSeriesColumnControl extends React.Component {
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<span>
|
||||
|
||||
@@ -60,12 +60,14 @@ export default class ViewportControl extends React.Component {
|
||||
super(props);
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
|
||||
onChange(ctrl, value) {
|
||||
this.props.onChange({
|
||||
...this.props.value,
|
||||
[ctrl]: value,
|
||||
});
|
||||
}
|
||||
|
||||
renderTextControl(ctrl) {
|
||||
return (
|
||||
<div key={ctrl}>
|
||||
@@ -78,6 +80,7 @@ export default class ViewportControl extends React.Component {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderPopover() {
|
||||
return (
|
||||
<Popover id={`filter-popover-${this.props.name}`} title="Viewport">
|
||||
@@ -85,6 +88,7 @@ export default class ViewportControl extends React.Component {
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
renderLabel() {
|
||||
if (this.props.value.longitude && this.props.value.latitude) {
|
||||
return `${decimal2sexagesimal(
|
||||
@@ -93,6 +97,7 @@ export default class ViewportControl extends React.Component {
|
||||
}
|
||||
return 'N/A';
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user