From c8617b374a5599b21d4e3ceaa664ae9a7a3c2d92 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 1 Dec 2021 08:02:09 -0500 Subject: [PATCH] KeybindingSrv: Prevent dashboard save modal when dashboard cannot be saved (#42505) (#42575) (cherry picked from commit fa930e7dbdf7ae556dc6192e0905f319745dce00) Co-authored-by: Dominik Prokop --- public/app/core/services/keybindingSrv.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index d807975d1e1..8356343dd81 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -173,14 +173,16 @@ export class KeybindingSrv { }); this.bind('mod+s', () => { - appEvents.publish( - new ShowModalReactEvent({ - component: SaveDashboardModalProxy, - props: { - dashboard, - }, - }) - ); + if (dashboard.meta.canSave) { + appEvents.publish( + new ShowModalReactEvent({ + component: SaveDashboardModalProxy, + props: { + dashboard, + }, + }) + ); + } }); this.bind('t z', () => {