From a727fb5f756f12d261181e1c1d03542f1a45a922 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 21 Apr 2022 14:15:13 +0800 Subject: [PATCH] fix: lost renameOperator in mixed timeseries chart --- .../src/MixedTimeseries/buildQuery.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts index b85feb1eee5fa..9adc149489a27 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts @@ -22,7 +22,11 @@ import { QueryObject, normalizeOrderBy, } from '@superset-ui/core'; -import { flattenOperator, pivotOperator } from '@superset-ui/chart-controls'; +import { + pivotOperator, + renameOperator, + flattenOperator, +} from '@superset-ui/chart-controls'; export default function buildQuery(formData: QueryFormData) { const { @@ -66,7 +70,11 @@ export default function buildQuery(formData: QueryFormData) { is_timeseries: true, post_processing: [ pivotOperator(formData1, { ...baseQueryObject, is_timeseries: true }), - flattenOperator(formData1, { ...baseQueryObject, is_timeseries: true }), + renameOperator(formData1, { + ...baseQueryObject, + ...{ is_timeseries: true }, + }), + flattenOperator(formData1, baseQueryObject), ], } as QueryObject; return [normalizeOrderBy(queryObjectA)]; @@ -78,7 +86,11 @@ export default function buildQuery(formData: QueryFormData) { is_timeseries: true, post_processing: [ pivotOperator(formData2, { ...baseQueryObject, is_timeseries: true }), - flattenOperator(formData2, { ...baseQueryObject, is_timeseries: true }), + renameOperator(formData2, { + ...baseQueryObject, + ...{ is_timeseries: true }, + }), + flattenOperator(formData2, baseQueryObject), ], } as QueryObject; return [normalizeOrderBy(queryObjectB)];