Commit 06e48cb8 by Peter Holmberg Committed by GitHub

Fix: Migrate Panel edit uiState percentage strings to number (#29412)

parent bec3fbea
......@@ -18,7 +18,7 @@ import { OptionsPaneContent } from './OptionsPaneContent';
import { DashNavButton } from 'app/features/dashboard/components/DashNav/DashNavButton';
import { SubMenuItems } from 'app/features/dashboard/components/SubMenu/SubMenuItems';
import { BackButton } from 'app/core/components/BackButton/BackButton';
import { SplitPaneWrapper } from 'app/core/components/ThreePaneSplit/SplitPaneWrapper';
import { SplitPaneWrapper } from 'app/core/components/SplitPaneWrapper/SplitPaneWrapper';
import { SaveDashboardModalProxy } from '../SaveDashboard/SaveDashboardModalProxy';
import { DashboardPanel } from '../../dashgrid/DashboardPanel';
......
......@@ -37,6 +37,14 @@ export interface PanelEditorState {
}
export const initialState = (): PanelEditorState => {
const storedUiState = store.getObject(PANEL_EDITOR_UI_STATE_STORAGE_KEY, DEFAULT_PANEL_EDITOR_UI_STATE);
let migratedState = { ...storedUiState };
if (typeof storedUiState.rightPaneSize === 'string') {
migratedState = { ...storedUiState, rightPaneSize: parseFloat(storedUiState.rightPaneSize) / 100 };
}
return {
getPanel: () => new PanelModel({}),
getSourcePanel: () => new PanelModel({}),
......@@ -50,7 +58,7 @@ export const initialState = (): PanelEditorState => {
isOpen: false,
ui: {
...DEFAULT_PANEL_EDITOR_UI_STATE,
...store.getObject(PANEL_EDITOR_UI_STATE_STORAGE_KEY, DEFAULT_PANEL_EDITOR_UI_STATE),
...migratedState,
},
};
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment