mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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 debounce from 'debounce-promise';
|
||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { locationUtil } from '@grafana/data';
|
|
||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
import { t } from 'app/core/internationalization';
|
import { t } from 'app/core/internationalization';
|
||||||
import { contextSrv } from 'app/core/services/context_srv';
|
import { contextSrv } from 'app/core/services/context_srv';
|
||||||
@ -43,7 +42,7 @@ export async function getRecentDashboardActions(): Promise<CommandPaletteAction[
|
|||||||
name: `${name}`,
|
name: `${name}`,
|
||||||
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
|
section: t('command-palette.section.recent-dashboards', 'Recent dashboards'),
|
||||||
priority: RECENT_DASHBOARDS_PRORITY,
|
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.dashboard-search-results', 'Dashboards')
|
||||||
: t('command-palette.section.folder-search-results', 'Folders'),
|
: t('command-palette.section.folder-search-results', 'Folders'),
|
||||||
priority: SEARCH_RESULTS_PRORITY,
|
priority: SEARCH_RESULTS_PRORITY,
|
||||||
url: locationUtil.stripBaseFromUrl(url),
|
url,
|
||||||
subtitle: data.view.dataFrame.meta?.custom?.locationInfo[location]?.name,
|
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 { t } from 'app/core/internationalization';
|
||||||
import { changeTheme } from 'app/core/services/theme';
|
import { changeTheme } from 'app/core/services/theme';
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ function navTreeToActions(navTree: NavModelItem[], parents: NavModelItem[] = [])
|
|||||||
id: idForNavItem(navItem),
|
id: idForNavItem(navItem),
|
||||||
name: text,
|
name: text,
|
||||||
section: section,
|
section: section,
|
||||||
url: url && locationUtil.stripBaseFromUrl(url),
|
url,
|
||||||
target,
|
target,
|
||||||
parent: parents.length > 0 && !isCreateAction ? idForNavItem(parents[parents.length - 1]) : undefined,
|
parent: parents.length > 0 && !isCreateAction ? idForNavItem(parents[parents.length - 1]) : undefined,
|
||||||
priority: priority,
|
priority: priority,
|
||||||
|
Loading…
Reference in New Issue
Block a user