2020-06-05 16:24:37 +08:00
|
|
|
|
import React, { Component } from "react";
|
2020-11-05 11:31:26 +08:00
|
|
|
|
import { Tabs } from 'antd';
|
2020-06-05 16:24:37 +08:00
|
|
|
|
import { Link } from "react-router-dom";
|
2020-11-05 11:31:26 +08:00
|
|
|
|
import { AlignCenter } from '../Component/layout';
|
2020-06-05 16:24:37 +08:00
|
|
|
|
import axios from "axios";
|
|
|
|
|
|
import { getImageUrl } from "educoder";
|
|
|
|
|
|
import {
|
|
|
|
|
|
Form,
|
|
|
|
|
|
Input,
|
|
|
|
|
|
Spin,
|
|
|
|
|
|
Dropdown,
|
|
|
|
|
|
Icon,
|
|
|
|
|
|
Menu,
|
|
|
|
|
|
Select,
|
|
|
|
|
|
Tag,
|
2020-06-12 17:58:58 +08:00
|
|
|
|
Button,
|
|
|
|
|
|
Alert,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
} from "antd";
|
|
|
|
|
|
import "./merge.css";
|
|
|
|
|
|
import RenderHtml from "../../components/render-html";
|
|
|
|
|
|
import "../Order/order.css";
|
2020-06-12 17:58:58 +08:00
|
|
|
|
import MergeFooter from "./merge_footer";
|
2020-04-26 16:07:51 +08:00
|
|
|
|
|
2020-04-13 17:45:36 +08:00
|
|
|
|
const Option = Select.Option;
|
2020-04-02 11:00:53 +08:00
|
|
|
|
const TextArea = Input.TextArea;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2021-07-08 15:24:56 +08:00
|
|
|
|
function turnbar(str){
|
|
|
|
|
|
if(str && str.length>0 && str.indexOf("/")>-1){
|
|
|
|
|
|
return str.replaceAll('/','%2F');
|
|
|
|
|
|
}
|
|
|
|
|
|
return str;
|
|
|
|
|
|
}
|
2020-05-07 10:10:13 +08:00
|
|
|
|
class MessageCount extends Component {
|
|
|
|
|
|
constructor(props) {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
super(props);
|
2020-05-07 10:10:13 +08:00
|
|
|
|
this.state = {
|
|
|
|
|
|
data: undefined,
|
|
|
|
|
|
isSpin: false,
|
2020-06-12 17:58:58 +08:00
|
|
|
|
ismesrge: false,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
buttonshow: "none",
|
|
|
|
|
|
mergename: "合并请求",
|
|
|
|
|
|
mergekey: "merge",
|
|
|
|
|
|
title: "",
|
|
|
|
|
|
body: "",
|
2020-05-07 10:10:13 +08:00
|
|
|
|
SpinFlag: true,
|
2020-04-30 10:34:06 +08:00
|
|
|
|
SpinMerge: false,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
edit_spin: false,
|
2020-06-12 17:58:58 +08:00
|
|
|
|
pr_status: undefined,
|
2021-01-13 15:46:17 +08:00
|
|
|
|
pull_request:undefined,
|
2021-06-25 18:21:31 +08:00
|
|
|
|
conflict_files:[],
|
2020-11-05 11:31:26 +08:00
|
|
|
|
|
|
|
|
|
|
copyVisible:false,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
};
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
2020-05-07 10:10:13 +08:00
|
|
|
|
|
|
|
|
|
|
componentDidMount = () => {
|
2020-03-31 15:07:27 +08:00
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
SpinFlag: true,
|
|
|
|
|
|
});
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.getDetail();
|
2020-11-05 11:31:26 +08:00
|
|
|
|
|
|
|
|
|
|
// this.clickBody();
|
2020-06-05 16:24:37 +08:00
|
|
|
|
};
|
2020-11-05 11:31:26 +08:00
|
|
|
|
clickBody=()=>{
|
|
|
|
|
|
document.body.addEventListener('click', e => {
|
|
|
|
|
|
let name = e.target.className;
|
|
|
|
|
|
if(name.indexOf("notHide")>-1 || name.indexOf("ant-tabs-tab")>-1 || name==="ant-tabs-nav-scroll"){return;}
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
copyVisible:false
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
getDetail = () => {
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId, mergeId, owner } = this.props.match.params;
|
|
|
|
|
|
const url = `/${owner}/${projectsId}/pulls/${mergeId}.json`;
|
2020-06-05 16:24:37 +08:00
|
|
|
|
axios
|
|
|
|
|
|
.get(url)
|
|
|
|
|
|
.then((result) => {
|
2021-01-13 15:46:17 +08:00
|
|
|
|
if (result && result.data) {
|
2020-06-05 16:24:37 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
data: result.data,
|
|
|
|
|
|
SpinFlag: false,
|
2021-01-13 15:46:17 +08:00
|
|
|
|
pr_status: result.data.pull_request && result.data.pull_request.status,
|
2021-06-25 18:21:31 +08:00
|
|
|
|
pull_request:result.data.pull_request,
|
|
|
|
|
|
conflict_files:result.data.conflict_files
|
2020-06-05 16:24:37 +08:00
|
|
|
|
});
|
2020-06-12 17:58:58 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.setState({ SpinFlag: false });
|
2020-06-05 16:24:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch((error) => {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
SpinFlag: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
//关闭任务
|
2020-06-12 17:58:58 +08:00
|
|
|
|
closedetail = () => {
|
|
|
|
|
|
this.setState({ isSpin: true });
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId, mergeId , owner } = this.props.match.params;
|
|
|
|
|
|
const url = `/${owner}/${projectsId}/pulls/${mergeId}/refuse_merge.json`;
|
2020-06-05 16:24:37 +08:00
|
|
|
|
axios
|
2020-06-12 17:58:58 +08:00
|
|
|
|
.post(url)
|
2020-06-05 16:24:37 +08:00
|
|
|
|
.then((result) => {
|
|
|
|
|
|
if (result) {
|
2020-06-12 17:58:58 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
isSpin: false,
|
|
|
|
|
|
pr_status: 2,
|
|
|
|
|
|
});
|
2021-06-16 15:51:47 +08:00
|
|
|
|
const { getDetail } = this.props;
|
|
|
|
|
|
getDetail && getDetail();
|
2020-06-12 17:58:58 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
isSpin: false,
|
|
|
|
|
|
});
|
2020-06-05 16:24:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch((error) => {
|
2020-06-12 17:58:58 +08:00
|
|
|
|
this.setState({
|
|
|
|
|
|
isSpin: false,
|
|
|
|
|
|
});
|
2020-06-05 16:24:37 +08:00
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
//合并请求
|
|
|
|
|
|
prmerge = () => {
|
|
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
SpinMerge: true,
|
|
|
|
|
|
});
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
2020-06-12 17:58:58 +08:00
|
|
|
|
const { data, title, body, mergekey, pr_status } = this.state;
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const url = `/${owner}/${projectsId}/pulls/${data.pull_request.id}/pr_merge.json`;
|
2020-06-05 16:24:37 +08:00
|
|
|
|
axios
|
|
|
|
|
|
.post(url, {
|
|
|
|
|
|
project_id: projectsId,
|
|
|
|
|
|
id: data.pull_request.id,
|
|
|
|
|
|
do: mergekey,
|
|
|
|
|
|
body: body,
|
|
|
|
|
|
title: title,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
2020-06-05 16:24:37 +08:00
|
|
|
|
.then((result) => {
|
|
|
|
|
|
if (result) {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
SpinMerge: false,
|
2020-06-12 17:58:58 +08:00
|
|
|
|
pr_status: 1,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
});
|
2021-06-16 15:51:47 +08:00
|
|
|
|
const { getDetail } = this.props;
|
|
|
|
|
|
getDetail && getDetail();
|
2020-06-12 17:58:58 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.setState({ SpinMerge: false });
|
2020-06-05 16:24:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
SpinMerge: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-05-07 10:10:13 +08:00
|
|
|
|
|
|
|
|
|
|
changtitlepr = (e) => {
|
|
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
title: e.target.value,
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
changbodypr = (e) => {
|
|
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
body: e.target.value,
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-06-12 17:58:58 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
submitmerge = () => {
|
|
|
|
|
|
if (this.state.mergekey === "rebase") {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
buttonshow: "block",
|
2020-06-12 17:58:58 +08:00
|
|
|
|
ismesrge: true,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
});
|
2020-05-07 10:10:13 +08:00
|
|
|
|
} else {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
ismesrge: "block",
|
2020-06-12 17:58:58 +08:00
|
|
|
|
buttonshow: false,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
});
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
2020-06-05 16:24:37 +08:00
|
|
|
|
};
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
nonemerge = () => {
|
|
|
|
|
|
this.setState({
|
2020-06-12 17:58:58 +08:00
|
|
|
|
ismesrge: false,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
buttonshow: "none",
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-05-07 10:10:13 +08:00
|
|
|
|
|
|
|
|
|
|
getOption = (e) => {
|
|
|
|
|
|
if (e.key === "rebase") {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
mergename: e.item.props.value,
|
|
|
|
|
|
mergekey: e.key,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
title: "",
|
|
|
|
|
|
body: "",
|
|
|
|
|
|
buttonshow: "block",
|
|
|
|
|
|
});
|
2020-05-07 10:10:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
mergename: e.item.props.value,
|
|
|
|
|
|
mergekey: e.key,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
title: "",
|
|
|
|
|
|
body: "",
|
2020-06-12 17:58:58 +08:00
|
|
|
|
ismesrge: true,
|
2020-06-05 16:24:37 +08:00
|
|
|
|
buttonshow: "block",
|
|
|
|
|
|
});
|
2020-05-07 10:10:13 +08:00
|
|
|
|
}
|
2020-06-05 16:24:37 +08:00
|
|
|
|
};
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
cancelSubmit = () => {
|
|
|
|
|
|
this.setState({
|
2020-06-05 16:24:37 +08:00
|
|
|
|
editMerge: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2020-04-13 17:45:36 +08:00
|
|
|
|
|
2020-04-28 17:23:34 +08:00
|
|
|
|
commentCtx = (v) => {
|
2020-12-15 18:01:16 +08:00
|
|
|
|
return <RenderHtml className="break_word_comments imageLayerParent" value={v} url={this.props.history.location}/>;
|
2020-03-25 15:14:20 +08:00
|
|
|
|
};
|
2020-06-12 17:58:58 +08:00
|
|
|
|
|
2020-11-05 11:31:26 +08:00
|
|
|
|
setCopyVisible=(e)=>{
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
copyVisible:true
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
copyItem =()=>{
|
|
|
|
|
|
return(
|
|
|
|
|
|
<div className="copyTab notHide">
|
|
|
|
|
|
<Tabs defaultActiveKey="1" className="notHide" animated={false} size={"small"}>
|
|
|
|
|
|
<Tabs.TabPane key="1" tab={<span className="notHide">HTTPS</span>}>{this.returnCopyUrl("https://gitee.com/44886/polhttp.git")}</Tabs.TabPane>
|
|
|
|
|
|
<Tabs.TabPane key="2" tab={<span className="notHide">SSH</span>}>{this.returnCopyUrl("https://gitee.com/44886/polssh.git")}</Tabs.TabPane>
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
returnCopyUrl=(url)=>{
|
|
|
|
|
|
return(
|
|
|
|
|
|
<div className="df notHide">
|
|
|
|
|
|
<Input value={url} className="notHide" disabled={true}/>
|
|
|
|
|
|
<Button type="primary" ghost className="ml15 notHide">复制</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-21 16:44:40 +08:00
|
|
|
|
// 点击按钮复制功能
|
|
|
|
|
|
jsCopy = () => {
|
|
|
|
|
|
const copyEle = document.querySelector('#descContent') // 获取要复制的节点
|
|
|
|
|
|
const range = document.createRange(); // 创造range
|
|
|
|
|
|
window.getSelection().removeAllRanges(); //清除页面中已有的selection
|
|
|
|
|
|
range.selectNode(copyEle); // 选中需要复制的节点
|
|
|
|
|
|
window.getSelection().addRange(range); // 执行选中元素
|
|
|
|
|
|
document.execCommand("Copy"); // 执行copy操作
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mergeabledMes=()=>{
|
|
|
|
|
|
return(
|
|
|
|
|
|
<div className="clearfix">
|
2021-05-21 18:58:17 +08:00
|
|
|
|
<p className="fl">该分支存在冲突,无法自动合并,你可以尝试通过如下命令手动合并</p>
|
2021-05-21 16:44:40 +08:00
|
|
|
|
<i className="iconfont icon-fuzhi font-16 fr" onClick={()=>this.jsCopy()}></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
2021-06-25 18:21:31 +08:00
|
|
|
|
mergeabledDesc=(base,head,conflict_files)=>{
|
2021-05-21 16:44:40 +08:00
|
|
|
|
return(
|
2021-06-25 18:21:31 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<ul id="descContent">
|
|
|
|
|
|
<li>git fetch origin</li>
|
|
|
|
|
|
<li>git checkout -b {`${base}`} origin/{`${base}`}</li>
|
|
|
|
|
|
<li>git merge {`${head}`}</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
{
|
|
|
|
|
|
conflict_files && conflict_files.length>0 &&
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<p className="mt10 font-16 pt10" style={{borderTop:"1px solid #f9d7d5"}}>如下文件有代码冲突:</p>
|
|
|
|
|
|
<p>
|
|
|
|
|
|
{
|
|
|
|
|
|
conflict_files.map((i,k)=>{
|
2021-06-25 18:33:54 +08:00
|
|
|
|
return <p>{i}</p>
|
2021-06-25 18:21:31 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
</div>
|
2021-05-21 16:44:40 +08:00
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-07 10:10:13 +08:00
|
|
|
|
render() {
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId, mergeId , owner } = this.props.match.params;
|
2020-07-03 17:01:58 +08:00
|
|
|
|
|
2020-06-05 16:24:37 +08:00
|
|
|
|
const {
|
|
|
|
|
|
data,
|
|
|
|
|
|
SpinMerge,
|
2020-06-12 17:58:58 +08:00
|
|
|
|
pr_status,
|
|
|
|
|
|
isSpin,
|
|
|
|
|
|
ismesrge,
|
|
|
|
|
|
SpinFlag,
|
2021-01-13 15:46:17 +08:00
|
|
|
|
copyVisible,
|
2021-06-25 18:21:31 +08:00
|
|
|
|
pull_request,
|
|
|
|
|
|
conflict_files
|
2020-06-05 16:24:37 +08:00
|
|
|
|
} = this.state;
|
2020-07-03 17:01:58 +08:00
|
|
|
|
const { current_user, projectDetail } = this.props;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const menu = (
|
2020-05-07 10:10:13 +08:00
|
|
|
|
<Menu onClick={(e) => this.getOption(e)}>
|
2020-06-05 16:24:37 +08:00
|
|
|
|
<Menu.Item key={"merge"} value="合并请求">
|
|
|
|
|
|
合并请求
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
<Menu.Item key={"rebase"} value="变基并合并">
|
|
|
|
|
|
变基并合并
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
<Menu.Item key={"rebase-merge"} value="变基合并 --no-ff">
|
|
|
|
|
|
变基合并 --no-ff
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
<Menu.Item key={"squash"} value="压缩提交并合并">
|
|
|
|
|
|
压缩提交并合并
|
|
|
|
|
|
</Menu.Item>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</Menu>
|
2020-06-05 16:24:37 +08:00
|
|
|
|
);
|
2021-01-13 15:46:17 +08:00
|
|
|
|
const permission = projectDetail && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission === "Manager");
|
|
|
|
|
|
const userLogin = current_user && current_user.login;
|
|
|
|
|
|
const operate = userLogin && projectDetail && pr_status === 0 && permission;
|
2020-05-07 10:10:13 +08:00
|
|
|
|
return (
|
2021-01-13 15:46:17 +08:00
|
|
|
|
<div>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
{data ? (
|
2020-06-05 16:24:37 +08:00
|
|
|
|
<div>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<div className="main">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div className="grid-item-top pb20 border-1f">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div className="ver-middle">
|
|
|
|
|
|
<span className="mr10 ver-middle">
|
|
|
|
|
|
<span className="font-18 fwb">
|
|
|
|
|
|
{data.issue.subject}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
{data.pull_request && (
|
|
|
|
|
|
<Tag
|
|
|
|
|
|
className={`pr_tags_${data.pull_request.pull_request_staus}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
{pr_status === 1
|
|
|
|
|
|
? "已合并"
|
|
|
|
|
|
: pr_status === 2
|
|
|
|
|
|
? "已拒绝"
|
|
|
|
|
|
: "开启的"}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{
|
|
|
|
|
|
<div className="mt15">
|
2020-06-30 10:27:05 +08:00
|
|
|
|
<Tag className="pr-branch-tag">
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<Link
|
2021-09-01 09:33:22 +08:00
|
|
|
|
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
className="ver-middle"
|
|
|
|
|
|
>
|
2021-10-09 17:33:10 +08:00
|
|
|
|
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
</Link>
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
<span className="mr8 ver-middle">
|
|
|
|
|
|
<i
|
|
|
|
|
|
className={
|
|
|
|
|
|
"iconfont icon-youjiang color-grey-c font-16"
|
|
|
|
|
|
}
|
|
|
|
|
|
></i>
|
|
|
|
|
|
</span>
|
2020-06-30 10:27:05 +08:00
|
|
|
|
<Tag className="pr-branch-tag">
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<Link
|
2021-09-01 09:33:22 +08:00
|
|
|
|
to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
className="ver-middle"
|
|
|
|
|
|
>
|
2020-06-30 10:08:36 +08:00
|
|
|
|
{data.issue.project_author_name}:{data.pull_request.base}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
</Link>
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
}
|
2020-06-05 16:24:37 +08:00
|
|
|
|
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<div className="mt15">
|
2021-08-30 10:31:51 +08:00
|
|
|
|
<Link to={`/${data.issue.author_login}`} className="show-user-link">
|
2021-04-20 11:17:54 +08:00
|
|
|
|
<img className="mr5" src={getImageUrl(`/${data.issue.author_picture}`)}
|
|
|
|
|
|
alt="" width="24" height="24" style={{borderRadius:"50%"}}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
<span className="ver-middle">
|
|
|
|
|
|
<span className="color-grey-8 mr5">由</span>
|
2021-08-30 10:31:51 +08:00
|
|
|
|
<Link to={`/${data.issue.author_login}`} className="show-user-link color-blue">
|
2020-06-12 17:58:58 +08:00
|
|
|
|
{data.issue.author_name}
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
<span className="ml5 color-grey-8">
|
|
|
|
|
|
{pr_status === 0
|
|
|
|
|
|
? "创建于"
|
|
|
|
|
|
: pr_status === 1
|
|
|
|
|
|
? "合并于"
|
|
|
|
|
|
: "更新于"}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span className="color-grey-8 ml5">{data.pr_time}</span>
|
|
|
|
|
|
<span className="ml25">
|
|
|
|
|
|
<span className="color-grey-8">审查人员:</span>
|
2020-06-12 18:46:55 +08:00
|
|
|
|
{data.issue.assign_user_name ? (
|
|
|
|
|
|
<Link
|
2021-08-30 10:31:51 +08:00
|
|
|
|
to={`/${data.issue.assign_user_login}`}
|
2020-06-12 18:46:55 +08:00
|
|
|
|
className="show-user-link color-blue"
|
|
|
|
|
|
>
|
|
|
|
|
|
{data.issue.assign_user_name}
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
"--"
|
|
|
|
|
|
)}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
<span className="ml25">
|
|
|
|
|
|
<span className="color-grey-8">里程碑:</span>
|
|
|
|
|
|
<span className="color-grey-3">
|
|
|
|
|
|
{data.issue.version ? data.issue.version : "--"}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span className="ml25">
|
2021-09-16 15:48:43 +08:00
|
|
|
|
<span className="color-grey-8">标记:</span>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<span className="color-grey-3">
|
|
|
|
|
|
{data.issue.issue_tags &&
|
|
|
|
|
|
data.issue.issue_tags.length > 0
|
|
|
|
|
|
? data.issue.issue_tags[0].name
|
|
|
|
|
|
: "--"}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span className="ml25">
|
|
|
|
|
|
<span className="color-grey-8">优先级:</span>
|
|
|
|
|
|
<span className="color-grey-3">
|
|
|
|
|
|
{data.issue.priority ? data.issue.priority : "--"}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div className="ml10">
|
2020-11-05 11:31:26 +08:00
|
|
|
|
<div className="mt15 text-right" style={{display:"flex",justifyContent:"flex-end"}}>
|
2021-01-13 15:46:17 +08:00
|
|
|
|
{operate && (
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<Button
|
2020-11-05 11:31:26 +08:00
|
|
|
|
type="green"
|
2020-06-12 17:58:58 +08:00
|
|
|
|
ghost
|
2020-11-05 11:31:26 +08:00
|
|
|
|
className="ml20"
|
2021-09-01 09:33:22 +08:00
|
|
|
|
onClick={()=>{this.props.history.push(`/${owner}/${projectsId}/pulls/${mergeId}/UpdateMerge`);}}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
>
|
|
|
|
|
|
编辑
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
)}
|
2021-01-13 15:46:17 +08:00
|
|
|
|
{operate && (
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<Button
|
|
|
|
|
|
type="danger"
|
|
|
|
|
|
ghost
|
|
|
|
|
|
onClick={() => this.closedetail()}
|
2020-11-05 11:31:26 +08:00
|
|
|
|
className="ml20"
|
2020-06-12 17:58:58 +08:00
|
|
|
|
loading={isSpin}
|
|
|
|
|
|
>
|
|
|
|
|
|
拒绝
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-09-27 13:58:44 +08:00
|
|
|
|
{
|
|
|
|
|
|
data.issue.description ?
|
|
|
|
|
|
<div className="mt15">{this.commentCtx(data.issue.description)}</div>
|
|
|
|
|
|
:
|
|
|
|
|
|
<p className="color-grey-9 ml3 mr3 mt15">没有描述</p>
|
|
|
|
|
|
}
|
2020-06-05 16:24:37 +08:00
|
|
|
|
</div>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<div className="mt15">
|
|
|
|
|
|
{pr_status === 2 && (
|
|
|
|
|
|
<Alert
|
|
|
|
|
|
message="提示"
|
|
|
|
|
|
description="该合并请求已被拒绝"
|
|
|
|
|
|
type="error"
|
|
|
|
|
|
/>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{pr_status === 1 && (
|
|
|
|
|
|
<Alert
|
|
|
|
|
|
message="提示"
|
|
|
|
|
|
description="该合并请求已被合并"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
/>
|
|
|
|
|
|
)}
|
2021-05-21 16:44:40 +08:00
|
|
|
|
{operate && (
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<Spin spinning={SpinFlag}>
|
2020-06-05 16:24:37 +08:00
|
|
|
|
<div
|
|
|
|
|
|
style={{
|
|
|
|
|
|
display:
|
2020-06-12 17:58:58 +08:00
|
|
|
|
this.state.mergekey === "rebase"
|
2021-05-21 16:44:40 +08:00
|
|
|
|
? this.state.buttonshow === "none" ? "block" : "none"
|
|
|
|
|
|
: !ismesrge ? "block" : "none",
|
2020-06-05 16:24:37 +08:00
|
|
|
|
}}
|
|
|
|
|
|
>
|
2021-06-16 15:51:47 +08:00
|
|
|
|
<Dropdown.Button
|
|
|
|
|
|
overlay={menu}
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
onClick={this.submitmerge}
|
|
|
|
|
|
className="mb15"
|
|
|
|
|
|
icon={<Icon type="caret-down" />}
|
|
|
|
|
|
disabled={!pull_request || (pull_request && !pull_request.mergeable) }
|
|
|
|
|
|
>
|
|
|
|
|
|
{this.state.mergename}
|
|
|
|
|
|
</Dropdown.Button>
|
2021-05-21 16:44:40 +08:00
|
|
|
|
{pull_request && pull_request.mergeable
|
|
|
|
|
|
?
|
|
|
|
|
|
<Alert
|
|
|
|
|
|
message="该合并请求可以进行自动合并操作"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
showIcon
|
|
|
|
|
|
/>:
|
|
|
|
|
|
<Alert
|
|
|
|
|
|
message={this.mergeabledMes()}
|
|
|
|
|
|
type="error"
|
2021-06-25 18:21:31 +08:00
|
|
|
|
description={this.mergeabledDesc(pull_request.base,pull_request.head,conflict_files)}
|
2021-05-21 16:44:40 +08:00
|
|
|
|
showIcon
|
|
|
|
|
|
/>
|
|
|
|
|
|
}
|
2020-06-12 17:58:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
style={{
|
|
|
|
|
|
display: ismesrge ? "block" : "none",
|
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
<Input
|
|
|
|
|
|
placeholder="标题"
|
|
|
|
|
|
value={this.state.title}
|
|
|
|
|
|
onChange={this.changtitlepr}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<TextArea
|
|
|
|
|
|
placeholder="请输入合并描述..."
|
|
|
|
|
|
style={{ height: "170px", marginTop: 20 }}
|
|
|
|
|
|
value={this.state.body}
|
|
|
|
|
|
onChange={this.changbodypr}
|
|
|
|
|
|
/>
|
2020-05-07 10:10:13 +08:00
|
|
|
|
</div>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
<p
|
|
|
|
|
|
className="clearfix mt15"
|
|
|
|
|
|
style={{ display: this.state.buttonshow }}
|
|
|
|
|
|
>
|
|
|
|
|
|
<Spin spinning={SpinMerge}>
|
|
|
|
|
|
<Button type="primary" onClick={() => this.prmerge()}>
|
|
|
|
|
|
确认合并
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
onClick={() => this.nonemerge()}
|
|
|
|
|
|
className="ml15"
|
|
|
|
|
|
>
|
|
|
|
|
|
取消
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Spin>
|
|
|
|
|
|
</p>
|
2020-05-07 10:10:13 +08:00
|
|
|
|
</div>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
</Spin>
|
|
|
|
|
|
)}
|
2020-06-05 16:24:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-05-07 10:10:13 +08:00
|
|
|
|
|
2020-11-06 18:41:23 +08:00
|
|
|
|
<MergeFooter
|
|
|
|
|
|
footer_type={true}
|
|
|
|
|
|
order_id={data && data.issue.id}
|
|
|
|
|
|
{...this.props}
|
|
|
|
|
|
{...this.state}
|
|
|
|
|
|
></MergeFooter>
|
2020-06-12 17:58:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
""
|
|
|
|
|
|
)}
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</div>
|
2020-06-05 16:24:37 +08:00
|
|
|
|
);
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-06-05 16:24:37 +08:00
|
|
|
|
const MessageCountForm = Form.create({ name: "MessageCountForm" })(
|
|
|
|
|
|
MessageCount
|
|
|
|
|
|
);
|
|
|
|
|
|
export default MessageCountForm;
|