You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/05 16:49:37 UTC

[GitHub] [incubator-superset] ktmud commented on a change in pull request #12213: fix: tests errors and warnings - iteration 1 (#12212)

ktmud commented on a change in pull request #12213:
URL: https://github.com/apache/incubator-superset/pull/12213#discussion_r552040881



##########
File path: superset-frontend/src/components/Menu/SubMenu.tsx
##########
@@ -138,41 +138,44 @@ const SubMenu: React.FunctionComponent<SubMenuProps> = props => {
             props.tabs.map(tab => {
               if ((props.usesRouter || hasHistory) && !!tab.usesRouter) {
                 return (
-                  <li
-                    className={tab.name === props.activeChild ? 'active' : ''}
-                    key={`${tab.label}`}
-                  >
-                    <div>
-                      <Link to={tab.url || ''}>{tab.label}</Link>
-                    </div>
-                  </li>
+                  <React.Fragment key={`${tab.label}`}>

Review comment:
       ```suggestion
                     <React.Fragment key={tab.label}>
   ```
   
   Does this work?
   
   I assume this is also for fixing the `activeHref` warning from react-bootstrap? We should probably migrate the menu to AntD, but I guess this works, too.

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx
##########
@@ -296,9 +296,16 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
       const id = database.id || 0;
       setTabKey(DEFAULT_TAB_KEY);
 
-      fetchResource(id).then(() => {
-        setDB(dbFetched);
-      });
+      fetchResource(id)
+        .then(() => {
+          setDB(dbFetched);
+        })
+        .catch(e =>
+          addDangerToast(
+            t('Sorry there was an error fetching database information: ') +
+              e.message,

Review comment:
       ```ts
   t('Sorry there was an error fetching database information: %s', e.message)
   ```
   
   Let's use interpolation for translations. 




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