From 8172672e96ce3162a6ea57939bc4f44c2c990af2 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 8 Dec 2022 09:44:04 +0100 Subject: [PATCH] [v9.3.x] PanelEdit: Fixes bug with not remembering panel options pane collapse/expand state (#59309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PanelEdit: Fixes bug with not remembering panel options pane collapse/expand state (#59265) (cherry picked from commit d76638338dde8e2d13cd69fc352543576d4e9145) Co-authored-by: Torkel Ödegaard --- .../dashboard/components/PanelEditor/PanelEditor.tsx | 5 ----- .../dashboard/components/PanelEditor/VisualizationButton.tsx | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index 0ff0ddc03cf..8582d2a3420 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -193,11 +193,6 @@ export class PanelEditorUnconnected extends PureComponent { this.props.toggleTableView(); }; - onTogglePanelOptions = () => { - const { uiState, updatePanelEditorUIState } = this.props; - updatePanelEditorUIState({ isPanelOptionsVisible: !uiState.isPanelOptionsVisible }); - }; - renderPanel(styles: EditorStyles, isOnlyPanel: boolean) { const { dashboard, panel, uiState, tableViewEnabled, theme } = this.props; diff --git a/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx b/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx index 7fea2df9955..7143623a879 100644 --- a/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx +++ b/public/app/features/dashboard/components/PanelEditor/VisualizationButton.tsx @@ -8,7 +8,8 @@ import { useDispatch, useSelector } from 'app/types'; import { PanelModel } from '../../state'; import { getPanelPluginWithFallback } from '../../state/selectors'; -import { setPanelEditorUIState, toggleVizPicker } from './state/reducers'; +import { updatePanelEditorUIState } from './state/actions'; +import { toggleVizPicker } from './state/reducers'; type Props = { panel: PanelModel; @@ -25,7 +26,7 @@ export const VisualizationButton = ({ panel }: Props) => { }; const onToggleOptionsPane = () => { - dispatch(setPanelEditorUIState({ isPanelOptionsVisible: !isPanelOptionsVisible })); + dispatch(updatePanelEditorUIState({ isPanelOptionsVisible: !isPanelOptionsVisible })); }; if (!plugin) {