mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user