jessie-ross commented on code in PR #26391:
URL: https://github.com/apache/superset/pull/26391#discussion_r1723151120


##########
superset-frontend/src/SqlLab/components/ResultSet/index.tsx:
##########
@@ -310,12 +320,50 @@ const ResultSet = ({
         schema: query?.schema,
       };
 
-      const canExportData = findPermission(
+      const canExportCsv = findPermission(
         'can_export_csv',
-        'SQLLab',
+        'SqlLab',
+        user?.roles,
+      );
+      const canExportGoogleSheets = findPermission(
+        'can_export_google_sheets',
+        'SqlLab',
         user?.roles,
       );
 
+      // Antd >= 4.24.0 format:
+      const exportMenuItems = [];
+      if (canExportCsv) {
+        exportMenuItems.push({
+          label: t('CSV'),
+          key: 'csv',
+          icon: <Icons.FileOutlined />,
+          onClick: () => {
+            logAction(LOG_ACTIONS_SQLLAB_DOWNLOAD_CSV, {});
+            window.open(getExportCsvUrl(query.id), '_blank')?.focus();
+          },
+        });
+      }
+      if (isFeatureEnabled(FeatureFlag.GoogleSheetsExport) && 
canExportGoogleSheets) {
+        exportMenuItems.push({
+          label: t('Google Sheets'),
+          key: 'google-sheets',
+          icon: <Icons.GoogleOutlined />,
+          onClick: () =>
+            window.open(getExportGoogleSheetsUrl(query.id), '_blank')?.focus(),

Review Comment:
   Added in 
https://github.com/apache/superset/pull/26391/commits/92857562ee4c1c091e25def8c34e1f3042c6705d



-- 
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