# HG changeset patch # User Mike Becker # Date 1738262841 -3600 # Node ID 860bbccf33e79bd1e933cac37f381fa832cf92de # Parent 7a515768c481927f96de1d63bede1fc7ef9a103f use the component's color in issue overview - fixes #580 diff -r 7a515768c481 -r 860bbccf33e7 src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt --- a/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt Thu Jan 30 19:47:21 2025 +0100 @@ -500,7 +500,7 @@ p.description as project_description, p.vcs as project_vcs, p.repourl as project_repourl, - component, c.name as componentname, c.node as componentnode, + component, c.name as componentname, c.node as componentnode, c.color as componentcolor, status, phase, category, subject, i.description, userid, username, givenname, lastname, mail, created, updated, eta, affected, resolved @@ -518,6 +518,7 @@ Component(it, proj.id).apply { name = getString("componentname") node = getString("componentnode") + color = WebColor(getString("componentcolor")) } } val issue = Issue(getInt("issueid"), proj).apply { diff -r 7a515768c481 -r 860bbccf33e7 src/main/kotlin/de/uapcore/lightpit/types/WebColor.kt --- a/src/main/kotlin/de/uapcore/lightpit/types/WebColor.kt Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/types/WebColor.kt Thu Jan 30 19:47:21 2025 +0100 @@ -25,6 +25,8 @@ */ package de.uapcore.lightpit.types +import java.lang.Integer.parseInt + /** * Represents a web color in hexadecimal representation. @@ -49,4 +51,15 @@ override fun toString(): String { return color } + + /** + * Returns "light-text" or "dark-text" depending on the luminance of this color. + */ + fun getTextColorClass(): String { + val red = parseInt(color.substring(1, 3), 16) + val green = parseInt(color.substring(3, 5), 16) + val blue = parseInt(color.substring(5), 16) + val luminance = (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255.0 + return if (luminance > 0.5) "dark-text" else "light-text" + } } \ No newline at end of file diff -r 7a515768c481 -r 860bbccf33e7 src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Thu Jan 30 19:47:21 2025 +0100 @@ -33,6 +33,7 @@ Query Parameter in_project zu globalen Vorgangs-URLs hinzugefügt, der von Tools benutzt werden kann, um Vorgänge direkt in der Projektansicht zu öffnen. +
  • Die Anzeige von Komponenten in der Vorgangsliste nutzt nun die der Komponente zugewiesene Farbe.
  • Fehler behoben, bei dem der "Assignee"-Filter im RSS-Feed nicht auf Kommentare angewendet wurde.
  • Versionsinformationen werden nun korrekt in die Vorgangshistorie geschrieben (relevant für RSS-Feeds).
  • diff -r 7a515768c481 -r 860bbccf33e7 src/main/webapp/WEB-INF/changelogs/changelog.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Thu Jan 30 19:47:21 2025 +0100 @@ -33,6 +33,7 @@ Add optional query parameter in_project for global issue URLs that can be used by tools to directly open an issue in the project view.
  • +
  • Change that the component labels in the issue view now use their assigned color.
  • Fix that assignee filter does not work for comments in RSS feed.
  • Fix missing affected and target versions in issue history diff -r 7a515768c481 -r 860bbccf33e7 src/main/webapp/WEB-INF/jsp/site.jsp --- a/src/main/webapp/WEB-INF/jsp/site.jsp Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/webapp/WEB-INF/jsp/site.jsp Thu Jan 30 19:47:21 2025 +0100 @@ -31,7 +31,7 @@ <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%-- Version suffix for forcing browsers to update the CSS / JS files --%> - + <%-- Make the base href easily available at request scope --%> diff -r 7a515768c481 -r 860bbccf33e7 src/main/webapp/WEB-INF/jspf/issue-list.jspf --- a/src/main/webapp/WEB-INF/jspf/issue-list.jspf Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/webapp/WEB-INF/jspf/issue-list.jspf Thu Jan 30 19:47:21 2025 +0100 @@ -48,14 +48,15 @@
    + +
    + +
    +
    -
    - -
    -
    -
    - +
    diff -r 7a515768c481 -r 860bbccf33e7 src/main/webapp/lightpit.css --- a/src/main/webapp/lightpit.css Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/webapp/lightpit.css Thu Jan 30 19:47:21 2025 +0100 @@ -51,6 +51,14 @@ margin: 0.25em 0; } +.light-text { + color: white; +} + +.dark-text { + color: #1c204e; +} + textarea, input, button, select { font-family: inherit; font-size: inherit; diff -r 7a515768c481 -r 860bbccf33e7 src/main/webapp/projects.css --- a/src/main/webapp/projects.css Tue Jan 14 20:12:25 2025 +0100 +++ b/src/main/webapp/projects.css Thu Jan 30 19:47:21 2025 +0100 @@ -65,7 +65,7 @@ background: green; } -.issue-tag, .version-tag { +.issue-tag, .version-tag, .issue-tag-auto-color { padding: .1em 2ex .1em 2ex; display: inline-block; box-sizing: border-box; @@ -77,6 +77,9 @@ text-align: center; font-weight: bolder; font-size: x-small; +} + +.issue-tag, .version-tag { color: whitesmoke; }