|
|
|
@ -40,7 +40,7 @@ export function getPanelMenu( |
|
|
|
|
locationService.partial({ |
|
|
|
|
viewPanel: panel.id, |
|
|
|
|
}); |
|
|
|
|
reportInteraction('dashboards_panelheader_view_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'view' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onEditPanel = (event: React.MouseEvent<any>) => { |
|
|
|
@ -48,25 +48,26 @@ export function getPanelMenu( |
|
|
|
|
locationService.partial({ |
|
|
|
|
editPanel: panel.id, |
|
|
|
|
}); |
|
|
|
|
reportInteraction('dashboards_panelheader_edit_clicked'); |
|
|
|
|
|
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'edit' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onSharePanel = (event: React.MouseEvent<any>) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
sharePanel(dashboard, panel); |
|
|
|
|
reportInteraction('dashboards_panelheader_share_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'share' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onAddLibraryPanel = (event: React.MouseEvent<any>) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
addLibraryPanel(dashboard, panel); |
|
|
|
|
reportInteraction('dashboards_panelheader_createlibrarypanel_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'createLibraryPanel' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onUnlinkLibraryPanel = (event: React.MouseEvent<any>) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
unlinkLibraryPanel(panel); |
|
|
|
|
reportInteraction('dashboards_panelheader_unlinklibrarypanel_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'unlinkLibraryPanel' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onInspectPanel = (tab?: InspectTab) => { |
|
|
|
@ -74,7 +75,7 @@ export function getPanelMenu( |
|
|
|
|
inspect: panel.id, |
|
|
|
|
inspectTab: tab, |
|
|
|
|
}); |
|
|
|
|
reportInteraction('dashboards_panelheader_inspect_clicked', { tab: tab ?? InspectTab.Data }); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'inspect', tab: tab ?? InspectTab.Data }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onMore = (event: React.MouseEvent<any>) => { |
|
|
|
@ -84,19 +85,19 @@ export function getPanelMenu( |
|
|
|
|
const onDuplicatePanel = (event: React.MouseEvent<any>) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
duplicatePanel(dashboard, panel); |
|
|
|
|
reportInteraction('dashboards_panelheader_duplicate_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'duplicate' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onCopyPanel = (event: React.MouseEvent<any>) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
copyPanel(panel); |
|
|
|
|
reportInteraction('dashboards_panelheader_copy_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'copy' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onRemovePanel = (event: React.MouseEvent<any>) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
removePanel(dashboard, panel, true); |
|
|
|
|
reportInteraction('dashboards_panelheader_remove_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'remove' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onNavigateToExplore = (event: React.MouseEvent<any>) => { |
|
|
|
@ -104,13 +105,13 @@ export function getPanelMenu( |
|
|
|
|
const openInNewWindow = |
|
|
|
|
event.ctrlKey || event.metaKey ? (url: string) => window.open(`${config.appSubUrl}${url}`) : undefined; |
|
|
|
|
store.dispatch(navigateToExplore(panel, { getDataSourceSrv, getTimeSrv, getExploreUrl, openInNewWindow }) as any); |
|
|
|
|
reportInteraction('dashboards_panelheader_explore_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'explore' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onToggleLegend = (event: React.MouseEvent) => { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
toggleLegend(panel); |
|
|
|
|
reportInteraction('dashboards_panelheader_togglelegend_clicked'); |
|
|
|
|
reportInteraction('dashboards_panelheader_menu', { item: 'toggleLegend' }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const menu: PanelMenuItem[] = []; |
|
|
|
|