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

Correct type check for the onBlur handler for SQLEditor #116

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

shelldandy
Copy link
Contributor

Otherwise type checking fails when attempting to use the prop as intended:

https://github.com/grafana/grafana-experimental/blob/main/src/sql-editor/components/SQLEditor.tsx#L115-L118

image

@shelldandy shelldandy requested a review from a team as a code owner February 2, 2024 23:21
@shelldandy shelldandy requested review from gabor, yesoreyeram and zoltanbedi and removed request for a team February 2, 2024 23:21
@shelldandy shelldandy self-assigned this Feb 2, 2024
@gabor
Copy link
Contributor

gabor commented Feb 5, 2024

hi @shelldandy , could you please explain the use-case where you need this? i mean, onBlur already calls onChange, so the parent component will be notified about the change (maybe it should not call onChange, but that ship has probably sailed already 😄 )

@shelldandy
Copy link
Contributor Author

For some reason on the VariableQueryEditor page the Run Query button on the page sometimes it's not on sync with the rest of the page (probably because on earlier grafana versions that button wasn't there)

So to fix that issue what we've been doing on enterprise Datasources is to add an onBlur event to force a model update of the onChange function so hitting the button works as intended

Copy link
Contributor

@gabor gabor left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@scottlepp scottlepp left a comment

Choose a reason for hiding this comment

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

just need to bump the version and changelog

@shelldandy shelldandy merged commit d8f2817 into main Feb 7, 2024
2 checks passed
@shelldandy shelldandy deleted the sqleditor-type-fix branch February 7, 2024 15:22
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.

3 participants