Skip to content

Commit 8f57aa0

Browse files
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>
1 parent df9a62b commit 8f57aa0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ issues.dependency.issue_closing_blockedby = Closing this issue is blocked by the
15411541
issues.dependency.issue_close_blocks = This issue blocks closing of the following issues
15421542
issues.dependency.pr_close_blocks = This pull request blocks closing of the following issues
15431543
issues.dependency.issue_close_blocked = You need to close all issues blocking this issue before you can close it.
1544+
issues.dependency.issue_batch_close_blocked = "Cannot batch close issues that you choose, because issue #%d still has open dependencies"
15441545
issues.dependency.pr_close_blocked = You need to close all issues blocking this pull request before you can merge it.
15451546
issues.dependency.blocks_short = Blocks
15461547
issues.dependency.blocked_by_short = Depends on

routers/web/repo/issue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2689,7 +2689,7 @@ func UpdateIssueStatus(ctx *context.Context) {
26892689
if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
26902690
if issues_model.IsErrDependenciesLeft(err) {
26912691
ctx.JSON(http.StatusPreconditionFailed, map[string]interface{}{
2692-
"error": "cannot close this issue because it still has open dependencies",
2692+
"error": ctx.Tr("repo.issues.dependency.issue_batch_close_blocked", issue.Index),
26932693
})
26942694
return
26952695
}

web_src/js/features/repo-issue-list.js

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ function initRepoIssueListCheckboxes() {
5555
elementId
5656
).then(() => {
5757
window.location.reload();
58+
}).catch((reason) => {
59+
window.alert(reason.responseJSON.error);
5860
});
5961
});
6062
}

0 commit comments

Comments
 (0)