summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2016-11-27 11:33:15 +0100
committerjacopo-beschi-intersail <jacopo.beschi@intersail.it>2016-12-05 18:06:36 +0100
commit4d26ab28a955885cfe8ae08917395cc7fc252ebf (patch)
tree145986b6be738530d967864ae1ae981eccc16463 /app/finders
parent90c0f610e29976608dbfeeb63bc4763982c5dbc3 (diff)
downloadgitlab-ce-4d26ab28a955885cfe8ae08917395cc7fc252ebf.tar.gz
Fix Archived project merge requests add to group's Merge Requests
counter This is done by: - Extending the IssuableFinder adding the non_archived option to the params - Overriding the #filter_params in the MergeRequestsAction - Passing the non_archived param in the nav/_group.html.haml navbar partial from the groups/merge_requests.html.haml
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb6
-rw-r--r--app/finders/merge_requests_finder.rb1
2 files changed, 7 insertions, 0 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 001c83ccb4b..7cf75cd6fc7 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -15,6 +15,7 @@
# search: string
# label_name: string
# sort: string
+# non_archived: boolean
#
class IssuableFinder
NONE = '0'
@@ -38,6 +39,7 @@ class IssuableFinder
items = by_author(items)
items = by_label(items)
items = by_due_date(items)
+ items = by_non_archived(items)
sort(items)
end
@@ -353,6 +355,10 @@ class IssuableFinder
end
end
+ def by_non_archived(items)
+ params[:non_archived].present? ? items.non_archived : items
+ end
+
def current_user_related?
params[:scope] == 'created-by-me' || params[:scope] == 'authored' || params[:scope] == 'assigned-to-me'
end
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb
index 3b254e7d9d5..8b82255445e 100644
--- a/app/finders/merge_requests_finder.rb
+++ b/app/finders/merge_requests_finder.rb
@@ -14,6 +14,7 @@
# search: string
# label_name: string
# sort: string
+# non_archived: boolean
#
class MergeRequestsFinder < IssuableFinder
def klass