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 2022/03/10 03:14:36 UTC

[GitHub] [superset] lyndsiWilliams commented on a change in pull request #19051: fix: update Permissions for right nav

lyndsiWilliams commented on a change in pull request #19051:
URL: https://github.com/apache/superset/pull/19051#discussion_r823295925



##########
File path: superset-frontend/src/views/components/MenuRight.tsx
##########
@@ -144,6 +168,18 @@ const RightMenu = ({
     },
   ];
 
+  const hasFileUploadEnabled = () => {
+    SupersetClient.get({
+      endpoint: '/api/v1/database/upload_enabled',
+    }).then(({ json }: Record<string, any>) => {
+      setAllowUploads(json.can_upload);
+    });
+  };
+
+  useEffect(() => {
+    hasFileUploadEnabled();
+  }, []);

Review comment:
       ```suggestion
     useEffect(() => hasFileUploadEnabled(), []);
   ```
   Small nit, not blocking, but this can be written on one line.

##########
File path: superset-frontend/src/views/components/MenuRight.tsx
##########
@@ -165,14 +201,39 @@ const RightMenu = ({
     setShowModal(false);
   };
 
+  const isDisabled = isUserAdmin && !allowUploads;
+
+  const tooltipText = "Enable 'Allow data upload' in any database's settings";

Review comment:
       Should this string be `t()` translated?




-- 
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-unsubscribe@superset.apache.org

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