This is an automated email from the ASF dual-hosted git repository. vavila pushed a commit to branch fix/big-number-subheader-migration in repository https://gitbox.apache.org/repos/asf/superset.git
commit 40b579f1f88201f3c56b0f4e9d7bb04338935b5a Author: Vitor Avila <[email protected]> AuthorDate: Thu Apr 17 18:13:35 2025 -0300 fix(Big Number): Migrate old subheader config to subtitle --- .../src/BigNumber/BigNumberTotal/transformProps.ts | 13 +++++++------ .../plugins/plugin-chart-echarts/src/BigNumber/types.ts | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts index c673ebd9f5..21f64e78e9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts @@ -47,19 +47,22 @@ export default function transformProps( const { headerFontSize, metric = 'value', - subtitle = '', + subtitle, subtitleFontSize, forceTimestampFormatting, timeFormat, yAxisFormat, conditionalFormatting, currencyFormat, + subheader, + subheaderFontSize, } = formData; const refs: Refs = {}; const { data = [], coltypes = [] } = queriesData[0]; const granularity = extractTimegrain(rawFormData as QueryFormData); const metricName = getMetricLabel(metric); - const formattedSubtitle = subtitle; + const finalSubtitle = subtitle || subheader || ''; + const finalSubtitleFontSzie = subheaderFontSize || subtitleFontSize; const bigNumber = data.length === 0 ? null : parseMetricValue(data[0][metricName]); @@ -105,10 +108,8 @@ export default function transformProps( bigNumber, headerFormatter, headerFontSize, - subtitleFontSize, - subtitle: formattedSubtitle, - subheader: '', - subheaderFontSize: subtitleFontSize, + subtitleFontSize: finalSubtitleFontSzie, + subtitle: finalSubtitle, onContextMenu, refs, colorThresholdFormatters, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts index d843ee1fd4..829949a7a3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts @@ -77,9 +77,9 @@ export type BigNumberVizProps = { formatTime?: TimeFormatter; headerFontSize: number; kickerFontSize?: number; - subheader: string; + subheader?: string; subtitle: string; - subheaderFontSize: number; + subheaderFontSize?: number; subtitleFontSize: number; showTimestamp?: boolean; showTrendLine?: boolean;
