mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 19:24:00 +01:00
Alert error message if open dependencies are included in the issues that try to batch close (#24329)
fix #24185 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
df9a62b5f9
commit
8f57aa014b
3 changed files with 4 additions and 1 deletions
|
@ -1541,6 +1541,7 @@ issues.dependency.issue_closing_blockedby = Closing this issue is blocked by the
|
||||||
issues.dependency.issue_close_blocks = This issue blocks closing of the following issues
|
issues.dependency.issue_close_blocks = This issue blocks closing of the following issues
|
||||||
issues.dependency.pr_close_blocks = This pull request blocks closing of the following issues
|
issues.dependency.pr_close_blocks = This pull request blocks closing of the following issues
|
||||||
issues.dependency.issue_close_blocked = You need to close all issues blocking this issue before you can close it.
|
issues.dependency.issue_close_blocked = You need to close all issues blocking this issue before you can close it.
|
||||||
|
issues.dependency.issue_batch_close_blocked = "Cannot batch close issues that you choose, because issue #%d still has open dependencies"
|
||||||
issues.dependency.pr_close_blocked = You need to close all issues blocking this pull request before you can merge it.
|
issues.dependency.pr_close_blocked = You need to close all issues blocking this pull request before you can merge it.
|
||||||
issues.dependency.blocks_short = Blocks
|
issues.dependency.blocks_short = Blocks
|
||||||
issues.dependency.blocked_by_short = Depends on
|
issues.dependency.blocked_by_short = Depends on
|
||||||
|
|
|
@ -2689,7 +2689,7 @@ func UpdateIssueStatus(ctx *context.Context) {
|
||||||
if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
|
if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
|
||||||
if issues_model.IsErrDependenciesLeft(err) {
|
if issues_model.IsErrDependenciesLeft(err) {
|
||||||
ctx.JSON(http.StatusPreconditionFailed, map[string]interface{}{
|
ctx.JSON(http.StatusPreconditionFailed, map[string]interface{}{
|
||||||
"error": "cannot close this issue because it still has open dependencies",
|
"error": ctx.Tr("repo.issues.dependency.issue_batch_close_blocked", issue.Index),
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ function initRepoIssueListCheckboxes() {
|
||||||
elementId
|
elementId
|
||||||
).then(() => {
|
).then(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
}).catch((reason) => {
|
||||||
|
window.alert(reason.responseJSON.error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue