QueryLibrary: Analytics (#106740)

Query Library Analytic Changes
This commit is contained in:
Collin Fingar
2025-06-18 09:54:52 -04:00
committed by GitHub
parent 13406336ce
commit 8b4b77c928
2 changed files with 10 additions and 3 deletions
@@ -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;
/**
@@ -541,7 +541,7 @@ function ReplaceQueryFromLibrary<TQuery extends DataQuery>({
const { openDrawer, queryLibraryEnabled } = useQueryLibraryContext();
const onReplaceQueryFromLibrary = () => {
openDrawer(datasourceFilters, onSelectQuery);
openDrawer(datasourceFilters, onSelectQuery, { isReplacingQuery: true });
};
return queryLibraryEnabled ? (