DashboardScene: Only update/replace location for normal dashboard route (#84747)

This commit is contained in:
Torkel Ödegaard 2024-03-19 16:40:49 +01:00 committed by GitHub
parent 97156bb759
commit 862305d5ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -80,14 +80,16 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
break;
default:
rsp = await dashboardLoaderSrv.loadDashboard('db', '', uid);
if (route === DashboardRoutes.Embedded) {
rsp.meta.isEmbedded = true;
}
}
if (rsp.meta.url && route !== DashboardRoutes.Embedded) {
if (rsp.meta.url && route === DashboardRoutes.Normal) {
const dashboardUrl = locationUtil.stripBaseFromUrl(rsp.meta.url);
const currentPath = locationService.getLocation().pathname;
if (dashboardUrl !== currentPath) {
// Spread current location to persist search params used for navigation
locationService.replace({

View File

@ -96,6 +96,7 @@ export enum DashboardRoutes {
Scripted = 'scripted-dashboard',
Public = 'public-dashboard',
Embedded = 'embedded-dashboard',
Report = 'report-dashboard',
}
export enum DashboardInitPhase {