Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
240d94f4
Commit
240d94f4
authored
Mar 16, 2021
by
David Kim
Committed by
Sean McGivern
Mar 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reviewers detail to add merge request approver email
parent
b8b97284
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
17 deletions
+37
-17
ee/app/views/notify/add_merge_request_approver_email.html.haml
...p/views/notify/add_merge_request_approver_email.html.haml
+13
-13
ee/app/views/notify/add_merge_request_approver_email.text.erb
...pp/views/notify/add_merge_request_approver_email.text.erb
+1
-0
ee/changelogs/unreleased/300750-add-missing-reviewers-information-to-add_merge_request_approver_em.yml
...eviewers-information-to-add_merge_request_approver_em.yml
+5
-0
ee/spec/mailers/ee/emails/merge_requests_spec.rb
ee/spec/mailers/ee/emails/merge_requests_spec.rb
+18
-4
No files found.
ee/app/views/notify/add_merge_request_approver_email.html.haml
View file @
240d94f4
-
if
Gitlab
::
CurrentSettings
.
email_author_in_body
-
if
Gitlab
::
CurrentSettings
.
email_author_in_body
%div
%div
#{
link_to
@updated_by
.
name
,
user_url
(
@updated_by
)
}
added you as an approver for:
#{
link_to
@updated_by
.
name
,
user_url
(
@updated_by
)
}
added you as an approver for:
%p
.details
%p
=
merge_path_description
(
@merge_request
,
'→'
)
.details
=
merge_path_description
(
@merge_request
,
'→'
)
-
if
@merge_request
.
assignees
.
any?
.author
%p
Author:
#{
sanitize_name
(
@merge_request
.
author_name
)
}
-
label
=
assignees_label
(
@merge_request
,
include_value:
false
)
.assignee
-
author_name
=
sanitize_name
(
@merge_request
.
author_name
)
=
assignees_label
(
@merge_request
)
-
assignee_list
=
sanitize_name
(
@merge_request
.
assignee_list
)
.reviewer
=
reviewers_label
(
@merge_request
)
"
#{
label
}
:
#{
author_name
}
→
#{
assignee_list
}
"
.approvers
=
render
'notify/merge_request_approvers'
,
presenter:
@mr_presenter
=
render_if_exists
'notify/merge_request_approvers'
,
presenter:
@mr_presenter
-
if
@merge_request
.
description
-
if
@merge_request
.
description
=
markdown
(
@merge_request
.
description
,
pipeline: :email
,
author:
@merge_request
.
author
)
%div
=
markdown
(
@merge_request
.
description
,
pipeline: :email
,
author:
@merge_request
.
author
)
ee/app/views/notify/add_merge_request_approver_email.text.erb
View file @
240d94f4
...
@@ -5,4 +5,5 @@
...
@@ -5,4 +5,5 @@
<%=
merge_path_description
(
@merge_request
,
'to'
)
%>
<%=
merge_path_description
(
@merge_request
,
'to'
)
%>
Author:
<%=
sanitize_name
(
@merge_request
.
author_name
)
%>
Author:
<%=
sanitize_name
(
@merge_request
.
author_name
)
%>
<%=
assignees_label
(
@merge_request
)
%>
<%=
assignees_label
(
@merge_request
)
%>
<%=
reviewers_label
(
@merge_request
)
%>
<%=
render_if_exists
'notify/merge_request_approvers'
,
presenter:
@mr_presenter
%>
<%=
render_if_exists
'notify/merge_request_approvers'
,
presenter:
@mr_presenter
%>
ee/changelogs/unreleased/300750-add-missing-reviewers-information-to-add_merge_request_approver_em.yml
0 → 100644
View file @
240d94f4
---
title
:
Add reviewers detail to add merge request approver email
merge_request
:
56466
author
:
type
:
added
ee/spec/mailers/ee/emails/merge_requests_spec.rb
View file @
240d94f4
...
@@ -17,18 +17,32 @@ RSpec.describe EE::Emails::MergeRequests do
...
@@ -17,18 +17,32 @@ RSpec.describe EE::Emails::MergeRequests do
subject
{
Notify
.
add_merge_request_approver_email
(
recipient
.
id
,
merge_request
.
id
,
current_user
.
id
)
}
subject
{
Notify
.
add_merge_request_approver_email
(
recipient
.
id
,
merge_request
.
id
,
current_user
.
id
)
}
context
'when email_author_in_body is set'
do
context
'when email_author_in_body is set'
do
it
'
includes
the name of the person who added the approver'
do
it
'
has the correct body with
the name of the person who added the approver'
do
stub_application_setting
(
email_author_in_body:
true
)
stub_application_setting
(
email_author_in_body:
true
)
expect
(
subject
).
to
have_body_text
(
current_user
.
name
)
aggregate_failures
do
is_expected
.
to
have_body_text
(
current_user
.
name
)
is_expected
.
to
have_body_text
(
'added you as an approver'
)
is_expected
.
to
have_text_part_content
(
assignee
.
name
)
is_expected
.
to
have_html_part_content
(
assignee
.
name
)
is_expected
.
to
have_text_part_content
(
reviewer
.
name
)
is_expected
.
to
have_html_part_content
(
reviewer
.
name
)
end
end
end
end
end
context
'when email_author_in_body is not set'
do
context
'when email_author_in_body is not set'
do
it
'
does not include
the name of the person who added the approver'
do
it
'
has the correct body without
the name of the person who added the approver'
do
stub_application_setting
(
email_author_in_body:
false
)
stub_application_setting
(
email_author_in_body:
false
)
expect
(
subject
).
not_to
have_body_text
(
current_user
.
name
)
aggregate_failures
do
is_expected
.
not_to
have_body_text
(
current_user
.
name
)
is_expected
.
not_to
have_body_text
(
'added you as an approver'
)
is_expected
.
to
have_text_part_content
(
assignee
.
name
)
is_expected
.
to
have_html_part_content
(
assignee
.
name
)
is_expected
.
to
have_text_part_content
(
reviewer
.
name
)
is_expected
.
to
have_html_part_content
(
reviewer
.
name
)
end
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment