Skip to content

Commit

Permalink
[Dashboard] Fix Title BWC (#95355) (#95446)
Browse files Browse the repository at this point in the history
* allow saving blank string to panel title
  • Loading branch information
ThomThomson authored Mar 25, 2021
1 parent e4cd33d commit d748f64
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ export function convertPanelStateToSavedDashboardPanel(
panelState: DashboardPanelState,
version: string
): SavedDashboardPanel {
const customTitle: string | undefined = panelState.explicitInput.title
? (panelState.explicitInput.title as string)
: undefined;
const savedObjectId = (panelState.explicitInput as SavedObjectEmbeddableInput).savedObjectId;
return {
version,
type: panelState.type,
gridData: panelState.gridData,
panelIndex: panelState.explicitInput.id,
embeddableConfig: omit(panelState.explicitInput, ['id', 'savedObjectId', 'title']),
...(customTitle && { title: customTitle }),
...(panelState.explicitInput.title !== undefined && { title: panelState.explicitInput.title }),
...(savedObjectId !== undefined && { id: savedObjectId }),
};
}

0 comments on commit d748f64

Please sign in to comment.