forked from Gitlink/forgeplus-react
add information
This commit is contained in:
parent
36691c25a4
commit
01d3972d3e
|
@ -45,6 +45,9 @@ class MessageCount extends Component {
|
|||
copyVisible:false,
|
||||
|
||||
fix_issue_id: "",
|
||||
unclosed_issue_list: [],
|
||||
ownername: undefined,
|
||||
reponame: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -53,6 +56,7 @@ class MessageCount extends Component {
|
|||
SpinFlag: true,
|
||||
});
|
||||
this.getDetail();
|
||||
this.getUnclosedIssueList();
|
||||
|
||||
// this.clickBody();
|
||||
};
|
||||
|
@ -68,6 +72,8 @@ class MessageCount extends Component {
|
|||
|
||||
getDetail = () => {
|
||||
const { projectsId, mergeId, owner } = this.props.match.params;
|
||||
this.state.ownername = owner;
|
||||
this.state.reponame = projectsId;
|
||||
const url = `/${owner}/${projectsId}/pulls/${mergeId}.json`;
|
||||
axios
|
||||
.get(url)
|
||||
|
@ -171,6 +177,41 @@ class MessageCount extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
renderIssueList = (list) => {
|
||||
if (list && list.length > 0) {
|
||||
return list.map((item, index) => {
|
||||
return (
|
||||
<Option
|
||||
key={item[0]}
|
||||
value={item[0]}
|
||||
>
|
||||
{item[0] + ":" + item[1]}
|
||||
</Option>
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
getUnclosedIssueList = () => {
|
||||
const url = `/projects/blockchain/get_unclosed_issue_list`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
"ownername": this.state.ownername,
|
||||
"reponame": this.state.reponame
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
this.state.unclosed_issue_list = result.data.unclosed_issues;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
selectIssueChange = (selectedKeys, info) => {
|
||||
this.state.fix_issue_id = selectedKeys;
|
||||
};
|
||||
|
||||
submitmerge = () => {
|
||||
if (this.state.mergekey === "rebase") {
|
||||
this.setState({
|
||||
|
@ -497,12 +538,21 @@ class MessageCount extends Component {
|
|||
value={this.state.body}
|
||||
onChange={this.changbodypr}
|
||||
/>
|
||||
<Input
|
||||
placeholder="请输入解决的issue id"
|
||||
style={{ marginTop: 20 }}
|
||||
value={this.state.fix_issue_id}
|
||||
onChange={this.changefixissue}
|
||||
/>
|
||||
{/*<Input*/}
|
||||
{/* type="select"*/}
|
||||
{/* placeholder="请选择解决的issue"*/}
|
||||
{/* style={{ marginTop: 20 }}*/}
|
||||
{/* value={this.state.fix_issue_id}*/}
|
||||
{/* onChange={this.changefixissue}*/}
|
||||
{/*/>*/}
|
||||
<Select
|
||||
id = {'select_project'}
|
||||
style={{ marginTop: 20, width: "500px" }}
|
||||
placeholder={"请选择解决的易修"}
|
||||
onSelect={this.selectIssueChange}
|
||||
>
|
||||
{this.renderIssueList(this.state.unclosed_issue_list)}
|
||||
</Select>
|
||||
</div>
|
||||
<p
|
||||
className="clearfix mt15"
|
||||
|
|
Loading…
Reference in New Issue