mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Add feature to open log sample in split view (#62097)
* Add tests * Implement split open to see logs functionality * Fix imports in test * Update packages/grafana-data/src/types/logs.ts Co-authored-by: Matias Chomicki <matyax@gmail.com> * Update packages/grafana-data/src/types/logs.ts Co-authored-by: Matias Chomicki <matyax@gmail.com> * Update default scneario to throw error * Exit early in getSupplementaryQuery * Update public/app/features/explore/LogsSamplePanel.tsx Co-authored-by: Matias Chomicki <matyax@gmail.com>
This commit is contained in:
@@ -195,11 +195,23 @@ export enum SupplementaryQueryType {
|
||||
* @internal
|
||||
*/
|
||||
export interface DataSourceWithSupplementaryQueriesSupport<TQuery extends DataQuery> {
|
||||
/**
|
||||
* Returns an observable that will be used to fetch supplementary data based on the provided
|
||||
* supplementary query type and original request.
|
||||
*/
|
||||
getDataProvider(
|
||||
type: SupplementaryQueryType,
|
||||
request: DataQueryRequest<TQuery>
|
||||
): Observable<DataQueryResponse> | undefined;
|
||||
/**
|
||||
* Returns supplementary query types that data source supports.
|
||||
*/
|
||||
getSupportedSupplementaryQueryTypes(): SupplementaryQueryType[];
|
||||
/**
|
||||
* Returns a supplementary query to be used to fetch supplementary data based on the provided type and original query.
|
||||
* If provided query is not suitable for provided supplementary query type, undefined should be returned.
|
||||
*/
|
||||
getSupplementaryQuery(type: SupplementaryQueryType, query: TQuery): TQuery | undefined;
|
||||
}
|
||||
|
||||
export const hasSupplementaryQuerySupport = <TQuery extends DataQuery>(
|
||||
@@ -214,6 +226,7 @@ export const hasSupplementaryQuerySupport = <TQuery extends DataQuery>(
|
||||
|
||||
return (
|
||||
withSupplementaryQueriesSupport.getDataProvider !== undefined &&
|
||||
withSupplementaryQueriesSupport.getSupplementaryQuery !== undefined &&
|
||||
withSupplementaryQueriesSupport.getSupportedSupplementaryQueryTypes().includes(type)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user