New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore: Run test datasource default selection when mounted #65864
Conversation
You have successfully added a new CodeQL configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested it and i think the same can be achieved by adding
getDefaultQuery(): Partial<TestData> {
return {
scenarioId: TestDataQueryType.RandomWalk,
seriesCount: 1,
};
}
to public/app/plugins/datasource/testdata/datasource.ts
.
The however refers to -- Grafana --
datasource, so adding
getDefaultQuery(): Partial<GrafanaQuery> {
return {
queryType: GrafanaQueryType.RandomWalk,
};
}
to public/app/plugins/datasource/grafana/datasource.ts
would fix the issue also for that DS.
@Elfo404 both an objectively better solution and on the right datasource (😅 ) thank you so much! |
* Run test datasource query when mounted * Auto running test-datasource creates more query history entries * Make exemplar query intercept more robust * Delete unrelated query history queries * Revert "Run test datasource query when mounted" This reverts commit 28b37e4. * Add default query to testdata and grafana datasources
Awesome 👏 , thanks for this @gelicia |
What is this feature?
When the test datasource is selected, the query editor comes pre-populated with options where it can run without being changed. Because no changes can be made to the form for it to be a valid query, running "Run Queries" without editing anything is seen as an empty query and skipped. This updates the test data query editor on mount so the component picks up the default value.
Why do we need this feature?
Because opening the test datasource and finding the run query button to be non-responsive is a bad experience.
Which issue(s) does this PR fix?:
Fixes #65426
Special notes for your reviewer:
Please check that: