mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
fix: remove unused .js module (#8741)
* fix: remove unused .js module * fix tests, remove more references * lints
This commit is contained in:
parent
b107cc03bf
commit
e127579fc8
@ -24,14 +24,9 @@ import { defaultControls } from 'src/explore/store';
|
|||||||
import { getFormDataFromControls } from 'src/explore/controlUtils';
|
import { getFormDataFromControls } from 'src/explore/controlUtils';
|
||||||
import { ControlPanelsContainer } from 'src/explore/components/ControlPanelsContainer';
|
import { ControlPanelsContainer } from 'src/explore/components/ControlPanelsContainer';
|
||||||
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
|
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
|
||||||
import * as featureFlags from 'src/featureFlags';
|
|
||||||
|
|
||||||
describe('ControlPanelsContainer', () => {
|
describe('ControlPanelsContainer', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
let scopedFilterOn = false;
|
|
||||||
const isFeatureEnabledMock = jest
|
|
||||||
.spyOn(featureFlags, 'isFeatureEnabled')
|
|
||||||
.mockImplementation(() => scopedFilterOn);
|
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
getChartControlPanelRegistry().registerValue('table', {
|
getChartControlPanelRegistry().registerValue('table', {
|
||||||
@ -81,7 +76,6 @@ describe('ControlPanelsContainer', () => {
|
|||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
getChartControlPanelRegistry().remove('table');
|
getChartControlPanelRegistry().remove('table');
|
||||||
isFeatureEnabledMock.mockRestore();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function getDefaultProps() {
|
function getDefaultProps() {
|
||||||
@ -100,10 +94,4 @@ describe('ControlPanelsContainer', () => {
|
|||||||
wrapper = shallow(<ControlPanelsContainer {...getDefaultProps()} />);
|
wrapper = shallow(<ControlPanelsContainer {...getDefaultProps()} />);
|
||||||
expect(wrapper.find(ControlPanelSection)).toHaveLength(6);
|
expect(wrapper.find(ControlPanelSection)).toHaveLength(6);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders filter panel when SCOPED_FILTER flag is on', () => {
|
|
||||||
scopedFilterOn = true;
|
|
||||||
wrapper = shallow(<ControlPanelsContainer {...getDefaultProps()} />);
|
|
||||||
expect(wrapper.find(ControlPanelSection)).toHaveLength(7);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
import * as React from 'react';
|
|
||||||
|
|
||||||
export default function FilterPanel() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
test filter
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -38,7 +38,6 @@ import ViewportControl from './ViewportControl';
|
|||||||
import VizTypeControl from './VizTypeControl';
|
import VizTypeControl from './VizTypeControl';
|
||||||
import MetricsControl from './MetricsControl';
|
import MetricsControl from './MetricsControl';
|
||||||
import AdhocFilterControl from './AdhocFilterControl';
|
import AdhocFilterControl from './AdhocFilterControl';
|
||||||
import FilterPanel from './FilterPanel';
|
|
||||||
import FilterBoxItemControl from './FilterBoxItemControl';
|
import FilterBoxItemControl from './FilterBoxItemControl';
|
||||||
import withVerification from './withVerification';
|
import withVerification from './withVerification';
|
||||||
|
|
||||||
@ -65,7 +64,6 @@ const controlMap = {
|
|||||||
VizTypeControl,
|
VizTypeControl,
|
||||||
MetricsControl,
|
MetricsControl,
|
||||||
AdhocFilterControl,
|
AdhocFilterControl,
|
||||||
FilterPanel,
|
|
||||||
FilterBoxItemControl,
|
FilterBoxItemControl,
|
||||||
MetricsControlVerifiedOptions: withVerification(
|
MetricsControlVerifiedOptions: withVerification(
|
||||||
MetricsControl,
|
MetricsControl,
|
||||||
|
@ -48,12 +48,6 @@ export const sqlaTimeSeries = {
|
|||||||
controlSetRows: [['granularity_sqla'], ['time_range']],
|
controlSetRows: [['granularity_sqla'], ['time_range']],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const filters = {
|
|
||||||
label: t('Filters'),
|
|
||||||
expanded: true,
|
|
||||||
controlSetRows: [['filters']],
|
|
||||||
};
|
|
||||||
|
|
||||||
export const annotations = {
|
export const annotations = {
|
||||||
label: t('Annotations and Layers'),
|
label: t('Annotations and Layers'),
|
||||||
expanded: true,
|
expanded: true,
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import { getChartControlPanelRegistry } from '@superset-ui/chart';
|
import { getChartControlPanelRegistry } from '@superset-ui/chart';
|
||||||
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
|
|
||||||
import controls from './controls';
|
import controls from './controls';
|
||||||
import * as sections from './controlPanels/sections';
|
import * as sections from './controlPanels/sections';
|
||||||
|
|
||||||
@ -168,14 +167,12 @@ export function sectionsToRender(vizType, datasourceType) {
|
|||||||
datasourceAndVizType,
|
datasourceAndVizType,
|
||||||
sqlaTimeSeries,
|
sqlaTimeSeries,
|
||||||
druidTimeSeries,
|
druidTimeSeries,
|
||||||
filters,
|
|
||||||
} = sectionsCopy;
|
} = sectionsCopy;
|
||||||
|
|
||||||
return []
|
return []
|
||||||
.concat(
|
.concat(
|
||||||
datasourceAndVizType,
|
datasourceAndVizType,
|
||||||
datasourceType === 'table' ? sqlaTimeSeries : druidTimeSeries,
|
datasourceType === 'table' ? sqlaTimeSeries : druidTimeSeries,
|
||||||
isFeatureEnabled(FeatureFlag.SCOPED_FILTER) ? filters : undefined,
|
|
||||||
controlPanelSections,
|
controlPanelSections,
|
||||||
)
|
)
|
||||||
.filter(section => section);
|
.filter(section => section);
|
||||||
|
@ -2137,10 +2137,6 @@ export const controls = {
|
|||||||
provideFormDataToProps: true,
|
provideFormDataToProps: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
filters: {
|
|
||||||
type: 'FilterPanel',
|
|
||||||
},
|
|
||||||
|
|
||||||
slice_id: {
|
slice_id: {
|
||||||
type: 'HiddenControl',
|
type: 'HiddenControl',
|
||||||
label: t('Chart ID'),
|
label: t('Chart ID'),
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
// We can codegen the enum definition based on a list of supported flags that we
|
// We can codegen the enum definition based on a list of supported flags that we
|
||||||
// check into source control. We're hardcoding the supported flags for now.
|
// check into source control. We're hardcoding the supported flags for now.
|
||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
SCOPED_FILTER = 'SCOPED_FILTER',
|
|
||||||
OMNIBAR = 'OMNIBAR',
|
OMNIBAR = 'OMNIBAR',
|
||||||
CLIENT_CACHE = 'CLIENT_CACHE',
|
CLIENT_CACHE = 'CLIENT_CACHE',
|
||||||
SCHEDULED_QUERIES = 'SCHEDULED_QUERIES',
|
SCHEDULED_QUERIES = 'SCHEDULED_QUERIES',
|
||||||
|
Loading…
Reference in New Issue
Block a user