|
|
|
@ -7,7 +7,7 @@ import { Button, useStyles2, VerticalGroup } from '@grafana/ui'; |
|
|
|
|
import { PanelModel } from 'app/features/dashboard/state'; |
|
|
|
|
import { AddLibraryPanelModal } from '../AddLibraryPanelModal/AddLibraryPanelModal'; |
|
|
|
|
import { LibraryPanelsView } from '../LibraryPanelsView/LibraryPanelsView'; |
|
|
|
|
import { PanelOptionsChangedEvent, PanelQueriesChangedEvent } from 'app/types/events'; |
|
|
|
|
import { PanelDirectiveReadyEvent, PanelOptionsChangedEvent, PanelQueriesChangedEvent } from 'app/types/events'; |
|
|
|
|
import { LibraryElementDTO } from '../../types'; |
|
|
|
|
import { toPanelModelLibraryPanel } from '../../utils'; |
|
|
|
|
import { changePanelPlugin } from 'app/features/dashboard/state/actions'; |
|
|
|
@ -55,8 +55,12 @@ export const PanelLibraryOptionsGroup: FC<Props> = ({ panel, searchQuery }) => { |
|
|
|
|
|
|
|
|
|
panel.configRev = 0; |
|
|
|
|
panel.refresh(); |
|
|
|
|
panel.events.publish(new PanelQueriesChangedEvent()); |
|
|
|
|
panel.events.publish(new PanelOptionsChangedEvent()); |
|
|
|
|
const unsubscribeEvent = panel.events.subscribe(PanelDirectiveReadyEvent, () => { |
|
|
|
|
panel.refresh(); |
|
|
|
|
unsubscribeEvent.unsubscribe(); |
|
|
|
|
}); |
|
|
|
|
panel.events.publish(PanelQueriesChangedEvent); |
|
|
|
|
panel.events.publish(PanelOptionsChangedEvent); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onAddToPanelLibrary = () => { |
|
|
|
|