src/main/java/de/uapcore/lightpit/viewmodel/VersionInfo.java

Thu, 08 Oct 2020 20:38:43 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 08 Oct 2020 20:38:43 +0200
changeset 110
9d0be0b1580f
parent 88
1438e5a22c55
permissions
-rw-r--r--

adds indicators for version status

replaces table column "Status" with version tag
fixes New Version form button not overriding the session version ID

86
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 package de.uapcore.lightpit.viewmodel;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 import de.uapcore.lightpit.entities.Issue;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 import de.uapcore.lightpit.entities.IssueSummary;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 import de.uapcore.lightpit.entities.Version;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 import java.util.ArrayList;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 import java.util.List;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 public class VersionInfo {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 private final Version version;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 private final IssueSummary reportedTotal = new IssueSummary();
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 private final IssueSummary resolvedTotal = new IssueSummary();
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 private final List<Issue> reported = new ArrayList<>();
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 private final List<Issue> resolved = new ArrayList<>();
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 public VersionInfo(Version version) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 this.version = version;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 public Version getVersion() {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 return version;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 public void addReported(Issue issue) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29 reportedTotal.add(issue);
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30 reported.add(issue);
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33 public void addResolved(Issue issue) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34 resolvedTotal.add(issue);
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 resolved.add(issue);
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 public IssueSummary getReportedTotal() {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39 return reportedTotal;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 public IssueSummary getResolvedTotal() {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43 return resolvedTotal;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46 public List<Issue> getReported() {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47 return reported;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 public List<Issue> getResolved() {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 return resolved;
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 public void collectIssues(List<Issue> issues) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55 for (Issue issue : issues) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
56 if (issue.getAffectedVersions().contains(version)) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 addReported(issue);
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59 if (issue.getResolvedVersions().contains(version)) {
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60 addResolved(issue);
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
61 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63 }
0a658e53177c improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 }

mercurial