add "open in project" button - resolves #675 default tip

Mon, 26 May 2025 21:41:02 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 26 May 2025 21:41:02 +0200
changeset 375
cbbadb493f22
parent 374
34abadbdd0e3

add "open in project" button - resolves #675

src/main/kotlin/de/uapcore/lightpit/Constants.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/IssuesServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/viewmodel/PathInfos.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-form.jsp 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/Constants.kt	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/Constants.kt	Mon May 26 21:41:02 2025 +0200
@@ -29,7 +29,7 @@
     /**
      * A data in yyyy-mm-dd format to identify the release.
      */
-    const val VERSION_DATE = "2025-05-18"
+    const val VERSION_DATE = "2025-05-26"
 
     /**
      * The path where the JSP files reside.
--- a/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt	Mon May 26 21:41:02 2025 +0200
@@ -168,8 +168,8 @@
             comments,
             dao.listIssueRelations(issue),
             dao.listCommitRefs(issue),
+            pathInfos,
             relationError,
-            pathInfos
         )
         if (pathInfos is PathInfosFull) {
             navigationMenu = projectNavMenu(dao.listProjects(), pathInfos)
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/IssuesServlet.kt	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/IssuesServlet.kt	Mon May 26 21:41:02 2025 +0200
@@ -99,7 +99,8 @@
                 dao.listComponents(issue.project),
                 dao.listVariants(issue.project),
                 dao.listUsers(),
-                issue.project
+                issue.project,
+                PathInfosSimple()
             )
             styleSheets = listOf("projects")
             javascript = "issue-editor"
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Mon May 26 21:41:02 2025 +0200
@@ -121,11 +121,11 @@
     val comments: List<IssueComment>,
     val currentRelations: List<IssueRelation>,
     commitRefs: List<CommitRef>,
+    val pathInfos: PathInfos,
     /**
      * Optional resource key to an error message for the relation editor.
      */
     val relationError: String? = null,
-    val pathInfos: PathInfos? = null
 ) : View() {
     val relationTypes = RelationType.entries
     val commitLinks: List<CommitLink>
@@ -180,7 +180,7 @@
     val variants: List<Variant>,
     val users: List<User>,
     val project: Project,
-    val pathInfos: PathInfos? = null
+    val pathInfos: PathInfos
 ) : EditView() {
 
     val versionsUpcoming: List<Version>
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/PathInfos.kt	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/PathInfos.kt	Mon May 26 21:41:02 2025 +0200
@@ -33,19 +33,19 @@
 import de.uapcore.lightpit.entities.Variant
 import de.uapcore.lightpit.entities.Version
 
-abstract class PathInfos(val issuesHref: String) {
+abstract class PathInfos(val issuesHref: String, val inProject: Boolean) {
     override fun toString(): String {
         return issuesHref
     }
 }
 class PathInfosSimple(project: Project? = null)
-    : PathInfos(if (project == null) "issues/" else "projects/${project.node}/issues/-/-/-/")
+    : PathInfos(if (project == null) "issues/" else "projects/${project.node}/issues/-/-/-/", project != null)
 data class PathInfosFull(
     val projectInfo: ProjectInfo,
     val versionInfo: OptionalPathInfo<Version> = OptionalPathInfo.All,
     val componentInfo: OptionalPathInfo<Component> = OptionalPathInfo.All,
     val variantInfo: OptionalPathInfo<Variant> = OptionalPathInfo.All,
-): PathInfos("projects/${projectInfo.project.node}/issues/${versionInfo.node}/${componentInfo.node}/${variantInfo.node}/") {
+): PathInfos("projects/${projectInfo.project.node}/issues/${versionInfo.node}/${componentInfo.node}/${variantInfo.node}/", true) {
     val project = projectInfo.project
 }
 
--- a/src/main/resources/localization/strings.properties	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/resources/localization/strings.properties	Mon May 26 21:41:02 2025 +0200
@@ -37,6 +37,7 @@
 button.issue.create.another=Create another Issue
 button.issue.create=New Issue
 button.issue.edit=Edit
+button.issue.open-in-project=Open in Project
 button.issue.resolve=Resolve
 button.okay=OK
 button.project.create=New Project
--- a/src/main/resources/localization/strings_de.properties	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/resources/localization/strings_de.properties	Mon May 26 21:41:02 2025 +0200
@@ -37,6 +37,7 @@
 button.issue.create.another=Weiteren Vorgang erstellen
 button.issue.create=Neuer Vorgang
 button.issue.edit=Bearbeiten
+button.issue.open-in-project=In Projekt \u00d6ffnen
 button.issue.resolve=Erledigt
 button.okay=OK
 button.project.create=Neues Projekt
--- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Mon May 26 21:41:02 2025 +0200
@@ -28,7 +28,8 @@
 
 <ul>
     <li>Pop-Up hinzugefügt, das über eine neue LightPIT-Version informiert.</li>
-    <li>"Erledigt"-Schaltfläche zur Vorgangsansicht hinzugefügt.</li>
+    <li>"Erledigt" Schaltfläche zur Vorgangsansicht hinzugefügt.</li>
+    <li>"In Projekt Öffnen" Schaltfläche zur (globalen) Vorgangsansicht hinzugefügt.</li>
     <li>Die Standardkategorie für neue Vorgänge in veröffentlichten Versionen ist nun "Fehler" anstelle von "Feature".</li>
     <li>Fehler in der Deutschen Übersetzung behoben.</li>
 </ul>
--- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Mon May 26 21:41:02 2025 +0200
@@ -29,6 +29,7 @@
 <ul>
     <li>Add popup informing about a new LightPIT release.</li>
     <li>Add convenience RESOLVE button to the issue view.</li>
+    <li>Add convenience OPEN IN PROJECT button to the global issue view.</li>
     <li>Change that the default category for new issues in released versions is Bug instead of Feature.</li>
     <li>Fix errors in the German translation.</li>
 </ul>
--- a/src/main/webapp/WEB-INF/jsp/issue-form.jsp	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/webapp/WEB-INF/jsp/issue-form.jsp	Mon May 26 21:41:02 2025 +0200
@@ -32,10 +32,7 @@
 
 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
 <c:set var="project" scope="page" value="${viewmodel.project}"/>
-<c:set var="issuesHref" value="./issues/"/>
-<c:if test="${not empty viewmodel.pathInfos}">
-    <c:set var="issuesHref" value="./${viewmodel.pathInfos.issuesHref}"/>
-</c:if>
+<c:set var="issuesHref" value="./${viewmodel.pathInfos.issuesHref}"/>
 
 <form action="${issuesHref}-/commit" method="post">
     <input type="hidden" name="project" value="${issue.project.id}" />
--- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Wed May 21 14:19:07 2025 +0200
+++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp	Mon May 26 21:41:02 2025 +0200
@@ -35,10 +35,7 @@
 <c:set var="project" scope="page" value="${viewmodel.issue.project}"/>
 <c:set var="issue" scope="page" value="${viewmodel.issue}" />
 
-<c:set var="issuesHref" value="./issues/"/>
-<c:if test="${not empty viewmodel.pathInfos}">
-    <c:set var="issuesHref" value="./${viewmodel.pathInfos.issuesHref}"/>
-</c:if>
+<c:set var="issuesHref" value="./${viewmodel.pathInfos.issuesHref}"/>
 
 <table class="issue-view fullwidth">
     <colgroup>
@@ -177,6 +174,11 @@
     <a href="${issuesHref}" class="button">
         <fmt:message key="button.back"/>
     </a>
+    <c:if test="${not viewmodel.pathInfos.inProject}">
+    <a href="${issuesHref}${issue.id}?in_project=true" class="button">
+        <fmt:message key="button.issue.open-in-project"/>
+    </a>
+    </c:if>
     <c:if test="${issue.status.phase ne IssueStatusPhase.Companion.done}">
     <a href="${issuesHref}${issue.id}/resolve" class="button submit">
         <fmt:message key="button.issue.resolve"/>

mercurial