Sun, 21 Jun 2020 11:38:16 +0200
simplifies version overviews by removing "scheduled issues"
--- a/setup/postgres/psql_create_tables.sql Sun Jun 21 11:10:30 2020 +0200 +++ b/setup/postgres/psql_create_tables.sql Sun Jun 21 11:38:16 2020 +0200 @@ -77,12 +77,6 @@ primary key (issueid, versionid) ); -create table lpit_issue_scheduled_version ( - issueid integer references lpit_issue(issueid), - versionid integer references lpit_version(versionid), - primary key (issueid, versionid) -); - create table lpit_issue_resolved_version ( issueid integer references lpit_issue(issueid), versionid integer references lpit_version(versionid),
--- a/src/main/java/de/uapcore/lightpit/dao/postgres/PGIssueDao.java Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/dao/postgres/PGIssueDao.java Sun Jun 21 11:38:16 2020 +0200 @@ -44,9 +44,9 @@ public final class PGIssueDao implements IssueDao { private final PreparedStatement insert, update, list, listForVersion, find; - private final PreparedStatement affectedVersions, scheduledVersions, resolvedVersions; - private final PreparedStatement clearAffected, clearScheduled, clearResolved; - private final PreparedStatement insertAffected, insertScheduled, insertResolved; + private final PreparedStatement affectedVersions, resolvedVersions; + private final PreparedStatement clearAffected, clearResolved; + private final PreparedStatement insertAffected, insertResolved; public PGIssueDao(Connection connection) throws SQLException { list = connection.prepareStatement( @@ -62,7 +62,6 @@ listForVersion = connection.prepareStatement( "with issue_version as ( "+ "select issueid, versionid from lpit_issue_affected_version union "+ - "select issueid, versionid from lpit_issue_scheduled_version union "+ "select issueid, versionid from lpit_issue_resolved_version) "+ "select issueid, project, p.name as projectname, status, category, subject, i.description, " + "userid, username, givenname, lastname, mail, " + @@ -102,15 +101,6 @@ clearAffected = connection.prepareStatement("delete from lpit_issue_affected_version where issueid = ?"); insertAffected = connection.prepareStatement("insert into lpit_issue_affected_version (issueid, versionid) values (?,?)"); - scheduledVersions = connection.prepareStatement( - "select versionid, name, status, ordinal " + - "from lpit_version join lpit_issue_scheduled_version using (versionid) " + - "where issueid = ? " + - "order by ordinal, name" - ); - clearScheduled = connection.prepareStatement("delete from lpit_issue_scheduled_version where issueid = ?"); - insertScheduled = connection.prepareStatement("insert into lpit_issue_scheduled_version (issueid, versionid) values (?,?)"); - resolvedVersions = connection.prepareStatement( "select versionid, name, status, ordinal " + "from lpit_version v join lpit_issue_resolved_version using (versionid) " + @@ -161,22 +151,15 @@ private void updateVersionLists(Issue instance) throws SQLException { clearAffected.setInt(1, instance.getId()); - clearScheduled.setInt(1, instance.getId()); clearResolved.setInt(1, instance.getId()); insertAffected.setInt(1, instance.getId()); - insertScheduled.setInt(1, instance.getId()); insertResolved.setInt(1, instance.getId()); clearAffected.executeUpdate(); - clearScheduled.executeUpdate(); clearResolved.executeUpdate(); for (Version v : instance.getAffectedVersions()) { insertAffected.setInt(2, v.getId()); insertAffected.executeUpdate(); } - for (Version v : instance.getScheduledVersions()) { - insertScheduled.setInt(2, v.getId()); - insertScheduled.executeUpdate(); - } for (Version v : instance.getResolvedVersions()) { insertResolved.setInt(2, v.getId()); insertResolved.executeUpdate(); @@ -269,7 +252,6 @@ public void joinVersionInformation(Issue issue) throws SQLException { Objects.requireNonNull(issue.getProject()); issue.setAffectedVersions(listVersions(affectedVersions, issue)); - issue.setScheduledVersions(listVersions(scheduledVersions, issue)); issue.setResolvedVersions(listVersions(resolvedVersions, issue)); } }
--- a/src/main/java/de/uapcore/lightpit/entities/Issue.java Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/entities/Issue.java Sun Jun 21 11:38:16 2020 +0200 @@ -48,7 +48,6 @@ private User assignee; private List<Version> affectedVersions = Collections.emptyList(); - private List<Version> scheduledVersions = Collections.emptyList(); private List<Version> resolvedVersions = Collections.emptyList(); private Timestamp created = Timestamp.from(Instant.now()); @@ -131,14 +130,6 @@ this.affectedVersions = affectedVersions; } - public List<Version> getScheduledVersions() { - return scheduledVersions; - } - - public void setScheduledVersions(List<Version> scheduledVersions) { - this.scheduledVersions = scheduledVersions; - } - public List<Version> getResolvedVersions() { return resolvedVersions; }
--- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Sun Jun 21 11:38:16 2020 +0200 @@ -127,7 +127,7 @@ } // our object contains more details issue.setProject(project); - if (!issue.getResolvedVersions().contains(version) && !issue.getScheduledVersions().contains(version) + if (!issue.getResolvedVersions().contains(version) && !issue.getAffectedVersions().contains(version)) { version = null; } @@ -536,11 +536,6 @@ .map(stream -> stream.map(Version::new).collect(Collectors.toList()) ).ifPresent(issue::setAffectedVersions); - getParameter(req, Integer[].class, "scheduled") - .map(Stream::of) - .map(stream -> - stream.map(Version::new).collect(Collectors.toList()) - ).ifPresent(issue::setScheduledVersions); getParameter(req, Integer[].class, "resolved") .map(Stream::of) .map(stream ->
--- a/src/main/java/de/uapcore/lightpit/viewmodel/ProjectView.java Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/viewmodel/ProjectView.java Sun Jun 21 11:38:16 2020 +0200 @@ -39,7 +39,8 @@ issuesWithoutVersionTotal = new IssueSummary(); for (Issue issue : issues) { issuesTotal.add(issue); - if (issue.getResolvedVersions().isEmpty() && issue.getScheduledVersions().isEmpty() && issue.getResolvedVersions().isEmpty()) { + // we want to list all issues that do not have a target version + if (issue.getResolvedVersions().isEmpty()) { issuesWithoutVersion.add(issue); issuesWithoutVersionTotal.add(issue); }
--- a/src/main/java/de/uapcore/lightpit/viewmodel/VersionInfo.java Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/viewmodel/VersionInfo.java Sun Jun 21 11:38:16 2020 +0200 @@ -12,11 +12,9 @@ private final Version version; private final IssueSummary reportedTotal = new IssueSummary(); - private final IssueSummary scheduledTotal = new IssueSummary(); private final IssueSummary resolvedTotal = new IssueSummary(); private final List<Issue> reported = new ArrayList<>(); - private final List<Issue> scheduled = new ArrayList<>(); private final List<Issue> resolved = new ArrayList<>(); public VersionInfo(Version version) { @@ -32,11 +30,6 @@ reported.add(issue); } - public void addScheduled(Issue issue) { - scheduledTotal.add(issue); - scheduled.add(issue); - } - public void addResolved(Issue issue) { resolvedTotal.add(issue); resolved.add(issue); @@ -46,10 +39,6 @@ return reportedTotal; } - public IssueSummary getScheduledTotal() { - return scheduledTotal; - } - public IssueSummary getResolvedTotal() { return resolvedTotal; } @@ -58,10 +47,6 @@ return reported; } - public List<Issue> getScheduled() { - return scheduled; - } - public List<Issue> getResolved() { return resolved; } @@ -71,9 +56,6 @@ if (issue.getAffectedVersions().contains(version)) { addReported(issue); } - if (issue.getScheduledVersions().contains(version)) { - addScheduled(issue); - } if (issue.getResolvedVersions().contains(version)) { addResolved(issue); }
--- a/src/main/resources/localization/projects.properties Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/resources/localization/projects.properties Sun Jun 21 11:38:16 2020 +0200 @@ -28,9 +28,6 @@ button.issue.create=New Issue button.issue.all=All Issues -button.stats.hidezeros=Reduced View -button.stats.showzeros=Full View - no-projects=Welcome to LightPIT. Start off by creating a new project! menu.issues=Issues @@ -49,8 +46,7 @@ issues.done=Done issues.total=Total issues.reported=Reported Issues -issues.scheduled=Scheduled Issues -issues.resolved=Resolved Issues +issues.resolved=Issues version.project=Project version.name=Version @@ -61,6 +57,7 @@ placeholder.null-owner=Unassigned placeholder.null-assignee=Unassigned +version.open=open version.label=Version version.status.Future=Future version.status.Unreleased=Unreleased @@ -75,8 +72,7 @@ issue.description=Description issue.assignee=Assignee issue.affected-versions=Affected Versions -issue.scheduled-versions=Scheduled for Versions -issue.resolved-versions=Resolved in Versions +issue.resolved-versions=Target Versions issue.category=Category issue.status=Status issue.created=Created
--- a/src/main/resources/localization/projects_de.properties Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/resources/localization/projects_de.properties Sun Jun 21 11:38:16 2020 +0200 @@ -28,9 +28,6 @@ button.issue.create=Neuer Vorgang button.issue.all=Alle Vorg\u00e4nge -button.stats.hidezeros=Reduzierte Ansicht -button.stats.showzeros=Komplettansicht - no-projects=Wilkommen bei LightPIT. Beginnen Sie mit der Erstellung eines Projektes! menu.issues=Vorg\u00e4nge @@ -48,8 +45,7 @@ issues.active=In Arbeit issues.done=Erledigt issues.reported=Er\u00f6ffnete Vorg\u00e4nge -issues.scheduled=Geplante Vorg\u00e4nge -issues.resolved=Gel\u00f6ste Vorg\u00e4nge +issues.resolved=Vorg\u00e4nge issues.total=Summe version.project=Projekt @@ -61,6 +57,7 @@ placeholder.null-owner=Nicht Zugewiesen placeholder.null-assignee=Niemandem +version.open=ansehen version.label=Version version.status.Future=Geplant version.status.Unreleased=Unver\u00f6ffentlicht @@ -74,8 +71,7 @@ issue.description=Beschreibung issue.assignee=Zugewiesen issue.affected-versions=Betroffene Versionen -issue.scheduled-versions=Zielversionen -issue.resolved-versions=Gel\u00f6st in Versionen +issue.resolved-versions=Zielversionen issue.category=Kategorie issue.status=Status issue.created=Erstellt
--- a/src/main/webapp/WEB-INF/jsp/issue-form.jsp Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/issue-form.jsp Sun Jun 21 11:38:16 2020 +0200 @@ -120,14 +120,6 @@ </td> </tr> <tr> - <th class="vtop"><fmt:message key="issue.scheduled-versions"/></th> - <td> - <c:set var="fieldname" value="scheduled"/> - <c:set var="data" value="${issue.scheduledVersions}" /> - <%@include file="../jspf/version-list.jsp"%> - </td> - </tr> - <tr> <th class="vtop"><fmt:message key="issue.resolved-versions"/></th> <td> <c:set var="fieldname" value="resolved"/>
--- a/src/main/webapp/WEB-INF/jsp/project-details.jsp Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/project-details.jsp Sun Jun 21 11:38:16 2020 +0200 @@ -53,21 +53,14 @@ <c:forEach var="versionInfo" items="${viewmodel.versionInfos}"> <h2> <fmt:message key="version.label" /> <c:out value="${versionInfo.version.name}" /> - <fmt:message key="version.status.${versionInfo.version.status}"/> - (<a href="./projects/versions/view?vid=${versionInfo.version.id}">open</a>) + (<a href="./projects/versions/view?vid=${versionInfo.version.id}"><fmt:message key="version.open" /></a>) </h2> - <h3><fmt:message key="issues.reported"/> </h3> - <c:set var="summary" value="${versionInfo.reportedTotal}"/> - <c:set var="issues" value="${versionInfo.reported}"/> - <%@include file="../jspf/issue-summary.jsp"%> - - <h3><fmt:message key="issues.scheduled"/> </h3> - <c:set var="summary" value="${versionInfo.scheduledTotal}"/> - <c:set var="issues" value="${versionInfo.scheduled}"/> - <%@include file="../jspf/issue-summary.jsp"%> - <h3><fmt:message key="issues.resolved"/> </h3> <c:set var="summary" value="${versionInfo.resolvedTotal}"/> <c:set var="issues" value="${versionInfo.resolved}"/> <%@include file="../jspf/issue-summary.jsp"%> + <c:if test="${not empty issues}"> + <%@include file="../jspf/issue-list.jsp"%> + </c:if> </c:forEach> \ No newline at end of file
--- a/src/main/webapp/WEB-INF/jsp/version.jsp Sun Jun 21 11:10:30 2020 +0200 +++ b/src/main/webapp/WEB-INF/jsp/version.jsp Sun Jun 21 11:38:16 2020 +0200 @@ -44,22 +44,19 @@ <a href="./projects/versions/edit?vid=${version.id}">✎</a> </h2> -<h3><fmt:message key="issues.reported"/> </h3> - -<c:set var="summary" value="${viewmodel.versionInfo.reportedTotal}"/> -<c:set var="issues" value="${viewmodel.versionInfo.reported}"/> -<%@include file="../jspf/issue-summary.jsp"%> -<%@include file="../jspf/issue-list.jsp"%> +<c:if test="${not empty viewmodel.versionInfo.resolved}"> + <h3><fmt:message key="issues.resolved"/> </h3> + <c:set var="summary" value="${viewmodel.versionInfo.resolvedTotal}"/> + <c:set var="issues" value="${viewmodel.versionInfo.resolved}"/> + <%@include file="../jspf/issue-summary.jsp"%> + <%@include file="../jspf/issue-list.jsp"%> +</c:if> -<h3><fmt:message key="issues.scheduled"/> </h3> -<c:set var="summary" value="${viewmodel.versionInfo.scheduledTotal}"/> -<c:set var="issues" value="${viewmodel.versionInfo.scheduled}"/> -<%@include file="../jspf/issue-summary.jsp"%> -<%@include file="../jspf/issue-list.jsp"%> +<c:if test="${not empty viewmodel.versionInfo.reported}"> + <h3><fmt:message key="issues.reported"/> </h3> + <c:set var="summary" value="${viewmodel.versionInfo.reportedTotal}"/> + <c:set var="issues" value="${viewmodel.versionInfo.reported}"/> + <%@include file="../jspf/issue-summary.jsp"%> + <%@include file="../jspf/issue-list.jsp"%> +</c:if> -<h3><fmt:message key="issues.resolved"/> </h3> -<c:set var="summary" value="${viewmodel.versionInfo.resolvedTotal}"/> -<c:set var="issues" value="${viewmodel.versionInfo.resolved}"/> -<%@include file="../jspf/issue-summary.jsp"%> -<%@include file="../jspf/issue-list.jsp"%> -