mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
LibrayPanels: Fix unlinking libray panel (#57825)
This commit is contained in:
parent
30dc0f56a4
commit
d7f9093ccd
@ -370,8 +370,7 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
|
||||
onClick={() => {
|
||||
showModal(UnlinkModal, {
|
||||
onConfirm: () => {
|
||||
delete this.props.panel.libraryPanel;
|
||||
this.props.panel.render();
|
||||
this.props.panel.unlinkLibraryPanel();
|
||||
this.forceUpdate();
|
||||
},
|
||||
onDismiss: hideModal,
|
||||
|
@ -672,6 +672,12 @@ export class PanelModel implements DataConfigSource, IPanelModel {
|
||||
}
|
||||
this.libraryPanel = libPanel;
|
||||
}
|
||||
|
||||
unlinkLibraryPanel() {
|
||||
delete this.libraryPanel;
|
||||
this.configRev++;
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
|
||||
function getPluginVersion(plugin: PanelPlugin): string {
|
||||
|
@ -87,10 +87,7 @@ export const unlinkLibraryPanel = (panel: PanelModel) => {
|
||||
new ShowModalReactEvent({
|
||||
component: UnlinkModal,
|
||||
props: {
|
||||
onConfirm: () => {
|
||||
delete panel.libraryPanel;
|
||||
panel.render();
|
||||
},
|
||||
onConfirm: () => panel.unlinkLibraryPanel(),
|
||||
isOpen: true,
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user