# HG changeset patch # User Mike Becker # Date 1617534221 -7200 # Node ID 05eec764facdc405bc433ace41c85e3163a16a82 # Parent 5ec9fcfbdf9cec7fdbf3daa7bf8793abfbd7ce28 fixes some minor migration regressions diff -r 5ec9fcfbdf9c -r 05eec764facd src/main/kotlin/de/uapcore/lightpit/entities/Issue.kt --- a/src/main/kotlin/de/uapcore/lightpit/entities/Issue.kt Sun Apr 04 11:52:30 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/Issue.kt Sun Apr 04 13:03:41 2021 +0200 @@ -38,7 +38,7 @@ var category = IssueCategory.Feature var subject: String = "" - var description: String = "" + var description: String? = null var assignee: User? = null var created: Timestamp = Timestamp.from(Instant.now()) diff -r 5ec9fcfbdf9c -r 05eec764facd src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Sun Apr 04 11:52:30 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Sun Apr 04 13:03:41 2021 +0200 @@ -63,9 +63,9 @@ get("/%project/issues/%version/%component/%issue", this::issue) get("/%project/issues/%version/%component/%issue/edit", this::issueForm) - get("/%project/issues/%version/%component/%issue/comment", this::issueComment) + post("/%project/issues/%version/%component/%issue/comment", this::issueComment) get("/%project/issues/%version/%component/-/create", this::issueForm) - get("/%project/issues/%version/%component/-/commit", this::issueCommit) + post("/%project/issues/%version/%component/-/commit", this::issueCommit) } fun projects(http: HttpRequest, dao: DataAccessObject) { @@ -508,7 +508,7 @@ else -> dao.findUser(it) } } - eta = http.param("eta")?.let { Date.valueOf(it) } + eta = http.param("eta")?.let { if (it.isBlank()) null else Date.valueOf(it) } affectedVersions = http.paramArray("affected") .mapNotNull { param -> param.toIntOrNull()?.let { Version(it, projectInfo.project.id) } } @@ -516,10 +516,17 @@ .mapNotNull { param -> param.toIntOrNull()?.let { Version(it, projectInfo.project.id) } } } - if (http.param("more").toBoolean()) { + val openId = if (issue.id < 0) { + dao.insertIssue(issue) + } else { + dao.updateIssue(issue) + issue.id + } + + if (http.param("more") != null) { http.renderCommit("${issuesHref}-/create") } else { - http.renderCommit("${issuesHref}${issue.id}") + http.renderCommit("${issuesHref}${openId}") } } } diff -r 5ec9fcfbdf9c -r 05eec764facd src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Sun Apr 04 11:52:30 2021 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt Sun Apr 04 13:03:41 2021 +0200 @@ -76,7 +76,7 @@ val renderer = HtmlRenderer.builder(options).build() val process = fun(it: String) = renderer.render(parser.parse(it)) - issue.description = process(issue.description) + issue.description = process(issue.description?:"") for (comment in comments) { comment.comment = process(comment.comment) } @@ -111,8 +111,8 @@ upcoming.add(v) } } - versionsRecent = recent - versionsUpcoming = upcoming + versionsRecent = recent.distinct() + versionsUpcoming = upcoming.distinct() } } diff -r 5ec9fcfbdf9c -r 05eec764facd src/main/webapp/WEB-INF/jsp/issue-form.jsp --- a/src/main/webapp/WEB-INF/jsp/issue-form.jsp Sun Apr 04 11:52:30 2021 +0200 +++ b/src/main/webapp/WEB-INF/jsp/issue-form.jsp Sun Apr 04 13:03:41 2021 +0200 @@ -37,7 +37,7 @@ -
+ @@ -89,11 +89,11 @@