diff --git a/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx b/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx index d5b0a6d77b3..6735563b939 100644 --- a/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx +++ b/public/app/features/explore/QueryLibrary/QueryLibraryContext.tsx @@ -20,7 +20,11 @@ export type QueryLibraryContextType = { * @param options.context Used for tracking. Should identify the context this is called from, like 'explore' or * 'dashboard'. */ - openDrawer: (datasourceFilters: string[], onSelectQuery: OnSelectQueryType, options?: { context?: string }) => void; + openDrawer: ( + datasourceFilters: string[], + onSelectQuery: OnSelectQueryType, + options?: { isReplacingQuery?: boolean; context?: string } + ) => void; closeDrawer: () => void; isDrawerOpen: boolean; @@ -31,7 +35,10 @@ export type QueryLibraryContextType = { * @param options.context Used for tracking. Should identify the context this is called from, like 'explore' or * 'dashboard'. */ - openAddQueryModal: (query: DataQuery, options?: { onSave?: () => void; context?: string }) => void; + openAddQueryModal: ( + query: DataQuery, + options?: { isDuplicating?: boolean; onSave?: () => void; context?: string } + ) => void; closeAddQueryModal: () => void; /** diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index e30f9b6e7f8..5e1a6c845f6 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -541,7 +541,7 @@ function ReplaceQueryFromLibrary({ const { openDrawer, queryLibraryEnabled } = useQueryLibraryContext(); const onReplaceQueryFromLibrary = () => { - openDrawer(datasourceFilters, onSelectQuery); + openDrawer(datasourceFilters, onSelectQuery, { isReplacingQuery: true }); }; return queryLibraryEnabled ? (