Compare commits

...

1 Commits

Author SHA1 Message Date
Vitor Avila
40b579f1f8 fix(Big Number): Migrate old subheader config to subtitle 2025-04-17 18:13:35 -03:00
2 changed files with 9 additions and 8 deletions

View File

@@ -47,19 +47,22 @@ export default function transformProps(
const { const {
headerFontSize, headerFontSize,
metric = 'value', metric = 'value',
subtitle = '', subtitle,
subtitleFontSize, subtitleFontSize,
forceTimestampFormatting, forceTimestampFormatting,
timeFormat, timeFormat,
yAxisFormat, yAxisFormat,
conditionalFormatting, conditionalFormatting,
currencyFormat, currencyFormat,
subheader,
subheaderFontSize,
} = formData; } = formData;
const refs: Refs = {}; const refs: Refs = {};
const { data = [], coltypes = [] } = queriesData[0]; const { data = [], coltypes = [] } = queriesData[0];
const granularity = extractTimegrain(rawFormData as QueryFormData); const granularity = extractTimegrain(rawFormData as QueryFormData);
const metricName = getMetricLabel(metric); const metricName = getMetricLabel(metric);
const formattedSubtitle = subtitle; const finalSubtitle = subtitle || subheader || '';
const finalSubtitleFontSzie = subheaderFontSize || subtitleFontSize;
const bigNumber = const bigNumber =
data.length === 0 ? null : parseMetricValue(data[0][metricName]); data.length === 0 ? null : parseMetricValue(data[0][metricName]);
@@ -105,10 +108,8 @@ export default function transformProps(
bigNumber, bigNumber,
headerFormatter, headerFormatter,
headerFontSize, headerFontSize,
subtitleFontSize, subtitleFontSize: finalSubtitleFontSzie,
subtitle: formattedSubtitle, subtitle: finalSubtitle,
subheader: '',
subheaderFontSize: subtitleFontSize,
onContextMenu, onContextMenu,
refs, refs,
colorThresholdFormatters, colorThresholdFormatters,

View File

@@ -77,9 +77,9 @@ export type BigNumberVizProps = {
formatTime?: TimeFormatter; formatTime?: TimeFormatter;
headerFontSize: number; headerFontSize: number;
kickerFontSize?: number; kickerFontSize?: number;
subheader: string; subheader?: string;
subtitle: string; subtitle: string;
subheaderFontSize: number; subheaderFontSize?: number;
subtitleFontSize: number; subtitleFontSize: number;
showTimestamp?: boolean; showTimestamp?: boolean;
showTrendLine?: boolean; showTrendLine?: boolean;