fix incorrect order of versions in issue form when a version is already selected - fixes #748 default tip

Sat, 18 Oct 2025 21:02:39 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 18 Oct 2025 21:02:39 +0200
changeset 402
9af80d711c8c
parent 401
bf220daedabe

fix incorrect order of versions in issue form when a version is already selected - fixes #748

src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt 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
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Thu Oct 09 11:49:39 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Sat Oct 18 21:02:39 2025 +0200
@@ -193,19 +193,18 @@
 
     init {
         val recent = mutableListOf<Version>()
-        issue.affected?.let { recent.add(it) }
         val upcoming = mutableListOf<Version>()
-        issue.resolved?.let { upcoming.add(it) }
 
         for (v in versions) {
-            if (v.status.isReleased) {
-                if (v.status != VersionStatus.Deprecated) recent.add(v)
-            } else {
+            if ((v.status.isReleased && v.status != VersionStatus.Deprecated) || v == issue.affected) {
+                recent.add(v)
+            }
+            if (!v.status.isReleased || v == issue.resolved) {
                 upcoming.add(v)
             }
         }
-        versionsRecent = recent.distinct()
-        versionsUpcoming = upcoming.distinct()
+        versionsRecent = recent
+        versionsUpcoming = upcoming
     }
 }
 
--- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Thu Oct 09 11:49:39 2025 +0200
+++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Sat Oct 18 21:02:39 2025 +0200
@@ -45,6 +45,7 @@
     <li>Vorgänge können nicht länger mit sich selbst verlinkt werden.</li>
     <li>Fehler in der deutschen Übersetzung behoben.</li>
     <li>Das Navigationsmenü verliert nicht mehr so schnell an Breite, wenn das Fenster verkleinert wird.</li>
+    <li>Fehler behoben, dass bereits ausgewählte Versionen in einem Vorgang im Vorgangseditor nicht an ihrer korrekten Position im Verhältnis zu anderen Versionen angezeigt wurden.</li>
 </ul>
 
 <h3>Version 1.5.1</h3>
--- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Thu Oct 09 11:49:39 2025 +0200
+++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Sat Oct 18 21:02:39 2025 +0200
@@ -45,6 +45,7 @@
     <li>Fix that issues could relate to themselves.</li>
     <li>Fix errors in the German translation.</li>
     <li>Fix that the sidebar is losing width too early when the window becomes smaller.</li>
+    <li>Fix that selected versions in the issue form were not shown in the correct order in relation to other versions.</li>
 </ul>
 
 <h3>Version 1.5.1</h3>

mercurial