Prometheus: Adds hint support to dashboard and fixes prometheus link in query editor (#20275)

* Prometheus: moved hints into query editor, and fixed missing refIds in responses

* Minor fix

* Removed unused type import
This commit is contained in:
Torkel Ödegaard
2019-11-11 16:47:17 +01:00
committed by GitHub
parent 78520ac3d1
commit b756aa0bb1
7 changed files with 14 additions and 23 deletions

View File

@@ -14,7 +14,6 @@ import {
DataQuery,
DataSourceApi,
PanelData,
DataQueryRequest,
PanelEvents,
TimeRange,
LoadingState,
@@ -316,10 +315,6 @@ export function filterPanelDataToQuery(data: PanelData, refId: string): PanelDat
return undefined;
}
// Don't pass the request if all requests are the same
const request: DataQueryRequest = undefined;
// TODO: look in sub-requets to match the info
// Only say this is an error if the error links to the query
let state = LoadingState.Done;
const error = data.error && data.error.refId === refId ? data.error : undefined;
@@ -330,9 +325,9 @@ export function filterPanelDataToQuery(data: PanelData, refId: string): PanelDat
const timeRange = data.timeRange;
return {
...data,
state,
series,
request,
error,
timeRange,
};

View File

@@ -15,7 +15,6 @@ import { StoreState } from 'app/types';
import {
DataQuery,
DataSourceApi,
QueryFixAction,
PanelData,
HistoryItem,
TimeRange,
@@ -97,14 +96,6 @@ export class QueryRow extends PureComponent<QueryRowProps, QueryRowState> {
this.props.changeQuery(exploreId, newQuery, index, true);
};
onClickHintFix = (action: QueryFixAction) => {
const { datasourceInstance, exploreId, index } = this.props;
if (datasourceInstance && datasourceInstance.modifyQuery) {
const modifier = (queries: DataQuery, action: QueryFixAction) => datasourceInstance.modifyQuery(queries, action);
this.props.modifyQueries(exploreId, action, index, modifier);
}
};
onClickRemoveButton = () => {
const { exploreId, index } = this.props;
this.props.removeQueryRowAction({ exploreId, index });
@@ -161,7 +152,6 @@ export class QueryRow extends PureComponent<QueryRowProps, QueryRowState> {
query={query}
history={history}
onRunQuery={this.onRunQuery}
onHint={this.onClickHintFix}
onBlur={noopOnBlur}
onChange={this.onChange}
data={queryResponse}