geido commented on a change in pull request #14557:
URL: https://github.com/apache/superset/pull/14557#discussion_r630274555
##########
File path: superset-frontend/src/components/Menu/MenuRight.tsx
##########
@@ -66,116 +75,109 @@ const RightMenu = ({
navbarRight,
isFrontendRoute,
}: RightMenuProps) => (
- <Menu className="navbar-right" mode="horizontal">
- {!navbarRight.user_is_anonymous && (
- <SubMenu
- data-test="new-dropdown"
- title={<StyledI data-test="new-dropdown-icon" className="fa fa-plus"
/>}
- icon={<Icon name="triangle-down" />}
- >
- {dropdownItems.map((menu, i) => (
- <Menu.Item key={i}>
- <a href={menu.url}>
- <i
- data-test={`menu-item-${menu.label}`}
- className={`fa ${menu.icon}`}
- />{' '}
- {menu.label}
- </a>
- </Menu.Item>
- ))}
- </SubMenu>
- )}
- <SubMenu title="Settings" icon={<Icon name="triangle-down" />}>
- {settings.map((section, index) => [
- <Menu.ItemGroup key={`${section.label}`} title={section.label}>
- {section.childs?.map(child => {
- if (typeof child !== 'string') {
- return (
- <Menu.Item key={`${child.label}`}>
- {isFrontendRoute(child.url) ? (
- <Link to={child.url || ''}>{child.label}</Link>
- ) : (
- <a href={child.url}>{child.label}</a>
- )}
- </Menu.Item>
- );
- }
- return null;
- })}
- </Menu.ItemGroup>,
- index < settings.length - 1 && <Menu.Divider />,
- ])}
-
- {!navbarRight.user_is_anonymous && [
- <Menu.Divider key="user-divider" />,
- <Menu.ItemGroup key="user-section" title={t('User')}>
- {navbarRight.user_profile_url && (
- <Menu.Item key="profile">
- <a href={navbarRight.user_profile_url}>{t('Profile')}</a>
+ <StyledDiv>
+ <Menu mode="horizontal">
+ {!navbarRight.user_is_anonymous && (
+ <SubMenu
+ data-test="new-dropdown"
+ title={
+ <StyledI data-test="new-dropdown-icon" className="fa fa-plus" />
+ }
+ icon={<Icon name="triangle-down" />}
+ >
+ {dropdownItems.map((menu, i) => (
Review comment:
I know this wasn't directly part of this PR but maybe we can remove the
usage of the index as the key and use some other unique value?
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]