mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 04:04:00 -06:00
Command Palette: Links opened in a new tab now route correctly when Grafana is served under a subpath (#69845)
don't strip base from url since we're not using locationSrv.push anymore
This commit is contained in:
parent
5a831d877a
commit
9eb8ec9fa9
@ -1,7 +1,6 @@
|
||||
import debounce from 'debounce-promise';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { locationUtil } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
@ -43,7 +42,7 @@ export async function getRecentDashboardActions(): Promise<CommandPaletteAction[
|
||||
name: `${name}`,
|
||||
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
|
||||
priority: RECENT_DASHBOARDS_PRORITY,
|
||||
url: locationUtil.stripBaseFromUrl(url),
|
||||
url,
|
||||
};
|
||||
});
|
||||
|
||||
@ -72,7 +71,7 @@ export async function getSearchResultActions(searchQuery: string): Promise<Comma
|
||||
? t('command-palette.section.dashboard-search-results', 'Dashboards')
|
||||
: t('command-palette.section.folder-search-results', 'Folders'),
|
||||
priority: SEARCH_RESULTS_PRORITY,
|
||||
url: locationUtil.stripBaseFromUrl(url),
|
||||
url,
|
||||
subtitle: data.view.dataFrame.meta?.custom?.locationInfo[location]?.name,
|
||||
};
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { locationUtil, NavModelItem } from '@grafana/data';
|
||||
import { NavModelItem } from '@grafana/data';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { changeTheme } from 'app/core/services/theme';
|
||||
|
||||
@ -32,7 +32,7 @@ function navTreeToActions(navTree: NavModelItem[], parents: NavModelItem[] = [])
|
||||
id: idForNavItem(navItem),
|
||||
name: text,
|
||||
section: section,
|
||||
url: url && locationUtil.stripBaseFromUrl(url),
|
||||
url,
|
||||
target,
|
||||
parent: parents.length > 0 && !isCreateAction ? idForNavItem(parents[parents.length - 1]) : undefined,
|
||||
priority: priority,
|
||||
|
Loading…
Reference in New Issue
Block a user