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

(superset) 09/16: fix: Exclude header controls from dashboard PDF export (#27068)

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

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

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

    fix: Exclude header controls from dashboard PDF export (#27068)
    
    (cherry picked from commit 005cee023b7c312d51e0f10629834d53dab4c60a)
---
 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 19ecce85b4..bc884fd43a 100644
--- a/superset-frontend/src/types/dom-to-pdf.d.ts
+++ b/superset-frontend/src/types/dom-to-pdf.d.ts
@@ -9,6 +9,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 eebca66b8b..5367efc724 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(() => {