chore(plugin-chart-echarts): add types to controls (#18059)

This commit is contained in:
Ville Brofeldt 2022-01-16 14:21:47 +02:00 committed by GitHub
parent e53a50a155
commit de8a1fa9c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 13 deletions

View File

@ -20,6 +20,7 @@ import React from 'react';
import { t } from '@superset-ui/core';
import {
ControlPanelsContainerProps,
ControlSetItem,
ControlSetRow,
sharedControls,
} from '@superset-ui/chart-controls';
@ -29,7 +30,7 @@ import { DEFAULT_FORM_DATA } from './Timeseries/types';
const { legendMargin, legendOrientation, legendType, showLegend } =
DEFAULT_LEGEND_FORM_DATA;
const showLegendControl = {
const showLegendControl: ControlSetItem = {
name: 'show_legend',
config: {
type: 'CheckboxControl',
@ -40,7 +41,7 @@ const showLegendControl = {
},
};
const legendMarginControl = {
const legendMarginControl: ControlSetItem = {
name: 'legendMargin',
config: {
type: 'TextControl',
@ -54,7 +55,7 @@ const legendMarginControl = {
},
};
const legendTypeControl = {
const legendTypeControl: ControlSetItem = {
name: 'legendType',
config: {
type: 'SelectControl',
@ -72,7 +73,7 @@ const legendTypeControl = {
},
};
const legendOrientationControl = {
const legendOrientationControl: ControlSetItem = {
name: 'legendOrientation',
config: {
type: 'SelectControl',
@ -92,7 +93,7 @@ const legendOrientationControl = {
},
};
export const legendSection = [
export const legendSection: ControlSetRow[] = [
[<h1 className="section-header">{t('Legend')}</h1>],
[showLegendControl],
[legendTypeControl],
@ -100,7 +101,7 @@ export const legendSection = [
[legendMarginControl],
];
const showValueControl = {
const showValueControl: ControlSetItem = {
name: 'show_value',
config: {
type: 'CheckboxControl',
@ -111,7 +112,7 @@ const showValueControl = {
},
};
const stackControl = {
const stackControl: ControlSetItem = {
name: 'stack',
config: {
type: 'CheckboxControl',
@ -122,7 +123,7 @@ const stackControl = {
},
};
const onlyTotalControl = {
const onlyTotalControl: ControlSetItem = {
name: 'only_total',
config: {
type: 'CheckboxControl',
@ -137,7 +138,7 @@ const onlyTotalControl = {
},
};
const percentageThresholdControl = {
const percentageThresholdControl: ControlSetItem = {
name: 'percentage_threshold',
config: {
type: 'TextControl',
@ -155,14 +156,14 @@ const percentageThresholdControl = {
},
};
export const showValueSection = [
export const showValueSection: ControlSetRow[] = [
[showValueControl],
[stackControl],
[onlyTotalControl],
[percentageThresholdControl],
];
const richTooltipControl = {
const richTooltipControl: ControlSetItem = {
name: 'rich_tooltip',
config: {
type: 'CheckboxControl',
@ -175,7 +176,7 @@ const richTooltipControl = {
},
};
const tooltipTimeFormatControl = {
const tooltipTimeFormatControl: ControlSetItem = {
name: 'tooltipTimeFormat',
config: {
...sharedControls.x_axis_time_format,
@ -185,7 +186,7 @@ const tooltipTimeFormatControl = {
},
};
const tooltipSortByMetricControl = {
const tooltipSortByMetricControl: ControlSetItem = {
name: 'tooltipSortByMetric',
config: {
type: 'CheckboxControl',