From 89b78bc0469318db17bf8b5c08d32a793739fac4 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 27 Nov 2020 11:59:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=92=8C=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderRootDirectory.js | 7 +++++-- src/forge/Newfile/UserSubmitComponent.js | 16 ++++++---------- src/forge/Settings/Branch.js | 2 +- src/forge/Settings/Index.js | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 02dcdadbf..21a6a59f9 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -406,6 +406,7 @@ class CoderRootDirectory extends Component { let branch = branchName || defaultBranch; const columns = [ { + key:"name", dataIndex: 'name', width:"30%", render: (text,item) => ( @@ -415,7 +416,8 @@ class CoderRootDirectory extends Component { ), }, { - dataIndex: "commit", + key:"message", + dataIndex: "message", width: "60%", render: (text, item) => item.commit && item.commit.message ? @@ -425,7 +427,8 @@ class CoderRootDirectory extends Component { : "" }, { - dataIndex: "commit", + key:"time_from_now", + dataIndex: "time_from_now", width: "10%", className: "edu-txt-right", render: (text, item) => diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index e2c57d72e..e24d167b3 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -54,9 +54,7 @@ class UserSubmitComponent extends Component { const { getTopCount } = this.props; getTopCount && getTopCount(values.branchname); } - let url = values.branchname - ? `/projects/${owner}/${projectsId}/branch/${values.branchname}` - : `/projects/${owner}/${projectsId}`; + let url = `/projects/${owner}/${projectsId}${values.branchname ? `/branch/${values.branchname}`: (branch ? `/branch/${branch}` : "")}`; this.props.history.push(url); } }) @@ -73,7 +71,7 @@ class UserSubmitComponent extends Component { // 确认修改文件 UpdateFile = () => { this.setState({ isSpin: true }); - const { branch, detail, content, filepath } = this.props; + const { branch, detail, content , currentBranch } = this.props; const { projectsId , owner } = this.props.match.params; const { submitType } = this.state; const url = `/${owner}/${projectsId}/update_file.json`; @@ -82,7 +80,7 @@ class UserSubmitComponent extends Component { axios .put(url, { filepath: detail.path, - branch: branch, + branch: submitType === "1" ? undefined : (currentBranch || branch), new_branch: submitType === "1" ? values.branchname : undefined, content: content, sha: detail.sha, @@ -91,12 +89,10 @@ class UserSubmitComponent extends Component { .then((result) => { this.setState({ isSpin: false }); if (result.data && result.data.status === 1) { - let url = values.branchname - ? `/projects/${owner}/${projectsId}/branch/${values.branchname}` - : `/projects/${owner}/${projectsId}`; - + debugger; + let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/branch/${values.branchname}` : ((currentBranch || branch) ? `/branch/${currentBranch || branch}`:""))}`; this.props.history.push(url); - this.props.showNotification("修改成功!"); + this.props.showNotification("文件修改成功!"); } }) .catch((error) => { diff --git a/src/forge/Settings/Branch.js b/src/forge/Settings/Branch.js index 50f4b3189..2a391bc6c 100644 --- a/src/forge/Settings/Branch.js +++ b/src/forge/Settings/Branch.js @@ -64,7 +64,7 @@ export default ((props)=>{ settingRule()}>+ 新建规则 -
  • 限制分支的推送、合并。强制推送相关请去仓库设置
  • +
  • 限制分支的推送、合并。强制推送相关请去{props.history.push(`/projects/${owner}/${projectsId}/setting`)}}>仓库设置
  • 一个分支同时只能有一个保护分支规则生效,越早创建的规则优先级越高。
  • 保护分支规则只影响状态是【保护分支】的分支。【常规分支】和【只读分支】都不影响。
  • diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js index 31ecdefd4..c46f48392 100644 --- a/src/forge/Settings/Index.js +++ b/src/forge/Settings/Index.js @@ -65,7 +65,7 @@ class Index extends Component {

    - {/*
  • -1 ? "active" : "" } @@ -76,7 +76,7 @@ class Index extends Component { 分支设置

    -
  • */} +
  • -1 ? "active" : ""} >