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

[Reporting] Offer CSV Report Generation for saved search panel and deprecate CSV Download #164104

Closed
1 task done
tsullivan opened this issue Aug 16, 2023 · 3 comments · Fixed by #178159
Closed
1 task done
Assignees
Labels
Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@tsullivan
Copy link
Member

tsullivan commented Aug 16, 2023

Implements a change that was researched in #145937

The goals of making a change to offer CSV report generation in the context of saved search panels in a dashboard are:

  1. Deprecate code that we've identified as problematic in the Reporting code: CSV Download
  2. Restore the existing xpack.reporting.csv.enablePanelActionDownload setting (today this is unused) to allow administrators to choose between the deprecated feature and the forwards-compatible feature
  3. Use serverless settings to enforce the forwards-compatible feature, and subtract an internal API used in serverless

Image

Tasks

Preview Give feedback
  1. (Deprecated) Feature:Reporting Team:SharedUX backport:skip release_note:skip v8.14.0
@tsullivan tsullivan added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Aug 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@tsullivan
Copy link
Member Author

tsullivan commented Jan 2, 2024

Bumping this as it has come up from an internal case:

... i configured a role with proper reporting privileges as per the doc (not necessarily using API, can use UI too), especially the download CSV files from saved search panels in Dashboard privilege. And i can now download CSV from a Dashboard that is created from a saved search. The download though, does not create a report in Stack Management - Reporting. while if you download a CSV report from Discover, the report does show up in Stack Management - Reporting. Any idea what’s the difference here? is it expected?

This issue will hopefully get traction and work can be done to make the CSV export options consistent: wherever you are in Kibana when you export CSV, it should create a downloadable report document that can be accessed in Stack Management > Reporting.

@tsullivan
Copy link
Member Author

Working on having this prioritized higher

tsullivan added a commit that referenced this issue Mar 6, 2024
A bugfix/refactoring part of
#164104

## Summary

This PR prevents an exception that happens with CSV download when the
`xpack.reporting.csv.scroll.duration: auto` configuration is set.

Steps to reproduce:
1. Use `xpack.reporting.csv.scroll.duration: auto` in kibana.yml
2. Attempt CSV download from a dashboard search panel.

**Before**


![csv-download-bug-before](https://github.com/elastic/kibana/assets/908371/074fc9f9-05c0-4fd4-b29a-a84a043d0874)

**After**


![csv-download-bug-after](https://github.com/elastic/kibana/assets/908371/ce7159b3-c863-4da4-b9a5-c76b3d096769)

## Other changes
* Move `get_panel_action` to the `kbn-reporting/public` package.
* Update unit test

### Checklist

Delete any items that are not applicable to this PR.

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@tsullivan tsullivan self-assigned this Mar 14, 2024
tsullivan added a commit that referenced this issue Mar 23, 2024
…178159)

Closes #164104

## Summary

**Replace "Download CSV" with "Generate CSV report" to export a CSV file
from saved search panel, deprecate "Download CSV", use a config flag for
providing the deprecated feature.**

This PR uses the `xpack.reporting.csv.enablePanelActionDownload`
kibana.yml setting, which was previously unused, for choosing behavior
of CSV export in a Dashboard saved search panel, and sets the default
value to `false`. The options allow the user to download a CSV file
without creating a report (deprecated, support will be removed in the
future) or to generate a CSV report (default).

1. Use the config as a flag to switch between implementations:
    - downloading a CSV file without a generated report
    - generating a CSV report
2. Updated documentation
3. Refactored / cleaned up tests
4. Increased API test coverage in Serverless
5. Better error handling in
`packages/kbn-reporting/public/reporting_api_client.ts`

### Checklist

Delete any items that are not applicable to this PR.

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

## Release Note
Kibana CSV Reporting offered a feature allowing users to download a CSV
file from a saved search panel in a dashboard, without having a report
generated. This feature is now deprecated. Now, when users need to
access saved search data from a dashboard panel as CSV, a normal report
will be generated. To access the deprecated functionality, you can add
`xpack.reporting.csv.enablePanelActionDownload: true` to kibana.yml, but
this ability will be removed in a future version of Kibana.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants