Skip to content

Commit

Permalink
fix: call detected_fields when levels var changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gtk-grafana committed Oct 22, 2024
1 parent 13ee888 commit 89b28d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Components/ServiceScene/ServiceScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export class ServiceScene extends SceneObjectBase<ServiceSceneState> {
this.setSubscribeToLabelsVariable();
this._subs.add(this.subscribeToFieldsVariable());
this._subs.add(this.subscribeToMetadataVariable());
this._subs.add(this.subscribeToLevelsVariable());
this._subs.add(this.subscribeToDataSourceVariable());

// Update query runner on manual time range change
Expand Down Expand Up @@ -306,6 +307,14 @@ export class ServiceScene extends SceneObjectBase<ServiceSceneState> {
});
}

private subscribeToLevelsVariable() {
return getLevelsVariable(this).subscribeToState((newState, prevState) => {
if (!areArraysEqual(newState.filters, prevState.filters)) {
this.state.$detectedFieldsData?.runQueries();
}
});
}

private runQueries() {
const slug = getDrilldownSlug();
const parentSlug = getDrilldownValueSlug();
Expand Down

0 comments on commit 89b28d2

Please sign in to comment.