mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add groupby when adding first aggregate
This commit is contained in:
parent
0e608a08c2
commit
9f0b4e0aa7
@ -234,6 +234,10 @@ export class PostgresQueryCtrl extends QueryCtrl {
|
||||
this.selectModels.push(parts);
|
||||
break;
|
||||
case 'aggregate':
|
||||
// add group by if no group by yet
|
||||
if (this.target.groupBy.length === 0) {
|
||||
this.addGroupBy('time', '1m');
|
||||
}
|
||||
case 'special':
|
||||
let index = _.findIndex(selectParts, (p: any) => p.def.type === item.value);
|
||||
if (index !== -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user