feat: combine review requests comments

- Combine review requests comments similairy how labels comments are
combined. If review requests comments were made within 60 seconds of
each other they will be grouped.
- Integration and unit test added.
- Resolves #2774
This commit is contained in:
Gusted 2024-10-25 09:24:36 +02:00
parent aa86e94853
commit 8fdc0a7a6c
9 changed files with 685 additions and 65 deletions

View file

@ -262,3 +262,15 @@ func RenderLabels(ctx context.Context, locale translation.Locale, labels []*issu
htmlCode += "</span>"
return template.HTML(htmlCode)
}
func RenderReviewRequest(users []issues_model.RequestReviewTarget) template.HTML {
usernames := make([]string, 0, len(users))
for _, user := range users {
usernames = append(usernames, template.HTMLEscapeString(user.Name()))
}
htmlCode := `<span class="review-request-list">`
htmlCode += strings.Join(usernames, ", ")
htmlCode += "</span>"
return template.HTML(htmlCode)
}