fix: fix T-2916 (#3393)
This commit is contained in:
parent
6fb5af993e
commit
8530da7c23
@ -115,7 +115,7 @@ export const ChartRendererProvider: React.FC<ChartRendererProps> = (props) => {
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
defaultParams: [collection, query],
|
defaultParams: [collection, query],
|
||||||
// Wait until CharrFilterProvider is rendered and check the status of the filter form
|
// Wait until ChartFilterProvider is rendered and check the status of the filter form
|
||||||
// since the filter parameters should be applied if the filter block is enabled
|
// since the filter parameters should be applied if the filter block is enabled
|
||||||
ready: ready && (!enabled || !!form),
|
ready: ready && (!enabled || !!form),
|
||||||
},
|
},
|
||||||
|
@ -111,7 +111,7 @@ export const removeUnparsableFilter = (filter: any) => {
|
|||||||
const newLogic = {};
|
const newLogic = {};
|
||||||
for (const key in filter) {
|
for (const key in filter) {
|
||||||
const value = removeUnparsableFilter(filter[key]);
|
const value = removeUnparsableFilter(filter[key]);
|
||||||
if (value && !(typeof value === 'object' && Object.keys(value).length === 0)) {
|
if (value !== null && value !== undefined && !(typeof value === 'object' && Object.keys(value).length === 0)) {
|
||||||
newLogic[key] = value;
|
newLogic[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,20 +51,21 @@ export const postProcess = async (ctx: Context, next: Next) => {
|
|||||||
fieldMap: { [source: string]: { type?: string } };
|
fieldMap: { [source: string]: { type?: string } };
|
||||||
};
|
};
|
||||||
ctx.body = data.map((record) => {
|
ctx.body = data.map((record) => {
|
||||||
const result = {};
|
|
||||||
Object.entries(record).forEach(([key, value]) => {
|
Object.entries(record).forEach(([key, value]) => {
|
||||||
|
if (!value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { type } = fieldMap[key] || {};
|
const { type } = fieldMap[key] || {};
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'bigInt':
|
case 'bigInt':
|
||||||
case 'integer':
|
case 'integer':
|
||||||
case 'float':
|
case 'float':
|
||||||
case 'double':
|
case 'double':
|
||||||
value = Number(value);
|
record[key] = Number(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
result[key] = value;
|
|
||||||
});
|
});
|
||||||
return result;
|
return record;
|
||||||
});
|
});
|
||||||
await next();
|
await next();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user