From 434d370394d0c7033a9ae147c6807e19e024aacf Mon Sep 17 00:00:00 2001 From: Laura Benz <48948963+L-M-K-B@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:19:37 +0100 Subject: [PATCH] BrowseDashboards: Add tracking (#113696) * feat: add tracking for New button * feat: add tracking for New button dashboard click * refactor: move tracking * refactor: add payload * refactor: clean up * refactor: include folder clicks * refactor: add view to payload * feat: add tracking in serach view * refactor: fix TS error * refactor: adjust payload * refactor: adjust payload * refactor: fix TS error * refactor: clean up * refactor: set trackingSource * refactor: remove type declaration Co-authored-by: Alex Khomenko * refactor: apply changes after code review * Refactor: clean up Co-authored-by: Alex Khomenko * refactor: fix tests --------- Co-authored-by: Alex Khomenko --- .../components/CreateNewButton.tsx | 7 ++- .../browse-dashboards/components/NameCell.tsx | 6 ++- .../components/SearchView.tsx | 1 + .../plugins/admin/components/PluginUsage.tsx | 1 + .../page/components/SearchResultsTable.tsx | 45 ++++++++++++++----- 5 files changed, 47 insertions(+), 13 deletions(-) diff --git a/public/app/features/browse-dashboards/components/CreateNewButton.tsx b/public/app/features/browse-dashboards/components/CreateNewButton.tsx index c263b110e56..46bff8848f5 100644 --- a/public/app/features/browse-dashboards/components/CreateNewButton.tsx +++ b/public/app/features/browse-dashboards/components/CreateNewButton.tsx @@ -50,6 +50,11 @@ export default function CreateNewButton({ const notifyApp = useAppNotification(); const isProvisionedInstance = useIsProvisionedInstance(); + const handleVisibleChange = () => { + !isOpen && reportInteraction('grafana_create_new_button_menu_opened'); + setIsOpen(!isOpen); + }; + let renderPreBuiltDashboardAction = false; if (config.featureToggles.dashboardTemplates) { const testDataSources = getDataSourceSrv().getList({ type: 'grafana-testdata-datasource' }); @@ -129,7 +134,7 @@ export default function CreateNewButton({ return ( <> - +