Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/scenes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export { SceneTimeZoneOverride } from './core/SceneTimeZoneOverride';

export { SceneQueryRunner, type QueryRunnerState } from './querying/SceneQueryRunner';
export { DataProviderProxy } from './querying/DataProviderProxy';
export { type ApplicabilityResults } from './variables/DrilldownDependenciesManager';
export { buildApplicabilityMatcher } from './variables/applicabilityUtils';
export {
type ExtraQueryDescriptor,
type ExtraQueryProvider,
Expand Down
15 changes: 15 additions & 0 deletions packages/scenes/src/querying/SceneQueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,14 @@ export class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implemen
});
}

/**
* Returns the per-panel applicability results computed before the last query run.
* Used by UI components (e.g. the panel sub-header) to display non-applicable filters.
*/
public getNonApplicableFilters() {
return this._drilldownDependenciesManager.getApplicabilityResults();
}

private async runWithTimeRange(timeRange: SceneTimeRangeLike) {
// If no maxDataPoints specified we might need to wait for container width to be set from the outside
if (!this.state.maxDataPoints && this.state.maxDataPointsFromWidth && !this._containerWidth) {
Expand Down Expand Up @@ -470,6 +478,13 @@ export class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implemen

this._drilldownDependenciesManager.findAndSubscribeToDrilldowns(ds.uid, this);

await this._drilldownDependenciesManager.resolveApplicability(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to await here? This is gonna block query execution. Maybe instead just fire this funtion without await.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could let it fire and not block querying but then we would cancel inflights and requuery as soon as applicability resolves so we get the correct filters for the given queries

ds,
queries,
timeRange.state.value,
sceneGraph.getScopes(this)
);

const runRequest = getRunRequest();
const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);

Expand Down
Loading
Loading