fix incorrect diff of metadata - part 1/2 fixes #719

Sun, 14 Sep 2025 15:42:23 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 14 Sep 2025 15:42:23 +0200
changeset 386
41ce87983ab5
parent 385
7e3afd24ae76
child 387
a0c4d4038f21

fix incorrect diff of metadata - part 1/2 fixes #719

src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt file | annotate | diff | comparison | revisions
src/main/resources/localization/strings.properties file | annotate | diff | comparison | revisions
src/main/resources/localization/strings_de.properties file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog-de.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/issue-view.jsp file | annotate | diff | comparison | revisions
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt	Sun Sep 14 14:06:16 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt	Sun Sep 14 15:42:23 2025 +0200
@@ -53,6 +53,7 @@
         .showInlineDiffs(true)
         .mergeOriginalRevised(true)
         .inlineDiffByWord(true)
+        .reportLinesUnchanged(true)
         .oldTag { start -> if (start) "<strike style=\"color:red\">" else "</strike>" }
         .newTag { start -> if (start) "<i style=\"color: green\">" else "</i>" }
         .build()
@@ -80,17 +81,18 @@
         )
 
     private fun fullContent(http: HttpRequest, issue: IssueHistoryEntry) = IssueDiff(
+        // Note: we must make sure that every entry is non-empty, otherwise the diff generator will produce wrong results
         id = issue.issueid,
         project = issue.project,
-        component = issue.component,
+        component = issue.component.ifBlank { http.i18n("placeholder.null-component") },
         status = http.i18n("issue.status."+issue.status.name),
         category = http.i18n("issue.category."+issue.category.name),
         subject = issue.subject,
         description = issue.description.replace("\r", ""),
-        assignee = issue.assignee,
-        eta = issue.eta?.let { SimpleDateFormat("dd.MM.yyyy").format(it) } ?: "",
-        affected = issue.affected,
-        resolved = issue.resolved
+        assignee = issue.assignee.ifBlank { http.i18n("placeholder.null-assignee") },
+        eta = issue.eta?.let { SimpleDateFormat("dd.MM.yyyy").format(it) } ?: http.i18n("placeholder.null-eta"),
+        affected = issue.affected.ifBlank { http.i18n("placeholder.null-version") },
+        resolved = issue.resolved.ifBlank { http.i18n("placeholder.null-version") }
     )
 
     private fun diffContent(http: HttpRequest, cur: IssueHistoryEntry, next: IssueHistoryEntry): IssueDiff {
--- a/src/main/resources/localization/strings.properties	Sun Sep 14 14:06:16 2025 +0200
+++ b/src/main/resources/localization/strings.properties	Sun Sep 14 15:42:23 2025 +0200
@@ -170,6 +170,7 @@
 placeholder.null-lead=Unassigned
 placeholder.null-owner=Unassigned
 placeholder.null-version=None
+placeholder.null-eta=None
 progress=Overall Progress
 project.name=Name
 project.owner=Project Lead
--- a/src/main/resources/localization/strings_de.properties	Sun Sep 14 14:06:16 2025 +0200
+++ b/src/main/resources/localization/strings_de.properties	Sun Sep 14 15:42:23 2025 +0200
@@ -170,6 +170,7 @@
 placeholder.null-lead=Niemand
 placeholder.null-owner=Nicht Zugewiesen
 placeholder.null-version=Keine
+placeholder.null-eta=Nicht geplant
 progress=Gesamtfortschritt
 project.name=Name
 project.owner=Projektleitung
--- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Sun Sep 14 14:06:16 2025 +0200
+++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Sun Sep 14 15:42:23 2025 +0200
@@ -35,6 +35,7 @@
     <li>Vorgänge können nun auch direkt über die Vorgangsnummer (anstatt Raute + Nummer) verlinkt werden.</li>
     <li>Die Vorschläge in den Suchfeldern für Vorgänge sind nun absteigend nach Vorgangsnummer sortiert.</li>
     <li>Die Standardkategorie für neue Vorgänge in veröffentlichten Versionen ist nun "Fehler" anstelle von "Feature".</li>
+    <li>Fehlerhafte Delta-Anzeige in RSS-Feeds behoben.</li>
     <li>Vorgänge können nicht länger mit sich selbst verlinkt werden.</li>
     <li>Fehler in der Deutschen Übersetzung behoben.</li>
 </ul>
--- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Sun Sep 14 14:06:16 2025 +0200
+++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Sun Sep 14 15:42:23 2025 +0200
@@ -35,6 +35,7 @@
     <li>Change that you can now relate issues by just submitting their number (instead of hash + number).</li>
     <li>Change that issues suggested by the search boxes are now sorted by ID in descending order.</li>
     <li>Change that the default category for new issues in released versions is Bug instead of Feature.</li>
+    <li>Fix wrong diffs in RSS feed.</li>
     <li>Fix that issues could relate to themselves.</li>
     <li>Fix errors in the German translation.</li>
 </ul>
--- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Sun Sep 14 14:06:16 2025 +0200
+++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Sun Sep 14 15:42:23 2025 +0200
@@ -169,7 +169,14 @@
     </tr>
     <tr>
         <th><fmt:message key="issue.eta"/></th>
-        <td><fmt:formatDate value="${issue.eta}" timeZone="${timezone}"/></td>
+        <td>
+            <c:if test="${not empty issue.eta}">
+                <fmt:formatDate value="${issue.eta}" timeZone="${timezone}"/>
+            </c:if>
+            <c:if test="${empty issue.eta}">
+                <fmt:message key="placeholder.null-eta" />
+            </c:if>
+        </td>
     </tr>
     </tbody>
 </table>

mercurial