mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Disable merging a WIP Pull request (#4529)
* prevent pull request to be merged when PR is a WIP * add tests * add helper to prepend WIP: in PR title * move default wip prefixes into settings * use configurable WIP prefixes in javascript and default to first one in templates * add documentation * add unit test on pull model Signed-off-by: Julien Tant <julien@craftyx.fr>
This commit is contained in:
@@ -1655,6 +1655,23 @@ function u2fRegisterRequest() {
|
||||
});
|
||||
}
|
||||
|
||||
function initWipTitle() {
|
||||
$(".title_wip_desc > a").click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $issueTitle = $("#issue_title");
|
||||
var value = $issueTitle.val().trim().toUpperCase();
|
||||
|
||||
for (var i in wipPrefixes) {
|
||||
if (value.startsWith(wipPrefixes[i].toUpperCase())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$issueTitle.val(wipPrefixes[0] + " " + $issueTitle.val());
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
csrf = $('meta[name=_csrf]').attr("content");
|
||||
suburl = $('meta[name=_suburl]').attr("content");
|
||||
@@ -1869,6 +1886,7 @@ $(document).ready(function () {
|
||||
initU2FAuth();
|
||||
initU2FRegister();
|
||||
initIssueList();
|
||||
initWipTitle();
|
||||
initPullRequestReview();
|
||||
|
||||
// Repo clone url.
|
||||
|
Reference in New Issue
Block a user