mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 02:15:20 +02:00
Add notification interface and refactor UI notifications (#5085)
* add notification interface and refactor UI notifications * add missing methods on notification interface and notifiy only issue status really changed * implement NotifyPullRequestReview for ui notification
This commit is contained in:
parent
dd62ca7ba9
commit
ea619b39b2
11 changed files with 378 additions and 44 deletions
|
@ -79,7 +79,7 @@ func CreateCodeComment(ctx *context.Context, form auth.CodeCommentForm) {
|
|||
}
|
||||
// Send no notification if comment is pending
|
||||
if !form.IsReview {
|
||||
notification.Service.NotifyIssue(issue, ctx.User.ID)
|
||||
notification.NotifyCreateIssueComment(ctx.User, issue.Repo, issue, comment)
|
||||
}
|
||||
|
||||
log.Trace("Comment created: %d/%d/%d", ctx.Repo.Repository.ID, issue.ID, comment.ID)
|
||||
|
@ -184,5 +184,13 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
|
|||
ctx.ServerError("Publish", err)
|
||||
return
|
||||
}
|
||||
|
||||
pr, err := issue.GetPullRequest()
|
||||
if err != nil {
|
||||
ctx.ServerError("GetPullRequest", err)
|
||||
return
|
||||
}
|
||||
notification.NotifyPullRequestReview(pr, review, comm)
|
||||
|
||||
ctx.Redirect(fmt.Sprintf("%s/pulls/%d#%s", ctx.Repo.RepoLink, issue.Index, comm.HashTag()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue