Explore: Moves PromContext from query level to DataQueryRequest level (#21260)

Closes #19598

Fixes bug introduced recently where the new PromQueryEditor did not preserve
the PromContext.Explore set on the query model by PromQueryField which caused
the table to be empty for Prometheus in explore.
This commit is contained in:
Torkel Ödegaard
2019-12-27 09:11:16 +01:00
committed by GitHub
parent 545b72da33
commit 45b7de1910
11 changed files with 40 additions and 38 deletions

View File

@@ -3,6 +3,11 @@ import { KeyValue } from './data';
import { NavModel } from './navModel';
import { PluginMeta, GrafanaPlugin, PluginIncludeType } from './plugin';
export enum CoreApp {
Dashboard = 'dashboard',
Explore = 'explore',
}
export interface AppRootProps<T = KeyValue> {
meta: AppPluginMeta<T>;

View File

@@ -7,6 +7,7 @@ import { AnnotationEvent, KeyValue, LoadingState, TableData, TimeSeries } from '
import { DataFrame, DataFrameDTO } from './dataFrame';
import { RawTimeRange, TimeRange, AbsoluteTimeRange } from './time';
import { ScopedVars } from './ScopedVars';
import { CoreApp } from './app';
export interface DataSourcePluginOptionsEditorProps<JSONData = DataSourceJsonData, SecureJSONData = {}> {
options: DataSourceSettings<JSONData, SecureJSONData>;
@@ -449,6 +450,7 @@ export interface DataQueryRequest<TQuery extends DataQuery = DataQuery> {
scopedVars: ScopedVars;
targets: TQuery[];
timezone: string;
app: CoreApp | string;
cacheTimeout?: string;
exploreMode?: 'Logs' | 'Metrics';