From 3204942a86d7d744cc4dc2517825d43f67c4a8c0 Mon Sep 17 00:00:00 2001 From: Juan Cabanas Date: Tue, 6 May 2025 11:31:59 -0300 Subject: [PATCH] ShareDrawer: Add onDismiss prop (#104658) --- .../dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx | 4 +++- public/app/features/dashboard-scene/sharing/types.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx b/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx index bbb48cc6524..7b5b87a11cf 100644 --- a/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx @@ -38,7 +38,9 @@ export class ShareDrawer extends SceneObjectBase implements Mo } onDismiss = () => { - if (this.state.panelRef) { + if (this.state.activeShare?.onDismiss) { + this.state.activeShare.onDismiss(); + } else if (this.state.panelRef) { const dashboard = getDashboardSceneFor(this); dashboard.closeModal(); } else { diff --git a/public/app/features/dashboard-scene/sharing/types.ts b/public/app/features/dashboard-scene/sharing/types.ts index d6c93a7eb2a..bf344638d86 100644 --- a/public/app/features/dashboard-scene/sharing/types.ts +++ b/public/app/features/dashboard-scene/sharing/types.ts @@ -15,4 +15,5 @@ export interface SceneShareTab void; }