From d78c249c3fa646cc96410e8a2661015974542233 Mon Sep 17 00:00:00 2001 From: Diego Medina Date: Tue, 15 Mar 2022 14:46:38 -0300 Subject: [PATCH] chore: add missing keys to components inside lists --- .../DndColumnSelectControl/DndColumnSelect.tsx | 1 + .../src/views/CRUD/welcome/Welcome.tsx | 9 +++++++-- superset-frontend/src/views/components/Menu.tsx | 7 ++++--- .../src/views/components/MenuRight.tsx | 14 ++++++++------ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx index fd360a5e36859..c68ee009ea178 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx @@ -143,6 +143,7 @@ export function DndColumnSelect(props: DndColumnSelectProps) { optionSelector.values.map((column, idx) => isFeatureEnabled(FeatureFlag.ENABLE_DND_WITH_CLICK_UX) ? ( { if (isColumnMeta(newColumn)) { diff --git a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx index eb9fd6eadb1d3..28ad652965ae1 100644 --- a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx +++ b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx @@ -134,8 +134,13 @@ const WelcomeNav = styled.div` export const LoadingCards = ({ cover }: LoadingProps) => ( - {[...new Array(loadingCardCount)].map(() => ( - } description="" loading /> + {[...new Array(loadingCardCount)].map((_, index) => ( + } + description="" + loading + /> ))} ); diff --git a/superset-frontend/src/views/components/Menu.tsx b/superset-frontend/src/views/components/Menu.tsx index 77a074f71b6c7..eace479ebfef4 100644 --- a/superset-frontend/src/views/components/Menu.tsx +++ b/superset-frontend/src/views/components/Menu.tsx @@ -194,7 +194,7 @@ export function Menu({ }: MenuProps) { const [showMenu, setMenu] = useState('horizontal'); const screens = useBreakpoint(); - const uiConig = useUiConfig(); + const uiConfig = useUiConfig(); const theme = useTheme(); useEffect(() => { @@ -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, @@ -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 => { diff --git a/superset-frontend/src/views/components/MenuRight.tsx b/superset-frontend/src/views/components/MenuRight.tsx index ab5b5d8d82a7e..512dbfc7308f6 100644 --- a/superset-frontend/src/views/components/MenuRight.tsx +++ b/superset-frontend/src/views/components/MenuRight.tsx @@ -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'; @@ -209,22 +209,22 @@ const RightMenu = ({ if (menu.childs) { return canDatabase || canUpload ? ( {menu.childs.map((item, idx) => typeof item !== 'string' && item.name && item.perm ? ( - <> + {idx === 2 && } - + {item.url ? ( {item.label} ) : ( item.label )} - + ) : null, )} @@ -271,7 +271,9 @@ const RightMenu = ({ return null; })} , - index < settings.length - 1 && , + index < settings.length - 1 && ( + + ), ])} {!navbarRight.user_is_anonymous && [