mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 06:22:35 +08:00
[Chore] Dashboard: Update analytic events for new panel/row/import/pasted panel (#67205)
update analytic events for new panel/row/import/pasted panel
This commit is contained in:
@ -27,7 +27,7 @@ export const AddPanelMenu = ({ dashboard }: Props) => {
|
||||
label={t('dashboard.add-menu.visualization', 'Visualization')}
|
||||
testId={selectors.components.PageToolbar.itemButton('Add new visualization menu item')}
|
||||
onClick={() => {
|
||||
reportInteraction('Create new panel');
|
||||
reportInteraction('dashboards_toolbar_add_clicked', { item: 'add_visualization' });
|
||||
const id = onCreateNewPanel(dashboard);
|
||||
locationService.partial({ editPanel: id });
|
||||
}}
|
||||
@ -37,7 +37,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);
|
||||
}}
|
||||
/>
|
||||
@ -46,7 +46,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);
|
||||
}}
|
||||
/>
|
||||
@ -55,7 +55,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}
|
||||
|
@ -36,7 +36,7 @@ export const DashboardEmpty = ({ dashboard, canCreate }: Props) => {
|
||||
icon="plus"
|
||||
aria-label="Add new panel"
|
||||
onClick={() => {
|
||||
reportInteraction('Create new panel');
|
||||
reportInteraction('dashboards_emptydashboard_clicked', { item: 'add_visualization' });
|
||||
const id = onCreateNewPanel(dashboard);
|
||||
locationService.partial({ editPanel: id });
|
||||
}}
|
||||
@ -58,7 +58,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}
|
||||
@ -80,7 +80,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}
|
||||
|
Reference in New Issue
Block a user