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
pull/87043/head
Oscar Kilhed 1 year ago committed by GitHub
parent 37af1ae58e
commit c6975e06d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      public/app/features/dashboard-scene/scene/DashboardScene.tsx
  2. 5
      public/app/features/dashboard-scene/utils/urlBuilders.ts

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

@ -83,7 +83,10 @@ export function getDashboardUrl(options: DashboardUrlOptions) {
}
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) {

Loading…
Cancel
Save