Show branch errors when creating pull request (#3667)

This commit is contained in:
Naoki Takezoe
2024-12-21 11:54:47 +09:00
committed by GitHub
parent d2fc7a0642
commit ad9a0afc9b

View File

@@ -21,6 +21,7 @@
@import gitbucket.core.view.helpers @import gitbucket.core.view.helpers
@gitbucket.core.html.main(s"Pull requests - ${repository.owner}/${repository.name}", Some(repository)){ @gitbucket.core.html.main(s"Pull requests - ${repository.owner}/${repository.name}", Some(repository)){
@gitbucket.core.html.menu("pulls", repository){ @gitbucket.core.html.menu("pulls", repository){
<form method="POST" action="@context.path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
<div class="pullreq-info"> <div class="pullreq-info">
<div id="compare-edit"> <div id="compare-edit">
@gitbucket.core.helper.html.dropdown(originRepository.owner + "/" + originRepository.name, "base fork", filter=("origin_repo", "Find Repository...")) { @gitbucket.core.helper.html.dropdown(originRepository.owner + "/" + originRepository.name, "base fork", filter=("origin_repo", "Find Repository...")) {
@@ -36,6 +37,7 @@
<li><a href="#" class="origin-branch" data-branch="@helpers.encodeRefName(branch)">@gitbucket.core.helper.html.checkicon(branch == originId) @branch</a></li> <li><a href="#" class="origin-branch" data-branch="@helpers.encodeRefName(branch)">@gitbucket.core.helper.html.checkicon(branch == originId) @branch</a></li>
} }
} }
<span class="error" id="error-targetBranch"></span>
... ...
@gitbucket.core.helper.html.dropdown(forkedRepository.owner + "/" + forkedRepository.name, "head fork", filter=("forked_repo", "Find Repository...")) { @gitbucket.core.helper.html.dropdown(forkedRepository.owner + "/" + forkedRepository.name, "head fork", filter=("forked_repo", "Find Repository...")) {
@members.map { case (owner, name, defaultBranch) => @members.map { case (owner, name, defaultBranch) =>
@@ -50,6 +52,7 @@
<li><a href="#" class="forked-branch" data-branch="@helpers.encodeRefName(branch)">@gitbucket.core.helper.html.checkicon(branch == forkedId) @branch</a></li> <li><a href="#" class="forked-branch" data-branch="@helpers.encodeRefName(branch)">@gitbucket.core.helper.html.checkicon(branch == forkedId) @branch</a></li>
} }
} }
<span class="error" id="error-requestBranch"></span>
</div> </div>
@if(originRepository.branchList.contains(originId) && forkedRepository.branchList.contains(forkedId)){ @if(originRepository.branchList.contains(originId) && forkedRepository.branchList.contains(forkedId)){
<div class="check-conflict" style="display: none;"> <div class="check-conflict" style="display: none;">
@@ -59,7 +62,6 @@
</div> </div>
@if(commits.nonEmpty && context.loginAccount.isDefined && originRepository.branchList.contains(originId) && forkedRepository.branchList.contains(forkedId)){ @if(commits.nonEmpty && context.loginAccount.isDefined && originRepository.branchList.contains(originId) && forkedRepository.branchList.contains(forkedId)){
<div id="pull-request-form" style="margin-bottom: 20px;"> <div id="pull-request-form" style="margin-bottom: 20px;">
<form method="POST" action="@context.path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
<span class="error" id="error-title"></span> <span class="error" id="error-title"></span>
@@ -113,9 +115,9 @@
) )
</div> </div>
</div> </div>
</form>
</div> </div>
} }
</form>
@if(commits.isEmpty){ @if(commits.isEmpty){
<div class="panel panel-default" style="padding: 20px; background-color: #eee; text-align: center;"> <div class="panel panel-default" style="padding: 20px; background-color: #eee; text-align: center;">
<h4>There isn't anything to compare.</h4> <h4>There isn't anything to compare.</h4>