Commit 1e76f1a7 by Ryan McKinley Committed by GitHub

DataSourceApi: remove ExploreDataSourceApi (#17424)

parent 4066c552
...@@ -202,14 +202,20 @@ export abstract class DataSourceApi< ...@@ -202,14 +202,20 @@ export abstract class DataSourceApi<
* Used by alerting to check if query contains template variables * Used by alerting to check if query contains template variables
*/ */
targetContainsTemplate?(query: TQuery): boolean; targetContainsTemplate?(query: TQuery): boolean;
}
export abstract class ExploreDataSourceApi< /**
TQuery extends DataQuery = DataQuery, * Used in explore
TOptions extends DataSourceJsonData = DataSourceJsonData */
> extends DataSourceApi<TQuery, TOptions> {
modifyQuery?(query: TQuery, action: QueryFixAction): TQuery; modifyQuery?(query: TQuery, action: QueryFixAction): TQuery;
/**
* Used in explore
*/
getHighlighterExpression?(query: TQuery): string[]; getHighlighterExpression?(query: TQuery): string[];
/**
* Used in explore
*/
languageProvider?: any; languageProvider?: any;
} }
......
...@@ -31,7 +31,7 @@ import { ...@@ -31,7 +31,7 @@ import {
} from './state/actions'; } from './state/actions';
// Types // Types
import { RawTimeRange, DataQuery, ExploreStartPageProps, ExploreDataSourceApi, DataQueryError } from '@grafana/ui'; import { RawTimeRange, DataQuery, ExploreStartPageProps, DataSourceApi, DataQueryError } from '@grafana/ui';
import { import {
ExploreItemState, ExploreItemState,
ExploreUrlState, ExploreUrlState,
...@@ -62,7 +62,7 @@ interface ExploreProps { ...@@ -62,7 +62,7 @@ interface ExploreProps {
changeSize: typeof changeSize; changeSize: typeof changeSize;
changeTime: typeof changeTime; changeTime: typeof changeTime;
datasourceError: string; datasourceError: string;
datasourceInstance: ExploreDataSourceApi; datasourceInstance: DataSourceApi;
datasourceLoading: boolean | null; datasourceLoading: boolean | null;
datasourceMissing: boolean; datasourceMissing: boolean;
exploreId: ExploreId; exploreId: ExploreId;
......
...@@ -16,7 +16,7 @@ import { StoreState } from 'app/types'; ...@@ -16,7 +16,7 @@ import { StoreState } from 'app/types';
import { import {
TimeRange, TimeRange,
DataQuery, DataQuery,
ExploreDataSourceApi, DataSourceApi,
QueryFixAction, QueryFixAction,
DataSourceStatus, DataSourceStatus,
PanelData, PanelData,
...@@ -38,7 +38,7 @@ interface QueryRowProps extends PropsFromParent { ...@@ -38,7 +38,7 @@ interface QueryRowProps extends PropsFromParent {
changeQuery: typeof changeQuery; changeQuery: typeof changeQuery;
className?: string; className?: string;
exploreId: ExploreId; exploreId: ExploreId;
datasourceInstance: ExploreDataSourceApi; datasourceInstance: DataSourceApi;
datasourceStatus: DataSourceStatus; datasourceStatus: DataSourceStatus;
highlightLogsExpressionAction: typeof highlightLogsExpressionAction; highlightLogsExpressionAction: typeof highlightLogsExpressionAction;
history: HistoryItem[]; history: HistoryItem[];
......
...@@ -16,7 +16,7 @@ import BracesPlugin from 'app/features/explore/slate-plugins/braces'; ...@@ -16,7 +16,7 @@ import BracesPlugin from 'app/features/explore/slate-plugins/braces';
// Types // Types
import { LokiQuery } from '../types'; import { LokiQuery } from '../types';
import { TypeaheadOutput, HistoryItem } from 'app/types/explore'; import { TypeaheadOutput, HistoryItem } from 'app/types/explore';
import { ExploreDataSourceApi, ExploreQueryFieldProps, DataSourceStatus } from '@grafana/ui'; import { DataSourceApi, ExploreQueryFieldProps, DataSourceStatus } from '@grafana/ui';
function getChooserText(hasSyntax: boolean, hasLogLabels: boolean, datasourceStatus: DataSourceStatus) { function getChooserText(hasSyntax: boolean, hasLogLabels: boolean, datasourceStatus: DataSourceStatus) {
if (datasourceStatus === DataSourceStatus.Disconnected) { if (datasourceStatus === DataSourceStatus.Disconnected) {
...@@ -65,7 +65,7 @@ export interface CascaderOption { ...@@ -65,7 +65,7 @@ export interface CascaderOption {
disabled?: boolean; disabled?: boolean;
} }
export interface LokiQueryFieldFormProps extends ExploreQueryFieldProps<ExploreDataSourceApi<LokiQuery>, LokiQuery> { export interface LokiQueryFieldFormProps extends ExploreQueryFieldProps<DataSourceApi<LokiQuery>, LokiQuery> {
history: HistoryItem[]; history: HistoryItem[];
syntax: any; syntax: any;
logLabelOptions: any[]; logLabelOptions: any[];
......
...@@ -15,7 +15,7 @@ import BracesPlugin from 'app/features/explore/slate-plugins/braces'; ...@@ -15,7 +15,7 @@ import BracesPlugin from 'app/features/explore/slate-plugins/braces';
import QueryField, { TypeaheadInput, QueryFieldState } from 'app/features/explore/QueryField'; import QueryField, { TypeaheadInput, QueryFieldState } from 'app/features/explore/QueryField';
import { PromQuery } from '../types'; import { PromQuery } from '../types';
import { CancelablePromise, makePromiseCancelable } from 'app/core/utils/CancelablePromise'; import { CancelablePromise, makePromiseCancelable } from 'app/core/utils/CancelablePromise';
import { ExploreDataSourceApi, ExploreQueryFieldProps, DataSourceStatus, QueryHint } from '@grafana/ui'; import { DataSourceApi, ExploreQueryFieldProps, DataSourceStatus, QueryHint } from '@grafana/ui';
const HISTOGRAM_GROUP = '__histograms__'; const HISTOGRAM_GROUP = '__histograms__';
const METRIC_MARK = 'metric'; const METRIC_MARK = 'metric';
...@@ -101,7 +101,7 @@ interface CascaderOption { ...@@ -101,7 +101,7 @@ interface CascaderOption {
disabled?: boolean; disabled?: boolean;
} }
interface PromQueryFieldProps extends ExploreQueryFieldProps<ExploreDataSourceApi<PromQuery>, PromQuery> { interface PromQueryFieldProps extends ExploreQueryFieldProps<DataSourceApi<PromQuery>, PromQuery> {
history: HistoryItem[]; history: HistoryItem[];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment