summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorJeff Stubler <brunsa2@gmail.com>2017-01-08 17:09:00 -0600
committerJeff Stubler <brunsa2@gmail.com>2018-02-13 07:47:09 -0600
commit9abbe3cc860f5838df76405e59830efdacb07047 (patch)
treedcdb5b75689d3feca4f760f91e0fde084f37f2cd /app/services
parent5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff)
downloadgitlab-ce-9abbe3cc860f5838df76405e59830efdacb07047.tar.gz
Change issue show page to group MRs by projects and namespaces
Closes #26466.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/issues/fetch_referenced_merge_requests_service.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/issues/fetch_referenced_merge_requests_service.rb b/app/services/issues/fetch_referenced_merge_requests_service.rb
new file mode 100644
index 00000000000..39c8ded9df4
--- /dev/null
+++ b/app/services/issues/fetch_referenced_merge_requests_service.rb
@@ -0,0 +1,12 @@
+module Issues
+ class FetchReferencedMergeRequestsService < Issues::BaseService
+ def execute(issue)
+ referenced_merge_requests = issue.referenced_merge_requests(current_user)
+ referenced_merge_requests = Gitlab::IssuableSorter.sort(project, referenced_merge_requests) { |i| i.iid.to_s }
+ closed_by_merge_requests = issue.closed_by_merge_requests(current_user)
+ closed_by_merge_requests = Gitlab::IssuableSorter.sort(project, closed_by_merge_requests) { |i| i.iid.to_s }
+
+ [referenced_merge_requests, closed_by_merge_requests]
+ end
+ end
+end