superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] rusackas commented on a change in pull request #11102: chore: refactor submenu's right nav to accept list of buttons
Date Tue, 29 Sep 2020 22:13:58 GMT

rusackas commented on a change in pull request #11102:
URL: https://github.com/apache/incubator-superset/pull/11102#discussion_r497091393



##########
File path: superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx
##########
@@ -397,24 +397,30 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
     ...commonMenuData,
   };
 
+  const buttonArr = [];
+
+  if (canDelete) {
+    buttonArr.push({
+      name: t('Bulk Select'),
+      onClick: toggleBulkSelect,
+      style: 'secondary',
+    });
+  }
+
   if (canCreate) {
-    menuData.primaryButton = {
+    buttonArr.push({
       name: (
         <>
           {' '}
           <i className="fa fa-plus" /> {t('Dataset')}{' '}
         </>
       ),
       onClick: () => setDatasetAddModalOpen(true),
-    };
+      style: 'primary',
+    });
   }
 
-  if (canDelete) {
-    menuData.secondaryButton = {
-      name: t('Bulk Select'),
-      onClick: toggleBulkSelect,
-    };
-  }
+  menuData.buttons = [...buttonArr];

Review comment:
       ```suggestion
     menuData.buttons = buttonArr;
   ```




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

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



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


Mime
View raw message