Skip to content
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] Fixes error on table when there is no data #161953

Merged
merged 3 commits into from Jul 17, 2023

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Jul 14, 2023

Summary

Closes #161948

Fixes the bug described in the issue. The bug is happening only for the table viz.

image

Checklist

@stratoula stratoula added v8.10.0 v7.17.12 release_note:fix backport:prev-MAJOR Backport to the previous major branch (7.x) and all later branches still in development Feature:Lens labels Jul 14, 2023
@stratoula stratoula added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jul 14, 2023
@stratoula stratoula marked this pull request as ready for review July 14, 2023 13:38
@stratoula stratoula requested a review from a team as a code owner July 14, 2023 13:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great. Love that you added a test

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@@ -118,7 +118,7 @@ function updateColumnArgs(
) {
args.columns = [...bucketsColumnArgs];
// add first column from each group, then add second column for each group, ...
transposedColumnGroups[0].forEach((_, index) => {
transposedColumnGroups[0]?.forEach((_, index) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly why we enabled noUncheckedIndexedAccess in elastic/elastic-charts#2006

I don't know why typescript excluded this flag from strict mode when this is clearly an undefined union.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider adding this setting just for our code... it makes sense to me

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

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.3MB 1.3MB +64.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@stratoula stratoula merged commit 6550793 into elastic:main Jul 17, 2023
19 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 17, 2023
## Summary

Closes elastic#161948

Fixes the bug described in the issue. The bug is happening only for the
table viz.

<img width="1664" alt="image"
src="https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e">

### Checklist

- [ ] [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

(cherry picked from commit 6550793)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 17, 2023
## Summary

Closes elastic#161948

Fixes the bug described in the issue. The bug is happening only for the
table viz.

<img width="1664" alt="image"
src="https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e">

### Checklist

- [ ] [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

(cherry picked from commit 6550793)
kibanamachine added a commit that referenced this pull request Jul 17, 2023
…62020)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Lens] Fixes error on table when there is no data
(#161953)](#161953)

<!--- 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-07-17T07:45:22Z","message":"[Lens]
Fixes error on table when there is no data (#161953)\n\n##
Summary\r\n\r\nCloses
#161948 the bug
described in the issue. The bug is happening only for the\r\ntable
viz.\r\n\r\n<img width=\"1664\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"6550793b4fe793ad53072bddc51118e43414e7ad","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:prev-MAJOR","v8.10.0","v7.17.12"],"number":161953,"url":"#161953
Fixes error on table when there is no data (#161953)\n\n##
Summary\r\n\r\nCloses
#161948 the bug
described in the issue. The bug is happening only for the\r\ntable
viz.\r\n\r\n<img width=\"1664\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"6550793b4fe793ad53072bddc51118e43414e7ad"}},"sourceBranch":"main","suggestedTargetBranches":["7.17"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"#161953
Fixes error on table when there is no data (#161953)\n\n##
Summary\r\n\r\nCloses
#161948 the bug
described in the issue. The bug is happening only for the\r\ntable
viz.\r\n\r\n<img width=\"1664\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"6550793b4fe793ad53072bddc51118e43414e7ad"}},{"branch":"7.17","label":"v7.17.12","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 17, 2023
…162018)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[Lens] Fixes error on table when there is no data
(#161953)](#161953)

<!--- 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-07-17T07:45:22Z","message":"[Lens]
Fixes error on table when there is no data (#161953)\n\n##
Summary\r\n\r\nCloses
#161948 the bug
described in the issue. The bug is happening only for the\r\ntable
viz.\r\n\r\n<img width=\"1664\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"6550793b4fe793ad53072bddc51118e43414e7ad","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:prev-MAJOR","v8.10.0","v7.17.12"],"number":161953,"url":"#161953
Fixes error on table when there is no data (#161953)\n\n##
Summary\r\n\r\nCloses
#161948 the bug
described in the issue. The bug is happening only for the\r\ntable
viz.\r\n\r\n<img width=\"1664\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"6550793b4fe793ad53072bddc51118e43414e7ad"}},"sourceBranch":"main","suggestedTargetBranches":["7.17"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"#161953
Fixes error on table when there is no data (#161953)\n\n##
Summary\r\n\r\nCloses
#161948 the bug
described in the issue. The bug is happening only for the\r\ntable
viz.\r\n\r\n<img width=\"1664\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/9646edcc-005d-4d2c-919a-097a673d730e\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"6550793b4fe793ad53072bddc51118e43414e7ad"}},{"branch":"7.17","label":"v7.17.12","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-MAJOR Backport to the previous major branch (7.x) and all later branches still in development Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.17.12 v8.9.0 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Table errors out when the timespan returns no data
6 participants