From 125a11ca99e8f011ee6be1ceadda9397ddaeec86 Mon Sep 17 00:00:00 2001 From: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:33:29 -0700 Subject: [PATCH] Dashboard: Fix snapshots for the old arch (#98902) Fix snapshots for the old arch --- .../app/features/dashboard/services/DashboardLoaderSrv.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/app/features/dashboard/services/DashboardLoaderSrv.ts b/public/app/features/dashboard/services/DashboardLoaderSrv.ts index ede6a20a6e6..08e59febaa4 100644 --- a/public/app/features/dashboard/services/DashboardLoaderSrv.ts +++ b/public/app/features/dashboard/services/DashboardLoaderSrv.ts @@ -146,6 +146,14 @@ export class DashboardLoaderSrv extends DashboardLoaderSrvBase { if (type === 'script' && slug) { promise = this.loadScriptedDashboard(slug); + // needed for the old architecture + // in scenes this is handled through loadSnapshot method + } else if (type === 'snapshot' && slug) { + promise = getDashboardSnapshotSrv() + .getSnapshot(slug) + .catch(() => { + return this._dashboardLoadFailed('Snapshot not found', true); + }); } else if (type === 'public' && uid) { promise = backendSrv .getPublicDashboardByUid(uid)