You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/06/30 05:52:39 UTC

[superset] branch master updated: feat: screenshot reports with custom width (#24549)

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

beto 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 a740c2c06e feat: screenshot reports with custom width (#24549)
a740c2c06e is described below

commit a740c2c06e1fba0852f9a2cef50043e061186fac
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Thu Jun 29 22:52:32 2023 -0700

    feat: screenshot reports with custom width (#24549)
---
 superset/reports/commands/execute.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/superset/reports/commands/execute.py b/superset/reports/commands/execute.py
index bb7c53ed5e..c499741b08 100644
--- a/superset/reports/commands/execute.py
+++ b/superset/reports/commands/execute.py
@@ -206,18 +206,29 @@ class BaseReportState:
             model=self._report_schedule,
         )
         user = security_manager.find_user(username)
+
         if self._report_schedule.chart:
+            window_width, window_height = app.config["WEBDRIVER_WINDOW"]["slice"]
+            window_size = (
+                self._report_schedule.custom_width or window_width,
+                self._report_schedule.custom_height or window_height,
+            )
             screenshot: Union[ChartScreenshot, DashboardScreenshot] = ChartScreenshot(
                 url,
                 self._report_schedule.chart.digest,
-                window_size=app.config["WEBDRIVER_WINDOW"]["slice"],
+                window_size=window_size,
                 thumb_size=app.config["WEBDRIVER_WINDOW"]["slice"],
             )
         else:
+            window_width, window_height = app.config["WEBDRIVER_WINDOW"]["dashboard"]
+            window_size = (
+                self._report_schedule.custom_width or window_width,
+                self._report_schedule.custom_height or window_height,
+            )
             screenshot = DashboardScreenshot(
                 url,
                 self._report_schedule.dashboard.digest,
-                window_size=app.config["WEBDRIVER_WINDOW"]["dashboard"],
+                window_size=window_size,
                 thumb_size=app.config["WEBDRIVER_WINDOW"]["dashboard"],
             )
         try: