NewPanelEditor: bring back queries not being run on editmode navigation (#23837)

This commit is contained in:
Dominik Prokop 2020-04-23 22:10:08 +02:00 committed by GitHub
parent 2f5bea27b1
commit 6320e5c91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -315,14 +315,18 @@ export class DashboardModel {
panelInitialized(panel: PanelModel) {
panel.initialized();
// refresh new panels unless we are in fullscreen / edit mode
if (!this.otherPanelInFullscreen(panel)) {
panel.refresh();
}
// refresh if panel is in edit mode and there is no last result
if (this.panelInEdit === panel && !this.panelInEdit.getQueryRunner().getLastResult()) {
panel.refresh();
if (this.panelInEdit === panel) {
if (this.panelInEdit.getQueryRunner().getLastResult()) {
return;
} else {
// refresh if panel is in edit mode and there is no last result
panel.refresh();
}
} else {
// refresh new panels unless we are in fullscreen / edit mode
if (!this.otherPanelInFullscreen(panel)) {
panel.refresh();
}
}
}