# HG changeset patch # User Mike Becker # Date 1738691450 -3600 # Node ID b76d976d197058bfa7f4bbe9effeaa3fef99dfd2 # Parent d23fb91ba462010ffb9b1dc065b0425948f746dc improve navmenu fixes #581 diff -r d23fb91ba462 -r b76d976d1970 src/main/kotlin/de/uapcore/lightpit/viewmodel/NavMenus.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/NavMenus.kt Tue Feb 04 18:43:13 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/NavMenus.kt Tue Feb 04 18:50:50 2025 +0100 @@ -72,126 +72,159 @@ ) ) if (active) { - yield( - NavMenuEntry( - level = 1, - caption = "navmenu.versions", - resolveCaption = true, - href = "projects/${project.node}/versions/" + if (pathInfos.projectInfo.versions.isEmpty()) { + yield( + NavMenuEntry( + level = 1, + caption = "button.version.create", + resolveCaption = true, + href = "projects/${project.node}/versions/-/create" + ) + ) + } else { + yield( + NavMenuEntry( + level = 1, + caption = "navmenu.versions", + resolveCaption = true, + href = "projects/${project.node}/versions/" + ) + ) + yield( + NavMenuEntry( + level = 2, + caption = "navmenu.all", + resolveCaption = true, + href = "projects/${project.node}/issues/-/${cnode}/${varnode}/", + iconColor = "#000000", + active = vnode == "-", + ) ) - ) - yield( - NavMenuEntry( - level = 2, - caption = "navmenu.all", - resolveCaption = true, - href = "projects/${project.node}/issues/-/${cnode}/${varnode}/", - iconColor = "#000000", - active = vnode == "-", + yield( + NavMenuEntry( + level = 2, + caption = "navmenu.none", + resolveCaption = true, + href = "projects/${project.node}/issues/~/${cnode}/${varnode}/", + iconColor = "#000000", + active = vnode == "~", + ) ) - ) - yield( - NavMenuEntry( - level = 2, - caption = "navmenu.none", - resolveCaption = true, - href = "projects/${project.node}/issues/~/${cnode}/${varnode}/", - iconColor = "#000000", - active = vnode == "~", + for (version in pathInfos.projectInfo.versions) { + if (version.status == VersionStatus.Deprecated && vnode != version.node) continue + yield( + NavMenuEntry( + level = 2, + caption = version.name, + title = "version.status.${version.status}", + href = "projects/${project.node}/issues/${version.node}/${cnode}/${varnode}/", + iconColor = "version-${version.status}", + active = version.node == vnode + ) + ) + } + } + if (pathInfos.projectInfo.components.isEmpty()) { + yield( + NavMenuEntry( + level = 1, + caption = "button.component.create", + resolveCaption = true, + href = "projects/${project.node}/components/-/create" + ) ) - ) - for (version in pathInfos.projectInfo.versions) { - if (version.status == VersionStatus.Deprecated && vnode != version.node) continue + } else { + yield( + NavMenuEntry( + level = 1, + caption = "navmenu.components", + resolveCaption = true, + href = "projects/${project.node}/components/" + ) + ) yield( NavMenuEntry( level = 2, - caption = version.name, - title = "version.status.${version.status}", - href = "projects/${project.node}/issues/${version.node}/${cnode}/${varnode}/", - iconColor = "version-${version.status}", - active = version.node == vnode + caption = "navmenu.all", + resolveCaption = true, + href = "projects/${project.node}/issues/${vnode}/-/${varnode}/", + iconColor = "#000000", + active = cnode == "-", ) ) - } - yield( - NavMenuEntry( - level = 1, - caption = "navmenu.components", - resolveCaption = true, - href = "projects/${project.node}/components/" - ) - ) - yield( - NavMenuEntry( - level = 2, - caption = "navmenu.all", - resolveCaption = true, - href = "projects/${project.node}/issues/${vnode}/-/${varnode}/", - iconColor = "#000000", - active = cnode == "-", - ) - ) - yield( - NavMenuEntry( - level = 2, - caption = "navmenu.none", - resolveCaption = true, - href = "projects/${project.node}/issues/${vnode}/~/${varnode}/", - iconColor = "#000000", - active = cnode == "~", - ) - ) - for (component in pathInfos.projectInfo.components) { - if (!component.active && component.node != cnode) continue yield( NavMenuEntry( level = 2, - caption = component.name, - href = "projects/${project.node}/issues/${vnode}/${component.node}/${varnode}/", - iconColor = "${component.color}", - active = component.node == cnode + caption = "navmenu.none", + resolveCaption = true, + href = "projects/${project.node}/issues/${vnode}/~/${varnode}/", + iconColor = "#000000", + active = cnode == "~", ) ) + for (component in pathInfos.projectInfo.components) { + if (!component.active && component.node != cnode) continue + yield( + NavMenuEntry( + level = 2, + caption = component.name, + href = "projects/${project.node}/issues/${vnode}/${component.node}/${varnode}/", + iconColor = "${component.color}", + active = component.node == cnode + ) + ) + } } - yield( - NavMenuEntry( - level = 1, - caption = "navmenu.variants", - resolveCaption = true, - href = "projects/${project.node}/variants/" + if (pathInfos.projectInfo.variants.isEmpty()) { + yield( + NavMenuEntry( + level = 1, + caption = "button.variant.create", + resolveCaption = true, + href = "projects/${project.node}/variants/-/create" + ) ) - ) - yield( - NavMenuEntry( - level = 2, - caption = "navmenu.all", - resolveCaption = true, - href = "projects/${project.node}/issues/${vnode}/${cnode}/-/", - iconColor = "#000000", - active = varnode == "-", + } else { + yield( + NavMenuEntry( + level = 1, + caption = "navmenu.variants", + resolveCaption = true, + href = "projects/${project.node}/variants/" + ) ) - ) - yield( - NavMenuEntry( - level = 2, - caption = "navmenu.none", - resolveCaption = true, - href = "projects/${project.node}/issues/${vnode}/${cnode}/~/", - iconColor = "#000000", - active = varnode == "~", - ) - ) - for (variant in pathInfos.projectInfo.variants) { - if (!variant.active && variant.node != cnode) continue yield( NavMenuEntry( level = 2, - caption = variant.name, - href = "projects/${project.node}/issues/${vnode}/${cnode}/${variant.node}/", - iconColor = "${variant.color}", - active = variant.node == varnode + caption = "navmenu.all", + resolveCaption = true, + href = "projects/${project.node}/issues/${vnode}/${cnode}/-/", + iconColor = "#000000", + active = varnode == "-", ) ) + yield( + NavMenuEntry( + level = 2, + caption = "navmenu.none", + resolveCaption = true, + href = "projects/${project.node}/issues/${vnode}/${cnode}/~/", + iconColor = "#000000", + active = varnode == "~", + ) + ) + for (variant in pathInfos.projectInfo.variants) { + if (!variant.active && variant.node != cnode) continue + yield( + NavMenuEntry( + level = 2, + caption = variant.name, + href = "projects/${project.node}/issues/${vnode}/${cnode}/${variant.node}/", + iconColor = "${variant.color}", + active = variant.node == varnode + ) + ) + } } } } diff -r d23fb91ba462 -r b76d976d1970 src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Feb 04 18:43:13 2025 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Feb 04 18:50:50 2025 +0100 @@ -35,6 +35,7 @@ der von Tools benutzt werden kann, um Vorgänge direkt in der Projektansicht zu öffnen.
  • Die Anzeige von Komponenten in der Vorgangsliste nutzt nun die der Komponente zugewiesene Farbe.
  • +
  • Das Navigationsmenü bietet nun direkt die Möglichkeit eine neue Komponente/Version/Variante zu erzeugen, falls noch keine existiert.
  • Fehler behoben, bei dem der "Assignee"-Filter im RSS-Feed nicht auf Kommentare angewendet wurde.
  • Versionsinformationen werden nun korrekt in die Vorgangshistorie geschrieben (relevant für RSS-Feeds).
  • diff -r d23fb91ba462 -r b76d976d1970 src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Feb 04 18:43:13 2025 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Feb 04 18:50:50 2025 +0100 @@ -35,6 +35,7 @@ that can be used by tools to directly open an issue in the project view.
  • Change that the component labels in the issue view now use their assigned color.
  • +
  • Change navigation menu to show a menu item to create a component/version/variant if none exist, yet.
  • Fix that assignee filter does not work for comments in RSS feed.
  • Fix missing affected and target versions in issue history