#156 fixes auto-selection overriding issue data

Mon, 09 Aug 2021 16:25:50 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 09 Aug 2021 16:25:50 +0200
changeset 215
028792eda9b7
parent 214
69647ddb57f2
child 216
6357d2fd84f2

#156 fixes auto-selection overriding issue data

src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt file | annotate | diff | comparison | revisions
     1.1 --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt	Mon Aug 09 16:22:56 2021 +0200
     1.2 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt	Mon Aug 09 16:25:50 2021 +0200
     1.3 @@ -484,6 +484,7 @@
     1.4              eta = getDate("eta")
     1.5          }
     1.6  
     1.7 +        //language=SQL
     1.8          fun versionQuery(table: String) =
     1.9              """
    1.10              select versionid, project, name, status, ordinal, node
     2.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Mon Aug 09 16:22:56 2021 +0200
     2.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Mon Aug 09 16:25:50 2021 +0200
     2.3 @@ -460,15 +460,18 @@
     2.4                  project,
     2.5              )
     2.6  
     2.7 -            // pre-select component, if available in the path info
     2.8 -            issue.component = component
     2.9 +            // for new issues set some defaults
    2.10 +            if (issue.id < 0) {
    2.11 +                // pre-select component, if available in the path info
    2.12 +                issue.component = component
    2.13  
    2.14 -            // pre-select version, if available in the path info
    2.15 -            if (version != null) {
    2.16 -                if (version.status.isReleased) {
    2.17 -                    issue.affectedVersions = listOf(version)
    2.18 -                } else {
    2.19 -                    issue.resolvedVersions = listOf(version)
    2.20 +                // pre-select version, if available in the path info
    2.21 +                if (version != null) {
    2.22 +                    if (version.status.isReleased) {
    2.23 +                        issue.affectedVersions = listOf(version)
    2.24 +                    } else {
    2.25 +                        issue.resolvedVersions = listOf(version)
    2.26 +                    }
    2.27                  }
    2.28              }
    2.29  

mercurial