Skip to content
Snippets Groups Projects
Unverified Commit f4d1d873 authored by Nicolò Pretto's avatar Nicolò Pretto Committed by GitHub
Browse files

Embed pdf export - MS2 (#44463)


* add pdf export button to static embed and public sharing (#43743)

* add export button to embed frame, it works on static embed and public sharing

* move css around to make dashcard border show up on static/public embed pdf exports
the library we use to render an html node to an image doesn't seem to support box shadow
the original fix was done in ParametersAndCardsContainer, but that component is not used in the static/public embeds

* fix types

* fix night theme pdf export
- use padding for the title instead of starting to draw the image from 60px, to keep the bg color
- change the css to also apply the bg-color to the first child of the EmbedFrame, to make it work when exporting to pdfs, where the EmbedFrame is not part of the exported dom

* refactor: exportTabAsPdfButtonText function

* give a default to the filename, even though it should always be there

* exportTabAsPdfButtonText -> getExportTabAsPdfButtonText

* introduce .WithThemeBackground to not have a css rule too much generic

* feat: adds endpoint to download results of a dashcard part of a public dashboard (#44156)

* Flag to hide download buttons (#44206)

* pass down downloadsEnabled to hide downloads buttons in public and embedded questions or dashcards

* Update frontend/src/metabase/dashboard/components/DashCard/DashCardMenu/DashCardMenu.tsx

Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* PLUGIN_DOWNLOADS_ENABLED -> PLUGIN_RESOURCE_DOWNLOADS

* adds comment to areDownloadsEnabled function to explain what it does

---------

Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* logic to handle downloads url parameter (#44363)

* minimal support for downloads url parameter

* updates StaticEmbedSetupPane test to epxect downloads=false instead of hide_download_button=true

* fix prettier mistakes

* tmp fix to the tests until we have the new analytics events

* fix eslint issues

* update embedding snippets e2e

* update embedding questions e2e

* try to clean up the mess of downloads/downloadsEnabled

* adds `hasPremiumFeature` check to the plugin, adds unit test for the logic

* adds TODOS for analytics

* unit tests for downloads flag (#45178)

* fix download pdf button not showing up when titled=false and there's only one tab

* unit tests for downloads flag on dashboards and questions

* adds test about the container id, not sure if we should keep it

* adds a comment to explain why we enable premium features in the tests

* move downloadsEnabled outside of the Boolean cast as it's already a boolean

* E2E tests for public/static downloads (#45240)

* wip e2e tests

* make downloadUtils ts friendly

* assertNotEmpty function

* adds tests for public questions

* e2e tests for static embed downloads

* publicUid -> publicUuid

* fix assertNotEmpty

* fix parameter not renamed

* Apply suggestions from code review

Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>

* remove duplicated test

* fix another typo i forgot to rename

* fix another rename issue

* convert e2e-downloads-helpers to ts

* refactor: put method calculation in getEndpoint function

* adds note to downloadUtils

---------

Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>

* Update e2e/test/scenarios/embedding/embedding-snippets.cy.spec.js

Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* change requires to import to reflect that we changed to export the source code in downloadUtils

* makes downloadsEnabled prop more consistent across components

* colocate downloadsEnabled with hideDownloadButton in embed-display-options

* defaults displayOptions.downloads to true to simplify logic

* remove unused queryString parameter in tests setup function

* reword TODO

* Revert "defaults displayOptions.downloads to true to simplify logic"

This reverts commit aebf4cf3cf3528deefb9c40dfc48d2f39a278b97.

* fix png export when on dark theme (public/embed) not having the dark … (#45497)

* fix png export when on dark theme (public/embed) not having the dark background

* move the border-radius fix for the dashcard export to saveChartImage

* remove comments

---------

Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
parent 1890179a
No related branches found
No related tags found
No related merge requests found
Showing
with 562 additions and 74 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment