fix(plugin-chart-echarts): fix incorrect groupby in buildQuery (#800)

This commit is contained in:
Ville Brofeldt 2020-09-29 10:47:17 +03:00 committed by Yongjie Zhao
parent 3c7320eb10
commit 5d70fd3946
4 changed files with 4 additions and 13 deletions

View File

@ -40,7 +40,7 @@ export default function buildQuery(formData: QueryFormData) {
return [
{
...baseQueryObject,
groupby: formData.series,
groupby: formData.groupby || [],
is_timeseries: true,
post_processing: [
{

View File

@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
t,
validateNonEmpty,
legacyValidateInteger,
legacyValidateNumber,
} from '@superset-ui/core';
import { t, legacyValidateInteger, legacyValidateNumber } from '@superset-ui/core';
import { ControlPanelConfig } from '@superset-ui/chart-controls';
const config: ControlPanelConfig = {
@ -295,10 +290,6 @@ const config: ControlPanelConfig = {
},
},
controlOverrides: {
series: {
validators: [validateNonEmpty],
clearable: false,
},
row_limit: {
default: 100,
},

View File

@ -22,7 +22,7 @@ describe('Timeseries buildQuery', () => {
const formData = {
datasource: '5__table',
granularity_sqla: 'ds',
series: ['foo'],
groupby: ['foo'],
metrics: ['bar', 'baz'],
viz_type: 'my_chart',
};

View File

@ -26,7 +26,7 @@ describe('EchartsTimeseries tranformProps', () => {
datasource: '3__table',
granularity_sqla: 'ds',
metric: 'sum__num',
series: ['foo', 'bar'],
groupby: ['foo', 'bar'],
};
const chartProps = new ChartProps({
formData,