adds indicators for version status

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 109
2e0669e814ff
child 111
db706d37c540

adds indicators for version status

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

src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/project-details.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/project-navmenu.jsp file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/jsp/versions.jsp file | annotate | diff | comparison | revisions
src/main/webapp/projects.css file | annotate | diff | comparison | revisions
     1.1 --- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Thu Oct 08 20:16:47 2020 +0200
     1.2 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Thu Oct 08 20:38:43 2020 +0200
     1.3 @@ -223,12 +223,19 @@
     1.4      }
     1.5  
     1.6      @RequestMapping(requestPath = "versions/edit", method = HttpMethod.GET)
     1.7 -    public ResponseType editVersion(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
     1.8 +    public ResponseType editVersion(HttpServletRequest req, HttpServletResponse resp, DataAccessObjects dao) throws IOException, SQLException {
     1.9          final var viewModel = new VersionEditView();
    1.10          populate(viewModel, req, dao);
    1.11  
    1.12 +        if (viewModel.getProjectInfo() == null) {
    1.13 +            resp.sendError(HttpServletResponse.SC_NOT_FOUND, "No project selected.");
    1.14 +            return ResponseType.NONE;
    1.15 +        }
    1.16 +
    1.17          if (viewModel.getVersionFilter() == null) {
    1.18 -            viewModel.setVersion(new Version(-1));
    1.19 +            final var version = new Version(-1);
    1.20 +            version.setProject(viewModel.getProjectInfo().getProject());
    1.21 +            viewModel.setVersion(version);
    1.22          } else {
    1.23              viewModel.setVersion(viewModel.getVersionFilter());
    1.24          }
     2.1 --- a/src/main/webapp/WEB-INF/jsp/project-details.jsp	Thu Oct 08 20:16:47 2020 +0200
     2.2 +++ b/src/main/webapp/WEB-INF/jsp/project-details.jsp	Thu Oct 08 20:38:43 2020 +0200
     2.3 @@ -37,7 +37,7 @@
     2.4      <c:if test="${not empty viewmodel.versionFilter}">
     2.5          <a href="./projects/versions/edit?vid=${viewmodel.versionFilter.id}" class="button"><fmt:message key="button.version.edit"/></a>
     2.6      </c:if>
     2.7 -    <a href="./projects/versions/edit" class="button"><fmt:message key="button.version.create"/></a>
     2.8 +    <a href="./projects/versions/edit?vid=-1" class="button"><fmt:message key="button.version.create"/></a>
     2.9      <a href="./projects/issues/edit?pid=${project.id}" class="button"><fmt:message key="button.issue.create"/></a>
    2.10  </div>
    2.11  
     3.1 --- a/src/main/webapp/WEB-INF/jsp/project-navmenu.jsp	Thu Oct 08 20:16:47 2020 +0200
     3.2 +++ b/src/main/webapp/WEB-INF/jsp/project-navmenu.jsp	Thu Oct 08 20:38:43 2020 +0200
     3.3 @@ -44,6 +44,7 @@
     3.4              </a>
     3.5          </div>
     3.6          <div class="menuEntry level-2">
     3.7 +            <div class="version-icon" style="background: black"></div>
     3.8              <a href="projects/view?pid=${projectInfo.project.id}&vid=-1">
     3.9                  <fmt:message key="menu.versions.unassigned" />
    3.10              </a>
    3.11 @@ -51,6 +52,7 @@
    3.12          <c:forEach var="version" items="${viewmodel.projectInfo.versions}">
    3.13              <c:set var="isVersionActive" value="${viewmodel.versionFilter eq version}" />
    3.14              <div class="menuEntry level-2" <c:if test="${isVersionActive}">data-active</c:if> >
    3.15 +                <div class="version-icon version-${version.status}"></div>
    3.16                  <a href="projects/view?pid=${projectInfo.project.id}&vid=${version.id}">
    3.17                      <c:out value="${version.name}"/>
    3.18                  </a>
     4.1 --- a/src/main/webapp/WEB-INF/jsp/versions.jsp	Thu Oct 08 20:16:47 2020 +0200
     4.2 +++ b/src/main/webapp/WEB-INF/jsp/versions.jsp	Thu Oct 08 20:38:43 2020 +0200
     4.3 @@ -34,7 +34,7 @@
     4.4  <%@include file="../jspf/project-header.jsp"%>
     4.5  
     4.6  <div id="tool-area">
     4.7 -    <a href="./projects/versions/edit" class="button"><fmt:message key="button.version.create"/></a>
     4.8 +    <a href="./projects/versions/edit?vid=-1" class="button"><fmt:message key="button.version.create"/></a>
     4.9      <a href="./projects/issues/edit?pid=${project.id}" class="button"><fmt:message key="button.issue.create"/></a>
    4.10  </div>
    4.11  
    4.12 @@ -46,14 +46,13 @@
    4.13  <table id="version-list" class="datatable medskip fullwidth">
    4.14      <colgroup>
    4.15          <col>
    4.16 -        <col width="20%">
    4.17 -        <col width="20%">
    4.18 -        <col width="10%">
    4.19 -        <col width="10%">
    4.20 -        <col width="10%">
    4.21 -        <col width="10%">
    4.22 -        <col width="10%">
    4.23 -        <col width="10%">
    4.24 +        <col width="28%">
    4.25 +        <col width="12%">
    4.26 +        <col width="12%">
    4.27 +        <col width="12%">
    4.28 +        <col width="12%">
    4.29 +        <col width="12%">
    4.30 +        <col width="12%">
    4.31      </colgroup>
    4.32      <thead>
    4.33      <tr>
    4.34 @@ -68,7 +67,6 @@
    4.35      <tr>
    4.36          <th></th>
    4.37          <th><fmt:message key="version.name"/></th>
    4.38 -        <th><fmt:message key="version.status" /></th>
    4.39          <th class="hcenter"><fmt:message key="issues.open" /></th>
    4.40          <th class="hcenter"><fmt:message key="issues.active" /></th>
    4.41          <th class="hcenter"><fmt:message key="issues.done" /></th>
    4.42 @@ -85,9 +83,9 @@
    4.43                  <a href="projects/view?pid=${viewmodel.projectInfo.project.id}&vid=${versionInfo.version.id}">
    4.44                      <c:out value="${versionInfo.version.name}"/>
    4.45                  </a>
    4.46 -            </td>
    4.47 -            <td>
    4.48 -                <fmt:message key="version.status.${versionInfo.version.status}"/>
    4.49 +                <div class="version-tag version-${versionInfo.version.status}">
    4.50 +                    <c:out value="${versionInfo.version.status}"/>
    4.51 +                </div>
    4.52              </td>
    4.53              <td class="hright">${versionInfo.resolvedTotal.open}</td>
    4.54              <td class="hright">${versionInfo.resolvedTotal.active}</td>
     5.1 --- a/src/main/webapp/projects.css	Thu Oct 08 20:16:47 2020 +0200
     5.2 +++ b/src/main/webapp/projects.css	Thu Oct 08 20:38:43 2020 +0200
     5.3 @@ -65,7 +65,7 @@
     5.4      background: green;
     5.5  }
     5.6  
     5.7 -.issue-tag {
     5.8 +.issue-tag, .version-tag {
     5.9      padding: .1em 2ex .1em 2ex;
    5.10      display: inline-block;
    5.11      box-sizing: border-box;
    5.12 @@ -102,10 +102,36 @@
    5.13  
    5.14  .issue-tag.phase-1 {
    5.15      background: gold;
    5.16 -    color: black;
    5.17  }
    5.18  
    5.19  .issue-tag.phase-2 {
    5.20      background: green;
    5.21  }
    5.22  
    5.23 +div.version-icon {
    5.24 +    display: inline-block;
    5.25 +    width: .5em;
    5.26 +    height: .5em;
    5.27 +    margin-right: .25em;
    5.28 +}
    5.29 +
    5.30 +.version-Future {
    5.31 +    background: lightskyblue;
    5.32 +}
    5.33 +
    5.34 +.version-Unreleased {
    5.35 +    background: steelblue;
    5.36 +}
    5.37 +
    5.38 +.version-Released {
    5.39 +    background: limegreen;
    5.40 +}
    5.41 +
    5.42 +.version-LTS {
    5.43 +    background: gold;
    5.44 +}
    5.45 +
    5.46 +.version-Deprecated {
    5.47 +    color: lightgray;
    5.48 +    background: darkgray;
    5.49 +}

mercurial