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
0d3a50a5
Commit
0d3a50a5
authored
Mar 25, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display link to review note in text email
similar with HTML email
parent
5e76abf4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
app/views/notify/_note_email.text.erb
app/views/notify/_note_email.text.erb
+4
-0
ee/app/views/notify/new_review_email.text.erb
ee/app/views/notify/new_review_email.text.erb
+2
-1
ee/changelogs/unreleased/10220-link-to-note-from-email.yml
ee/changelogs/unreleased/10220-link-to-note-from-email.yml
+5
-0
ee/spec/mailers/notify_spec.rb
ee/spec/mailers/notify_spec.rb
+15
-2
No files found.
app/views/notify/_note_email.text.erb
View file @
0d3a50a5
<%
note
=
local_assigns
.
fetch
(
:note
,
@note
)
-%>
<%
diff_limit
=
local_assigns
.
fetch
(
:diff_limit
,
nil
)
-%>
<%
target_url
=
local_assigns
.
fetch
(
:target_url
,
@target_url
)
-%>
<%
discussion
=
note
.
discussion
if
note
.
part_of_discussion?
-%>
<%
if
discussion
&&
!
discussion
.
individual_note?
-%>
...
...
@@ -13,6 +14,9 @@
<%=
" on
#{
discussion
.
file_path
}
"
-%>
<%
end
-%>
<%=
":"
-%>
<%
if
discussion
.
diff_discussion?
||
!
discussion
.
new_discussion?
-%>
<%=
"
#{
target_url
}
"
-%>
<%
end
-%>
<%
elsif
Gitlab
::
CurrentSettings
.
email_author_in_body
-%>
...
...
ee/app/views/notify/new_review_email.text.erb
View file @
0d3a50a5
...
...
@@ -2,7 +2,8 @@
--
<%
@notes
.
each_with_index
do
|
note
,
index
|
%>
<%=
render
'note_email'
,
note:
note
,
diff_limit:
3
%>
<%
target_url
=
project_merge_request_url
(
@project
,
@merge_request
,
anchor:
"note_
#{
note
.
id
}
"
)
%>
<%=
render
'note_email'
,
note:
note
,
diff_limit:
3
,
target_url:
target_url
%>
<%
if
index
!=
@notes
.
length
-
1
%>
--
...
...
ee/changelogs/unreleased/10220-link-to-note-from-email.yml
0 → 100644
View file @
0d3a50a5
---
title
:
Display link to review note in text email, similar to HTML email
merge_request
:
10401
author
:
type
:
changed
ee/spec/mailers/notify_spec.rb
View file @
0d3a50a5
...
...
@@ -278,8 +278,8 @@ describe Notify do
end
describe
'merge request reviews'
do
let
(
:review
)
{
create
(
:review
,
project:
project
,
merge_request:
merge_request
)
}
let
(
:notes
)
{
create_list
(
:notes
,
3
,
review:
review
,
project:
project
,
author:
review
.
author
,
noteable:
merge_request
)
}
let
!
(
:review
)
{
create
(
:review
,
project:
project
,
merge_request:
merge_request
)
}
let
!
(
:notes
)
{
create_list
(
:note
,
3
,
review:
review
,
project:
project
,
author:
review
.
author
,
noteable:
merge_request
)
}
subject
{
described_class
.
new_review_email
(
recipient
.
id
,
review
.
id
)
}
...
...
@@ -305,6 +305,19 @@ describe Notify do
end
end
context
'when diff note'
do
let!
(
:notes
)
{
create_list
(
:diff_note_on_merge_request
,
3
,
review:
review
,
project:
project
,
author:
review
.
author
,
noteable:
merge_request
)
}
it
'links to notes'
do
review
.
notes
.
each
do
|
note
|
# Text part
expect
(
subject
.
text_part
.
body
.
raw_source
).
to
include
(
project_merge_request_url
(
project
,
merge_request
,
anchor:
"note_
#{
note
.
id
}
"
)
)
end
end
end
it
'contains review author name'
do
is_expected
.
to
have_body_text
review
.
author_name
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