Improved quote line, reduced length by removing email address.

This commit is contained in:
Martin Edenhofer 2018-09-25 15:27:54 +02:00
parent 280ab7471f
commit cff3dba0a8
3 changed files with 7 additions and 3 deletions

View file

@ -152,7 +152,7 @@ class EmailReply extends App.Controller
date = @date_format(article.created_at) date = @date_format(article.created_at)
name = article.updated_by.displayName() name = article.updated_by.displayName()
email = article.updated_by.email email = article.updated_by.email
quote_header = App.i18n.translateInline('On %s, %s <%s> wrote:', date, name, email) quote_header = App.i18n.translateInline('On %s, %s wrote:', date, name)
selected = "<div><br><br/></div><div><blockquote type=\'cite\'>#{quote_header}<br><br>#{selected}<br></blockquote></div><div><br></div>" selected = "<div><br><br/></div><div><blockquote type=\'cite\'>#{quote_header}<br><br>#{selected}<br></blockquote></div><div><br></div>"
# add selected text to body # add selected text to body

View file

@ -125,7 +125,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
full_text = @browser.find_element(css: '.content.active .article-new .articleNewEdit-body').text full_text = @browser.find_element(css: '.content.active .article-new .articleNewEdit-body').text
match = full_text.match(/\nOn (.*?) Nicole Braun <nicole\.braun@zammad\.org> wrote:/) match = full_text.match(/\nOn (.*?) Nicole Braun wrote:/)
assert match assert match
assert match[1] assert match[1]
assert Time.zone.parse(match[1]) assert Time.zone.parse(match[1])

View file

@ -32,8 +32,12 @@ File.write('test/data/mail/mailXXX.yml', Channel::EmailParser.new.parse(File.rea
parsed_msg = m[:parsed].slice(*expected_msg.keys) parsed_msg = m[:parsed].slice(*expected_msg.keys)
expected_msg.each do |key, value| expected_msg.each do |key, value|
if value.nil?
assert_nil(parsed_msg[key], "parsed message data does not match test/data/mail/#{m[:source]}: #{key}")
else
assert_equal(value, parsed_msg[key], "parsed message data does not match test/data/mail/#{m[:source]}: #{key}") assert_equal(value, parsed_msg[key], "parsed message data does not match test/data/mail/#{m[:source]}: #{key}")
end end
end
# assert: attachments in parsed message hash match metadata in raw hash # assert: attachments in parsed message hash match metadata in raw hash
next if m[:content][:attachments].blank? next if m[:content][:attachments].blank?