fix(dashboard): Support bigint value in native filters (#32549)

(cherry picked from commit e7721a8c4d)
This commit is contained in:
JUST.in DO IT
2025-03-12 09:47:41 -07:00
committed by Michael S. Molina
parent bdb9f48044
commit 2f9edd3b0e
12 changed files with 59 additions and 13 deletions

View File

@@ -98,6 +98,7 @@ class BigNumberVis extends PureComponent<BigNumberVizProps> {
!formatTime ||
!showTimestamp ||
typeof timestamp === 'string' ||
typeof timestamp === 'bigint' ||
typeof timestamp === 'boolean'
)
return null;

View File

@@ -148,7 +148,7 @@ export default function transformProps(
if (!value) {
return NULL_STRING;
}
if (typeof value === 'boolean') {
if (typeof value === 'boolean' || typeof value === 'bigint') {
return String(value);
}
return value;

View File

@@ -183,7 +183,7 @@ export class EchartsChartPlugin<
super({
...restProps,
metadata: new ChartMetadata({
parseMethod: 'json',
parseMethod: 'json-bigint',
...metadata,
}),
});

View File

@@ -363,7 +363,7 @@ export function formatSeriesName(
if (name === undefined || name === null) {
return NULL_STRING;
}
if (typeof name === 'boolean') {
if (typeof name === 'boolean' || typeof name === 'bigint') {
return name.toString();
}
if (name instanceof Date || coltype === GenericDataType.Temporal) {

View File

@@ -125,6 +125,6 @@ test('@superset-ui/plugin-chart-echarts-parsemethod-validation', () => {
];
plugins.forEach(plugin => {
expect(plugin.metadata.parseMethod).toEqual('json');
expect(plugin.metadata.parseMethod).toEqual('json-bigint');
});
});