From 2d48e75e885d5944e931aad079120a82d8f5c98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Mon, 23 May 2022 08:26:33 +0200 Subject: [PATCH] Chore: Remove deprecated DataSourceAPI methods (#49313) * Remove deprecated metods * Update docs --- packages/grafana-data/src/types/datasource.ts | 24 ------------------- packages/grafana-data/src/types/logs.ts | 9 +++---- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/packages/grafana-data/src/types/datasource.ts b/packages/grafana-data/src/types/datasource.ts index 8d84a51751e..ca269d76d0f 100644 --- a/packages/grafana-data/src/types/datasource.ts +++ b/packages/grafana-data/src/types/datasource.ts @@ -8,7 +8,6 @@ import { AnnotationEvent, AnnotationQuery, AnnotationSupport } from './annotatio import { CoreApp } from './app'; import { KeyValue, LoadingState, TableData, TimeSeries } from './data'; import { DataFrame, DataFrameDTO } from './dataFrame'; -import { LogRowModel } from './logs'; import { PanelData } from './panel'; import { GrafanaPlugin, PluginMeta } from './plugin'; import { DataQuery } from './query'; @@ -266,29 +265,6 @@ abstract class DataSourceApi< */ getQueryDisplayText?(query: TQuery): string; - /** - * @deprecated getLogRowContext and showContextToggle in `DataSourceApi` is deprecated. - * - * DataSourceWithLogsContextSupport should be implemented instead (these methods have exactly - * the same signature in DataSourceWithLogsContextSupport). - * This method will be removed from DataSourceApi in the future. Some editors may still show - * a deprecation warning which can be ignored for time being. - */ - getLogRowContext?: ( - row: LogRowModel, - options?: TContextQueryOptions - ) => Promise; - - /** - * @deprecated getLogRowContext and showContextToggle in `DataSourceApi` is deprecated. - * - * DataSourceWithLogsContextSupport should be implemented instead (these methods have exactly - * the same signature in DataSourceWithLogsContextSupport). - * This method will be removed from DataSourceApi in the future. Some editors may still show - * a deprecation warning which can be ignored for time being. - */ - showContextToggle?(row?: LogRowModel): boolean; - /** * Variable query action. */ diff --git a/packages/grafana-data/src/types/logs.ts b/packages/grafana-data/src/types/logs.ts index 16efd4002a3..e79a8b25e3e 100644 --- a/packages/grafana-data/src/types/logs.ts +++ b/packages/grafana-data/src/types/logs.ts @@ -146,7 +146,8 @@ export enum LogsDedupDescription { } /** - * @alpha + * Data sources that allow showing context rows around the provided LowRowModel should implement this method. + * This will enable "context" button in Logs Panel. */ export interface DataSourceWithLogsContextSupport { /** @@ -157,12 +158,12 @@ export interface DataSourceWithLogsContextSupport { options?: TContextQueryOptions ) => Promise; + /** + * This method can be used to show "context" button based on runtime conditions (for example row model data or plugin settings, etc.) + */ showContextToggle(row?: LogRowModel): boolean; } -/** - * @alpha - */ export const hasLogsContextSupport = (datasource: any): datasource is DataSourceWithLogsContextSupport => { if (!datasource) { return false;