From f7fafe70f40fcb69dafe9d032bba58444dc14dfc Mon Sep 17 00:00:00 2001 From: Alexa Vargas <239999+axelavargas@users.noreply.github.com> Date: Tue, 24 Jun 2025 14:15:44 +0200 Subject: [PATCH] Dashboard: FF `dashboardNewLayouts` Fix library panels non-editable when multiple added (#107052) Dashboards: Fix library panels non-editable if multiple were added - dashboardNewLayouts --- .../dashboard-scene/scene/AddLibraryPanelDrawer.test.tsx | 1 + .../features/dashboard-scene/scene/AddLibraryPanelDrawer.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.test.tsx b/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.test.tsx index cba0d0f9e01..a1bbb12ac8c 100644 --- a/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.test.tsx +++ b/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.test.tsx @@ -139,6 +139,7 @@ describe('AddLibraryPanelWidget', () => { expect(behavior.state.uid).toBe('new_uid'); expect(behavior.state.name).toBe('new_name'); expect(panels[0].state.title).toBe('model title'); + expect(panels[0].state.key).toBe('panel-1'); // Key should be preserved from original panel }); it('should set hoverHeader to true if the library panel title is empty', () => { diff --git a/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.tsx b/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.tsx index 85d4b062a98..5e5d5e4a5c3 100644 --- a/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.tsx +++ b/public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.tsx @@ -38,6 +38,9 @@ export class AddLibraryPanelDrawer extends SceneObjectBase