Dashboard scenes: Fix view panel breadcrum when going to edit from view single panel (#87411)

Fix view panel breadcrum when going to edit from view panel
This commit is contained in:
Oscar Kilhed 2024-05-07 14:02:52 +02:00 committed by GitHub
parent 37af1ae58e
commit c6975e06d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -44,7 +44,7 @@ import { historySrv } from '../settings/version-history';
import { DashboardModelCompatibilityWrapper } from '../utils/DashboardModelCompatibilityWrapper'; import { DashboardModelCompatibilityWrapper } from '../utils/DashboardModelCompatibilityWrapper';
import { dashboardSceneGraph, getLibraryVizPanelFromVizPanel } from '../utils/dashboardSceneGraph'; import { dashboardSceneGraph, getLibraryVizPanelFromVizPanel } from '../utils/dashboardSceneGraph';
import { djb2Hash } from '../utils/djb2Hash'; import { djb2Hash } from '../utils/djb2Hash';
import { getDashboardUrl } from '../utils/urlBuilders'; import { getDashboardUrl, getViewPanelUrl } from '../utils/urlBuilders';
import { import {
NEW_PANEL_HEIGHT, NEW_PANEL_HEIGHT,
NEW_PANEL_WIDTH, NEW_PANEL_WIDTH,
@ -418,6 +418,7 @@ export class DashboardScene extends SceneObjectBase<DashboardSceneState> {
pageNav = { pageNav = {
text: 'View panel', text: 'View panel',
parentItem: pageNav, parentItem: pageNav,
url: getViewPanelUrl(viewPanelScene.state.panelRef.resolve()),
}; };
} }

View File

@ -83,7 +83,10 @@ export function getDashboardUrl(options: DashboardUrlOptions) {
} }
export function getViewPanelUrl(vizPanel: VizPanel) { export function getViewPanelUrl(vizPanel: VizPanel) {
return locationUtil.getUrlForPartial(locationService.getLocation(), { viewPanel: vizPanel.state.key }); return locationUtil.getUrlForPartial(locationService.getLocation(), {
viewPanel: vizPanel.state.key,
editPanel: undefined,
});
} }
export function getEditPanelUrl(panelId: number) { export function getEditPanelUrl(panelId: number) {