mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
Explore: Remove deprecated DataSourceWithLogsVolumeSupport (#66266)
Logs volume: Remove deprecated DataSourceWithLogsVolumeSupport
This commit is contained in:
parent
2eed889ab7
commit
29c43fcf7e
@ -431,9 +431,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||
],
|
||||
"packages/grafana-data/src/types/logsVolume.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"packages/grafana-data/src/types/options.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
|
@ -7,7 +7,6 @@ export * from './dashboard';
|
||||
export * from './query';
|
||||
export * from './annotations';
|
||||
export * from './logs';
|
||||
export * from './logsVolume';
|
||||
export * from './navModel';
|
||||
export * from './select';
|
||||
export * from './time';
|
||||
|
@ -1,26 +0,0 @@
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { DataQueryRequest, DataQueryResponse } from './datasource';
|
||||
import { DataQuery } from './query';
|
||||
|
||||
/**
|
||||
* Support for DataSourceWithLogsVolumeSupport is deprecated and will be removed in the next major version.
|
||||
* Use DataSourceWithSupplementaryQueriesSupport instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export interface DataSourceWithLogsVolumeSupport<TQuery extends DataQuery> {
|
||||
getLogsVolumeDataProvider(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Support for hasLogsVolumeSupport is deprecated and will be removed in the next major version.
|
||||
* Use DataSourceWithSupplementaryQueriesSupport and hasSupplementaryQuerySupport instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export const hasLogsVolumeSupport = <TQuery extends DataQuery>(
|
||||
datasource: unknown
|
||||
): datasource is DataSourceWithLogsVolumeSupport<TQuery> => {
|
||||
return (datasource as DataSourceWithLogsVolumeSupport<TQuery>).getLogsVolumeDataProvider !== undefined;
|
||||
};
|
@ -10,7 +10,6 @@ import {
|
||||
DataQueryErrorType,
|
||||
DataQueryResponse,
|
||||
DataSourceApi,
|
||||
hasLogsVolumeSupport,
|
||||
hasQueryExportSupport,
|
||||
hasQueryImportSupport,
|
||||
HistoryItem,
|
||||
@ -630,27 +629,6 @@ export const runQueries = (
|
||||
})
|
||||
);
|
||||
|
||||
if (!canReuseSupplementaryQueryData(supplementaryQueries[type].data, queries, absoluteRange)) {
|
||||
dispatch(cleanSupplementaryQueryAction({ exploreId, type }));
|
||||
if (supplementaryQueries[type].enabled) {
|
||||
dispatch(loadSupplementaryQueryData(exploreId, type));
|
||||
}
|
||||
}
|
||||
// Code below (else if scenario) is for backward compatibility with data sources that don't support supplementary queries
|
||||
// TODO: Remove in next major version - v10 (https://github.com/grafana/grafana/issues/61845)
|
||||
} else if (hasLogsVolumeSupport(datasourceInstance) && type === SupplementaryQueryType.LogsVolume) {
|
||||
const dataProvider = datasourceInstance.getLogsVolumeDataProvider({
|
||||
...transaction.request,
|
||||
requestId: `${transaction.request.requestId}_${snakeCase(type)}`,
|
||||
});
|
||||
dispatch(
|
||||
storeSupplementaryQueryDataProviderAction({
|
||||
exploreId,
|
||||
type,
|
||||
dataProvider,
|
||||
})
|
||||
);
|
||||
|
||||
if (!canReuseSupplementaryQueryData(supplementaryQueries[type].data, queries, absoluteRange)) {
|
||||
dispatch(cleanSupplementaryQueryAction({ exploreId, type }));
|
||||
if (supplementaryQueries[type].enabled) {
|
||||
|
Loading…
Reference in New Issue
Block a user