-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] Edits query in the dashboard #167754
Conversation
…-ref HEAD~1..HEAD --fix'
… popover (elastic#169193) ## Summary Leftover from my ES|QL implementation. We don't need to rerun the query when a user clicks the warning popover. I am removing this here. Note: I still keep it on the footer component because I will need this here elastic#167754 (cherry picked from commit 2ebb325)
… popover (elastic#169193) ## Summary Leftover from my ES|QL implementation. We don't need to rerun the query when a user clicks the warning popover. I am removing this here. Note: I still keep it on the footer component because I will need this here elastic#167754
…g/error popover (#169193) (#169214) # Backport This will backport the following commits from `main` to `8.11`: - [[ES|QL] Do not refresh the query when a user clicks the warning/error popover (#169193)](#169193) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Stratoula Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2023-10-18T09:43:50Z","message":"[ES|QL] Do not refresh the query when a user clicks the warning/error popover (#169193)\n\n## Summary\r\n\r\nLeftover from my ES|QL implementation. We don't need to rerun the query\r\nwhen a user clicks the warning popover. I am removing this here.\r\n\r\nNote: I still keep it on the footer component because I will need this\r\nhere https://github.com/elastic/kibana/pull/167754","sha":"2ebb325d24cef862295008e881c11367e0c00519","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","backport:prev-minor","v8.11.0","Feature:ES|QL","v8.12.0"],"number":169193,"url":"https://github.com/elastic/kibana/pull/169193","mergeCommit":{"message":"[ES|QL] Do not refresh the query when a user clicks the warning/error popover (#169193)\n\n## Summary\r\n\r\nLeftover from my ES|QL implementation. We don't need to rerun the query\r\nwhen a user clicks the warning popover. I am removing this here.\r\n\r\nNote: I still keep it on the footer component because I will need this\r\nhere https://github.com/elastic/kibana/pull/167754","sha":"2ebb325d24cef862295008e881c11367e0c00519"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/169193","number":169193,"mergeCommit":{"message":"[ES|QL] Do not refresh the query when a user clicks the warning/error popover (#169193)\n\n## Summary\r\n\r\nLeftover from my ES|QL implementation. We don't need to rerun the query\r\nwhen a user clicks the warning popover. I am removing this here.\r\n\r\nNote: I still keep it on the footer component because I will need this\r\nhere https://github.com/elastic/kibana/pull/167754","sha":"2ebb325d24cef862295008e881c11367e0c00519"}}]}] BACKPORT--> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
@@ -142,6 +144,7 @@ export const useLensSuggestions = ({ | |||
currentSuggestion: histogramSuggestion ?? currentSuggestion, | |||
suggestionUnsupported: !currentSuggestion && !histogramSuggestion && isPlainRecord, | |||
isOnHistogramMode: Boolean(histogramSuggestion), | |||
histogramQuery: histogramQuery.current ? { esql: histogramQuery.current } : undefined, | |||
}; |
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.
ℹ️ This is done to communicate correctly the histogram query (as it is not the same that Discover uses aka the unified search query)
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: |
closing in favor of #169911 |
Summary
Part of #165928
Closes #144498
Allows the user to edit the ES|QL query from the dashboard. Also allows the user to select one of the suggestions.
Testing
Navigate to Discover ES|QL mode and save a Lens chart to a dashboard. Click the edit Visualization.
Important notes
Running queries which don't return numeric fields
In these cases (i.e.
from logstash-* | keep clientip
we are returning a table. I had to change the datatable logic for text based datasource to not depend to isBucketed flag. This is something we had foreseen from the beginning of text based languagesRunning queries which return a lot of fields
For queries with many fields Lens is going to suggest a huge table trying to add the fields to the different dimensions. This is not something we want:
For this reason we decided to select the first 5 fields and then the user can easily adjust the dimensions with the fields they want.
Checklist