[v11.4.x] Panel inspect: Fix inspect keyboard shortcut when grafana served from subpath (#99373)

Panel inspect: Fix inspect keyboard shortcut when grafana served from subpath (#99366)

* Panel inspect: Fix inspect keyboard shortcut when grafana served from a subpath

* Add e2e test

(cherry picked from commit 51b4ac50aa)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
pull/99406/head
grafana-delivery-bot[bot] 5 months ago committed by GitHub
parent 0fc69d16e9
commit 8dd4637706
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      e2e/dashboards-suite/dashboard-keybindings.spec.ts
  2. 2
      public/app/features/dashboard-scene/scene/keyboardShortcuts.ts

@ -21,4 +21,12 @@ describe('Dashboard keybindings', () => {
e2e.components.Panels.Panel.title('server = A, pod = Bob').should('be.visible');
e2e.components.Panels.Panel.title('server = B, pod = Bob').should('be.visible');
});
it('should open panel inspect', () => {
e2e.flows.openDashboard({ uid: 'edediimbjhdz4b/a-tall-dashboard' });
e2e.components.Panels.Panel.title('Panel #1').type('i');
e2e.components.PanelInspector.Json.content().should('be.visible');
cy.get('body').type('{esc}');
e2e.components.PanelInspector.Json.content().should('not.exist');
});
});

@ -100,7 +100,7 @@ export function setupKeyboardShortcuts(scene: DashboardScene) {
keybindings.addBinding({
key: 'i',
onTrigger: withFocusedPanel(scene, async (vizPanel: VizPanel) => {
locationService.push(getInspectUrl(vizPanel));
locationService.push(locationUtil.stripBaseFromUrl(getInspectUrl(vizPanel)));
}),
});

Loading…
Cancel
Save