Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit 81617c8

Browse files
committed
address review comments
1 parent 787d3c0 commit 81617c8

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

plugins/plugin-chart-echarts/src/Pie/EchartsPie.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ import React from 'react';
2020
import { EchartsPieProps } from './types';
2121
import Echart from '../components/Echart';
2222

23-
export default function EchartsPie(props: EchartsPieProps) {
24-
return <Echart height={props.height} width={props.width} echartOptions={props.echartOptions} />;
23+
export default function EchartsPie({ height, width, echartOptions}: EchartsPieProps) {
24+
return <Echart height={height} width={width} echartOptions={echartOptions} />;
2525
}

plugins/plugin-chart-echarts/src/Pie/buildQuery.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,5 @@
1919
import { buildQueryContext, QueryFormData } from '@superset-ui/query';
2020

2121
export default function buildQuery(formData: QueryFormData) {
22-
return buildQueryContext(formData, baseQueryObject => [
23-
{
24-
...baseQueryObject,
25-
},
26-
]);
22+
return buildQueryContext(formData);
2723
}

plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ import React from 'react';
2020
import { EchartsTimeseriesProps } from './types';
2121
import Echart from '../components/Echart';
2222

23-
export default function EchartsTimeseries(props: EchartsTimeseriesProps) {
24-
return <Echart height={props.height} width={props.width} echartOptions={props.echartOptions} />;
23+
export default function EchartsTimeseries({ height, width, echartOptions}: EchartsTimeseriesProps) {
24+
return <Echart height={height} width={width} echartOptions={echartOptions} />;
2525
}

plugins/plugin-chart-echarts/src/Timeseries/buildQuery.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,9 @@ export default function buildQuery(formData: QueryFormData) {
4949
index: ['__timestamp'],
5050
columns: formData.groupby,
5151
// Create 'dummy' sum aggregates to assign cell values in pivot table
52-
aggregates: baseQueryMetrics
53-
.map(metric => metric.label)
54-
.reduce(
55-
(obj, cur) => ({
56-
...obj,
57-
[cur]: { operator: 'sum' },
58-
}),
59-
{},
60-
),
52+
aggregates: Object.fromEntries(baseQueryMetrics.map(
53+
metric => [metric.label, { operator: 'sum' }]
54+
)),
6155
},
6256
},
6357
formData.contributionMode

0 commit comments

Comments
 (0)