From bdf61d7bbbb3d0877043a8db1877afac9c3df0c2 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 31 Mar 2020 15:07:27 +0800 Subject: [PATCH] issue --- src/forge/Main/CoderRootDirectory.js | 3 +- src/forge/Main/CoderRootFileDetail.js | 3 +- src/forge/Main/Detail.js | 2 +- src/forge/Main/list.css | 1 + src/forge/Merge/MergeSubmit.js | 138 +++++++------- src/forge/Merge/MessageCount.js | 253 +++++++++++++------------- src/forge/Merge/NewMerge.js | 6 +- src/forge/Merge/UpdateMerge.js | 77 +++++--- 8 files changed, 256 insertions(+), 227 deletions(-) diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 6f1b397a..21186ff9 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -256,6 +256,7 @@ class CoderRootDirectory extends Component{ } const urlRoot = filePath && filePath.length > 0 ? `/${filePath[filePath.length - 1].path}` : ""; + const { projectDetail } = this.props; return( { @@ -271,7 +272,7 @@ class CoderRootDirectory extends Component{ { filePath && filePath.length > 0 && - this.getProjectRoot(branch)} className="color-blue">{projectsId} + this.getProjectRoot(branch)} className="color-blue">{ projectDetail && projectDetail.identifier } { filePath.map((item,key)=>{ return( diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index d15dbbf5..46b6da40 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -113,7 +113,8 @@ class CoderRootFileDetail extends Component{ lineNumbers: true, mode: 'javascript', readOnly:readOnly?'nocursor':false, - autofocus:readOnly?false:true + autofocus:readOnly?false:true, + styleActiveLine:true }; return(
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 17536164..34553caf 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -453,7 +453,7 @@ class Detail extends Component{ () + (props) => () } > { - - this.getDetail(); + // this.getDetail(); + const { data } = this.props; + const { page , limit } = this.state; + this.setState({ + isSpin:true + }) + this.getCommitList( data.pull_request.base , page , limit ); } getDetail=()=>{ + const { projectsId , mergeId} = this.props.match.params; const url = `/projects/${projectsId}/pull_requests/${mergeId}.json`; axios.get(url).then((result)=>{ @@ -46,32 +47,13 @@ class MergeSubmit extends Component{ this.setState({ data:result.data, }) - const { page , limit } = this.state; - - this.getCommitList( result.data.pull_request.base , page , limit ); + } }).catch((error)=>{ console.log(error); }) } - handleok=() => { - this.setState({ - isShow:false - }); - }; - handleCancel=()=>{ - this.setState({ - isShow:false - }); - } - - imgshow=()=>{ - this.setState({ - isShow:true - }); - }; - //获取提交列表 getCommitList=(branch , page , limit)=>{ const { projectsId } = this.props.match.params; @@ -105,8 +87,8 @@ class MergeSubmit extends Component{ render(){ - const { projectsId,mergeId } = this.props.match.params; - const { data,titledata} = this.state; + // const { projectsId,mergeId } = this.props.match.params; + const { titledata } = this.state; const columns=[{ @@ -153,56 +135,58 @@ class MergeSubmit extends Component{ ) } - const url = this.props.history.location.pathname; + // const url = this.props.history.location.pathname; return( -
-
-
-
-
-

- { - data ? - 【{ data.issue.issue_classify==='issue'?data.issue.tracker:"合并"}】 - : - "" - } - { data && data.issue.subject } + //

+ //
+ //
+ //
+ //
+ //

+ // { + // data ? + // 【{ data.issue.issue_classify==='issue'?data.issue.tracker:"合并"}】 + // : + // "" + // } + // { data && data.issue.subject } -

-

- {data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} - - 由 { data && data.issue.author_name} 于 { data && data.issue.created_at }创建{ data && data.issue.journals_count && data.issue.journals_count > 0 ?` · ${data.issue.journals_count} 条评论`:""} - - - 编辑 - -

-
+ //

+ //

+ // {data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} + // + // 由 { data && data.issue.author_name} 于 { data && data.issue.created_at }创建{ data && data.issue.journals_count && data.issue.journals_count > 0 ?` · ${data.issue.journals_count} 条评论`:""} + // + // + // 编辑 + // + //

+ //
-
-
-
    -
  • 0? "active" : ""}>对话内容
  • -
  • 0 ? "active" : ""}>代码提交
  • -
-
-
- title()} - /> - - + //
+ //
+ //
    + //
  • 0? "active" : ""}>对话内容
  • + //
  • 0 ? "active" : ""}>代码提交
  • + //
+ //
+ //
+ +
title()} + /> + + // + // ) } } diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index ebe66b38..9537a8dd 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -9,8 +9,9 @@ import {Modal, Form, Input, Tooltip, Popconfirm, Pagination , Spin,Dropdown,Ico import Attachments from '../Upload/attachment' import './merge.css'; import QuillForEditor from '../quillForEditor'; +import MergeSubmit from './MergeSubmit'; -const TextArea = Input.TextArea; +// const TextArea = Input.TextArea; const options = [ ['bold', 'italic', 'underline'], @@ -46,11 +47,15 @@ class MessageCount extends Component{ title:'', body:'', commentsContent:undefined, - quillFlag:false + quillFlag:false, + SpinFlag:true } } componentDidMount=()=>{ + this.setState({ + SpinFlag:true + }) this.getDetail(); } @@ -140,7 +145,8 @@ class MessageCount extends Component{ search_count:result.data.journals_count, isSpin:false, fileList:undefined, - showFiles: true + showFiles: true, + SpinFlag:false }) } }).catch(error=>{ @@ -487,16 +493,13 @@ class MessageCount extends Component{
-

- { - data ? - 【{ data.issue.issue_classify==='issue'?data.issue.tracker:"合并"}】 - : - "" - } - { data && data.issue.subject } - -

+ { + data && +

+ 【{ data.issue && (data.issue.issue_classify==='issue' ? data.issue.tracker : "合并")}】 + { data.issue && data.issue.subject } +

+ }

{data&&data.issue.issue_status==="关闭"?"关闭中":data&&data.pull_request.status===0?"开启中":"已合并"} @@ -522,134 +525,140 @@ class MessageCount extends Component{

  • 0? "active" : ""}>对话内容
  • -
  • 0 ? "active" : ""}>代码提交
  • +
  • 0 ? "active" : ""}>代码提交
-
-
- -
    - {renderList()} -
-
+ { + url.indexOf("Messagecount")>0 ? + +
+
+ +
    + {renderList()} +
+
- { Paginations } + { Paginations } - { - data && data.issue.user_permission ? -
- -
-

该合并请求可以进行自动合并操作

-

- {/* */} - {/* */} - }> - {this.state.mergename} - + { + data && data.issue.user_permission ? +

+ +
+

该合并请求可以进行自动合并操作

+

+ {/* */} + {/* */} + }> + {this.state.mergename} + - {/* */} -

+ {/* */} +

-
- -
- +
+ +
+ +
+ {/*