From d76638338dde8e2d13cd69fc352543576d4e9145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 24 Nov 2022 16:03:26 +0100 Subject: [PATCH] PanelEdit: Fixes bug with not remembering panel options pane collapse/expand state (#59265) --- .../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 d06cbfc7353..8dea8470fbe 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) {