Quatters commented on code in PR #34096:
URL: https://github.com/apache/superset/pull/34096#discussion_r2194836151


##########
superset-frontend/src/types/bootstrapTypes.ts:
##########
@@ -157,6 +157,7 @@ export interface CommonBootstrapData {
   menu_data: MenuData;
   d3_format: Partial<FormatLocaleDefinition>;
   d3_time_format: Partial<TimeLocaleDefinition>;
+  pdf_compression_level: string;

Review Comment:
   Maybe use here literal type too? 
   
   ```ts
   pdf_compression_level: 'NONE' | 'FAST' | 'MEDIUM' | 'SLOW',
   ```



##########
superset-frontend/src/utils/downloadAsPdf.ts:
##########
@@ -58,6 +59,7 @@ export default function downloadAsPdf(
 
     const options = {
       margin: 10,
+      compression: getBootstrapData().common?.pdf_compression_level,

Review Comment:
   `getBootstrapData().common?.pdf_compression_level` never changes in scope of 
`downloadAsPdf` function. I think it's better to put it on top of file (global 
scope). E.g.:
   
   ```ts
   const pdfCompressionLevel = getBootstrapData().common.pdf_compression_level; 
   ...
   compression: pdfCompressionLevel,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to