Skip to content
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

Query Editor: Stop running query automatically when all macros are selected #269

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

idastambuk
Copy link
Contributor

@idastambuk idastambuk commented Jan 5, 2024

This PR in main grafana introduced the bug where onRunQuery function is getting redefined and therefore triggers the useEffect and an infinite loop (reported here).
The quickest fix is just removing this effect, since we don't want to run query automatically anyway. Furthermore, when the user opens the editor, and selects all the macros, they might not even have anything in the SQL editor, so we don't want to trigger it anyway.

Also fixed another useEffect typo (I think?) if (!database || !table || !table) {

@idastambuk idastambuk changed the title Stop running query automatically Query Editor: Stop running query automatically when all resources are selected Jan 5, 2024
@idastambuk idastambuk changed the title Query Editor: Stop running query automatically when all resources are selected Query Editor: Stop running query automatically when all macros are selected Jan 5, 2024
@idastambuk idastambuk marked this pull request as ready for review January 5, 2024 21:52
@idastambuk idastambuk requested a review from a team as a code owner January 5, 2024 21:52
Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

Sounds reasonable!

@idastambuk idastambuk merged commit d431282 into main Jan 8, 2024
2 checks passed
@idastambuk idastambuk deleted the fix/runQuery branch January 8, 2024 19:27
@idastambuk idastambuk mentioned this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants