From d256ec6ba098cef253038c61f530c588aa8c4df8 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Sun, 16 Jan 2022 14:21:47 +0200 Subject: [PATCH] chore(plugin-chart-echarts): add types to controls (#18059) --- .../plugin-chart-echarts/src/controls.tsx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx index 614a0481e1951..5f8ebeaa271c1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx @@ -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[] = [ [

{t('Legend')}

], [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',