[Lens] Improve suggestions when dragging field for the second time#60687
[Lens] Improve suggestions when dragging field for the second time#60687wylieconlon merged 3 commits intoelastic:masterfrom
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.
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.
timroes
left a comment
There was a problem hiding this comment.
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 <elasticmachine@users.noreply.github.com>
Release note
Improves suggestion logic when dragging fields into the chart. Specifically:
Checklist