Tue, 04 Feb 2025 18:50:50 +0100
improve navmenu
fixes #581
--- 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 + ) + ) + } } } }
--- 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. </li> <li>Die Anzeige von Komponenten in der Vorgangsliste nutzt nun die der Komponente zugewiesene Farbe.</li> + <li>Das Navigationsmenü bietet nun direkt die Möglichkeit eine neue Komponente/Version/Variante zu erzeugen, falls noch keine existiert.</li> <li>Fehler behoben, bei dem der "Assignee"-Filter im RSS-Feed nicht auf Kommentare angewendet wurde.</li> <li>Versionsinformationen werden nun korrekt in die Vorgangshistorie geschrieben (relevant für RSS-Feeds).</li> <li>
--- 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. </li> <li>Change that the component labels in the issue view now use their assigned color.</li> + <li>Change navigation menu to show a menu item to create a component/version/variant if none exist, yet.</li> <li>Fix that assignee filter does not work for comments in RSS feed.</li> <li> Fix missing affected and target versions in issue history