# HG changeset patch # User Mike Becker # Date 1782217810 -7200 # Node ID a07662e829c0efb93d8923926d8583788cd82a81 # Parent 5e36330f954b85b9b97f463278c28a156c982dec add the possibility to hide projects from the left menu - resolves #818 diff -r 5e36330f954b -r a07662e829c0 build.gradle.kts --- a/build.gradle.kts Tue Jun 23 13:06:07 2026 +0200 +++ b/build.gradle.kts Tue Jun 23 14:30:10 2026 +0200 @@ -5,7 +5,7 @@ war } group = "de.uapcore" -version = "1.6.2" +version = "1.7.0" repositories { mavenCentral() diff -r 5e36330f954b -r a07662e829c0 setup/postgres/psql_create_tables.sql --- a/setup/postgres/psql_create_tables.sql Tue Jun 23 13:06:07 2026 +0200 +++ b/setup/postgres/psql_create_tables.sql Tue Jun 23 14:30:10 2026 +0200 @@ -16,6 +16,7 @@ name text not null unique, node text not null unique, ordinal integer not null default 0, + hidden boolean not null default false, description text, repoUrl text, vcs vcstype not null default 'None'::vcstype, diff -r 5e36330f954b -r a07662e829c0 setup/postgres/psql_patch_1.7.0.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup/postgres/psql_patch_1.7.0.sql Tue Jun 23 14:30:10 2026 +0200 @@ -0,0 +1,3 @@ +-- apply this script to patch a version 1.6.x database to version 1.7.0 + +alter table lpit_project add column hidden boolean default false; diff -r 5e36330f954b -r a07662e829c0 src/main/kotlin/de/uapcore/lightpit/Constants.kt --- a/src/main/kotlin/de/uapcore/lightpit/Constants.kt Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/Constants.kt Tue Jun 23 14:30:10 2026 +0200 @@ -29,7 +29,7 @@ /** * A date in yyyy-mm-dd format to identify the release. */ - const val VERSION_DATE = "2026-06-11" + const val VERSION_DATE = "2026-06-23" /** * The path where the JSP files reside. @@ -116,4 +116,9 @@ * Key for the current timezone selection within the session. */ const val SESSION_ATTR_TIMEZONE = "timezone" + + /** + * Key for the session attribute that controls whether all projects are shown in the navmenu. + */ + const val SESSION_ATTR_SHOW_ALL_PROJECTS = "show_all_projects" } diff -r 5e36330f954b -r a07662e829c0 src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt --- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Tue Jun 23 14:30:10 2026 +0200 @@ -48,7 +48,12 @@ val node = info.node } -sealed interface ValidationResult +sealed interface ValidationResult { + fun getOrNull(): T? = when (this) { + is ValidatedValue -> result + else -> null + } +} class ValidationError(val message: String): ValidationResult class ValidatedValue(val result: T): ValidationResult diff -r 5e36330f954b -r a07662e829c0 src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Tue Jun 23 14:30:10 2026 +0200 @@ -480,7 +480,7 @@ //language=SQL private val projectQuery = """ - select projectid, name, node, ordinal, description, vcs, repourl, + select projectid, name, node, ordinal, hidden, description, vcs, repourl, userid, username, lastname, givenname, mail from lpit_project left join lpit_user owner on lpit_project.owner = owner.userid @@ -491,6 +491,7 @@ name = getString("${prefix}name") node = getString("${prefix}node") ordinal = getInt("${prefix}ordinal") + hidden = getBoolean("${prefix}hidden") description = getString("${prefix}description") vcs = getEnum("${prefix}vcs") repoUrl = getString("${prefix}repourl") @@ -503,6 +504,7 @@ setStringSafe(i++, name) setStringSafe(i++, node) setInt(i++, ordinal) + setBoolean(i++, hidden) setStringOrNull(i++, description) setEnum(i++, vcs) setStringOrNull(i++, repoUrl) @@ -529,14 +531,14 @@ } override fun insertProject(project: Project) { - withStatement("insert into lpit_project (name, node, ordinal, description, vcs, repourl, owner) values (?, ?, ?, ?, ?::vcstype, ?, ?)") { + withStatement("insert into lpit_project (name, node, ordinal, hidden, description, vcs, repourl, owner) values (?, ?, ?, ?, ?::vcstype, ?, ?)") { setProject(1, project) executeUpdate() } } override fun updateProject(project: Project) { - withStatement("update lpit_project set name = ?, node = ?, ordinal = ?, description = ?, vcs = ?::vcstype, repourl = ?, owner = ? where projectid = ?") { + withStatement("update lpit_project set name = ?, node = ?, ordinal = ?, hidden = ?, description = ?, vcs = ?::vcstype, repourl = ?, owner = ? where projectid = ?") { val col = setProject(1, project) setInt(col, project.id) executeUpdate() @@ -626,6 +628,7 @@ p.name as project_name, p.node as project_node, p.ordinal as project_ordinal, + p.hidden as project_hidden, p.description as project_description, p.vcs as project_vcs, p.repourl as project_repourl, @@ -648,6 +651,7 @@ p.name as project_name, p.node as project_node, p.ordinal as project_ordinal, + p.hidden as project_hidden, p.description as project_description, p.vcs as project_vcs, p.repourl as project_repourl, diff -r 5e36330f954b -r a07662e829c0 src/main/kotlin/de/uapcore/lightpit/entities/Project.kt --- a/src/main/kotlin/de/uapcore/lightpit/entities/Project.kt Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/Project.kt Tue Jun 23 14:30:10 2026 +0200 @@ -31,6 +31,7 @@ var name: String = "" override var node: String = name var ordinal = 0 + var hidden = false var description: String? = null var vcs: VcsType = VcsType.None var repoUrl: String? = null diff -r 5e36330f954b -r a07662e829c0 src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Tue Jun 23 14:30:10 2026 +0200 @@ -38,6 +38,7 @@ class ProjectServlet : AbstractServlet() { init { + post("/settings", this::changeSettings) get("/", this::projects) get("/%project", this::project) get("/%project/issues/%version/%component/%variant/", this::project) @@ -75,6 +76,13 @@ post("/%project/issues/%version/%component/%variant/-/commit", this::issueCommit) } + private fun changeSettings(http: HttpRequest, dao: DataAccessObject) { + http.param("show_all_projects")?.let(::boolValidator)?.getOrNull()?.let { + http.session.setAttribute(Constants.SESSION_ATTR_SHOW_ALL_PROJECTS, it) + } + http.response.status = 204 + } + private fun projects(http: HttpRequest, dao: DataAccessObject) { val projects = dao.listProjects() val projectInfos = projects.map { @@ -154,6 +162,7 @@ node = http.param("node") ?: "" description = http.param("description") ?: "" ordinal = http.param("ordinal")?.toIntOrNull() ?: 0 + hidden = http.param("hidden", ::boolValidator, false, mutableListOf()) repoUrl = http.param("repoUrl") ?: "" vcs = VcsType.valueOf(http.param("vcs") ?: "None") owner = (http.param("owner")?.toIntOrNull() ?: -1).let { @@ -171,7 +180,11 @@ dao.updateProject(project) } - http.renderCommit("projects/${project.node}") + if (project.hidden) { + http.renderCommit("projects") + } else { + http.renderCommit("projects/${project.node}") + } } private fun vcsAnalyze(http: HttpRequest, dao: DataAccessObject) { @@ -241,7 +254,6 @@ dao.listVersionSummaries(path.project) ) navigationMenu = projectNavMenu(dao.listProjects(), path) - javascript = "issue-overview" render("versions") } } @@ -350,7 +362,6 @@ dao.listComponentSummaries(path.project) ) navigationMenu = projectNavMenu(dao.listProjects(), path) - javascript = "issue-overview" render("components") } } @@ -381,7 +392,6 @@ ordinal = http.param("ordinal")?.toIntOrNull() ?: 0 color = WebColor(http.param("color") ?: "#000000") description = http.param("description") - // TODO: process error message active = http.param("active", ::boolValidator, true, mutableListOf()) lead = (http.param("lead")?.toIntOrNull() ?: -1).let { if (it < 0) null else dao.findUser(it) @@ -410,7 +420,6 @@ dao.listVariantSummaries(path.project) ) navigationMenu = projectNavMenu(dao.listProjects(), path) - javascript = "issue-overview" render("variants") } } diff -r 5e36330f954b -r a07662e829c0 src/main/kotlin/de/uapcore/lightpit/viewmodel/NavMenus.kt --- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/NavMenus.kt Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/NavMenus.kt Tue Jun 23 14:30:10 2026 +0200 @@ -34,6 +34,7 @@ val href: String, val title: String = "", val active: Boolean = false, + val hidden: Boolean = false, val resolveCaption: Boolean = false, val iconColor: String? = null, val editHref: String? = null @@ -50,6 +51,7 @@ NavMenuEntry( level = 0, caption = project.name, + hidden = project.hidden, href = "projects/${project.node}", ) ) @@ -68,6 +70,7 @@ NavMenuEntry( level = 0, caption = project.name, + hidden = !active && project.hidden, href = "projects/${project.node}", active = active ) diff -r 5e36330f954b -r a07662e829c0 src/main/resources/localization/strings.properties --- a/src/main/resources/localization/strings.properties Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/resources/localization/strings.properties Tue Jun 23 14:30:10 2026 +0200 @@ -158,6 +158,7 @@ menu.projects=Projects menu.settings=Settings menu.users=Developer +navmenu.showall=Show All navmenu.all=all navmenu.components=Components navmenu.none=none @@ -178,6 +179,8 @@ placeholder.null-version=None placeholder.null-eta=None progress=Overall Progress +project.hidden=Hidden +project.hidden.tooltip=Hide this project from the left menu. project.name=Name project.owner=Project Lead project.repoUrl=Repository diff -r 5e36330f954b -r a07662e829c0 src/main/resources/localization/strings_de.properties --- a/src/main/resources/localization/strings_de.properties Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/resources/localization/strings_de.properties Tue Jun 23 14:30:10 2026 +0200 @@ -158,6 +158,7 @@ menu.projects=Projekte menu.settings=Einstellungen menu.users=Entwickler +navmenu.showall=Alle anzeigen navmenu.all=Alle navmenu.components=Komponenten navmenu.none=Keine @@ -178,6 +179,8 @@ placeholder.null-version=Keine placeholder.null-eta=Nicht geplant progress=Gesamtfortschritt +project.hidden=Versteckt +project.hidden.tooltip=Dieses Projekt wird im Navigationsmen\u00fc versteckt. project.name=Name project.owner=Projektleitung project.repoUrl=Repository diff -r 5e36330f954b -r a07662e829c0 src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Jun 23 14:30:10 2026 +0200 @@ -24,6 +24,12 @@ --%> <%@ page contentType="text/html;charset=UTF-8" %> +

Version 1.7.0 (Vorschau)

+ +
    +
  • Die Möglichkeit hinzugefügt, Projekte im Navigationsmenü zu verstecken.
  • +
+

Version 1.6.2

    diff -r 5e36330f954b -r a07662e829c0 src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Jun 23 14:30:10 2026 +0200 @@ -24,6 +24,12 @@ --%> <%@ page contentType="text/html;charset=UTF-8" %> +

    Version 1.7.0 (preview)

    + +
      +
    • Add the possibility to hide projects from the left menu.
    • +
    +

    Version 1.6.2

      diff -r 5e36330f954b -r a07662e829c0 src/main/webapp/WEB-INF/jsp/project-form.jsp --- a/src/main/webapp/WEB-INF/jsp/project-form.jsp Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/webapp/WEB-INF/jsp/project-form.jsp Tue Jun 23 14:30:10 2026 +0200 @@ -84,6 +84,12 @@ + "> + + + checked/> + + diff -r 5e36330f954b -r a07662e829c0 src/main/webapp/WEB-INF/jsp/site.jsp --- a/src/main/webapp/WEB-INF/jsp/site.jsp Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/webapp/WEB-INF/jsp/site.jsp Tue Jun 23 14:30:10 2026 +0200 @@ -57,6 +57,9 @@ <%-- Define an alias for timezone --%> +<%-- Define an alias for project_showall --%> + + <%-- Load resource bundle --%> @@ -79,16 +82,8 @@ + diff -r 5e36330f954b -r a07662e829c0 src/main/webapp/WEB-INF/jspf/navmenu.jspf --- a/src/main/webapp/WEB-INF/jspf/navmenu.jspf Tue Jun 23 13:06:07 2026 +0200 +++ b/src/main/webapp/WEB-INF/jspf/navmenu.jspf Tue Jun 23 14:30:10 2026 +0200 @@ -30,9 +30,14 @@ +