Commit 72232d35 authored by Andy Steele's avatar Andy Steele Committed by Nick Thomas

Display Merge Request approval counts in Merge Request list

parent ccf14b48
...@@ -200,3 +200,5 @@ module IssuableCollections ...@@ -200,3 +200,5 @@ module IssuableCollections
end end
end end
end end
IssuableCollections.prepend(EE::IssuableCollections)
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
- if merge_request.assignee - if merge_request.assignee
%li %li
= link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: _('Assigned to :name')) = link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: _('Assigned to :name'))
= render_if_exists 'projects/merge_requests/approvals_count', merge_request: merge_request
= render 'shared/issuable_meta_data', issuable: merge_request = render 'shared/issuable_meta_data', issuable: merge_request
......
# frozen_string_literal: true
module EE
module IssuableCollections
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
override :preload_for_collection
def preload_for_collection
@preload_for_collection ||= case collection_type
when 'MergeRequest'
super.push(:approvals)
else
super
end
end
end
end
...@@ -19,6 +19,10 @@ module Approvable ...@@ -19,6 +19,10 @@ module Approvable
approvals_left < 1 approvals_left < 1
end end
def approvals_given
approvals.size
end
# Number of approvals remaining (excluding existing approvals) before the MR is # Number of approvals remaining (excluding existing approvals) before the MR is
# considered approved. If there are fewer potential approvers than approvals left, # considered approved. If there are fewer potential approvers than approvals left,
# users should either reduce the number of approvers on projects and/or merge # users should either reduce the number of approvers on projects and/or merge
......
- if merge_request.approval_needed?
%li.d-none.d-sm-inline-block.has-tooltip{ title: _('Approvals'), class: ('text-success' if merge_request.approved?) }
= sprite_icon('approval', size: 16, css_class: 'align-middle')
= merge_request.approvals_given
&nbsp;of&nbsp;
= merge_request.approvals_required
---
title: Shows the approval given/required counts and its status for each MR when
viewing the Merge Requests page
merge_request: 9142
author: Glavin Wiechert, Andy Steele
type: added
...@@ -892,6 +892,9 @@ msgstr "" ...@@ -892,6 +892,9 @@ msgstr ""
msgid "Apply suggestion" msgid "Apply suggestion"
msgstr "" msgstr ""
msgid "Approvals"
msgstr ""
msgid "Approvals required" msgid "Approvals required"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment