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

fix(Dashboard download): Download dashboard screenshot/PDF using SupersetClient #30212

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

Vitor-Avila
Copy link
Contributor

SUMMARY

When downloading the dashboard as a screenshot/PDF via the client, a POST request is sent to /api/v1/dashboard/cache_dashboard_screenshot/, and then a following GET request has to be sent to /api/v1/dashboard/${dashboardId}/screenshot/${cacheKey}/?download_format=${format}.

This PR changes the GET request to be fired with SupersetClient as opposed to fetch, to make sure that the GUEST_TOKEN_HEADER_NAME header is included in the request (for guest users).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

No UI changes.

TESTING INSTRUCTIONS

  1. Access a dashboard via embedded.
  2. Download the dashboard as PDF.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added api Related to the REST API dashboard:export Related to exporting dashboards labels Sep 10, 2024
@geido geido changed the title fix (Dashboard download): Download dashboard screenshot/PDF using SupersetClient fix(Dashboard download): Download dashboard screenshot/PDF using SupersetClient Sep 10, 2024
@github-actions github-actions bot removed the api Related to the REST API label Sep 10, 2024
@geido geido merged commit d191e67 into apache:master Sep 10, 2024
34 checks passed
@sadpandajoe sadpandajoe added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Sep 11, 2024
sadpandajoe pushed a commit that referenced this pull request Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:export Related to exporting dashboards size/M v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants