eschutho commented on a change in pull request #19051:
URL: https://github.com/apache/superset/pull/19051#discussion_r825205092
##########
File path: superset-frontend/src/views/components/MenuRight.tsx
##########
@@ -165,14 +196,41 @@ const RightMenu = ({
setShowModal(false);
};
+ const isDisabled = isAdmin && !allowUploads;
+
+ const tooltipText = t(
+ "Enable 'Allow data upload' in any database's settings",
+ );
+
+ const buildMenuItem = (item: Record<string, any>) => {
+ const disabledText = isDisabled && item.url;
+ return disabledText ? (
+ <Menu.Item key={item.name} css={styledDisabled}>
+ <Tooltip placement="top" title={tooltipText}>
+ {item.label}
+ </Tooltip>
+ </Menu.Item>
+ ) : (
+ <Menu.Item key={item.name}>
+ {item.url ? <a href={item.url}> {item.label} </a> : item.label}
+ </Menu.Item>
+ );
+ };
+
return (
<StyledDiv align={align}>
<DatabaseModal
onHide={handleOnHideModal}
show={showModal}
+ onDatabaseAdd={() => {}}
dbEngine={engine}
/>
- <Menu selectable={false} mode="horizontal" onClick={handleMenuSelection}>
+ <Menu
+ selectable={false}
+ mode="horizontal"
+ onClick={handleMenuSelection}
+ onOpenChange={() => hasFileUploadEnabled()}
Review comment:
nit, this can just be
```
onOpenChange={hasFileUploadEnabled}
```
but also when testing it looks like this is also triggering on close, which
you prob don't need.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]