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

[Discover] Unsaved work error on CSV reports for read-only user #151523

Closed
cqliu1 opened this issue Feb 16, 2023 · 6 comments · Fixed by #180406
Closed

[Discover] Unsaved work error on CSV reports for read-only user #151523

cqliu1 opened this issue Feb 16, 2023 · 6 comments · Fixed by #180406
Assignees
Labels
bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews) Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@cqliu1
Copy link
Contributor

cqliu1 commented Feb 16, 2023

Kibana version:
8.7.0

Elasticsearch version:
8.7.0

Server OS version:
cloud

Browser version:
safari

Browser OS version:
mac ventura 13.2

Original install method (e.g. download page, yum, from source, etc.):
cloud deployment

Describe the bug:
I'm getting a confusing error message when I go to the CSV report advanced options on a read-only user in Discover.

Steps to reproduce:

  1. Log into a user with read only access to discover
  2. Open Discover
  3. Click Share
  4. Click CSV Reports
  5. Click Advanced options
  6. Observe Unsaved work error

Expected behavior:
I'm not sure what the error message should say instead, but we shouldn't tell the user to save their work when they don't have access to save their search. It might be better to just hide the entire CSV report menu when the user doesn't have access to generate a CSV report.

Screenshots (if relevant):
Screenshot 2023-02-16 at 1 46 01 PM
Note: the toast error is from clicking Generate CSV which is expected.

Errors in browser console (if relevant):
Screenshot 2023-02-16 at 1 53 13 PM

Provide logs and/or server output (if relevant):

Any additional context:

@cqliu1 cqliu1 added bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews) labels Feb 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@davismcphee davismcphee added loe:needs-research This issue requires some research before it can be worked on or estimated impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Feb 16, 2023
@tsullivan
Copy link
Member

Related: #112156

@boskjoett
Copy link

boskjoett commented Jan 11, 2024

We have this issue too. We have several Kibana dashboards that are read-only, because we don't want the user to be able to change them. When you initially open the dashboard the "Copy POST URL" button works fine.
If you change the Time Range you can no longer create a POST URL. It shows the error "Unsaved work".

It would be nice if you were able to change the Time Range on a read-only dashboard and still be able to generate a POST URL.

I believe this used to work in Kibana 7.x

@jughosta jughosta added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Mar 13, 2024
@elasticmachine
Copy link
Contributor

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

@Hubadova-F
Copy link

Adding also here, that we have reports of the same behaviour with Unsaved work errors for PDF reports, when the user has read-only privileges.

When dashboard is modified, we get the: "Unsaved work" when choosing the "Copy POST URL" in Kibana.

@tsullivan
Copy link
Member

tsullivan commented Mar 13, 2024

In 8.0, some changes came out for the Share functionality in Dashboard and Discover to prevent the POST URL from being copied when there are unsaved changes in the application state. This was done to a prevent subtle problem and a migration issue:

  1. Subtle problems: if a POST URL is created that refers to a stored Saved Object; plus inline, static, unsaved state; it creates a "mixed state" that can lead to user confusion. The stored SO can be updated at any time, but the unsaved state encoded into the POST URL job parameters can only be updated with the POST URL is re-created. If the stored SO is updated, the POST URL no longer represents what it represented originally, but the static unsaved state still does. The solution: users should need to regenerate the POST URL any time the stored SO is updated. That would not be obvious to the user, as they would have to pay close attention to their reports to notice the issue.
  2. Migration issues: if the schema of an application's Saved Object changes from one version to the next, the unsaved state never gets migrated to the new schema. Today, SO schemas are migrated in storage when Kibana boots up. When an application is requested to load state using the SO schema from an older version, it will break. The solution is the same: users would need to regenerate the POST URL whenever upgrading to a new version that uses a different schema for the SO.

The current configuration of the UI rules is intended to prevent these problems. However, if only the date range is changing and added as unsaved state in the POST URL, it definitely seems unlikely to cause either one of these. I'm not opposed to supporting POST URL creation for applications with unsaved changes, but there also needs to be some explanation in the UI about the problems it can cause.

rshen91 added a commit that referenced this issue Apr 16, 2024
## Summary

This PR refactors #179206 to have
each export type be registered in Reporting and then passed into the
share plugin.

This PR is focused on the redesign in terms of the export modals. Test
refactoring will be done in a separate PR.
Partially closes elastic/kibana-team#753

- [x] Need to refactor this PR to include @eokoneyo's general modal
component
- [x] Lens needs to have Export with all three report type options - to
avoid circular dependencies move the Lens CSV stuff into the reporting
plugin vs having it in Lens
- [x] Canvas should not be affected by these changes (so the old
share/reporting code has to stay for canvas)
#151523 to keep in mind for the
redesign

Failed tests will be covered in this PR
#180406


### TO TEST 

Mark `share.new_version.enabled: true` in your kibana.dev.yml


### Checklist

- [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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

---------

Co-authored-by: Eyo Okon Eyo <eyo.eyo@elastic.co>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
rshen91 added a commit that referenced this issue May 15, 2024
## Summary

This PR makes the share redesign modal work the primary share context
paradigm (excluding Canvas) by removing the share plugin config that had
share.new_version.enabled for testing and implementation.
This PR cleans up the FTRs. 

Closes [#151523](#151523)
As a result of defaulting to short urls, some tests were removed since
they are now obsolete.
One fix in this PR to avoid customer known issues is to allow reporting
(if license is permitted) for watcher users. Refer to
elastic/sdh-kibana#4481 (comment).

I've opened a separate issue to track any skipped or deleted tests as a
result of short urls by default here
#181066

### Checklist

- [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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))


### Release Note

The share menu is updated for a more streamlined user experience. Users
can navigate through a tabbed modal to copy links for discover,
dashboard, and lens.

---------

Co-authored-by: Eyo Okon Eyo <eyo.eyo@elastic.co>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews) Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants