修改新建合并请求页面目标分支存在但显示不存在bug以及提交详情页面的浏览文件按钮上移样式问题

This commit is contained in:
谢思 2021-10-15 15:22:22 +08:00
parent 94fd500423
commit 66108083fd
2 changed files with 22 additions and 15 deletions

View File

@ -21,8 +21,8 @@ const Infos = styled.div`
& .markdown-body table{
background: #f1f8ff;
}
& .f-wrap-between{
align-items: center;
& .btnblue{
margin-top: 12px;
}
& .task-hide{
width: 65rem;

View File

@ -96,7 +96,6 @@ class CreateMerge extends Component {
// 再获取对应的仓库列表、分支列表
// 再调用比较接口
const branchParams = getBranchParams(this.props.location.pathname);
console.log('componentDidMount branchParams', branchParams);
this.getMergeInfo(branchParams);
};
@ -106,7 +105,6 @@ class CreateMerge extends Component {
const newPathname = this.props.location.pathname;
if (oldPathname !== newPathname) {
const branchParams = getBranchParams(newPathname);
console.log('componentDidUpdate branchParams', branchParams);
this.getMergeInfo(branchParams);
}
};
@ -142,22 +140,29 @@ class CreateMerge extends Component {
pull: pullBranch,
});
if (!noMergeBranch && !noPullBranch) {
this.compareProject(result.data.id, branchParams);
} else {
const _message = [];
noMergeBranch && _message.push('目标分支不存在');
noPullBranch && _message.push('源分支不存在');
//判断源分支是否存在
if(noPullBranch){
this.setState({
showMessage: true,
defaultMessage: _message.join(' , '),
defaultMessage:'源分支不存在',
isCompareSpin: false,
});
}else{
if(pullOwner === mergeOwner){
if (!noMergeBranch) {
this.compareProject(result.data.id, branchParams);
} else {
this.setState({
showMessage: true,
defaultMessage:'目标分支不存在',
isCompareSpin: false,
});
}
}
if (pullOwner !== mergeOwner) {
}else{
this.getBranchList(branchParams);
}
}
}
this.setState({ isSpin: false });
})
.catch((error) => {
@ -225,7 +230,9 @@ class CreateMerge extends Component {
.length === 0;
this.setState({
mergeBranches: result.data,
merge: noMergeBranch ? 'master' : mergeBranch,
showMessage: noMergeBranch,
defaultMessage: '目标分支不存在',
isCompareSpin: false,
});
}
this.setState({ isSpin: false });