Skip to content

Commit

Permalink
fix(LogsPanelScene): improve query rerunning
Browse files Browse the repository at this point in the history
  • Loading branch information
matyax committed Jan 6, 2025
1 parent bfc0b7d commit fcfc371
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Components/ServiceScene/LogsPanelScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { CopyLinkButton } from './CopyLinkButton';
import { getLogsPanelSortOrder, LogOptionsScene } from './LogOptionsScene';
import { LogsVolumePanel, logsVolumePanelKey } from './LogsVolumePanel';
import { getPanelWrapperStyles, PanelMenu } from '../Panels/PanelMenu';
import { LOGS_PANEL_QUERY_REFID, ServiceScene } from './ServiceScene';
import { ServiceScene } from './ServiceScene';

interface LogsPanelSceneState extends SceneObjectState {
body?: VizPanel;
Expand Down Expand Up @@ -106,13 +106,12 @@ export class LogsPanelScene extends SceneObjectBase<LogsPanelSceneState> {
return;
}
if ('sortOrder' in options) {
const serviceScene = sceneGraph.getAncestor(this, ServiceScene);
const runners = sceneGraph.findDescendents(serviceScene, SceneQueryRunner);
runners.forEach((runner) => {
if (runner.isActive && runner.state.queries[0]?.refId === LOGS_PANEL_QUERY_REFID) {
runner.runQueries();
}
});
const $data = sceneGraph.getData(this);
const queryRunner =
$data instanceof SceneQueryRunner ? $data : sceneGraph.findDescendents($data, SceneQueryRunner)[0];
if (queryRunner) {
queryRunner.runQueries();
}
}
this.state.body.onOptionsChange(options);
}
Expand Down

0 comments on commit fcfc371

Please sign in to comment.