[Dashboard] Remove duplicate ID (#215575)

Removes a holdover extra `id` key from Dashboard's explicit input
This commit is contained in:
Devon Thomson 2025-04-21 18:15:20 -04:00 committed by GitHub
parent 4e6fa9e37f
commit 154b14da20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,13 +22,11 @@ import {
export const convertPanelsArrayToPanelMap = (panels?: DashboardPanel[]): DashboardPanelMap => {
const panelsMap: DashboardPanelMap = {};
panels?.forEach((panel, idx) => {
const panelIndex = panel.panelIndex ?? String(idx);
panelsMap![panel.panelIndex ?? String(idx)] = {
type: panel.type,
gridData: panel.gridData,
panelRefName: panel.panelRefName,
explicitInput: {
id: panelIndex,
...(panel.id !== undefined && { savedObjectId: panel.id }),
...(panel.title !== undefined && { title: panel.title }),
...panel.panelConfig,
@ -77,7 +75,7 @@ export const generateNewPanelIds = (panels: DashboardPanelMap, references?: Refe
newPanelsMap[newId] = {
...panel,
gridData: { ...panel.gridData, i: newId },
explicitInput: { ...panel.explicitInput, id: newId },
explicitInput: panel.explicitInput ?? {},
};
newReferences.push(
...prefixReferencesFromPanel(newId, getReferencesForPanelId(oldId, references ?? []))