From b8d4d28f4a7b5068d162f9f2e6908d29adec5a19 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Tue, 12 Mar 2024 13:54:55 +0100 Subject: [PATCH] DashboardScene: Fix Get Help panel menu for lib panels (#84272) --- .../HelpWizard/SupportSnapshotService.ts | 13 +++++----- .../inspect/HelpWizard/utils.ts | 26 +++++++++++++++---- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/public/app/features/dashboard-scene/inspect/HelpWizard/SupportSnapshotService.ts b/public/app/features/dashboard-scene/inspect/HelpWizard/SupportSnapshotService.ts index c0ea8b29591..c58e00c6667 100644 --- a/public/app/features/dashboard-scene/inspect/HelpWizard/SupportSnapshotService.ts +++ b/public/app/features/dashboard-scene/inspect/HelpWizard/SupportSnapshotService.ts @@ -75,12 +75,13 @@ export class SupportSnapshotService extends StateManagerBase c.length + acc, 0) : 0; const html = ` @@ -119,6 +132,9 @@ export async function getDebugDashboard(panel: VizPanel, rand: Randomize, timeRa ], }; + // delete library panel not to load the panel from the db + delete dashboard.panels[0].libraryPanel; + if (saveModel.transformations?.length) { const last = dashboard.panels[dashboard.panels.length - 1]; last.title = last.title + ' (after transformations)'; @@ -131,7 +147,7 @@ export async function getDebugDashboard(panel: VizPanel, rand: Randomize, timeRa dashboard.panels.push(before); } - if (data.annotations?.length) { + if (annotationsCount > 0) { dashboard.panels.push({ id: 7, gridPos: { @@ -216,7 +232,7 @@ function getAnnotationsRow(data: PanelData): string { return ` - + `; }
Panel
Annotations${data.annotations.map((a, idx) => `${a.length}`)}${data.annotations.reduce((acc, c) => c.length + acc, 0)}