# HG changeset patch # User Mike Becker # Date 1771517587 -3600 # Node ID e70ac9e11fb1cac0fb648656c8f94ba5ae7043d2 # Parent 109850e92e95a54ec6721e2219625122c4c5fe68 add "assign to me" button - resolves #798 diff -r 109850e92e95 -r e70ac9e11fb1 src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt --- a/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt Thu Feb 19 17:13:07 2026 +0100 @@ -174,6 +174,18 @@ dao.insertHistoryEvent(http.user, issue) } +fun issueQuickAssign(http: HttpRequest, dao: DataAccessObject, issue: Issue) { + val newAssignee = http.user + + // don't update when nothing changes + if (issue.assignee == newAssignee) return + + // update the issue + issue.assignee = newAssignee + dao.updateIssue(issue) + dao.insertHistoryEvent(http.user, issue) +} + fun renderIssueView( http: HttpRequest, dao: DataAccessObject, @@ -191,6 +203,7 @@ dao.listIssueRelations(issue), dao.listCommitRefs(issue), pathInfos, + http.user, relationError, ) if (pathInfos is PathInfosFull) { diff -r 109850e92e95 -r e70ac9e11fb1 src/main/kotlin/de/uapcore/lightpit/servlet/IssuesServlet.kt --- a/src/main/kotlin/de/uapcore/lightpit/servlet/IssuesServlet.kt Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/IssuesServlet.kt Thu Feb 19 17:13:07 2026 +0100 @@ -21,6 +21,7 @@ get("/%issue", this::issue) get("/%issue/edit", this::issueForm) get("/%issue/progress", this::issueProgress) + get("/%issue/assign", this::issueAssign) get("/%issue/resolve", this::issueResolve) post("/%issue/comment", this::issueComment) post("/%issue/relation", this::issueRelation) @@ -67,6 +68,20 @@ http.renderCommit("${pathInfos.issuesHref}${issue.id}") } + private fun issueAssign(http: HttpRequest, dao: DataAccessObject) { + if (http.user == null) { + http.response.sendError(403) + return + } + val issue = http.pathParams["issue"]?.toIntOrNull()?.let(dao::findIssue) + if (issue == null) { + http.response.sendError(404) + return + } + issueQuickAssign(http, dao, issue) + http.renderCommit("${pathInfos.issuesHref}${issue.id}") + } + private fun issueResolve(http: HttpRequest, dao: DataAccessObject) { val issue = http.pathParams["issue"]?.toIntOrNull()?.let(dao::findIssue) if (issue == null) { diff -r 109850e92e95 -r e70ac9e11fb1 src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Thu Feb 19 17:13:07 2026 +0100 @@ -67,6 +67,7 @@ get("/%project/issues/%version/%component/%variant/%issue/edit", this::issueForm) get("/%project/issues/%version/%component/%variant/%issue/progress", this::issueProgress) get("/%project/issues/%version/%component/%variant/%issue/resolve", this::issueResolve) + get("/%project/issues/%version/%component/%variant/%issue/assign", this::issueAssign) post("/%project/issues/%version/%component/%variant/%issue/comment", this::issueComment) post("/%project/issues/%version/%component/%variant/%issue/relation", this::issueRelation) get("/%project/issues/%version/%component/%variant/%issue/removeRelation", this::issueRemoveRelation) @@ -474,6 +475,23 @@ } } + private fun issueAssign(http: HttpRequest, dao: DataAccessObject) { + if (http.user == null) { + http.response.sendError(403) + return + } + val issue = http.pathParams["issue"]?.toIntOrNull()?.let(dao::findIssue) + if (issue == null) { + http.response.sendError(404) + return + } + withPathInfo(http, dao)?.let { path -> + issueQuickAssign(http, dao, issue) + http.renderCommit("${path.issuesHref}${issue.id}") + } + } + + private fun issueForm(http: HttpRequest, dao: DataAccessObject) { withPathInfo(http, dao)?.let { path -> val issue = http.pathParams["issue"]?.toIntOrNull()?.let(dao::findIssue) ?: Issue( diff -r 109850e92e95 -r e70ac9e11fb1 src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Thu Feb 19 17:13:07 2026 +0100 @@ -118,6 +118,7 @@ val currentRelations: List, commitRefs: List, val pathInfos: PathInfos, + val authenticatedUser: User? = null, /** * Optional resource key to an error message for the relation editor. */ @@ -126,6 +127,7 @@ val relationTypes = RelationType.entries val commitLinks: List val openedVariant: Variant? = ((pathInfos as? PathInfosFull)?.variantInfo as? OptionalPathInfo.Specific)?.elem + val isAssignedToAuthenticatedUser = authenticatedUser != null && authenticatedUser.id == issue.assignee?.id init { issue.description = formatMarkdown(issue.description) diff -r 109850e92e95 -r e70ac9e11fb1 src/main/resources/localization/strings.properties --- a/src/main/resources/localization/strings.properties Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/resources/localization/strings.properties Thu Feb 19 17:13:07 2026 +0100 @@ -35,6 +35,7 @@ button.dismiss=Dismiss button.edit=Edit button.issue.all=All Issues +button.issue.assign-myself=Assign To Me button.issue.create.another=Create another Issue button.issue.create=New Issue button.issue.edit=Edit diff -r 109850e92e95 -r e70ac9e11fb1 src/main/resources/localization/strings_de.properties --- a/src/main/resources/localization/strings_de.properties Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/resources/localization/strings_de.properties Thu Feb 19 17:13:07 2026 +0100 @@ -35,6 +35,7 @@ button.dismiss=Nicht Jetzt button.edit=Bearbeiten button.issue.all=Alle Vorg\u00e4nge +button.issue.assign-myself=Mir Zuweisen button.issue.create.another=Weiteren Vorgang erstellen button.issue.create=Neuer Vorgang button.issue.edit=Bearbeiten diff -r 109850e92e95 -r e70ac9e11fb1 src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Thu Feb 19 17:13:07 2026 +0100 @@ -29,7 +29,7 @@
  • Neues Feature zur Planung von Versionen hinzugefügt.
  • Pop-Up hinzugefügt, das über eine neue LightPIT-Version informiert.
  • -
  • Neue Schaltflächen zur Vorgangsansicht hinzugefügt, mit denen der Status des Vorgangs schnell geändert werden kann.
  • +
  • Neue Schaltflächen zur Vorgangsansicht hinzugefügt, mit denen der Status und die Zuweisung des Vorgangs schnell geändert werden können.
  • "In Projekt Öffnen" Schaltfläche zur (globalen) Vorgangsansicht hinzugefügt.
  • Schaltflächen hinzugefügt, die schnelleren Zugang zu den Editoren für Versionen, Komponenten und Varianten bieten.
  • Es können nun neue Vorgänge direkt mit einer Verknüpfung zu einem existierenden Vorgang erstellt werden.
  • diff -r 109850e92e95 -r e70ac9e11fb1 src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Thu Feb 19 17:13:07 2026 +0100 @@ -29,7 +29,7 @@
    • Add new version planning UI.
    • Add popup informing about a new LightPIT release.
    • -
    • Add convenience buttons to the issue view to quickly change the issue status.
    • +
    • Add convenience buttons to the issue view to quickly change the issue status and assignee.
    • Add convenience OPEN IN PROJECT button to the global issue view.
    • Add buttons and hover-icons to quickly access the editor for versions, components, and variants.
    • Add the possibility to create new related issues with one click.
    • diff -r 109850e92e95 -r e70ac9e11fb1 src/main/webapp/WEB-INF/jsp/issue-view.jsp --- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp Tue Jan 06 20:08:54 2026 +0100 +++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp Thu Feb 19 17:13:07 2026 +0100 @@ -200,6 +200,11 @@ + + + + + @@ -362,7 +367,7 @@ - +