修改新建合并请求页面目标分支存在但显示不存在bug以及提交详情页面的浏览文件按钮上移样式问题
This commit is contained in:
parent
94fd500423
commit
66108083fd
|
@ -21,8 +21,8 @@ const Infos = styled.div`
|
||||||
& .markdown-body table{
|
& .markdown-body table{
|
||||||
background: #f1f8ff;
|
background: #f1f8ff;
|
||||||
}
|
}
|
||||||
& .f-wrap-between{
|
& .btnblue{
|
||||||
align-items: center;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
& .task-hide{
|
& .task-hide{
|
||||||
width: 65rem;
|
width: 65rem;
|
||||||
|
|
|
@ -96,7 +96,6 @@ class CreateMerge extends Component {
|
||||||
// 再获取对应的仓库列表、分支列表
|
// 再获取对应的仓库列表、分支列表
|
||||||
// 再调用比较接口
|
// 再调用比较接口
|
||||||
const branchParams = getBranchParams(this.props.location.pathname);
|
const branchParams = getBranchParams(this.props.location.pathname);
|
||||||
console.log('componentDidMount branchParams', branchParams);
|
|
||||||
this.getMergeInfo(branchParams);
|
this.getMergeInfo(branchParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,7 +105,6 @@ class CreateMerge extends Component {
|
||||||
const newPathname = this.props.location.pathname;
|
const newPathname = this.props.location.pathname;
|
||||||
if (oldPathname !== newPathname) {
|
if (oldPathname !== newPathname) {
|
||||||
const branchParams = getBranchParams(newPathname);
|
const branchParams = getBranchParams(newPathname);
|
||||||
console.log('componentDidUpdate branchParams', branchParams);
|
|
||||||
this.getMergeInfo(branchParams);
|
this.getMergeInfo(branchParams);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -142,22 +140,29 @@ class CreateMerge extends Component {
|
||||||
pull: pullBranch,
|
pull: pullBranch,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!noMergeBranch && !noPullBranch) {
|
//判断源分支是否存在
|
||||||
this.compareProject(result.data.id, branchParams);
|
if(noPullBranch){
|
||||||
} else {
|
|
||||||
const _message = [];
|
|
||||||
noMergeBranch && _message.push('目标分支不存在');
|
|
||||||
noPullBranch && _message.push('源分支不存在');
|
|
||||||
this.setState({
|
this.setState({
|
||||||
showMessage: true,
|
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,
|
isCompareSpin: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}else{
|
||||||
if (pullOwner !== mergeOwner) {
|
|
||||||
this.getBranchList(branchParams);
|
this.getBranchList(branchParams);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.setState({ isSpin: false });
|
this.setState({ isSpin: false });
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -225,7 +230,9 @@ class CreateMerge extends Component {
|
||||||
.length === 0;
|
.length === 0;
|
||||||
this.setState({
|
this.setState({
|
||||||
mergeBranches: result.data,
|
mergeBranches: result.data,
|
||||||
merge: noMergeBranch ? 'master' : mergeBranch,
|
showMessage: noMergeBranch,
|
||||||
|
defaultMessage: '目标分支不存在',
|
||||||
|
isCompareSpin: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.setState({ isSpin: false });
|
this.setState({ isSpin: false });
|
||||||
|
|
Loading…
Reference in New Issue