forked from Gitlink/forgeplus-react
提交pr浏览代码link url
This commit is contained in:
parent
8cc9024e38
commit
74f6682178
|
|
@ -6,7 +6,8 @@ import { getImageUrl } from 'educoder';
|
|||
import { Link } from 'react-router-dom';
|
||||
import { Pagination } from 'antd';
|
||||
|
||||
function Commits({ commits , projectsId , owner , total ,limit , changeCommitFunc }){
|
||||
function Commits(props){
|
||||
const { commits , projectsId , owner , total ,limit , changeCommitFunc, pullOwnerLogin } = props;
|
||||
return(
|
||||
<div className="pb20">
|
||||
{
|
||||
|
|
@ -17,10 +18,10 @@ function Commits({ commits , projectsId , owner , total ,limit , changeCommitFun
|
|||
<div className="prInfo">
|
||||
<FlexAJ>
|
||||
<AlignCenter>
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0}}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||
<Link to={`/${pullOwnerLogin}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0}}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||
<p className="ml15 font-16 color-grey-3 task-hide" style={{maxWidth:"700px"}}>{item.message}</p>
|
||||
</AlignCenter>
|
||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
||||
<Link to={`/${pullOwnerLogin}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
||||
</FlexAJ>
|
||||
<AlignCenter className="mt15">
|
||||
<User url={getImageUrl(`/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
||||
|
|
|
|||
|
|
@ -386,6 +386,8 @@ class CreateMerge extends Component {
|
|||
} = this.state;
|
||||
|
||||
let { project } = this.props;
|
||||
// 源仓库所有者login
|
||||
const pullOwnerLogin = projects_names && projects_names.filter(item=>{return item.id === id})[0].project_user_login;
|
||||
return (
|
||||
<div>
|
||||
<Spin spinning={isSpin || isCompareSpin}>
|
||||
|
|
@ -481,6 +483,7 @@ class CreateMerge extends Component {
|
|||
limit = {limit}
|
||||
changeCommitFunc={this.changeCommitFunc}
|
||||
comparesData={comparesData}
|
||||
pullOwnerLogin={pullOwnerLogin}
|
||||
></MergeFooter>
|
||||
)}
|
||||
</Spin>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
word-break: break-all;
|
||||
}
|
||||
.see-file{
|
||||
width: 14rem;
|
||||
width: 15rem;
|
||||
.ml10{
|
||||
display: inline-block;
|
||||
width: 4.5rem;
|
||||
|
|
|
|||
|
|
@ -592,6 +592,7 @@ class MessageCount extends Component {
|
|||
{...this.props}
|
||||
{...this.state}
|
||||
bindFootRef={this.bindFootRef}
|
||||
pullOwnerLogin={data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.author_login}
|
||||
></MergeLinkFooter>
|
||||
</div>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Reference in New Issue