Controls cleanup pass (#9578)

* migrating date_filter

* normalized control

* filter_configs control

* column_collection control

* time_range_endpoints control

* time_range_fixed control

* url_params control

* cache_timeout control

* annotation_layers control

* color control unused?

* linters rule 🤘

* this should have been deleted earlier

* global_opacity, mapbox_label, mapbox_style, viewport_zoom

* linting

* comparison_type

* contribution control

* log_scale

* show_values

* table_filter

* pandas_aggfunc

* code control

* formatSelectOptions import

* lint

* markup_type control

* lintage

* date_time_format control, linting

* url control, test mods

* min_periods control

* rolling_periods

* rolling_type

* missing lib

* order_desc

* number_format

* link_length

* all_columns_y

* all_columns_x

* normalize_across, select_country, all_columns

* fixing test

* linter-caught dependencies

* waiting

* wait longer!

* utilizing tabOverride for Analytics

* tabOverride for Annotations and Layers
This commit is contained in:
Evan Rusackas
2020-04-24 16:12:26 -07:00
committed by GitHub
parent 29dd989483
commit 5e4c291913
37 changed files with 1095 additions and 617 deletions

View File

@@ -19,6 +19,7 @@
import { getChartControlPanelRegistry } from '@superset-ui/chart';
import getControlsForVizType from 'src/utils/getControlsForVizType';
import { t } from '@superset-ui/translation';
const fakePluginControls = {
controlPanelSections: [
@@ -26,7 +27,7 @@ const fakePluginControls = {
label: 'Fake Control Panel Sections',
expanded: true,
controlSetRows: [
['url_params'],
['label_colors'],
[
{
name: 'y_axis_bounds',
@@ -77,28 +78,36 @@ describe('getControlsForVizType', () => {
});
it('returns a map of the controls', () => {
expect(getControlsForVizType('chart_controls_inventory_fake')).toEqual({
url_params: {
type: 'HiddenControl',
label: 'URL Parameters',
hidden: true,
description: 'Extra parameters for use in jinja templated queries',
},
y_axis_bounds: {
type: 'BoundsControl',
label: 'Value bounds',
default: [null, null],
description: 'Value bounds for the y axis',
},
adhoc_filters: {
type: 'AdhocFilterControl',
label: 'Fake Filters',
default: null,
},
column_collection: {
type: 'CollectionControl',
label: 'Fake Collection Control',
},
});
expect(
JSON.stringify(getControlsForVizType('chart_controls_inventory_fake')),
).toEqual(
JSON.stringify({
label_colors: {
type: 'ColorMapControl',
label: t('Color Map'),
default: {},
renderTrigger: true,
mapStateToProps: state => ({
colorNamespace: state.form_data.color_namespace,
colorScheme: state.form_data.color_scheme,
}),
},
y_axis_bounds: {
type: 'BoundsControl',
label: 'Value bounds',
default: [null, null],
description: 'Value bounds for the y axis',
},
adhoc_filters: {
type: 'AdhocFilterControl',
label: 'Fake Filters',
default: null,
},
column_collection: {
type: 'CollectionControl',
label: 'Fake Collection Control',
},
}),
);
});
});