Commit 80915c35 authored by Gabriel Gizotti's avatar Gabriel Gizotti

diplays mentioned but not merged message on MR show page

parent 1a8f43ff
......@@ -59,6 +59,17 @@ module MergeRequestsHelper
@mr_closes_issues ||= @merge_request.closes_issues
end
def mr_issues_mentioned_but_not_closing
@mr_issues_mentioned_but_not_closing ||= @merge_request.issues_mentioned_but_not_closing
end
def mr_issues_mentioned_but_not_closing_message
verb = mr_issues_mentioned_but_not_closing.size > 1 ? 'are' : 'is'
issue_text = 'issue'.pluralize(mr_issues_mentioned_but_not_closing.size)
"The following #{issue_text} #{verb} mentioned but not being closed:"
end
def mr_change_branches_path(merge_request)
new_namespace_project_merge_request_path(
@project.namespace, @project,
......
......@@ -30,6 +30,15 @@
- elsif @merge_request.can_be_merged? || resolved_conflicts
= render 'projects/merge_requests/widget/open/accept'
- if mr_issues_mentioned_but_not_closing.present?
.mr-widget-footer
%span
%i.fa.fa-warning
= mr_issues_mentioned_but_not_closing_message
= succeed '.' do
!= markdown issues_sentence(mr_issues_mentioned_but_not_closing), pipeline: :gfm, author: @merge_request.author
= mr_assign_issues_link
- if mr_closes_issues.present?
.mr-widget-footer
%span
......
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