-
Notifications
You must be signed in to change notification settings - Fork 8k
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] Fix table sorting on time picker interval change #182173
Conversation
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
To update your PR or re-run it, just comment with: |
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.
Code changes LGTM, tested locally and resolves issue.
@@ -218,15 +226,19 @@ function getUndefinedHandler( | |||
if (valueB == null || Number.isNaN(valueB)) { | |||
return -1; | |||
} | |||
return sortingCriteria(rowA, rowB, direction); | |||
return sortingCriteria(rowA!, rowB!, direction); |
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.
Type guards are always preferable to !
💥
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
## Summary Fixes elastic#182153 Due to some specific implementation of the schema sorting in the EUI datagrid, sometimes the table row can be `null/undefined` and the comparison function utility wasn't prepared for that. Now the utility is resilient to `null` rows. ### 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 (cherry picked from commit 085d236)
## Summary Fixes elastic#182153 Due to some specific implementation of the schema sorting in the EUI datagrid, sometimes the table row can be `null/undefined` and the comparison function utility wasn't prepared for that. Now the utility is resilient to `null` rows. ### 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 (cherry picked from commit 085d236)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…) (#182215) # Backport This will backport the following commits from `main` to `8.13`: - [[Lens] Fix table sorting on time picker interval change (#182173)](#182173) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-05-01T05:04:29Z","message":"[Lens] Fix table sorting on time picker interval change (#182173)\n\n## Summary\r\n\r\nFixes #182153 \r\n\r\nDue to some specific implementation of the schema sorting in the EUI\r\ndatagrid, sometimes the table row can be `null/undefined` and the\r\ncomparison function utility wasn't prepared for that.\r\nNow the utility is resilient to `null` rows.\r\n\r\n### Checklist\r\n\r\n- [x] [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":"085d2368b08df645966a450025e297524682da4a","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","v8.14.0","v8.13.3","v8.15.0"],"title":"[Lens] Fix table sorting on time picker interval change","number":182173,"url":"#182173 Fix table sorting on time picker interval change (#182173)\n\n## Summary\r\n\r\nFixes #182153 \r\n\r\nDue to some specific implementation of the schema sorting in the EUI\r\ndatagrid, sometimes the table row can be `null/undefined` and the\r\ncomparison function utility wasn't prepared for that.\r\nNow the utility is resilient to `null` rows.\r\n\r\n### Checklist\r\n\r\n- [x] [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":"085d2368b08df645966a450025e297524682da4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.14","8.13"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.13","label":"v8.13.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#182173 Fix table sorting on time picker interval change (#182173)\n\n## Summary\r\n\r\nFixes #182153 \r\n\r\nDue to some specific implementation of the schema sorting in the EUI\r\ndatagrid, sometimes the table row can be `null/undefined` and the\r\ncomparison function utility wasn't prepared for that.\r\nNow the utility is resilient to `null` rows.\r\n\r\n### Checklist\r\n\r\n- [x] [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":"085d2368b08df645966a450025e297524682da4a"}}]}] BACKPORT--> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
…) (#182216) # Backport This will backport the following commits from `main` to `8.14`: - [[Lens] Fix table sorting on time picker interval change (#182173)](#182173) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-05-01T05:04:29Z","message":"[Lens] Fix table sorting on time picker interval change (#182173)\n\n## Summary\r\n\r\nFixes #182153 \r\n\r\nDue to some specific implementation of the schema sorting in the EUI\r\ndatagrid, sometimes the table row can be `null/undefined` and the\r\ncomparison function utility wasn't prepared for that.\r\nNow the utility is resilient to `null` rows.\r\n\r\n### Checklist\r\n\r\n- [x] [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":"085d2368b08df645966a450025e297524682da4a","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","v8.14.0","v8.13.3","v8.15.0"],"title":"[Lens] Fix table sorting on time picker interval change","number":182173,"url":"#182173 Fix table sorting on time picker interval change (#182173)\n\n## Summary\r\n\r\nFixes #182153 \r\n\r\nDue to some specific implementation of the schema sorting in the EUI\r\ndatagrid, sometimes the table row can be `null/undefined` and the\r\ncomparison function utility wasn't prepared for that.\r\nNow the utility is resilient to `null` rows.\r\n\r\n### Checklist\r\n\r\n- [x] [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":"085d2368b08df645966a450025e297524682da4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.14","8.13"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.13","label":"v8.13.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#182173 Fix table sorting on time picker interval change (#182173)\n\n## Summary\r\n\r\nFixes #182153 \r\n\r\nDue to some specific implementation of the schema sorting in the EUI\r\ndatagrid, sometimes the table row can be `null/undefined` and the\r\ncomparison function utility wasn't prepared for that.\r\nNow the utility is resilient to `null` rows.\r\n\r\n### Checklist\r\n\r\n- [x] [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":"085d2368b08df645966a450025e297524682da4a"}}]}] BACKPORT--> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
This didn't make it to BC2 of 8.13.3. Removing the label Thanks! |
## Summary Fixes elastic#182153 Due to some specific implementation of the schema sorting in the EUI datagrid, sometimes the table row can be `null/undefined` and the comparison function utility wasn't prepared for that. Now the utility is resilient to `null` rows. ### 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
Summary
Fixes #182153
Due to some specific implementation of the schema sorting in the EUI datagrid, sometimes the table row can be
null/undefined
and the comparison function utility wasn't prepared for that.Now the utility is resilient to
null
rows.Checklist