# HG changeset patch # User Mike Becker # Date 1722878256 -7200 # Node ID b7554a6ef430830f10ef2bdab378fb7e87ade8cc # Parent bf67e0ff71311398b81ddf9a76e553b084f323d0 add more filter options and cross-links relates to issue #397 diff -r bf67e0ff7131 -r b7554a6ef430 src/main/kotlin/de/uapcore/lightpit/types/IssueStatus.kt --- a/src/main/kotlin/de/uapcore/lightpit/types/IssueStatus.kt Mon Aug 05 18:40:47 2024 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/types/IssueStatus.kt Mon Aug 05 19:17:36 2024 +0200 @@ -36,4 +36,6 @@ Rejected(IssueStatusPhase.Done), Withdrawn(IssueStatusPhase.Done), Duplicate(IssueStatusPhase.Done); -} \ No newline at end of file +} + +fun issueStatusOf(phase: IssueStatusPhase) = IssueStatus.entries.filter { it.phase == phase } \ No newline at end of file diff -r bf67e0ff7131 -r b7554a6ef430 src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Mon Aug 05 18:40:47 2024 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Mon Aug 05 19:17:36 2024 +0200 @@ -220,7 +220,7 @@ val includeDone: Boolean = evalFlag(http, flagIncludeDone) val onlyMine: Boolean = evalFlag(http, flagMine) val onlyBlocker: Boolean = evalFlag(http, flagBlocker) - val status: List = evalEnum(http, "s") + val status: List = evalEnum(http, "s") { issueStatusOf(IssueStatusPhase(it)) } val category: List = evalEnum(http, "c") val assignee: List = evalInts(http, "u") @@ -258,18 +258,29 @@ return http.session.getAttribute(name) != null } - private inline fun > evalEnum(http: HttpRequest, prefix: String): List { + private inline fun > evalEnum( + http: HttpRequest, + prefix: String, + categorizer: ((Int) -> List) = { emptyList() } + ): List { val sattr = "f.${prefix}" val param = http.paramArray("filter") if (param.isNotEmpty()) { val list = param.filter { it.startsWith("${prefix}.") } .map { it.substring(prefix.length + 1) } - .map { - try { - // quick and very dirty validation - enumValueOf(it) - } catch (_: IllegalArgumentException) { - // skip + .flatMap { + // try resolving as category + val cat = it.toIntOrNull() + if (cat != null) { + categorizer(cat) + } else { + try { + // quick and very dirty validation + listOf(enumValueOf(it)) + } catch (_: IllegalArgumentException) { + // simply skip bogus enums + emptyList() + } } } if (list.isEmpty()) { diff -r bf67e0ff7131 -r b7554a6ef430 src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Mon Aug 05 18:40:47 2024 +0200 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Mon Aug 05 19:17:36 2024 +0200 @@ -29,6 +29,7 @@
  • Neue globale Vorgangsseite hinzugefügt.
  • Filter für Bearbeiter hinzugefügt.
  • +
  • Filter für Vorgangsphasen hinzugefügt.
  • Automatische Zuweisung von Vorgängen bezieht neben der Leitung für eine Komponente nun auch die Leitung des Projektes ein.
  • Der "OK" Button im Vorgangseditor führt nun zurück zur Vorgangsübersicht.
  • Ein neuer "Speichern" Button im Vorgangseditor führt, wie zuvor, zurück zur Vorgangsansicht.
  • diff -r bf67e0ff7131 -r b7554a6ef430 src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Mon Aug 05 18:40:47 2024 +0200 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Mon Aug 05 19:17:36 2024 +0200 @@ -29,6 +29,7 @@
    • Add new Issues page to globally list all issues across all projects.
    • Add filter for assignee.
    • +
    • Add filter for issue phases.
    • Automatic assignment of issue now uses the project lead as fallback when no component lead is available.
    • The "OK" button in the issue editor now leads to the issue overview.
    • A new "Save" button in the issue editor retains the old behavior and returns to the issue viewer.
    • diff -r bf67e0ff7131 -r b7554a6ef430 src/main/webapp/WEB-INF/jsp/users.jsp --- a/src/main/webapp/WEB-INF/jsp/users.jsp Mon Aug 05 18:40:47 2024 +0200 +++ b/src/main/webapp/WEB-INF/jsp/users.jsp Mon Aug 05 19:17:36 2024 +0200 @@ -69,9 +69,9 @@ - ${userdata.issueSummary.open} - ${userdata.issueSummary.active} - ${userdata.issueSummary.done} + ${userdata.issueSummary.open} + ${userdata.issueSummary.active} + ${userdata.issueSummary.done} diff -r bf67e0ff7131 -r b7554a6ef430 src/main/webapp/WEB-INF/jspf/issue-summary.jspf --- a/src/main/webapp/WEB-INF/jspf/issue-summary.jspf Mon Aug 05 18:40:47 2024 +0200 +++ b/src/main/webapp/WEB-INF/jspf/issue-summary.jspf Mon Aug 05 19:17:36 2024 +0200 @@ -6,12 +6,24 @@
      :
      -
      +
      + + + +
      :
      -
      +
      + + + +
      :
      -
      +
      + + + +
      \ No newline at end of file