仓库设置页面增加资源库配置项

This commit is contained in:
caishi 2021-04-06 17:34:37 +08:00
parent b6dc01b0be
commit e541e91a06
3 changed files with 11 additions and 2 deletions

View File

@ -518,6 +518,7 @@ class Detail extends Component {
{
firstSync ? "" :
<DetailBanner
history={this.props.history}
list={bannerList}
owner={owner}
projectsId={projectsId}

View File

@ -2,10 +2,17 @@ import React, { useEffect, useState } from 'react';
import { Skeleton , Tooltip } from 'antd';
import { Link } from 'react-router-dom';
function DetailBanner({ list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){
function DetailBanner({ history,list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){
const [ menuName , setMenuName ] = useState(undefined);
useEffect(()=>{
if(list){
// banner
if(pathname && pathname==="source"){
let a = list.filter(item=>item.menu_name === "resources");
if(a && a.length === 0){
history.push(`/projects/${owner}/${projectsId}`);
}
}
setMenuName(list);
}
},[list]);
@ -69,7 +76,7 @@ function DetailBanner({ list , owner , projectsId , isManager , url , pathname ,
:""
}
{
item.menu_name === "source" &&
item.menu_name === "resources" &&
<li className={pathname==="source" ? "active" : ""}>
<Link to={{ pathname: `/projects/${owner}/${projectsId}/source`, state }}>
<i className={pathname==="source" ? "iconfont icon-ziyuanpaihanghetuijian color-grey-3 mr5 font-14":"iconfont icon-ziyuanpaihanghetuijian color-grey-6 font-14 mr5"}></i>

View File

@ -13,6 +13,7 @@ const menu = [
{name:"易修 (Issue)",index:"issues"},
{name:"合并请求",index:"pulls"},
{name:"工作流(beta版)",index:"devops"},
{name:"资源库",index:"resources"},
{name:"里程碑",index:"versions"},
{name:"动态",index:"activity"},
]