doortts doortts 2018-02-08
organization: Complement pull request group view
This commit complements f8ed345 which support listing
whole pull request list in the group menu.

Now, "Closed" tab works.

See: Yona Github issue #320
@ea2e3ab42bd991cd4d9306fe917338fd88b2e29b
app/controllers/OrganizationApp.java
--- app/controllers/OrganizationApp.java
+++ app/controllers/OrganizationApp.java
@@ -1,8 +1,9 @@
 /**
- * Yona, Project Hosting SW
- *
- * Copyright 2017 the original author or authors.
- */
+ * Yona, 21st Century Project Hosting SW
+ * <p>
+ * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
+ * https://yona.io
+ **/
 package controllers;
 
 import com.avaje.ebean.ExpressionList;
@@ -68,6 +69,10 @@
         return ok(group_pullrequest_list.render("title.pullrequest",  organization, page, condition, category));
     }
 
+    @AnonymousCheck(requiresLogin = false, displaysFlashMessage = true)
+    public static Result organizationClosedPullRequests(String organizationName) {
+        return organizationPullRequests(organizationName, "closed");
+    }
 
     /**
      * show New Group page
app/views/organization/group_pullrequest_list.scala.html
--- app/views/organization/group_pullrequest_list.scala.html
+++ app/views/organization/group_pullrequest_list.scala.html
@@ -17,7 +17,7 @@
 @searchFormAction(category: Category) = @{
     category match {
         case Category.CLOSED => {
-            routes.OrganizationApp.organizationPullRequests(organization.name, "closed")
+            routes.OrganizationApp.organizationClosedPullRequests(organization.name)
         }
         case Category.OPEN => {
             routes.OrganizationApp.organizationPullRequests(organization.name, "open")
conf/routes
--- conf/routes
+++ conf/routes
@@ -80,6 +80,7 @@
 GET            /organizations/:organizationName/issues                                controllers.IssueApp.organizationIssues(organizationName: String, state:String ?= "", format:String ?= "html", pageNum: Int ?= 1)
 GET            /organizations/:organizationName/boards                                controllers.BoardApp.organizationBoards(organizationName: String, pageNum: Int ?= 1)
 GET            /organizations/:organizationName/pullrequests                          controllers.OrganizationApp.organizationPullRequests(organizationName: String, category: String ?= "open")
+GET            /organizations/:organizationName/closedPullrequests                    controllers.OrganizationApp.organizationClosedPullRequests(organizationName: String)
 GET            /organizations/:organizationName/settingform                           controllers.OrganizationApp.settingForm(organizationName: String)
 GET            /organizations/:organizationName/deleteForm                            controllers.OrganizationApp.deleteForm(organizationName: String)
 DELETE         /organizations/:organizationName                                       controllers.OrganizationApp.deleteOrganization(organizationName: String)
Add a comment
List