[Dashboard] Fix Title BWC (#95355)
* allow saving blank string to panel title
This commit is contained in:
parent
07f32d03b3
commit
50bdbfc18e
|
@ -29,9 +29,6 @@ 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,
|
||||
|
@ -39,7 +36,7 @@ export function convertPanelStateToSavedDashboardPanel(
|
|||
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 }),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue