From 01e912e543c955365204823328fb3fb8250baef2 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 16 Aug 2023 14:56:17 +0800 Subject: [PATCH] fix: promptEng menu in wrong place (#864) --- .../(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx index a3af3c68e9..91f4ac7543 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx @@ -39,11 +39,10 @@ const AppDetailLayout: FC = (props) => { const navigation = useMemo(() => { const navs = [ { name: t('common.appMenus.overview'), href: `/app/${appId}/overview`, icon: ChartBarSquareIcon, selectedIcon: ChartBarSquareSolidIcon }, + isCurrentWorkspaceManager ? { name: t('common.appMenus.promptEng'), href: `/app/${appId}/configuration`, icon: Cog8ToothIcon, selectedIcon: Cog8ToothSolidIcon } : false, { name: t('common.appMenus.apiAccess'), href: `/app/${appId}/develop`, icon: CommandLineIcon, selectedIcon: CommandLineSolidIcon }, { name: t('common.appMenus.logAndAnn'), href: `/app/${appId}/logs`, icon: DocumentTextIcon, selectedIcon: DocumentTextSolidIcon }, - ] - if (isCurrentWorkspaceManager) - navs.push({ name: t('common.appMenus.promptEng'), href: `/app/${appId}/configuration`, icon: Cog8ToothIcon, selectedIcon: Cog8ToothSolidIcon }) + ].filter(nav => !!nav) return navs }, [appId, isCurrentWorkspaceManager, t])