Library Panels: Change unsaved change detection logic (#31477)

* Library Panels: Change unsaved change detection logic
Change logic from diffing panel models to setting dirty flag
This commit is contained in:
kay delaney
2021-03-03 14:16:54 +00:00
committed by GitHub
parent f5d1fa48ca
commit 9e0d84f1cf
7 changed files with 47 additions and 23 deletions

View File

@@ -28,8 +28,10 @@ export const PanelLibraryOptionsGroup: React.FC<Props> = ({ panel, dashboard })
libraryPanel: toPanelModelLibraryPanel(panelInfo),
});
// dummy change for re-render
// onPanelConfigChange('isEditing', true);
// Though the panel model has changed, since we're switching to an existing
// library panel, we reset the "hasChanged" state.
panel.hasChanged = false;
panel.refresh();
panel.events.publish(PanelQueriesChangedEvent);
};