Skip to content

Commit

Permalink
chore: add missing keys to components inside lists
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomedina248 committed Mar 17, 2022
1 parent 8d53db1 commit d78c249
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function DndColumnSelect(props: DndColumnSelectProps) {
optionSelector.values.map((column, idx) =>
isFeatureEnabled(FeatureFlag.ENABLE_DND_WITH_CLICK_UX) ? (
<ColumnSelectPopoverTrigger
key={idx}
columns={popoverOptions}
onColumnEdit={newColumn => {
if (isColumnMeta(newColumn)) {
Expand Down
9 changes: 7 additions & 2 deletions superset-frontend/src/views/CRUD/welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ const WelcomeNav = styled.div`

export const LoadingCards = ({ cover }: LoadingProps) => (
<CardContainer showThumbnails={cover} className="loading-cards">
{[...new Array(loadingCardCount)].map(() => (
<ListViewCard cover={cover ? false : <></>} description="" loading />
{[...new Array(loadingCardCount)].map((_, index) => (
<ListViewCard
key={index}
cover={cover ? false : <></>}
description=""
loading
/>
))}
</CardContainer>
);
Expand Down
7 changes: 4 additions & 3 deletions superset-frontend/src/views/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export function Menu({
}: MenuProps) {
const [showMenu, setMenu] = useState<MenuMode>('horizontal');
const screens = useBreakpoint();
const uiConig = useUiConfig();
const uiConfig = useUiConfig();
const theme = useTheme();

useEffect(() => {
Expand All @@ -210,7 +210,7 @@ export function Menu({
}, []);

const standalone = getUrlParam(URL_PARAMS.standalone);
if (standalone || uiConig.hideNav) return <></>;
if (standalone || uiConfig.hideNav) return <></>;

const renderSubMenu = ({
label,
Expand Down Expand Up @@ -286,8 +286,9 @@ export function Menu({
data-test="navbar-top"
className="main-nav"
>
{menu.map(item => {
{menu.map((item, index) => {
const props = {
index,
...item,
isFrontendRoute: isFrontendRoute(item.url),
childs: item.childs?.map(c => {
Expand Down
14 changes: 8 additions & 6 deletions superset-frontend/src/views/components/MenuRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useState } from 'react';
import React, { Fragment, useState } from 'react';
import { MainNav as Menu } from 'src/components/Menu';
import { t, styled, css, SupersetTheme } from '@superset-ui/core';
import { Link } from 'react-router-dom';
Expand Down Expand Up @@ -209,22 +209,22 @@ const RightMenu = ({
if (menu.childs) {
return canDatabase || canUpload ? (
<SubMenu
key="sub2"
key={`sub2_${menu.label}`}
className="data-menu"
title={menuIconAndLabel(menu)}
>
{menu.childs.map((item, idx) =>
typeof item !== 'string' && item.name && item.perm ? (
<>
<Fragment key={item.name}>
{idx === 2 && <Menu.Divider />}
<Menu.Item key={item.name}>
<Menu.Item>
{item.url ? (
<a href={item.url}> {item.label} </a>
) : (
item.label
)}
</Menu.Item>
</>
</Fragment>
) : null,
)}
</SubMenu>
Expand Down Expand Up @@ -271,7 +271,9 @@ const RightMenu = ({
return null;
})}
</Menu.ItemGroup>,
index < settings.length - 1 && <Menu.Divider />,
index < settings.length - 1 && (
<Menu.Divider key={`divider_${index}`} />
),
])}

{!navbarRight.user_is_anonymous && [
Expand Down

0 comments on commit d78c249

Please sign in to comment.