mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Command Palette: Links now work when grafana is served under a subpath (#60033)
strip base when pushing urls to locationService
This commit is contained in:
parent
e6743a7e9a
commit
a3681a3353
@ -1,7 +1,7 @@
|
||||
import { Action, Priority } from 'kbar';
|
||||
import React from 'react';
|
||||
|
||||
import { isIconName, NavModelItem } from '@grafana/data';
|
||||
import { isIconName, locationUtil, NavModelItem } from '@grafana/data';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { Icon } from '@grafana/ui';
|
||||
import { changeTheme } from 'app/core/services/theme';
|
||||
@ -35,7 +35,7 @@ function navTreeToActions(navTree: NavModelItem[], parent?: NavModelItem): Actio
|
||||
id: idForNavItem(navItem),
|
||||
name: text, // TODO: translate
|
||||
section: isCreateAction ? SECTION_ACTIONS : SECTION_PAGES,
|
||||
perform: url ? () => locationService.push(url) : undefined,
|
||||
perform: url ? () => locationService.push(locationUtil.stripBaseFromUrl(url)) : undefined,
|
||||
parent: parent && idForNavItem(parent),
|
||||
|
||||
// Only show icons for top level items
|
||||
|
Loading…
Reference in New Issue
Block a user