fix(big-number): use correct default font size for subtitle/subheader (#39493)

This commit is contained in:
Kamil Gabryjelski
2026-04-20 18:21:18 +02:00
committed by GitHub
parent 9fe3f634ec
commit bf7ec853fa
3 changed files with 30 additions and 12 deletions

View File

@@ -29,6 +29,7 @@ import {
} from '@superset-ui/core';
import { GenericDataType } from '@apache-superset/core/common';
import { BigNumberTotalChartProps, BigNumberVizProps } from '../types';
import { PROPORTION } from '../constants';
import { getDateFormatter, getOriginalLabel, parseMetricValue } from '../utils';
import { Refs } from '../../types';
@@ -76,8 +77,8 @@ export default function transformProps(
const showMetricName = chartProps.rawFormData?.show_metric_name ?? false;
const formattedSubtitle = subtitle?.trim() ? subtitle : subheader || '';
const formattedSubtitleFontSize = subtitle?.trim()
? (subtitleFontSize ?? 1)
: (subheaderFontSize ?? 1);
? (subtitleFontSize ?? PROPORTION.SUBHEADER)
: (subheaderFontSize ?? subtitleFontSize ?? PROPORTION.SUBHEADER);
const bigNumber =
data.length === 0 ? null : parseMetricValue(data[0][metricName]);