CommandPalette: Make dashboard nav work when under grafana is under sub path (#48744)

This commit is contained in:
Torkel Ödegaard
2022-05-05 17:15:59 +02:00
committed by GitHub
parent ec666f8785
commit fca52a1c83

View File

@@ -1,5 +1,6 @@
import { Action } from 'kbar';
import { locationUtil } from '@grafana/data';
import { locationService, getBackendSrv } from '@grafana/runtime';
async function getDashboardNav(parentId: string): Promise<Action[]> {
@@ -12,7 +13,7 @@ async function getDashboardNav(parentId: string): Promise<Action[]> {
id: `go/dashboard/${item.url}`,
name: `Go to dashboard ${item.title}`,
perform: () => {
locationService.push(item.url);
locationService.push(locationUtil.stripBaseFromUrl(item.url));
},
}));