[ML] Transforms/DF Analytics: Fix data grid column sorting.#80618
[ML] Transforms/DF Analytics: Fix data grid column sorting.#80618peteharverson merged 4 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/ml-ui (:ml) |
|
@elasticmachine merge upstream |
|
@peteharverson I tweaked the sorting behavior. Because of the underlying behavior where we never know the true order visible in the popover because it isn't exposed from the EUI component there will be some limitations, I added some comments to the code about it. The sorting now will always move all visible columns to the top of the list in the popover when an update is triggered. One glitch is that if you enable an invisible column further down, it will jump up to the already enabled items. It's something we have to live with for now. This way we can guarantee at least that all visible columns can be sorted as intended by the user. |
|
@elasticmachine merge upstream |
peteharverson
left a comment
There was a problem hiding this comment.
Tested latest edits and LGTM
alvarezmelissa87
left a comment
There was a problem hiding this comment.
Tested and LGTM ⚡
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
…80618) * [ML] Fix column sorting. * [ML] Tweak sorting. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…80618) * [ML] Fix column sorting. * [ML] Tweak sorting. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* master: (115 commits) [ML] Transforms/DF Analytics: Fix data grid column sorting. (elastic#80618) added brace import to vis editor (elastic#80652) Fix error rate sorting in services list (elastic#80764) Emit info log when using custom registry URL (elastic#80768) [Reporting] Config Schema Validation for rules[N].protocol strings (elastic#80766) Add Storybook a11y addon (elastic#80069) Fix anomaly alert selection text (elastic#80746) [Security Solution] [Maps] Kibana index pattern, comma bug fix (elastic#80208) [kbn/optimizer] tweak split chunks options (elastic#80444) update template to use the new team label (elastic#80748) [Security Solution] Fix the Field dropdown in Timeline data providers resets when scrolled (elastic#80718) Adjusts observability alerting perms to require "all" (elastic#79896) [Security Solutions][Detection Engine] Fixes pre-packaged rules which contain exception lists to not overwrite user defined lists (elastic#80592) [data.ui] Fix flaky test & lazy loading rendering artifacts. (elastic#80612) Licensed feature usage for connectors (elastic#77679) [Security Solution] Cypress template creation (elastic#80180) [APM] Hide service if only data is from ML (elastic#80145) Fix role mappings test for ESS (elastic#80604) [Maps] Add support for envelope (elastic#80614) [Security Solution] Update button text according to status (elastic#80389) ...
…80803) * [ML] Fix column sorting. * [ML] Tweak sorting. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Walter Rafelsberger <walter@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…80802) * [ML] Fix column sorting. * [ML] Tweak sorting. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Walter Rafelsberger <walter@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Summary
Part of #66381.
Partially fixes an issue with sorting columns in data grids.
Root cause analysis of the bug:
EuiDataGridresets a user's custom sorting in the data grid's popover menu setting when the overall columns passed in to data grid change. Even if the columns "visibly" don't change in our implementation, because of the applied data for the histogram charts, on a re-render the columns information isn't a reference but a new object and soEuiDataGridresets the the sorting of columns.Because
EuiDataGriddoesn't have a callback that exposes the full information of the sorting/visiblity popover (only the sorting of enabled columns) for now we can only make a partial fix.This PR does the partial fix by applying the sorting order of
visibleColumnsto all columns. A user can now successfully reorder at least visible columns.Checklist