Fix: Keep Kick start your query button visible while typing in a new query editor - #87
Conversation
…query editor Capture whether the editor was opened with an existing query in a ref on mount so the Kickstart button only hides when the editor loads with a saved query (e.g. from a panel or dashboard). New query editors keep the button visible even after the user starts typing. Fixes grafana/grafana#118375
|
|
|
@henrybrewer00-dotcom Thank you for your contribution. I'm reviewing it but I won't be able to merge it unless you sign your commits. Our CI dictates that all commits must be signed. Also you have to sign CLA: #87 (comment) |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions! |
Summary
The "Kick start your query" button in the Prometheus query editor disappears as soon as the user starts typing in a new editor. The button should only hide when the editor opens with an existing (saved) query.
Boolean(props.query.expr)on mount via auseRefand gate the button on that initial value.PromQueryEditorSelector.test.tsx.Fixes #108 (restores the intent of grafana/grafana#113762 without the regression).
Test plan
jest— all 918@grafana/prometheustests pass, including 3 new cases inPromQueryEditorSelector.test.tsx:yarn typecheckpasses