mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard save interaction evt (#43304)
This commit is contained in:
parent
4b4afc7b2c
commit
f6b70e0a69
@ -138,10 +138,8 @@ export function DashboardSettings({ dashboard, editview }: Props) {
|
||||
<aside className="dashboard-settings__aside">
|
||||
{pages.map((page) => (
|
||||
<Link
|
||||
to={(loc) => {
|
||||
reportInteraction(`Dashboard settings navigation to ${page.id}`);
|
||||
return locationUtil.updateSearchParams(loc.search, `editview=${page.id}`);
|
||||
}}
|
||||
onClick={() => reportInteraction(`Dashboard settings navigation to ${page.id}`)}
|
||||
to={(loc) => locationUtil.updateSearchParams(loc.search, `editview=${page.id}`)}
|
||||
className={cx('dashboard-settings__nav-item', { active: page.id === editview })}
|
||||
key={page.id}
|
||||
>
|
||||
|
@ -5,7 +5,7 @@ import { SaveDashboardOptions } from './types';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { DashboardModel } from 'app/features/dashboard/state';
|
||||
import { saveDashboard as saveDashboardApiCall } from 'app/features/manage-dashboards/state/actions';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { locationService, reportInteraction } from '@grafana/runtime';
|
||||
import { DashboardSavedEvent } from 'app/types/events';
|
||||
|
||||
const saveDashboard = (saveModel: any, options: SaveDashboardOptions, dashboard: DashboardModel) => {
|
||||
@ -32,6 +32,10 @@ export const useDashboardSave = (dashboard: DashboardModel) => {
|
||||
// important that these happen before location redirect below
|
||||
appEvents.publish(new DashboardSavedEvent());
|
||||
appEvents.emit(AppEvents.alertSuccess, ['Dashboard saved']);
|
||||
reportInteraction(`Dashboard ${dashboard.id ? 'saved' : 'created'}`, {
|
||||
name: dashboard.title,
|
||||
url: state.value.url,
|
||||
});
|
||||
|
||||
const currentPath = locationService.getLocation().pathname;
|
||||
const newUrl = locationUtil.stripBaseFromUrl(state.value.url);
|
||||
|
Loading…
Reference in New Issue
Block a user