-
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
[Lens] Improve suggestions when dragging field for the second time #60687
[Lens] Improve suggestions when dragging field for the second time #60687
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
const [, metrics] = separateBucketColumns(layer); | ||
|
||
// Add new metric if we already have multiple | ||
if (metrics.length > 1) { |
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.
We currently not using this path if metrics.length === 0
, and then later executing code like delete newColumns[metrics[0]]
where metrics[0]
is undefined
. This happens to work, but I think it would be a bit nicer, if we would also use this path if metrics.length === 0
, since we don't then access metrics[0]
and it could look a bit more clear. (At that point maybe we want to switch that if with the code below and make it a metrics.length === 1
-if instead.
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 on Chrome Linux. The described behavior seems to make more sense for me anyway :-) Left one minor code suggestion.
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…lastic#60687) * [Lens] Improve suggestions when dragging into an existing visualization * Include 0 metrics case Co-authored-by: Elastic Machine <[email protected]>
…60687) (#60996) * [Lens] Improve suggestions when dragging into an existing visualization * Include 0 metrics case Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Release note
Improves suggestion logic when dragging fields into the chart. Specifically:
Checklist