# HG changeset patch # User Mike Becker # Date 1728220130 -7200 # Node ID 61b16fc21f4de5446f90aa7932ac736cd2fc467c # Parent ba2a1313eb988b7c921b8d75fcf632745dcd9c03 fix missing localization in RSS feed fixes #422 diff -r ba2a1313eb98 -r 61b16fc21f4d build.gradle.kts --- a/build.gradle.kts Sat Aug 17 12:09:03 2024 +0200 +++ b/build.gradle.kts Sun Oct 06 15:08:50 2024 +0200 @@ -5,7 +5,7 @@ war } group = "de.uapcore" -version = "1.3.0" +version = "1.4.0-snapshot" repositories { mavenCentral() @@ -41,7 +41,7 @@ arrayOf( "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0", "org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1", - "org.postgresql:postgresql:42.7.3" + "org.postgresql:postgresql:42.7.4" ).forEach { if (libsAreProvided) compileOnly(it) else implementation(it) } @@ -57,7 +57,7 @@ val test by getting { dependencies { implementation("org.jetbrains.kotlin:kotlin-test-junit5") - runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.3") + runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.2") } } } diff -r ba2a1313eb98 -r 61b16fc21f4d src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt --- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Sat Aug 17 12:09:03 2024 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Sun Oct 06 15:08:50 2024 +0200 @@ -77,14 +77,12 @@ ).joinToString("\n", transform = DiffRow::getOldLine) ) - private fun fullContent(issue: IssueHistoryEntry) = IssueDiff( + private fun fullContent(http: HttpRequest, issue: IssueHistoryEntry) = IssueDiff( issue.issueid, - issue.subject, issue.project, issue.component, - issue.status.name, - issue.category.name, - issue.category.name, + http.i18n("issue.status."+issue.status.name), + http.i18n("issue.category."+issue.category.name), issue.subject, issue.description.replace("\r", ""), issue.assignee, @@ -93,9 +91,9 @@ issue.resolved ) - private fun diffContent(cur: IssueHistoryEntry, next: IssueHistoryEntry): IssueDiff { - val prev = fullContent(next) - val diff = fullContent(cur) + private fun diffContent(http: HttpRequest, cur: IssueHistoryEntry, next: IssueHistoryEntry): IssueDiff { + val prev = fullContent(http, next) + val diff = fullContent(http, cur) val result = diffGenerator.generateDiffRows( listOf( prev.subject, prev.component, prev.status, @@ -129,22 +127,23 @@ * Assumes that [issueEntries] and [commentEntries] are already sorted by timestamp (descending). */ private fun generateFeedEntries( + http: HttpRequest, issueEntries: List, commentEntries: List ): List = - (generateIssueFeedEntries(issueEntries) + generateCommentFeedEntries(commentEntries)).sortedByDescending { it.time } + (generateIssueFeedEntries(http, issueEntries) + generateCommentFeedEntries(commentEntries)).sortedByDescending { it.time } - private fun generateIssueFeedEntries(entries: List): List = + private fun generateIssueFeedEntries(http: HttpRequest, entries: List): List = if (entries.isEmpty()) { emptyList() } else { entries.groupBy { it.issueid }.mapValues { (_, history) -> history.zipWithNext().map { (cur, next) -> IssueFeedEntry( - cur.time, cur.type, issue = diffContent(cur, next) + cur.time, cur.type, issue = diffContent(http, cur, next) ) }.plus( - history.last().let { IssueFeedEntry(it.time, it.type, issue = fullContent(it)) } + history.last().let { IssueFeedEntry(it.time, it.type, issue = fullContent(http, it)) } ) }.flatMap { it.value } } @@ -192,7 +191,7 @@ else -> emptyList() } - http.view = IssueFeed(project, generateFeedEntries(issueHistory, commentHistory)) + http.view = IssueFeed(project, generateFeedEntries(http, issueHistory, commentHistory)) http.renderFeed("issues-feed") } } \ No newline at end of file diff -r ba2a1313eb98 -r 61b16fc21f4d src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt Sat Aug 17 12:09:03 2024 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Feeds.kt Sun Oct 06 15:08:50 2024 +0200 @@ -32,19 +32,20 @@ class IssueDiff( val id: Int, - val currentSubject: String, val project: String, var component: String, var status: String, var category: String, - var currentCategory: String, var subject: String, var description: String, var assignee: String, var eta: String, var affected: String, var resolved: String, -) +) { + var currentCategory: String = category + val currentSubject: String = subject +} class CommentDiff( val issueid: Int, diff -r ba2a1313eb98 -r 61b16fc21f4d src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Sat Aug 17 12:09:03 2024 +0200 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Sun Oct 06 15:08:50 2024 +0200 @@ -24,6 +24,12 @@ --%> <%@ page contentType="text/html;charset=UTF-8" %> +

Version 1.4.0 (Vorschau)

+ +
    +
  • Status und Kategorie eines Vorgangs sind nun auch im RSS-Feed korrekt lokalisiert.
  • +
+

Version 1.3.0

    diff -r ba2a1313eb98 -r 61b16fc21f4d src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Sat Aug 17 12:09:03 2024 +0200 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Sun Oct 06 15:08:50 2024 +0200 @@ -24,6 +24,12 @@ --%> <%@ page contentType="text/html;charset=UTF-8" %> +

    Version 1.4.0 (snapshot)

    + +
      +
    • Fix missing localization for issue status and category in RSS feed.
    • +
    +

    Version 1.3.0

      diff -r ba2a1313eb98 -r 61b16fc21f4d src/main/webapp/WEB-INF/jsp/issues-feed.jsp --- a/src/main/webapp/WEB-INF/jsp/issues-feed.jsp Sat Aug 17 12:09:03 2024 +0200 +++ b/src/main/webapp/WEB-INF/jsp/issues-feed.jsp Sun Oct 06 15:08:50 2024 +0200 @@ -65,7 +65,7 @@

      ${issue.description}
      ]]> - + ${issue.currentCategory}