diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fe77a99f7..cb39a24f7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -329,7 +329,7 @@ class ApplicationController < ActionController::Base def current_user # User.current if Rails.env.development? - user_id = 36390 + user_id = 50207 else user_id = 130328 end diff --git a/public/react/src/forge/Main/Detail.js b/public/react/src/forge/Main/Detail.js index e39059df8..a8a1d61e4 100644 --- a/public/react/src/forge/Main/Detail.js +++ b/public/react/src/forge/Main/Detail.js @@ -86,6 +86,7 @@ class Detail extends Component{ praises_count:undefined , forked_count:undefined, http_url: undefined, + author:undefined, branchs:undefined, branchList:undefined, @@ -132,6 +133,7 @@ class Detail extends Component{ isReporter:result.data.permission && result.data.permission === "Reporter", isDeveloper:result.data.permission && result.data.permission === "Developer", http_url: result.data.clone_url, + author:result.data.author, watchers_count:result.data.watchers_count, praises_count:result.data.praises_count, diff --git a/public/react/src/forge/Settings/Branch.js b/public/react/src/forge/Settings/Branch.js index 4a88f4c46..74b89c27a 100644 --- a/public/react/src/forge/Settings/Branch.js +++ b/public/react/src/forge/Settings/Branch.js @@ -16,6 +16,14 @@ class Branch extends Component{ } render(){ + const { branchList } = this.props; + const branchListRender = ( + branchList && branchList.map((item,key)=>{ + return( + + ) + }) + ) return(
@@ -24,7 +32,7 @@ class Branch extends Component{

请选择一个默认的分支用于合并请求和提交:

更新仓库设置
diff --git a/public/react/src/forge/Settings/Collaborator.js b/public/react/src/forge/Settings/Collaborator.js index c33ca672b..c8602ea97 100644 --- a/public/react/src/forge/Settings/Collaborator.js +++ b/public/react/src/forge/Settings/Collaborator.js @@ -132,7 +132,7 @@ class Collaborator extends Component{ // 删除协作者 deleteUser=(id)=>{ this.props.confirm({ - content:"确认删除此成员?", + content:"确认将此成员从项目中移除?", onOk:()=>{ const { project_id } = this.props; const url = `/projects/${project_id}/members/remove.json`; @@ -153,8 +153,9 @@ class Collaborator extends Component{ }) } render(){ - const { user , userDataSource , listData , isSpin } = this.state; - + const { userDataSource , listData , isSpin } = this.state; + // 获取当前项目的拥有者 + const { author } = this.props; const menu =(id)=> ( { @@ -187,12 +188,21 @@ class Collaborator extends Component{
{item.name} - - {operation && operation[0].name} - + { + author && author.login === item.login ? + + : + + {operation && operation[0].name} + + } + - this.deleteUser(item.id)}>删除 + { + author && author.login !== item.login && + this.deleteUser(item.id)}>删除 + }
) diff --git a/public/react/src/forge/Settings/Index.js b/public/react/src/forge/Settings/Index.js index 2e3a82e66..84674accd 100644 --- a/public/react/src/forge/Settings/Index.js +++ b/public/react/src/forge/Settings/Index.js @@ -31,16 +31,16 @@ class Index extends Component{
  • 仓库
  • -1?"active":""}>协作者
  • -
  • -1?"active":""}>分支列表
  • + {/*
  • -1?"active":""}>分支列表
  • */}
{/* 分支列表 */} - () } - > + > */} {/* 协作者 */} { console.log(error); @@ -74,10 +78,12 @@ class Setting extends Component{ this.props.form.validateFields((err,values)=>{ if(!err){ const { project_id } = this.props; + const { private_check } = this.state; const url = `/projects/${project_id}.json`; axios.put(url,{ name:values.project_name, description:values.project_description, + private:private_check, ...values }).then(result=>{ if(result){ @@ -108,11 +114,17 @@ class Setting extends Component{ } }) } + changePrivate=(e)=>{ + console.log(e); + this.setState({ + private_check:e.target.checked + }) + } render(){ const { getFieldDecorator } = this.props.form; - const { CategoryList , LanguageList } = this.state; + const { CategoryList , LanguageList , private_check } = this.state; return(
@@ -139,7 +151,7 @@ class Setting extends Component{ {getFieldDecorator('private', { rules: [], })( - 将仓库设为私有 + 将仓库设为私有 )}