mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard: Fix Table view when editing causes the panel data to not update (#34998)
* Dashboard: Fix Table view when editing causes the panel data to not update - Add event subscription on PanelEditorTableView - Extract runAllPanelQueries into Panel Model in order to use it on PanelChrome and PanelEditorTableView - Add simple unit test for runAllQueryPaneQueries
This commit is contained in:
@@ -38,7 +38,6 @@ import {
|
||||
} from './getPanelOptionsWithDefaults';
|
||||
import { QueryGroupOptions } from 'app/types';
|
||||
import { PanelModelLibraryPanel } from '../../library-panels/types';
|
||||
|
||||
export interface GridPos {
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -47,6 +46,8 @@ export interface GridPos {
|
||||
static?: boolean;
|
||||
}
|
||||
|
||||
import { TimeOverrideResult } from '../utils/panel';
|
||||
|
||||
const notPersistedProperties: { [str: string]: boolean } = {
|
||||
events: true,
|
||||
isViewing: true,
|
||||
@@ -292,6 +293,23 @@ export class PanelModel implements DataConfigSource {
|
||||
this.gridPos.h = newPos.h;
|
||||
}
|
||||
|
||||
runAllPanelQueries(dashboardId: number, dashboardTimezone: string, timeData: TimeOverrideResult, width: number) {
|
||||
this.getQueryRunner().run({
|
||||
datasource: this.datasource,
|
||||
queries: this.targets,
|
||||
panelId: this.editSourceId || this.id,
|
||||
dashboardId: dashboardId,
|
||||
timezone: dashboardTimezone,
|
||||
timeRange: timeData.timeRange,
|
||||
timeInfo: timeData.timeInfo,
|
||||
maxDataPoints: this.maxDataPoints || width,
|
||||
minInterval: this.interval,
|
||||
scopedVars: this.scopedVars,
|
||||
cacheTimeout: this.cacheTimeout,
|
||||
transformations: this.transformations,
|
||||
});
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.hasRefreshed = true;
|
||||
this.events.publish(new RefreshEvent());
|
||||
|
||||
Reference in New Issue
Block a user