You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2024/02/15 21:10:43 UTC
(superset) 04/04: making the linter happy
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch Lint-cleanup
in repository https://gitbox.apache.org/repos/asf/superset.git
commit cc0ab1e6788b13307eb6f096565da8627b230a03
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Thu Feb 15 14:10:28 2024 -0700
making the linter happy
---
.../src/components/Datasource/DatasourceEditor.jsx | 40 ----------------------
.../components/ColorSchemeControlWrapper.jsx | 4 ---
.../src/dashboard/components/dnd/DragDroppable.jsx | 9 -----
.../FilterControl/AdhocFilterControl/index.jsx | 2 --
.../VizTypeControl/VizTypeControl.test.jsx | 8 ++++-
5 files changed, 7 insertions(+), 56 deletions(-)
diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx
index cc18ec0fe4..02d4a39d4b 100644
--- a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx
+++ b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx
@@ -27,8 +27,6 @@ import shortid from 'shortid';
import {
css,
isFeatureEnabled,
- getCurrencySymbol,
- ensureIsArray,
FeatureFlag,
styled,
SupersetClient,
@@ -50,7 +48,6 @@ import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import CheckboxControl from 'src/explore/components/controls/CheckboxControl';
import TextControl from 'src/explore/components/controls/TextControl';
import TextAreaControl from 'src/explore/components/controls/TextAreaControl';
-import SpatialControl from 'src/explore/components/controls/SpatialControl';
import withToasts from 'src/components/MessageToasts/withToasts';
import Icons from 'src/components/Icons';
import CurrencyControl from 'src/explore/components/controls/CurrencyControl';
@@ -629,12 +626,6 @@ class DatasourceEditor extends React.PureComponent {
this.setColumns = this.setColumns.bind(this);
this.validateAndChange = this.validateAndChange.bind(this);
this.handleTabSelect = this.handleTabSelect.bind(this);
- this.currencies = ensureIsArray(props.currencies).map(currencyCode => ({
- value: currencyCode,
- label: `${getCurrencySymbol({
- symbol: currencyCode,
- })} (${currencyCode})`,
- }));
}
onChange() {
@@ -1012,37 +1003,6 @@ class DatasourceEditor extends React.PureComponent {
);
}
- renderSpatialTab() {
- const { datasource } = this.state;
- const { spatials, all_cols: allCols } = datasource;
- return (
- <Tabs.TabPane
- tab={<CollectionTabTitle collection={spatials} title={t('Spatial')} />}
- key={4}
- >
- <CollectionTable
- tableColumns={['name', 'config']}
- onChange={this.onDatasourcePropChange.bind(this, 'spatials')}
- itemGenerator={() => ({
- name: t('<new spatial>'),
- type: t('<no type>'),
- config: null,
- })}
- collection={spatials}
- allowDeletes
- itemRenderers={{
- name: (d, onChange) => (
- <EditableTitle canEdit title={d} onSaveTitle={onChange} />
- ),
- config: (v, onChange) => (
- <SpatialControl value={v} onChange={onChange} choices={allCols} />
- ),
- }}
- />
- </Tabs.TabPane>
- );
- }
-
renderSourceFieldset(theme) {
const { datasource } = this.state;
return (
diff --git a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
index 4a7839fdbb..9275fc9b02 100644
--- a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
+++ b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
@@ -45,10 +45,6 @@ class ColorSchemeControlWrapper extends React.PureComponent {
this.schemes = this.categoricalSchemeRegistry.getMap();
}
- setHover(hovered) {
- this.setState({ hovered });
- }
-
render() {
const { colorScheme, labelMargin = 0, hasCustomLabelColors } = this.props;
return (
diff --git a/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx b/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx
index 6a49f98875..593d84512e 100644
--- a/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx
+++ b/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx
@@ -147,16 +147,7 @@ export class UnwrappedDragDroppable extends React.PureComponent {
this.setRef = this.setRef.bind(this);
}
- componentDidMount() {
- this.mounted = true;
- }
-
- componentWillUnmount() {
- this.mounted = false;
- }
-
setRef(ref) {
- this.ref = ref;
// this is needed for a custom drag preview
if (this.props.useEmptyDragPreview) {
this.props.dragPreviewRef(getEmptyImage(), {
diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx
index 7b6a3938fd..7a9cf3af2f 100644
--- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx
+++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx
@@ -34,7 +34,6 @@ import {
Operators,
OPERATOR_ENUM_TO_OPERATOR_TYPE,
} from 'src/explore/constants';
-import FilterDefinitionOption from 'src/explore/components/controls/MetricControl/FilterDefinitionOption';
import {
AddControlLabel,
AddIconButton,
@@ -104,7 +103,6 @@ class AdhocFilterControl extends React.Component {
isDictionaryForAdhocFilter(filter) ? new AdhocFilter(filter) : filter,
);
- this.optionRenderer = option => <FilterDefinitionOption option={option} />;
this.valueRenderer = (adhocFilter, index) => (
<AdhocFilterOption
key={index}
diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx
index 67a6a19333..f742b93156 100644
--- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx
+++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx
@@ -40,7 +40,13 @@ const defaultProps = {
* on and prevents those warnings.
*/
const waitForEffects = () =>
- act(() => new Promise(resolve => setTimeout(resolve, 0)));
+ act(
+ () =>
+ new Promise(resolve => {
+ setTimeout(resolve, 0);
+ return undefined;
+ }),
+ );
describe('VizTypeControl', () => {
const registry = getChartMetadataRegistry();