diplays mentioned but not merged message on MR show page
This commit is contained in:
parent
1a8f43ff3e
commit
80915c35f4
2 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue