diff --git a/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx b/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx index 1930c56d81a..1531805c05c 100644 --- a/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx +++ b/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx @@ -70,6 +70,7 @@ export type QueryLibraryContextType = { contextOverride?: string ) => void; setNewQuery: (query?: QueryTemplate) => void; + onSelectQuery: (query: DataQuery) => void; }; export const QueryLibraryContext = createContext({ @@ -91,6 +92,7 @@ export const QueryLibraryContext = createContext({ queryLibraryEnabled: false, context: 'unknown', triggerAnalyticsEvent: () => {}, + onSelectQuery: () => {}, }); export function useQueryLibraryContext() { diff --git a/public/app/features/explore/QueryLibrary/mocks.tsx b/public/app/features/explore/QueryLibrary/mocks.tsx index ecef7d95870..718a3489a64 100644 --- a/public/app/features/explore/QueryLibrary/mocks.tsx +++ b/public/app/features/explore/QueryLibrary/mocks.tsx @@ -19,6 +19,7 @@ export function QueryLibraryContextProviderMock(props: PropsWithChildren) context: 'explore', triggerAnalyticsEvent: jest.fn(), setNewQuery: jest.fn(), + onSelectQuery: jest.fn(), }} > {props.children} diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 438fd609db0..ea3f9db6983 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -393,8 +393,8 @@ export class QueryEditorRow extends PureComponent )}