fix: Removes filter plugins from viz gallery (#27763)
This commit is contained in:
parent
951d7d66ac
commit
bbcb722e50
|
|
@ -189,3 +189,11 @@ export const DEFAULT_COMMON_BOOTSTRAP_DATA: CommonBootstrapData = {
|
||||||
export const DEFAULT_BOOTSTRAP_DATA: BootstrapData = {
|
export const DEFAULT_BOOTSTRAP_DATA: BootstrapData = {
|
||||||
common: DEFAULT_COMMON_BOOTSTRAP_DATA,
|
common: DEFAULT_COMMON_BOOTSTRAP_DATA,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export enum FilterPlugins {
|
||||||
|
Select = 'filter_select',
|
||||||
|
Range = 'filter_range',
|
||||||
|
Time = 'filter_time',
|
||||||
|
TimeColumn = 'filter_timecolumn',
|
||||||
|
TimeGrain = 'filter_timegrain',
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import { usePluginContext } from 'src/components/DynamicPlugins';
|
||||||
import Modal from 'src/components/Modal';
|
import Modal from 'src/components/Modal';
|
||||||
import { noOp } from 'src/utils/common';
|
import { noOp } from 'src/utils/common';
|
||||||
import getBootstrapData from 'src/utils/getBootstrapData';
|
import getBootstrapData from 'src/utils/getBootstrapData';
|
||||||
|
import { FilterPlugins } from 'src/constants';
|
||||||
import VizTypeGallery, {
|
import VizTypeGallery, {
|
||||||
MAX_ADVISABLE_VIZ_GALLERY_WIDTH,
|
MAX_ADVISABLE_VIZ_GALLERY_WIDTH,
|
||||||
} from './VizTypeGallery';
|
} from './VizTypeGallery';
|
||||||
|
|
@ -43,7 +44,9 @@ interface VizTypeControlProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const bootstrapData = getBootstrapData();
|
const bootstrapData = getBootstrapData();
|
||||||
const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST || [];
|
const denyList: string[] = (
|
||||||
|
bootstrapData.common.conf.VIZ_TYPE_DENYLIST || []
|
||||||
|
).concat(Object.values(FilterPlugins));
|
||||||
const metadataRegistry = getChartMetadataRegistry();
|
const metadataRegistry = getChartMetadataRegistry();
|
||||||
|
|
||||||
export const VIZ_TYPE_CONTROL_TEST_ID = 'viz-type-control';
|
export const VIZ_TYPE_CONTROL_TEST_ID = 'viz-type-control';
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import {
|
||||||
t,
|
t,
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
import { getUrlParam } from 'src/utils/urlUtils';
|
import { getUrlParam } from 'src/utils/urlUtils';
|
||||||
import { URL_PARAMS } from 'src/constants';
|
import { FilterPlugins, URL_PARAMS } from 'src/constants';
|
||||||
import { Link, withRouter, RouteComponentProps } from 'react-router-dom';
|
import { Link, withRouter, RouteComponentProps } from 'react-router-dom';
|
||||||
import Button from 'src/components/Button';
|
import Button from 'src/components/Button';
|
||||||
import { AsyncSelect, Steps } from 'src/components';
|
import { AsyncSelect, Steps } from 'src/components';
|
||||||
|
|
@ -60,7 +60,9 @@ const ESTIMATED_NAV_HEIGHT = 56;
|
||||||
const ELEMENTS_EXCEPT_VIZ_GALLERY = ESTIMATED_NAV_HEIGHT + 250;
|
const ELEMENTS_EXCEPT_VIZ_GALLERY = ESTIMATED_NAV_HEIGHT + 250;
|
||||||
|
|
||||||
const bootstrapData = getBootstrapData();
|
const bootstrapData = getBootstrapData();
|
||||||
const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST || [];
|
const denyList: string[] = (
|
||||||
|
bootstrapData.common.conf.VIZ_TYPE_DENYLIST || []
|
||||||
|
).concat(Object.values(FilterPlugins));
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledContainer = styled.div`
|
||||||
${({ theme }) => `
|
${({ theme }) => `
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ import {
|
||||||
} from 'src/filters/components';
|
} from 'src/filters/components';
|
||||||
import { PivotTableChartPlugin as PivotTableChartPluginV2 } from '@superset-ui/plugin-chart-pivot-table';
|
import { PivotTableChartPlugin as PivotTableChartPluginV2 } from '@superset-ui/plugin-chart-pivot-table';
|
||||||
import { HandlebarsChartPlugin } from '@superset-ui/plugin-chart-handlebars';
|
import { HandlebarsChartPlugin } from '@superset-ui/plugin-chart-handlebars';
|
||||||
|
import { FilterPlugins } from 'src/constants';
|
||||||
import TimeTableChartPlugin from '../TimeTable';
|
import TimeTableChartPlugin from '../TimeTable';
|
||||||
|
|
||||||
export default class MainPreset extends Preset {
|
export default class MainPreset extends Preset {
|
||||||
|
|
@ -157,11 +158,15 @@ export default class MainPreset extends Preset {
|
||||||
new EchartsWaterfallChartPlugin().configure({
|
new EchartsWaterfallChartPlugin().configure({
|
||||||
key: 'waterfall',
|
key: 'waterfall',
|
||||||
}),
|
}),
|
||||||
new SelectFilterPlugin().configure({ key: 'filter_select' }),
|
new SelectFilterPlugin().configure({ key: FilterPlugins.Select }),
|
||||||
new RangeFilterPlugin().configure({ key: 'filter_range' }),
|
new RangeFilterPlugin().configure({ key: FilterPlugins.Range }),
|
||||||
new TimeFilterPlugin().configure({ key: 'filter_time' }),
|
new TimeFilterPlugin().configure({ key: FilterPlugins.Time }),
|
||||||
new TimeColumnFilterPlugin().configure({ key: 'filter_timecolumn' }),
|
new TimeColumnFilterPlugin().configure({
|
||||||
new TimeGrainFilterPlugin().configure({ key: 'filter_timegrain' }),
|
key: FilterPlugins.TimeColumn,
|
||||||
|
}),
|
||||||
|
new TimeGrainFilterPlugin().configure({
|
||||||
|
key: FilterPlugins.TimeGrain,
|
||||||
|
}),
|
||||||
new EchartsTreeChartPlugin().configure({ key: 'tree_chart' }),
|
new EchartsTreeChartPlugin().configure({ key: 'tree_chart' }),
|
||||||
new EchartsSunburstChartPlugin().configure({ key: 'sunburst_v2' }),
|
new EchartsSunburstChartPlugin().configure({ key: 'sunburst_v2' }),
|
||||||
new HandlebarsChartPlugin().configure({ key: 'handlebars' }),
|
new HandlebarsChartPlugin().configure({ key: 'handlebars' }),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue