# HG changeset patch # User Mike Becker # Date 1592732296 -7200 # Node ID 1438e5a22c5508c1becc5fe75db27a5e3c943835 # Parent 501addad452b7437014e927e4e82943559f7751a simplifies version overviews by removing "scheduled issues" diff -r 501addad452b -r 1438e5a22c55 setup/postgres/psql_create_tables.sql --- 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), diff -r 501addad452b -r 1438e5a22c55 src/main/java/de/uapcore/lightpit/dao/postgres/PGIssueDao.java --- 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)); } } diff -r 501addad452b -r 1438e5a22c55 src/main/java/de/uapcore/lightpit/entities/Issue.java --- 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 affectedVersions = Collections.emptyList(); - private List scheduledVersions = Collections.emptyList(); private List resolvedVersions = Collections.emptyList(); private Timestamp created = Timestamp.from(Instant.now()); @@ -131,14 +130,6 @@ this.affectedVersions = affectedVersions; } - public List getScheduledVersions() { - return scheduledVersions; - } - - public void setScheduledVersions(List scheduledVersions) { - this.scheduledVersions = scheduledVersions; - } - public List getResolvedVersions() { return resolvedVersions; } diff -r 501addad452b -r 1438e5a22c55 src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java --- 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 -> diff -r 501addad452b -r 1438e5a22c55 src/main/java/de/uapcore/lightpit/viewmodel/ProjectView.java --- 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); } diff -r 501addad452b -r 1438e5a22c55 src/main/java/de/uapcore/lightpit/viewmodel/VersionInfo.java --- 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 reported = new ArrayList<>(); - private final List scheduled = new ArrayList<>(); private final List 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 getScheduled() { - return scheduled; - } - public List 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); } diff -r 501addad452b -r 1438e5a22c55 src/main/resources/localization/projects.properties --- 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 diff -r 501addad452b -r 1438e5a22c55 src/main/resources/localization/projects_de.properties --- 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 diff -r 501addad452b -r 1438e5a22c55 src/main/webapp/WEB-INF/jsp/issue-form.jsp --- 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 @@ - - - - - <%@include file="../jspf/version-list.jsp"%> - - - diff -r 501addad452b -r 1438e5a22c55 src/main/webapp/WEB-INF/jsp/project-details.jsp --- 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 @@

- - (open) + ()

-

- - - <%@include file="../jspf/issue-summary.jsp"%> - -

- - - <%@include file="../jspf/issue-summary.jsp"%> -

<%@include file="../jspf/issue-summary.jsp"%> + + <%@include file="../jspf/issue-list.jsp"%> +
\ No newline at end of file diff -r 501addad452b -r 1438e5a22c55 src/main/webapp/WEB-INF/jsp/version.jsp --- 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 @@ -

- - - -<%@include file="../jspf/issue-summary.jsp"%> -<%@include file="../jspf/issue-list.jsp"%> + +

+ + + <%@include file="../jspf/issue-summary.jsp"%> + <%@include file="../jspf/issue-list.jsp"%> +
-

- - -<%@include file="../jspf/issue-summary.jsp"%> -<%@include file="../jspf/issue-list.jsp"%> + +

+ + + <%@include file="../jspf/issue-summary.jsp"%> + <%@include file="../jspf/issue-list.jsp"%> +
-

- - -<%@include file="../jspf/issue-summary.jsp"%> -<%@include file="../jspf/issue-list.jsp"%> -