dev_forge
caicai8 5 years ago
parent b32e1901d7
commit 65e952bd31

@ -74,9 +74,10 @@ class CoderRootDirectory extends Component{
// 获取根目录
getProjectRoot=(branch)=>{
//const { login } = this.props.current_user;
console.log("root",this.props);
const { current_user } = this.props;
const { projectsId } = this.props.match.params;
const url = `/${this.props&&this.props.current_user.login}/${projectsId}/entries.json`;
const url = `/${current_user && current_user.login}/${projectsId}/entries.json`;
axios.get((url),{
params:{
branch

@ -26,6 +26,7 @@ const CoderRootBranch = Loadable({
class CoderRootIndex extends Component{
render(){
console.log("index",this.props)
const { projectDetail } = this.props;
const { projectsId } = this.props.match.params;
const { pathname } = this.props.location;

@ -85,7 +85,6 @@ class Detail extends Component{
watchers_count:undefined ,
praises_count:undefined ,
forked_count:undefined,
current_user:undefined,
http_url: undefined,
branchs:undefined,
@ -237,6 +236,7 @@ class Detail extends Component{
const { projectDetail , watchers_count , praises_count , forked_count , project_id } = this.state;
const url = this.props.history.location.pathname;
const urlFlag = (url.split("/").length === 3);
const { isManager , isDeveloper } = this.props;
const { projectsId } = this.props.match.params;
@ -269,16 +269,16 @@ class Detail extends Component{
</div>
<div className="normal f-wrap-between">
<ul className="headerMenu-wrapper">
<li className={url.indexOf("coder")>0? "active" : ""}><Link to={`/projects/${projectsId}/coder`}>代码</Link></li>
<li className={(url.indexOf("coder")>0 || urlFlag)? "active" : ""}><Link to={`/projects/${projectsId}/coder`}>代码</Link></li>
<li className={url.indexOf("orders")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/orders`}>工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}</Link></li>
<li className={url.indexOf("merge")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge`}>合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}</Link></li>
<li className={url.indexOf("edition")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/edition`}>版本发布</Link></li>
<li className={url.indexOf("trends")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/trends`}>动态</Link></li>
{
(isManager || isDeveloper) &&
isManager &&
<li className={url.indexOf("setting")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/setting`}>仓库设置</Link></li>
}
<li className={url.indexOf("setting")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/setting`}>仓库设置</Link></li>
{/* <li className={url.indexOf("setting")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/setting`}>仓库设置</Link></li> */}
</ul>
</div>
</div>
@ -370,18 +370,22 @@ class Detail extends Component{
render={
(props) => (<OrderIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge"
render={
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/coder"
render={
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge"
<Route path="/projects/:projectsId"
render={
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state}/>)
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
</Switch>
</div>
)

@ -154,7 +154,7 @@ class Collaborator extends Component{
const source = userDataSource && userDataSource.map((item,key)=>{
return(
<Option key={key} value={`${item.username}`} onClick={this.serachUser}>{item.username}</Option>
<Option key={key} value={`${item.user_id}`} onClick={this.serachUser}>{item.username}</Option>
)
})
return(

Loading…
Cancel
Save