From 1621380ba8d8e538b074c4159494e1332969e529 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Fri, 20 Mar 2020 21:20:35 +0800 Subject: [PATCH] issue --- src/forge/Main/CoderRootBranch.js | 2 +- src/forge/Main/CoderRootDirectory.js | 2 +- src/forge/Main/CoderRootIndex.js | 6 +++--- src/forge/Main/Detail.js | 24 +++++++++++++----------- src/forge/Main/DetailTop.js | 4 ++-- src/forge/New/Index.js | 2 +- src/forge/Newfile/UserSubmitComponent.js | 2 +- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js index a9859fd31..50037cc39 100644 --- a/src/forge/Main/CoderRootBranch.js +++ b/src/forge/Main/CoderRootBranch.js @@ -29,7 +29,7 @@ class CoderRootBranch extends Component { return(
  • - {item.name} + {item.name} {/*{item.name}*/}

    {item.last_commit && item.last_commit.id} diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 5bc089820..8e0dc6850 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -295,7 +295,7 @@ class CoderRootDirectory extends Component{ { subFileType !== "file" && isManager && isDeveloper &&

    - 新建文件 + 新建文件 上传文件

    } diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index a07e7b72e..fa6e7c11e 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -28,17 +28,17 @@ class CoderRootIndex extends Component{ return(
    - () } > - () } > - () } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index ccaf6990e..5a37c908e 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -255,7 +255,7 @@ class Detail extends Component{ const url = `/projects/${project_id}/forks.json`; axios.post(url).then(result=>{ if(result && result.data.status === 0){ - this.props.history.push(`/projects/${result.data.identifier}/${author}/coder`); + this.props.history.push(`/projects/${result.data.identifier}/${author}/coders`); }else{ this.props.showNotification(result.data.message); } @@ -289,7 +289,9 @@ class Detail extends Component{ const { projectDetail , watchers_count , praises_count , forked_count , project_id , current_user } = this.state; const url = this.props.history.location.pathname; - const urlFlag = (url.split("/").length === 3); + const urlArr= url.split("/"); + const url_last = urlArr[parseInt(urlArr.length)-1]; + const urlFlag = (urlArr.length === 4); const { isManager , isDeveloper } = this.props; const { projectsId , author } = this.props.match.params; @@ -303,17 +305,17 @@ class Detail extends Component{ {projectDetail && projectDetail.author && projectDetail.author.name} / - { projectDetail && projectDetail.identifier } + { projectDetail && projectDetail.identifier }

      -
    • 0 || urlFlag)? "active" : ""}>代码
    • -
    • 0 ? "active" : ""}>工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}
    • -
    • 0 ? "active" : ""}>合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}
    • -
    • 0 ? "active" : ""}>版本发布
    • -
    • 0 ? "active" : ""}>动态
    • +
    • 代码
    • +
    • 工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}
    • +
    • 合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}
    • +
    • 版本发布
    • +
    • 动态
    • { isManager &&
    • 0 ? "active" : ""}>仓库设置
    • @@ -346,12 +348,12 @@ class Detail extends Component{ {/* 新建文件 */} - () } > - () } @@ -486,7 +488,7 @@ class Detail extends Component{ (props) => () } > - () } diff --git a/src/forge/Main/DetailTop.js b/src/forge/Main/DetailTop.js index 8ce6096e9..b6151c7f5 100644 --- a/src/forge/Main/DetailTop.js +++ b/src/forge/Main/DetailTop.js @@ -8,11 +8,11 @@ class DetailTop extends Component{ const { pathname } = this.props.location; return(

      - 0 ? "active" : ""}> + 0 ? "active" : ""}> {projectDetail && projectDetail.commits_count}提交 - 0 ? "active" : ""}> + 0 ? "active" : ""}> {projectDetail && projectDetail.branches_count}分支 diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 0ccb1a9c4..8a42f2b4e 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -129,7 +129,7 @@ class Index extends Component{ isSpin:false }) this.props.showNotification(`${projectsType === "deposit" ? "托管" :"镜像"}项目创建成功!`); - this.props.history.push(`/projects/${result.data.identifier}/${current_user && current_user.login}/coder`); + this.props.history.push(`/projects/${result.data.identifier}/${current_user && current_user.login}/coders`); } } }).catch((error)=>{ diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index bb667f4f0..62fa18a56 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -37,7 +37,7 @@ class UserSubmitComponent extends Component{ message:values.desc }).then((result)=>{ if(result && result.data.name){ - this.props.history.push(`/projects/${projectsId}/${author}/coder`); + this.props.history.push(`/projects/${projectsId}/${author}/coders`); } }).catch(error=>{ console.log(error);