Skip to content

Commit

Permalink
fix ts and add t's
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdotson committed Feb 17, 2022
1 parent 32f6e79 commit 57e001c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion superset-frontend/src/views/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ export interface MenuProps {

interface MenuObjectChildProps {
label: string;
name: string;
name?: string;
icon?: string;
index?: number;
url?: string;
isFrontendRoute?: boolean;
perm?: string;
view?: string;
}

export interface MenuObjectProps extends MenuObjectChildProps {
Expand Down
12 changes: 7 additions & 5 deletions superset-frontend/src/views/components/MenuRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ import {
import LanguagePicker from './LanguagePicker';
import { NavBarProps, MenuObjectProps } from './Menu';

export const dropdownItems = [
export const dropdownItems: MenuObjectProps[] = [
{
label: t('Data'),
icon: 'fa-database',
childs: [
{
icon: 'fa-upload',
label: 'Upload a CSV',
label: t('Upload a CSV'),
name: 'Upload a CSV',
url: '/csvtodatabaseview/form',
},
{
icon: 'fa-upload',
label: 'Upload a Columnar File',
label: t('Upload a Columnar File'),
name: 'Upload a Columnar file',
url: '/columnartodatabaseview/form',
},
{
icon: 'fa-upload',
label: 'Upload Excel',
label: t('Upload Excel'),
name: 'Upload Excel',
url: '/exceltodatabaseview/form',
},
Expand Down Expand Up @@ -161,9 +161,11 @@ const RightMenu = ({
<SubMenu
key="sub2"
className="data-menu"
title={menuIconAndLabel(menu as MenuObjectProps)}
title={menuIconAndLabel(menu)}
>
{menu.childs.map(item =>
typeof item !== 'string' &&
item.name &&
configMap[item.name] === true ? (
<Menu.Item key={item.name}>
<a href={item.url}> {item.label} </a>
Expand Down

0 comments on commit 57e001c

Please sign in to comment.