summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Gizotti <gabriel@gizotti.com>2016-11-24 19:21:27 +1000
committerGabriel Gizotti <gabriel@gizotti.com>2016-12-16 19:13:17 +1000
commit80915c35f48463c3a983129961f3130bd9703754 (patch)
tree11d4711726678939b02102c185c3410ccfa17c8b
parent1a8f43ff3e5481d65f547ac01c03e2d64e14fff0 (diff)
downloadgitlab-ce-80915c35f48463c3a983129961f3130bd9703754.tar.gz
diplays mentioned but not merged message on MR show page
-rw-r--r--app/helpers/merge_requests_helper.rb11
-rw-r--r--app/views/projects/merge_requests/widget/_open.html.haml9
2 files changed, 20 insertions, 0 deletions
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
index a6659ea2fd1..dcd35dc6282 100644
--- a/app/helpers/merge_requests_helper.rb
+++ b/app/helpers/merge_requests_helper.rb
@@ -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,
diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml
index eee711dc5af..1f794cad663 100644
--- a/app/views/projects/merge_requests/widget/_open.html.haml
+++ b/app/views/projects/merge_requests/widget/_open.html.haml
@@ -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