# HG changeset patch # User Mike Becker # Date 1604132157 -3600 # Node ID 7761c37c5e611eb961d7678bbdb0e25d27baf6b5 # Parent b3f14cd4f3ab3bffa27c368d6e28fdf2d88b4c77 fixes default values for version and component form diff -r b3f14cd4f3ab -r 7761c37c5e61 src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java --- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Sat Oct 24 12:09:08 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Sat Oct 31 09:15:57 2020 +0100 @@ -298,7 +298,7 @@ return ResponseType.NONE; } - viewModel.setVersion(viewModel.getVersionFilter()); + viewModel.setVersion(new Version(-1)); return forwardView(req, viewModel, "version-form"); } diff -r b3f14cd4f3ab -r 7761c37c5e61 src/main/kotlin/de/uapcore/lightpit/entities/Component.kt --- a/src/main/kotlin/de/uapcore/lightpit/entities/Component.kt Sat Oct 24 12:09:08 2020 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/Component.kt Sat Oct 31 09:15:57 2020 +0100 @@ -28,8 +28,8 @@ import de.uapcore.lightpit.types.WebColor data class Component(val id: Int) { - var name: String? = null - var node: String? = null + var name: String = "" + var node: String = name var color = WebColor("000000") var ordinal = 0 var description: String? = null diff -r b3f14cd4f3ab -r 7761c37c5e61 src/main/kotlin/de/uapcore/lightpit/entities/Version.kt --- a/src/main/kotlin/de/uapcore/lightpit/entities/Version.kt Sat Oct 24 12:09:08 2020 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/Version.kt Sat Oct 31 09:15:57 2020 +0100 @@ -31,13 +31,13 @@ } data class Version(val id: Int) : Comparable { - var name: String = "unspecified" + var name: String = "" var node = name var ordinal = 0 var status = VersionStatus.Future override fun compareTo(other: Version): Int { - val ord = Integer.compare(ordinal, other.ordinal) + val ord = ordinal.compareTo(other.ordinal) return if (ord == 0) { name.compareTo(other.name, ignoreCase = true) } else { diff -r b3f14cd4f3ab -r 7761c37c5e61 src/main/webapp/WEB-INF/jsp/component-form.jsp --- a/src/main/webapp/WEB-INF/jsp/component-form.jsp Sat Oct 24 12:09:08 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/component-form.jsp Sat Oct 31 09:15:57 2020 +0100 @@ -52,7 +52,7 @@ "> - " /> + " /> diff -r b3f14cd4f3ab -r 7761c37c5e61 src/main/webapp/WEB-INF/jsp/project-form.jsp --- a/src/main/webapp/WEB-INF/jsp/project-form.jsp Sat Oct 24 12:09:08 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/project-form.jsp Sat Oct 31 09:15:57 2020 +0100 @@ -44,7 +44,7 @@ "> - " /> + " /> diff -r b3f14cd4f3ab -r 7761c37c5e61 src/main/webapp/WEB-INF/jsp/version-form.jsp --- a/src/main/webapp/WEB-INF/jsp/version-form.jsp Sat Oct 24 12:09:08 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/version-form.jsp Sat Oct 31 09:15:57 2020 +0100 @@ -52,7 +52,7 @@ "> - " /> + " />