修改 fork项目失败原因为已经复刻过则跳转到复刻仓库,合并请求【仓库:分支】显示统一样式

This commit is contained in:
谢思 2021-11-23 14:39:23 +08:00
parent a04b8de39e
commit 4f64b840b0
5 changed files with 10 additions and 7 deletions

View File

@ -423,6 +423,10 @@ class Detail extends Component {
const url = `/${owner}/${projectsId}/forks.json`; const url = `/${owner}/${projectsId}/forks.json`;
axios.post(url).then(result => { axios.post(url).then(result => {
if (result && result.data.status === 0) { if (result && result.data.status === 0) {
if(result.data.message === "fork失败你已拥有了这个项目"){
this.props.history.push(`/${current_user && current_user.login}/${projectsId}`);
return;
}
this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`); this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`);
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
} }

View File

@ -124,7 +124,6 @@ class CreateMerge extends Component {
initUser && initUser[0] && this.selectProjectName(initUser[0].id,false,{projects_names: result.data.projects_names,id: result.data.id}); initUser && initUser[0] && this.selectProjectName(initUser[0].id,false,{projects_names: result.data.projects_names,id: result.data.id});
} }
this.setState({isSpin: false}); this.setState({isSpin: false});
console.log('setTimeout state', this.state.data);
// 如果url上的分支不存在取默认值master // 如果url上的分支不存在取默认值master
const noMergeBranch = const noMergeBranch =
(result.data.branches || []).filter( (result.data.branches || []).filter(
@ -363,7 +362,7 @@ class CreateMerge extends Component {
<div className="main"> <div className="main">
<div className="merge-header width100 inline-block"> <div className="merge-header width100 inline-block">
<div className="width40 pull-left"> <div className="width40 pull-left">
<div className="color-grey-3 mb10 fwb">源分支:</div> <div className="color-grey-3 mb10 fwb">源分支 : </div>
<Input.Group compact className="display-flex"> <Input.Group compact className="display-flex">
<Select <Select
value={id} value={id}
@ -391,7 +390,7 @@ class CreateMerge extends Component {
</div> </div>
<div className="width40 pull-left"> <div className="width40 pull-left">
<div> <div>
<div className="color-grey-3 mb10 fwb">目标分支:</div> <div className="color-grey-3 mb10 fwb">目标分支 : </div>
<Input.Group compact className="display-flex"> <Input.Group compact className="display-flex">
<Select <Select
value={project && project.id} value={project && project.id}

View File

@ -115,7 +115,7 @@ class MergeItem extends Component {
{item.is_original {item.is_original
? item.fork_project_user_name ? item.fork_project_user_name
: item.author_name} : item.author_name}
:{item.pull_request_head} : {item.pull_request_head}
</Link> </Link>
</Tag> </Tag>
} }
@ -136,7 +136,7 @@ class MergeItem extends Component {
to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`} to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`}
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}} className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
> >
{project_author_name}:{item.pull_request_base} {project_author_name}: {item.pull_request_base}
</Link> </Link>
</Tag> </Tag>
} }

View File

@ -383,7 +383,7 @@ class MessageCount extends Component {
to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`} to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`}
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`} className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`}
> >
{data.issue.project_author_name}:{data.pull_request.base} {data.issue.project_author_name}: {data.pull_request.base}
</Link> </Link>
</Tag> </Tag>
</div> </div>

View File

@ -61,7 +61,7 @@ class UpdateMerge extends Component {
<div> <div>
<div className="merge-header width100 inline-block"> <div className="merge-header width100 inline-block">
<div className="width45 pull-left"> <div className="width45 pull-left">
<div className="color-grey-3 mb10 fwb">源分支:</div> <div className="color-grey-3 mb10 fwb">源分支 : </div>
<Input.Group compact className="display-flex"> <Input.Group compact className="display-flex">
<Button className="merge-header-button flex1 maxW50 hide-1 task-hide" disabled> <Button className="merge-header-button flex1 maxW50 hide-1 task-hide" disabled>