fix: remove unused .js module (#8741)

* fix: remove unused .js module

* fix tests, remove more references

* lints
This commit is contained in:
Maxime Beauchemin 2019-12-04 16:51:05 -08:00 committed by GitHub
parent b107cc03bf
commit e127579fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 0 additions and 55 deletions

View File

@ -24,14 +24,9 @@ import { defaultControls } from 'src/explore/store';
import { getFormDataFromControls } from 'src/explore/controlUtils';
import { ControlPanelsContainer } from 'src/explore/components/ControlPanelsContainer';
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
import * as featureFlags from 'src/featureFlags';
describe('ControlPanelsContainer', () => {
let wrapper;
let scopedFilterOn = false;
const isFeatureEnabledMock = jest
.spyOn(featureFlags, 'isFeatureEnabled')
.mockImplementation(() => scopedFilterOn);
beforeAll(() => {
getChartControlPanelRegistry().registerValue('table', {
@ -81,7 +76,6 @@ describe('ControlPanelsContainer', () => {
afterAll(() => {
getChartControlPanelRegistry().remove('table');
isFeatureEnabledMock.mockRestore();
});
function getDefaultProps() {
@ -100,10 +94,4 @@ describe('ControlPanelsContainer', () => {
wrapper = shallow(<ControlPanelsContainer {...getDefaultProps()} />);
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);
});
});

View File

@ -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>
);
}

View File

@ -38,7 +38,6 @@ import ViewportControl from './ViewportControl';
import VizTypeControl from './VizTypeControl';
import MetricsControl from './MetricsControl';
import AdhocFilterControl from './AdhocFilterControl';
import FilterPanel from './FilterPanel';
import FilterBoxItemControl from './FilterBoxItemControl';
import withVerification from './withVerification';
@ -65,7 +64,6 @@ const controlMap = {
VizTypeControl,
MetricsControl,
AdhocFilterControl,
FilterPanel,
FilterBoxItemControl,
MetricsControlVerifiedOptions: withVerification(
MetricsControl,

View File

@ -48,12 +48,6 @@ export const sqlaTimeSeries = {
controlSetRows: [['granularity_sqla'], ['time_range']],
};
export const filters = {
label: t('Filters'),
expanded: true,
controlSetRows: [['filters']],
};
export const annotations = {
label: t('Annotations and Layers'),
expanded: true,

View File

@ -17,7 +17,6 @@
* under the License.
*/
import { getChartControlPanelRegistry } from '@superset-ui/chart';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
import controls from './controls';
import * as sections from './controlPanels/sections';
@ -168,14 +167,12 @@ export function sectionsToRender(vizType, datasourceType) {
datasourceAndVizType,
sqlaTimeSeries,
druidTimeSeries,
filters,
} = sectionsCopy;
return []
.concat(
datasourceAndVizType,
datasourceType === 'table' ? sqlaTimeSeries : druidTimeSeries,
isFeatureEnabled(FeatureFlag.SCOPED_FILTER) ? filters : undefined,
controlPanelSections,
)
.filter(section => section);

View File

@ -2137,10 +2137,6 @@ export const controls = {
provideFormDataToProps: true,
},
filters: {
type: 'FilterPanel',
},
slice_id: {
type: 'HiddenControl',
label: t('Chart ID'),

View File

@ -19,7 +19,6 @@
// 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.
export enum FeatureFlag {
SCOPED_FILTER = 'SCOPED_FILTER',
OMNIBAR = 'OMNIBAR',
CLIENT_CACHE = 'CLIENT_CACHE',
SCHEDULED_QUERIES = 'SCHEDULED_QUERIES',