From 032ab0af508739f7951641ea85c0c2806064688f Mon Sep 17 00:00:00 2001 From: dmprieto Date: Fri, 3 Feb 2023 15:48:21 -0500 Subject: [PATCH] [Dashboard] Unlink from library / Save to library actions do not work for maximized panels #139915 - As stated in the issue comments, after linking/unlinking to the library, the expanded panel id is reset to undefined --- .../public/dashboard_actions/add_to_library_action.tsx | 3 +++ .../public/dashboard_actions/unlink_from_library_action.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx b/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx index 165f77b2c177e..1431c7fc61ed2 100644 --- a/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx +++ b/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx @@ -97,6 +97,9 @@ export class AddToLibraryAction implements Action { const title = dashboardAddToLibraryActionStrings.getSuccessMessage( embeddable.getTitle() ? `'${embeddable.getTitle()}'` : '' ); + if (dashboard.getExpandedPanelId() !== undefined) { + dashboard.setExpandedPanelId(undefined); + } this.toastsService.addSuccess({ title, 'data-test-subj': 'addPanelToLibrarySuccess', diff --git a/src/plugins/dashboard/public/dashboard_actions/unlink_from_library_action.tsx b/src/plugins/dashboard/public/dashboard_actions/unlink_from_library_action.tsx index 1dafc89972a3c..6be0001c62b59 100644 --- a/src/plugins/dashboard/public/dashboard_actions/unlink_from_library_action.tsx +++ b/src/plugins/dashboard/public/dashboard_actions/unlink_from_library_action.tsx @@ -91,6 +91,9 @@ export class UnlinkFromLibraryAction implements Action