Skip to content

[9.0] [Lens][Datatable] Fix color mapping of transposed datatables (#208623)#209924

Merged
nickofthyme merged 2 commits intoelastic:9.0from
nickofthyme:backport/9.0/pr-208623
Feb 10, 2025
Merged

[9.0] [Lens][Datatable] Fix color mapping of transposed datatables (#208623)#209924
nickofthyme merged 2 commits intoelastic:9.0from
nickofthyme:backport/9.0/pr-208623

Conversation

@nickofthyme
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

…#208623)

## Summary

In elastic#189895 we added logic to the `getColorCategories` util function to
handle transpose columns. This mistakenly assumed the first row of the
datatable would include all transposed column ids (i.e.
`${value}---${columnId}`). After closer analysis this case is only
present the in datatable rendering (i.e. `table_basic.tsx`), but in this
context we also have the original non-transposed datatable.

So to simplify this we revert this logic to not care about transposed
datatables. Now the color mappings are correctly assigned across **split
by** columns.

<img width="720" alt="image"
src="https://github.com/user-attachments/assets/c588930e-53b9-409f-a257-2c5be35aaa38"
/>

Fixes elastic#208555

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note

Fixes an issue in Lens (elastic#208555) Table where a split-by metric on a
terms rendered incorrect colors in table cells.

---------

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
(cherry picked from commit a93aaee)
@nickofthyme nickofthyme added the backport This PR is a backport of another PR label Feb 5, 2025
@nickofthyme nickofthyme enabled auto-merge (squash) February 5, 2025 21:40
@nickofthyme
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@nickofthyme nickofthyme merged commit 62a9be3 into elastic:9.0 Feb 10, 2025
1 check passed
@nickofthyme nickofthyme deleted the backport/9.0/pr-208623 branch February 10, 2025 20:22
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/chart-expressions-common 21 20 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.6MB 1.6MB -290.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
expressionPartitionVis 26.7KB 26.6KB -77.0B
expressionTagcloud 10.8KB 10.7KB -77.0B
expressionXY 39.5KB 39.5KB -77.0B
total -231.0B
Unknown metric groups

API count

id before after diff
@kbn/chart-expressions-common 25 24 -1

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants