src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java

changeset 70
821c4950b619
parent 68
ded1b5639bd3
child 71
dca186d3911f
     1.1 --- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Tue May 19 18:49:48 2020 +0200
     1.2 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java	Tue May 19 19:34:57 2020 +0200
     1.3 @@ -74,12 +74,6 @@
     1.4      }
     1.5  
     1.6      @RequestMapping(method = HttpMethod.GET)
     1.7 -    public ResponseType indexRedirect(HttpServletResponse resp) throws IOException {
     1.8 -        resp.sendRedirect("index/");
     1.9 -        return ResponseType.NONE;
    1.10 -    }
    1.11 -
    1.12 -    @RequestMapping(requestPath = "index", method = HttpMethod.GET, menuKey = "menu.index")
    1.13      public ResponseType index(HttpServletRequest req, DataAccessObjects dao) throws SQLException {
    1.14  
    1.15          final var projectList = dao.getProjectDao().list();
    1.16 @@ -120,7 +114,7 @@
    1.17  
    1.18              dao.getProjectDao().saveOrUpdate(project);
    1.19  
    1.20 -            setRedirectLocation(req, "./projects/index/");
    1.21 +            setRedirectLocation(req, "./projects/");
    1.22              setDynamicFragment(req, Constants.DYN_FRAGMENT_COMMIT_SUCCESSFUL);
    1.23              LOG.debug("Successfully updated project {}", project.getName());
    1.24          } catch (NoSuchElementException | NumberFormatException | SQLException ex) {
    1.25 @@ -135,8 +129,8 @@
    1.26          return ResponseType.HTML;
    1.27      }
    1.28  
    1.29 -    @RequestMapping(requestPath = "versions", method = HttpMethod.GET, menuKey = "menu.versions")
    1.30 -    public ResponseType versions(HttpServletRequest req, HttpServletResponse resp, DataAccessObjects dao) throws IOException, SQLException {
    1.31 +    @RequestMapping(requestPath = "view", method = HttpMethod.GET)
    1.32 +    public ResponseType view(HttpServletRequest req, HttpServletResponse resp, DataAccessObjects dao) throws IOException, SQLException {
    1.33          final var selectedProject = getSelectedProject(req, dao);
    1.34          if (selectedProject == null) {
    1.35              resp.sendError(HttpServletResponse.SC_FORBIDDEN);
    1.36 @@ -144,7 +138,9 @@
    1.37          }
    1.38  
    1.39          req.setAttribute("versions", dao.getVersionDao().list(selectedProject));
    1.40 -        setDynamicFragment(req, "versions");
    1.41 +        req.setAttribute("issues", dao.getIssueDao().list(selectedProject));
    1.42 +
    1.43 +        setDynamicFragment(req, "project-details");
    1.44  
    1.45          return ResponseType.HTML;
    1.46      }
    1.47 @@ -197,21 +193,6 @@
    1.48          return ResponseType.HTML;
    1.49      }
    1.50  
    1.51 -
    1.52 -    @RequestMapping(requestPath = "issues", method = HttpMethod.GET, menuKey = "menu.issues")
    1.53 -    public ResponseType issues(HttpServletRequest req, HttpServletResponse resp, DataAccessObjects dao) throws IOException, SQLException {
    1.54 -        final var selectedProject = getSelectedProject(req, dao);
    1.55 -        if (selectedProject == null) {
    1.56 -            resp.sendError(HttpServletResponse.SC_FORBIDDEN);
    1.57 -            return ResponseType.NONE;
    1.58 -        }
    1.59 -
    1.60 -        req.setAttribute("issues", dao.getVersionDao().list(selectedProject));
    1.61 -        setDynamicFragment(req, "issues");
    1.62 -
    1.63 -        return ResponseType.HTML;
    1.64 -    }
    1.65 -
    1.66      @RequestMapping(requestPath = "issues/edit", method = HttpMethod.GET)
    1.67      public ResponseType editIssue(HttpServletRequest req, HttpServletResponse resp, DataAccessObjects dao) throws IOException, SQLException {
    1.68          final var selectedProject = getSelectedProject(req, dao);

mercurial