mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Code review UI improvements and bugfixes (#4682)
* Code review UI improvements * More fixes to dark theme * Style fix * Fix to allow add code review comments only on review files tab * More readability dark style fixes * Fix commenting on deleted files. Fixes #4752 * Fix line blame getting for multiple corner cases
This commit is contained in:
@@ -128,13 +128,23 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
|
||||
}
|
||||
}
|
||||
|
||||
if form.HasEmptyContent() {
|
||||
review, err = models.GetCurrentReview(ctx.User, issue)
|
||||
if err == nil {
|
||||
review.Issue = issue
|
||||
if errl := review.LoadCodeComments(); errl != nil {
|
||||
ctx.ServerError("LoadCodeComments", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if ((err == nil && len(review.CodeComments) == 0) ||
|
||||
(err != nil && models.IsErrReviewNotExist(err))) &&
|
||||
form.HasEmptyContent() {
|
||||
ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty"))
|
||||
ctx.Redirect(fmt.Sprintf("%s/pulls/%d/files", ctx.Repo.RepoLink, issue.Index))
|
||||
return
|
||||
}
|
||||
|
||||
review, err = models.GetCurrentReview(ctx.User, issue)
|
||||
if err != nil {
|
||||
if !models.IsErrReviewNotExist(err) {
|
||||
ctx.ServerError("GetCurrentReview", err)
|
||||
|
Reference in New Issue
Block a user