# HG changeset patch # User Mike Becker # Date 1738690135 -3600 # Node ID 6b2caaf2c73d1b7230201839050748e2d8f8c24e # Parent 3720c7375146c576c5bf7fb712f7c58e42a43dc4 implement variant status in issue list relates to #491 diff -r 3720c7375146 -r 6b2caaf2c73d src/main/kotlin/de/uapcore/lightpit/entities/Issue.kt --- a/src/main/kotlin/de/uapcore/lightpit/entities/Issue.kt Sun Feb 02 17:08:18 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/entities/Issue.kt Tue Feb 04 18:28:55 2025 +0100 @@ -61,6 +61,29 @@ fun getStatusForVariant(variant: Variant): IssueStatus? { return variantStatus[variant] } + + fun updateStatusFromVariants() { + if (!isTrackingVariantStatus) return + + // when all variant status are equal, this is also the issue status + val statusList = variantStatus.values.toList() + status = if (statusList.all { it == statusList[0] }) { + statusList[0] + } + // check if all status are in phase 0 + else if (statusList.all { it.phase == IssueStatusPhase.Open}) { + IssueStatus.ToDo + } + // check if all status are in phase 2 + else if (statusList.all { it.phase == IssueStatusPhase.Done}) { + IssueStatus.Done + } + // otherwise, the issue status is "InProgress" + else { + IssueStatus.InProgress + } + } + val variantStatus = mutableMapOf() /** diff -r 3720c7375146 -r 6b2caaf2c73d src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt --- a/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt Sun Feb 02 17:08:18 2025 +0100 +++ b/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt Tue Feb 04 18:28:55 2025 +0100 @@ -77,7 +77,7 @@ } } } - // TODO: compute overall status + updateStatusFromVariants() } } diff -r 3720c7375146 -r 6b2caaf2c73d src/main/webapp/WEB-INF/changelogs/changelog-de.jspf --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Sun Feb 02 17:08:18 2025 +0100 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Feb 04 18:28:55 2025 +0100 @@ -27,6 +27,7 @@

Version 1.5.0 (Vorschau)