Fri, 23 Oct 2020 18:40:50 +0200
migrate WebColor
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 | |
129
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
3 | import de.uapcore.lightpit.entities.Component; |
86
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.Project; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
6 | import de.uapcore.lightpit.entities.Version; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | import java.util.Collections; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
9 | import java.util.List; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
10 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
11 | public class ProjectInfo { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
12 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
13 | private final Project project; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
14 | private List<Version> versions = Collections.emptyList(); |
129
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
15 | private List<Component> components = Collections.emptyList(); |
86
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | private IssueSummary issueSummary = new IssueSummary(); |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
17 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
18 | public ProjectInfo(Project project) { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
19 | this.project = project; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
20 | } |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
21 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
22 | public Project getProject() { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
23 | return project; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
24 | } |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
25 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
26 | public List<Version> getVersions() { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
27 | return versions; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
28 | } |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
29 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
30 | public void setVersions(List<Version> versions) { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
31 | this.versions = versions; |
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 | |
129
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
34 | public List<Component> getComponents() { |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
35 | return components; |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
36 | } |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
37 | |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
38 | public void setComponents(List<Component> components) { |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
39 | this.components = components; |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
40 | } |
a09d5c59351a
add components to navmenu
Mike Becker <universe@uap-core.de>
parents:
90
diff
changeset
|
41 | |
86
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
42 | public Version getLatestVersion() { |
90
2c74e36752f9
only show relevant versions in issue editor
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
43 | // expects versions to be sorted by status descending |
86
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
44 | for (var v : versions) { |
90
2c74e36752f9
only show relevant versions in issue editor
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
45 | if (v.getStatus().isReleased()) |
86
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
46 | return v; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
47 | } |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
48 | return null; |
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 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
51 | public Version getNextVersion() { |
90
2c74e36752f9
only show relevant versions in issue editor
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
52 | // expects versions to be sorted by status descending |
86
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
53 | Version next = null; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
54 | for (var v : versions) { |
90
2c74e36752f9
only show relevant versions in issue editor
Mike Becker <universe@uap-core.de>
parents:
86
diff
changeset
|
55 | if (v.getStatus().isReleased()) |
86
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
56 | break; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
57 | next = v; |
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 | return next; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
60 | } |
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 | public IssueSummary getIssueSummary() { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
63 | return issueSummary; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
64 | } |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
65 | |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
66 | public void setIssueSummary(IssueSummary issueSummary) { |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
67 | this.issueSummary = issueSummary; |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
68 | } |
0a658e53177c
improves issue overview and adds progress information
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
69 | } |