forked from Gitlink/forgeplus-react
仓库设置页面增加资源库配置项
This commit is contained in:
parent
b6dc01b0be
commit
e541e91a06
|
@ -518,6 +518,7 @@ class Detail extends Component {
|
|||
{
|
||||
firstSync ? "" :
|
||||
<DetailBanner
|
||||
history={this.props.history}
|
||||
list={bannerList}
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue