-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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][Datatable] Fix share export and inspect data #193780
Conversation
- Add transposed table to list of tables - Fix table select dropdown styles
- export transpose datatable from share - support sorting transposed columns - sort transposed columns by args column order (zippered) - removed hidden columns from share output - sort rows when column sorting is present - push empty value to bottom
- Set transposed table as default selection in inspector - Export only transposed table on share - Remove unused prop-types
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.
Comments to reviewers
src/plugins/data/public/utils/table_inspector_view/components/data_table_selector.tsx
Show resolved
Hide resolved
x-pack/plugins/lens/public/app_plugin/csv_download_provider/csv_download_provider.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx
Outdated
Show resolved
Hide resolved
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.
Initial code review
- used sorted column order from state - use column order from transposed table via activeData - remove transpose logic from csv export logic - use prepareLogTable to strip out ghost columns ids from formulas
…rted to the csv export utility - move column & row sorting into vis definition - use `@kbn/sort-predicates` to sort rows - remove sorted columns logic - remove column sorting logic
- remove circular dep issue with transpose-helpers pkg - split transpose logic to share only id util functions - move transpose table logic back to plugin - rename pkg to utils instead of helpers - fixup failing tests from transpose sorting changes
x-pack/plugins/lens/common/expressions/datatable/transpose_helpers.test.ts
Show resolved
Hide resolved
…form in `workpace_panel`
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
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.
kibana-presentation changes LGTM
code review only
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.
Tested, approving for not blocking this.
Few observations who could be addressed in a follow up:
- While now there's the option to select between tables in the
Inspector > Data
page, there's no clear distinctions nor explanation on why there are multiple tables. Better namings here would help (out of scope of this PR) - The download now leads to multiple downloads with generic names
Inspector 1
andInspector 2
which has the same issue as before: why 2 files? Which one is the transposed one? (Out of scope of this PR) - I've noticed some performance hit when switching between
Request
andData
page in the inspector when there's aSplit by
metric. (Out of scope of this PR)
Thanks @dej611 as for...
Yeah I agree, I thought about changing this to allow tables to have titles and descriptions but it's been unchanged for 4 years, so I just left as is.
Yeah this is the default behavior. The names could be better as mentioned above. I changed this on the share to export just the final table but not in the inspector downloads. I think adding options to the
I can take a look at this to see if there's duplicate code execution somewhere. |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
History
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11503862348 |
The exported table data table provided in the inspector and the share export now match what was visible in the UI. (cherry picked from commit a854ff8)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…197696) # Backport This will backport the following commits from `main` to `8.x`: - [[Lens][Datatable] Fix share export and inspect data (#193780)](#193780) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nick Partridge","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T16:51:38Z","message":"[Lens][Datatable] Fix share export and inspect data (#193780)\n\nThe exported table data table provided in the inspector and the share export now match what was visible in the UI.","sha":"a854ff8a4e4f81397cebde70adc31e4ee893ce34","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:ExpressionLanguage","Team:Visualizations","Feature:Lens","v9.0.0","backport:prev-minor"],"title":"[Lens][Datatable] Fix share export and inspect data","number":193780,"url":"https://github.com/elastic/kibana/pull/193780","mergeCommit":{"message":"[Lens][Datatable] Fix share export and inspect data (#193780)\n\nThe exported table data table provided in the inspector and the share export now match what was visible in the UI.","sha":"a854ff8a4e4f81397cebde70adc31e4ee893ce34"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193780","number":193780,"mergeCommit":{"message":"[Lens][Datatable] Fix share export and inspect data (#193780)\n\nThe exported table data table provided in the inspector and the share export now match what was visible in the UI.","sha":"a854ff8a4e4f81397cebde70adc31e4ee893ce34"}}]}] BACKPORT--> Co-authored-by: Nick Partridge <[email protected]>
Summary
This PR fixes #187551 where the table provided in the inspector and the share export, did not match what was visible in the table.
Changes
Viewing the datatable from Inspect action
Zight.Recording.2024-09-23.at.02.06.10.PM.mp4
Exporting table to csv via the Share action
['css › X', 'css › Y', 'deb › X', 'deb › Y']
).null
values at the bottom to match eui behavior.The Lens table above would output a csv that shows as shown below (in Numbers).
Or in raw form as.
Checklist