You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by kg...@apache.org on 2024/02/09 17:02:14 UTC

(superset) branch master updated: fix: Exclude header controls from dashboard PDF export (#27068)

This is an automated email from the ASF dual-hosted git repository.

kgabryje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 005cee023b fix: Exclude header controls from dashboard PDF export (#27068)
005cee023b is described below

commit 005cee023b7c312d51e0f10629834d53dab4c60a
Author: Kamil Gabryjelski <ka...@gmail.com>
AuthorDate: Fri Feb 9 18:02:05 2024 +0100

    fix: Exclude header controls from dashboard PDF export (#27068)
---
 superset-frontend/src/types/dom-to-pdf.d.ts  | 1 +
 superset-frontend/src/utils/downloadAsPdf.ts | 1 +
 2 files changed, 2 insertions(+)

diff --git a/superset-frontend/src/types/dom-to-pdf.d.ts b/superset-frontend/src/types/dom-to-pdf.d.ts
index 28c06163fd..306d05c162 100644
--- a/superset-frontend/src/types/dom-to-pdf.d.ts
+++ b/superset-frontend/src/types/dom-to-pdf.d.ts
@@ -27,6 +27,7 @@ declare module 'dom-to-pdf' {
     filename: string;
     image: Image;
     html2canvas: object;
+    excludeClassNames?: string[];
   }
 
   const domToPdf = (
diff --git a/superset-frontend/src/utils/downloadAsPdf.ts b/superset-frontend/src/utils/downloadAsPdf.ts
index 5095a75d26..bb769d1eb1 100644
--- a/superset-frontend/src/utils/downloadAsPdf.ts
+++ b/superset-frontend/src/utils/downloadAsPdf.ts
@@ -61,6 +61,7 @@ export default function downloadAsPdf(
       filename: `${generateFileStem(description)}.pdf`,
       image: { type: 'jpeg', quality: 1 },
       html2canvas: { scale: 2 },
+      excludeClassNames: ['header-controls'],
     };
     return domToPdf(elementToPrint, options)
       .then(() => {