mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
GroupBy: add new groupby variable type and optional groupByKeys (#81717)
* add new groupby type * rename to groupByKeys + introduce GroupByVariableModel * fix unit test * update scenes package * update interface * update fixture * update unit test * bump to scenes 2.6.2 * remove baseFilters for now
This commit is contained in:
@@ -560,6 +560,7 @@ export interface DataQueryRequest<TQuery extends DataQuery = DataQuery> {
|
||||
|
||||
/** Filters to dynamically apply to all queries */
|
||||
filters?: AdHocVariableFilter[];
|
||||
groupByKeys?: string[];
|
||||
|
||||
// Request Timing
|
||||
startTime: number;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { LoadingState } from './data';
|
||||
import { MetricFindValue } from './datasource';
|
||||
import { DataSourceRef } from './query';
|
||||
|
||||
export type VariableType = TypedVariableModel['type'];
|
||||
@@ -13,6 +14,7 @@ export interface VariableModel {
|
||||
export type TypedVariableModel =
|
||||
| QueryVariableModel
|
||||
| AdHocVariableModel
|
||||
| GroupByVariableModel
|
||||
| ConstantVariableModel
|
||||
| DataSourceVariableModel
|
||||
| IntervalVariableModel
|
||||
@@ -64,6 +66,14 @@ export interface AdHocVariableModel extends BaseVariableModel {
|
||||
baseFilters?: AdHocVariableFilter[];
|
||||
}
|
||||
|
||||
export interface GroupByVariableModel extends BaseVariableModel {
|
||||
type: 'groupby';
|
||||
datasource: DataSourceRef | null;
|
||||
groupByKeys: string[];
|
||||
defaultOptions?: MetricFindValue[];
|
||||
multi: true;
|
||||
}
|
||||
|
||||
export interface VariableOption {
|
||||
selected: boolean;
|
||||
text: string | string[];
|
||||
|
||||
Reference in New Issue
Block a user