Tue, 14 Jan 2025 19:21:48 +0100
fix currentAssignee filter not used for comments
--- a/src/main/kotlin/de/uapcore/lightpit/entities/IssueHistoryEntry.kt Mon Jan 13 21:38:06 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/IssueHistoryEntry.kt Tue Jan 14 19:21:48 2025 +0100 @@ -36,6 +36,9 @@ val subject: String, val time: Timestamp, val type: IssueHistoryType, + /** + * Used for filtering issue entries based on current assignment. + */ val currentAssignee: String?, val issueid: Int, val component: String, @@ -52,6 +55,9 @@ val subject: String, val time: Timestamp, val type: IssueHistoryType, + /** + * Unused at the moment, but might be used in the future to filter comments. + */ val currentAssignee: String?, val issueid: Int, val commentid: Int,
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Mon Jan 13 21:38:06 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Tue Jan 14 19:21:48 2025 +0100 @@ -185,11 +185,14 @@ issuesFromDb.filter { assignees.contains(it.currentAssignee) } val commentsFromDb = dao.listIssueCommentHistory(project, days) - val commentHistory = when (comments) { + var commentHistory = when (comments) { "all" -> commentsFromDb "new" -> commentsFromDb.filter { it.type == IssueHistoryType.NewComment } else -> emptyList() } + if (assignees != null) { + commentHistory = commentHistory.filter { assignees.contains(it.currentAssignee) } + } http.view = IssueFeed(project, generateFeedEntries(http, issueHistory, commentHistory)) http.renderFeed("issues-feed")