Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add missing keys in components inside lists #19161

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
rusackas marked this conversation as resolved.
Show resolved Hide resolved
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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}
rusackas marked this conversation as resolved.
Show resolved Hide resolved
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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