[Lens] Duplicated datatable available as inspector data for Heatmap chart#126786
[Lens] Duplicated datatable available as inspector data for Heatmap chart#126786alexwizp merged 7 commits intoelastic:mainfrom
Conversation
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Checked this PR and it fixes also #126886 👍 |
5f41118 to
1ffec98
Compare
|
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
|
@elasticmachine merge upstream |
flash1293
left a comment
There was a problem hiding this comment.
Tested and didn't manage to break it. Left one thing that should be addressed before merging - approving as I don't think it needs another round of review
|
|
||
| dispatchLens( | ||
| onActiveDataChange( | ||
| Object.entries(adapters.tables?.tables).reduce<Record<string, Datatable>>( |
There was a problem hiding this comment.
Note to @andrewctate We need to do something similar on your PR which brings "show underlying data" to the dashboard as a panel action - otherwise it won't have the required active data around in all cases
| } | ||
| }, | ||
| [dispatchLens] | ||
| [datasourceLayers, dispatchLens] |
There was a problem hiding this comment.
This will cause a lot of re-evaluations of this callback as datasourceLayers changes often. Let's move the default layer id calculation (const [defaultLayerId] = Object.keys(datasourceLayers);) into the component itself and pass defaultLayerId into the hook as a dependency instead.
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @alexwizp |
…hart (elastic#126786) * [Lens] Duplicated datatable available as inspector data for Heatmap chart Close: elastic#123176 * update workspace_panel * revert allowCsvExport * fix CI * fix PR comments * apply pr comments Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Closes: #123176, Closes: #126886
Summary
[Lens] Duplicated datatable available as inspector data for Heatmap chart
Describe the bug:
Since #120239 PR the Heatmap visualization has been unified between Lens, Visualize and Canvas.
The new shared function contains an inspector code to record the datatable with the default id, but because in Lens the inspector registers the data within the mergeTables expression function (executed earlier on) using the layer generated uuid, the result is a duplicated datatable in the Inspector (or in the CSV download).
Screen:
Screen.Recording.2022-03-14.at.10.45.37.AM.mov
[Lens] Datatables are not cleared on layer removal
Describe the bug:
Internal datatables are not cleaned up on layer removal in the configuration, appending any new table to the same multitable data structure.
To reproduce create a Lens visualization, then add a new layer and configure it, then remove it. Open the Inspect panel and see that there are 2 tables available to inspect.
Same issues applies also for reference layers.
Screen:
Screen.Recording.2022-03-14.at.10.44.52.AM.mov