Commit 6a3c3456 authored by Ethan Urie's avatar Ethan Urie

Merge branch '355027-optimize-new-reivew-mail' into 'master'

Do not include highlighted_diff_email css for each note for new review email

See merge request gitlab-org/gitlab!83385
parents d03b31ee 6c1276db
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- diff_limit = local_assigns.fetch(:diff_limit, nil) - diff_limit = local_assigns.fetch(:diff_limit, nil)
- target_url = local_assigns.fetch(:target_url, @target_url) - target_url = local_assigns.fetch(:target_url, @target_url)
- note_style = local_assigns.fetch(:note_style, "") - note_style = local_assigns.fetch(:note_style, "")
- skip_stylesheet_link = local_assigns.fetch(:skip_stylesheet_link, false)
- discussion = note.discussion if note.part_of_discussion? - discussion = note.discussion if note.part_of_discussion?
...@@ -22,8 +23,9 @@ ...@@ -22,8 +23,9 @@
= link_to 'discussion', target_url = link_to 'discussion', target_url
- if discussion&.diff_discussion? && discussion.on_text? - if discussion&.diff_discussion? && discussion.on_text?
= content_for :head do - unless skip_stylesheet_link
= stylesheet_link_tag 'mailers/highlighted_diff_email' = content_for :head do
= stylesheet_link_tag 'mailers/highlighted_diff_email'
%table.code %table.code
= render partial: "projects/diffs/email_line", = render partial: "projects/diffs/email_line",
......
= content_for :head do
= stylesheet_link_tag 'mailers/highlighted_diff_email'
%table{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:100%;margin:0 auto;border-collapse:separate;border-spacing:0;" } %table{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:100%;margin:0 auto;border-collapse:separate;border-spacing:0;" }
%tbody %tbody
%tr %tr
...@@ -13,4 +16,4 @@ ...@@ -13,4 +16,4 @@
%td{ style: "overflow:hidden;font-size:14px;line-height:1.4;display:grid;" } %td{ style: "overflow:hidden;font-size:14px;line-height:1.4;display:grid;" }
- @notes.each do |note| - @notes.each do |note|
- target_url = project_merge_request_url(@project, @merge_request, anchor: "note_#{note.id}") - 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, note_style: "border-bottom:1px solid #ededed;" = render 'note_email', note: note, diff_limit: 3, target_url: target_url, note_style: "border-bottom:1px solid #ededed;", skip_stylesheet_link: true
...@@ -2189,6 +2189,10 @@ RSpec.describe Notify do ...@@ -2189,6 +2189,10 @@ RSpec.describe Notify do
) )
end end
end end
it 'includes only one link to the highlighted_diff_email' do
expect(subject.html_part.body.raw_source).to include('assets/mailers/highlighted_diff_email').once
end
end end
it 'contains review author name' do it 'contains review author name' do
......
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