From 095407c8cf16dd94ab00480ec9405d7369d66fcd Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 19 Dec 2018 21:08:38 +0100 Subject: [PATCH] on deselect when reducer is set to none --- .../datasource/stackdriver/components/Aggregations.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx b/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx index 7dae4017991..a077649291c 100644 --- a/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx @@ -45,8 +45,7 @@ export class Aggregations extends React.Component { } } - setAggOptions({ metricDescriptor, aggregation }) { - const { templateSrv } = this.props; + setAggOptions({ metricDescriptor, aggregation, templateSrv }) { let aggregations = getAggregationOptionsByMetric(metricDescriptor.valueType, metricDescriptor.metricKind).map( a => ({ ...a, @@ -63,7 +62,9 @@ export class Aggregations extends React.Component { if (aggregation.groupBys.length > 0) { aggregations = aggregations.filter(o => o.value !== 'REDUCE_NONE'); - this.deselectAggregationOption('REDUCE_NONE'); + if (aggregation.crossSeriesReducer === 'REDUCE_NONE') { + this.deselectAggregationOption('REDUCE_NONE'); + } } this.setState({ aggOptions: aggregations }); }