# HG changeset patch # User Mike Becker # Date 1672321835 -3600 # Node ID c1be672af7ff52854e7a9104a678ce30b9e52fa5 # Parent a7da88714dc33e49145e82b095b04f2c93e0b9ec #164 add issue summary for developers diff -r a7da88714dc3 -r c1be672af7ff src/main/kotlin/de/uapcore/lightpit/dao/DataAccessObject.kt --- a/src/main/kotlin/de/uapcore/lightpit/dao/DataAccessObject.kt Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/DataAccessObject.kt Thu Dec 29 14:50:35 2022 +0100 @@ -68,6 +68,7 @@ fun updateProject(project: Project) fun collectIssueSummary(project: Project): IssueSummary + fun collectIssueSummary(assignee: User): IssueSummary fun listIssues(project: Project, version: Version?, component: Component?): List fun findIssue(id: Int): Issue? diff -r a7da88714dc3 -r c1be672af7ff src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Thu Dec 29 14:50:35 2022 +0100 @@ -444,6 +444,32 @@ } } + override fun collectIssueSummary(assignee: User): IssueSummary = + withStatement( + """ + select phase, count(*) as total + from lpit_issue + join lpit_issue_phases using(status) + where assignee = ? + group by phase + """.trimIndent() + ) { + setInt(1, assignee.id) + executeQuery().use { + val summary = IssueSummary() + while (it.next()) { + val phase = it.getInt("phase") + val total = it.getInt("total") + when (phase) { + 0 -> summary.open = total + 1 -> summary.active = total + 2 -> summary.done = total + } + } + summary + } + } + // // diff -r a7da88714dc3 -r c1be672af7ff src/main/kotlin/de/uapcore/lightpit/entities/User.kt --- a/src/main/kotlin/de/uapcore/lightpit/entities/User.kt Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/User.kt Thu Dec 29 14:50:35 2022 +0100 @@ -45,4 +45,4 @@ * If neither given name nor lastname are provided, the username is used instead. */ val displayname: String get() = if (mail.isNullOrBlank()) shortDisplayname else "$shortDisplayname <$mail>" -} \ No newline at end of file +} diff -r a7da88714dc3 -r c1be672af7ff src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt --- a/src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt Thu Dec 29 14:50:35 2022 +0100 @@ -32,6 +32,7 @@ import de.uapcore.lightpit.dao.DataAccessObject import de.uapcore.lightpit.entities.User import de.uapcore.lightpit.viewmodel.UserEditView +import de.uapcore.lightpit.viewmodel.UserViewData import de.uapcore.lightpit.viewmodel.UsersView import jakarta.servlet.annotation.WebServlet @@ -50,7 +51,9 @@ private fun index(http: HttpRequest, dao: DataAccessObject) { with(http) { - view = UsersView(dao.listUsers()) + view = UsersView(dao.listUsers().map { + UserViewData(it, dao.collectIssueSummary(it)) + }) render(list) } } diff -r a7da88714dc3 -r c1be672af7ff src/main/kotlin/de/uapcore/lightpit/viewmodel/Users.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Users.kt Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Users.kt Thu Dec 29 14:50:35 2022 +0100 @@ -27,8 +27,13 @@ import de.uapcore.lightpit.entities.User +class UserViewData( + val user: User, + val issueSummary: IssueSummary +) + class UsersView( - val users: List + val users: List ) : View() class UserEditView( diff -r a7da88714dc3 -r c1be672af7ff src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Thu Dec 29 14:50:35 2022 +0100 @@ -36,6 +36,7 @@
  • Spalte für zugewiesener Entwickler zu den Vorgangstabellen hinzugefügt.
  • Spalte für den Zeitpunkt der letzten Aktualisierung zu den Vorgangstabellen hinzugefügt.
  • E-Mail Link in Vorgangsansicht hinzugefügt, wenn der Zugewiesene eine Mailadresse hat.
  • +
  • Anzahl an zugewiesenen Vorgängen zur Übersichtstabelle der Entwickler hinzugefügt.
  • Formatierung für Status-Icons hinzugefügt, die als Text eingegeben werden: (/), (x) sowie (!)
  • Installationsanweisungen hinzugefügt.
  • Unterstützung für Jakarta EE hinzugefügt und Laufzeitabhängigkeiten entfernt.
  • diff -r a7da88714dc3 -r c1be672af7ff src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Thu Dec 29 14:50:35 2022 +0100 @@ -36,6 +36,7 @@
  • Add assignee to the issue overview tables.
  • Add updated timestamp to the issue overview tables.
  • Add mailto link in issue view when the assignee has a mail address.
  • +
  • Add issue summaries to developers table.
  • Add formatting for (/), (x), and (!) status indicators.
  • Add install instructions.
  • Add Jakarta EE support and remove runtime dependencies.
  • diff -r a7da88714dc3 -r c1be672af7ff src/main/webapp/WEB-INF/jsp/users.jsp --- a/src/main/webapp/WEB-INF/jsp/users.jsp Thu Dec 29 14:03:00 2022 +0100 +++ b/src/main/webapp/WEB-INF/jsp/users.jsp Thu Dec 29 14:50:35 2022 +0100 @@ -42,17 +42,36 @@ + + + + + + + + + + + + + + - + - - + + + + +
    + +
    ${userdata.issueSummary.open}${userdata.issueSummary.active}${userdata.issueSummary.done}