refactor(types): consolidate shared table types and fix Funnel enum typo (#37768)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-02-09 01:14:34 -05:00
committed by GitHub
parent 82d6076804
commit ebee9bb3f9
6 changed files with 135 additions and 163 deletions

View File

@@ -35,7 +35,7 @@ import {
DEFAULT_FORM_DATA as DEFAULT_FUNNEL_FORM_DATA,
EchartsFunnelChartProps,
EchartsFunnelFormData,
EchartsFunnelLabelTypeType,
EchartsFunnelLabelType,
FunnelChartTransformedProps,
PercentCalcType,
} from './types';
@@ -215,19 +215,19 @@ export default function transformProps(
percentCalculationType,
});
switch (labelType) {
case EchartsFunnelLabelTypeType.Key:
case EchartsFunnelLabelType.Key:
return name;
case EchartsFunnelLabelTypeType.Value:
case EchartsFunnelLabelType.Value:
return formattedValue;
case EchartsFunnelLabelTypeType.Percent:
case EchartsFunnelLabelType.Percent:
return formattedPercent;
case EchartsFunnelLabelTypeType.KeyValue:
case EchartsFunnelLabelType.KeyValue:
return `${name}: ${formattedValue}`;
case EchartsFunnelLabelTypeType.KeyValuePercent:
case EchartsFunnelLabelType.KeyValuePercent:
return `${name}: ${formattedValue} (${formattedPercent})`;
case EchartsFunnelLabelTypeType.KeyPercent:
case EchartsFunnelLabelType.KeyPercent:
return `${name}: ${formattedPercent}`;
case EchartsFunnelLabelTypeType.ValuePercent:
case EchartsFunnelLabelType.ValuePercent:
return `${formattedValue} (${formattedPercent})`;
default:
return name;
@@ -283,7 +283,7 @@ export default function transformProps(
percentCalculationType,
});
const row = [];
const enumName = EchartsFunnelLabelTypeType[tooltipLabelType];
const enumName = EchartsFunnelLabelType[tooltipLabelType];
const title = enumName.includes('Key') ? name : undefined;
if (enumName.includes('Value') || enumName.includes('Percent')) {
row.push(metricLabel);