From 8cac9b28a0824c3ed058fde795e8adc181499b95 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Sun, 30 Apr 2023 15:05:40 -0400 Subject: [PATCH] [v9.5.x] [Chore] Dashboard: Update analytic events for new panel/row/import/pasted panel (#67215) [Chore] Dashboard: Update analytic events for new panel/row/import/pasted panel (#67205) update analytic events for new panel/row/import/pasted panel (cherry picked from commit 2f1a08511a66d088ec503c041725152e41317076) Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com> Co-authored-by: polinaboneva --- lerna.json | 4 +--- .../dashboard/components/AddPanelButton/AddPanelMenu.tsx | 6 +++--- public/app/features/dashboard/dashgrid/DashboardEmpty.tsx | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index 197caeee0a9..faf4410c618 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,6 @@ { "npmClient": "yarn", "useWorkspaces": true, - "packages": [ - "packages/*" - ], + "packages": ["packages/*"], "version": "9.5.2" } diff --git a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx index 5e6a39b471e..4ec49a60bfc 100644 --- a/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx +++ b/public/app/features/dashboard/components/AddPanelButton/AddPanelMenu.tsx @@ -43,7 +43,7 @@ export const AddPanelMenu = ({ dashboard }: Props) => { label={t('dashboard.add-menu.row', 'Row')} testId={selectors.components.PageToolbar.itemButton('Add new row menu item')} onClick={() => { - reportInteraction('Create new row'); + reportInteraction('dashboards_toolbar_add_clicked', { item: 'add_row' }); onCreateNewRow(dashboard); }} /> @@ -52,7 +52,7 @@ export const AddPanelMenu = ({ dashboard }: Props) => { label={t('dashboard.add-menu.import', 'Import from library')} testId={selectors.components.PageToolbar.itemButton('Add new panel from panel library menu item')} onClick={() => { - reportInteraction('Add a panel from the panel library'); + reportInteraction('dashboards_toolbar_add_clicked', { item: 'import_from_library' }); onAddLibraryPanel(dashboard); }} /> @@ -61,7 +61,7 @@ export const AddPanelMenu = ({ dashboard }: Props) => { label={t('dashboard.add-menu.paste-panel', 'Paste panel')} testId={selectors.components.PageToolbar.itemButton('Add new panel from clipboard menu item')} onClick={() => { - reportInteraction('Paste panel from clipboard'); + reportInteraction('dashboards_toolbar_add_clicked', { item: 'paste_panel' }); onPasteCopiedPanel(dashboard, copiedPanelPlugin); }} disabled={!copiedPanelPlugin} diff --git a/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx b/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx index 117a5946483..581d8f5e3fe 100644 --- a/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx +++ b/public/app/features/dashboard/dashgrid/DashboardEmpty.tsx @@ -64,7 +64,7 @@ export const DashboardEmpty = ({ dashboard, canCreate }: Props) => { fill="outline" aria-label="Add new row" onClick={() => { - reportInteraction('Create new row'); + reportInteraction('dashboards_emptydashboard_clicked', { item: 'add_row' }); onCreateNewRow(dashboard); }} disabled={!canCreate} @@ -86,7 +86,7 @@ export const DashboardEmpty = ({ dashboard, canCreate }: Props) => { fill="outline" aria-label="Add new panel from panel library" onClick={() => { - reportInteraction('Add a panel from the panel library'); + reportInteraction('dashboards_emptydashboard_clicked', { item: 'import_from_library' }); onAddLibraryPanel(dashboard); }} disabled={!canCreate}