Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover/CSV Reporting] Fix support for nested field columns in CSV …
…reports (elastic#172240) ## Summary When we generate the parameters for the report, we add all of the selected columns as entries in the search request `fields` array (or `*` if none are selected, which is why this case works), but this doesn't work for nested fields since [the fields API doesn't support nested field roots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested): >However, when the `fields` pattern targets the nested `user` field directly, no values will be returned because the pattern doesn’t match any leaf fields. Instead we can detect nested fields and add them to the `fields` array as `{nestedFieldName}.*`, ensuring that all of the leaf fields are returned in the response. Fixes elastic#172236. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [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 - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit ab5ff9c) # Conflicts: # src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts # src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts # x-pack/plugins/reporting/tsconfig.json
- Loading branch information