Merge branch 'stable-5.1' into antifascista-stable

This commit is contained in:
f 2022-07-16 15:42:34 -03:00
commit 64a3c7e02c
10 changed files with 109 additions and 13 deletions

View file

@ -192,4 +192,4 @@
- Possible race condition causing OTRS import to fail [3765](https://github.com/zammad/zammad/issues/3765) [[bug](https://github.com/zammad/zammad/labels/bug)] [[import](https://github.com/zammad/zammad/labels/import)] - Possible race condition causing OTRS import to fail [3765](https://github.com/zammad/zammad/issues/3765) [[bug](https://github.com/zammad/zammad/labels/bug)] [[import](https://github.com/zammad/zammad/labels/import)]
- Incorrect alignment in the listing of attachments when creating a ticket [3746](https://github.com/zammad/zammad/issues/3746) [[bug](https://github.com/zammad/zammad/labels/bug)] - Incorrect alignment in the listing of attachments when creating a ticket [3746](https://github.com/zammad/zammad/issues/3746) [[bug](https://github.com/zammad/zammad/labels/bug)]
- Saved conditions break on selections without reloading [3758](https://github.com/zammad/zammad/issues/3758) [[bug](https://github.com/zammad/zammad/labels/bug)] [[core workflows](https://github.com/zammad/zammad/labels/core%20workflows)] - Saved conditions break on selections without reloading [3758](https://github.com/zammad/zammad/issues/3758) [[bug](https://github.com/zammad/zammad/labels/bug)] [[core workflows](https://github.com/zammad/zammad/labels/core%20workflows)]
- Misleading view of user icons which are on vacation and disabled [3075](https://github.com/zammad/zammad/issues/3075) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX%2FUI)] [[ticket](https://github.com/zammad/zammad/labels/ticket)] - Misleading view of user icons which are on vacation and disabled [3075](https://github.com/zammad/zammad/issues/3075) [[bug](https://github.com/zammad/zammad/labels/bug)] [[UX/UI](https://github.com/zammad/zammad/labels/UX%2FUI)] [[ticket](https://github.com/zammad/zammad/labels/ticket)]

View file

@ -14,19 +14,23 @@ class App.TicketZoomArticleImageView extends App.ControllerModal
constructor: -> constructor: ->
super super
@unbindAll() @unbindAll()
$(document).on('keydown.image_preview', 'right', (e) => $(document).on('keydown.image_preview', (e) =>
nextElement = @parentElement.closest('.attachment').next('.attachment.attachment--preview') return @nextRight() if e.keyCode is 39 # right
return if nextElement.length is 0 return @nextLeft() if e.keyCode is 37 # left
@close()
nextElement.find('img').trigger('click')
)
$(document).on('keydown.image_preview', 'left', (e) =>
prevElement = @parentElement.closest('.attachment').prev('.attachment.attachment--preview')
return if prevElement.length is 0
@close()
prevElement.find('img').trigger('click')
) )
nextRight: =>
nextElement = @parentElement.closest('.attachment').next('.attachment.attachment--preview')
return if nextElement.length is 0
@close()
nextElement.find('img').trigger('click')
nextLeft: =>
prevElement = @parentElement.closest('.attachment').prev('.attachment.attachment--preview')
return if prevElement.length is 0
@close()
prevElement.find('img').trigger('click')
content: -> content: ->
@image = @image.replace(/view=preview/, 'view=inline') @image = @image.replace(/view=preview/, 'view=inline')
"<div class=\"centered imagePreview\">#{@image}</div>" "<div class=\"centered imagePreview\">#{@image}</div>"

View file

@ -948,7 +948,7 @@ class App.Utils
tmp.find('blockquote').remove() tmp.find('blockquote').remove()
text = tmp.text() text = tmp.text()
matchwords = ['Attachment', 'attachment', 'Attached', 'attached', 'Enclosed', 'enclosed', 'Enclosure', 'enclosure'] matchwords = [__('Attachment'), __('attachment'), __('Attached'), __('attached'), __('Enclosed'), __('enclosed'), __('Enclosure'), __('enclosure')]
for word in matchwords for word in matchwords
# en # en
attachmentTranslatedRegExp = new RegExp("\\W#{word}\\W", 'i') attachmentTranslatedRegExp = new RegExp("\\W#{word}\\W", 'i')

View file

@ -941,11 +941,19 @@ msgstr ""
msgid "At least one user needs to have admin permissions." msgid "At least one user needs to have admin permissions."
msgstr "" msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "Attached"
msgstr ""
#: app/assets/javascripts/app/views/generic/attachments.jst.eco #: app/assets/javascripts/app/views/generic/attachments.jst.eco
#: app/views/knowledge_base/public/answers/show.html.erb #: app/views/knowledge_base/public/answers/show.html.erb
msgid "Attached Files" msgid "Attached Files"
msgstr "" msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "Attachment"
msgstr ""
#: db/seeds/settings.rb #: db/seeds/settings.rb
msgid "Attachment - Search for follow-up also in attachments." msgid "Attachment - Search for follow-up also in attachments."
msgstr "" msgstr ""
@ -3702,6 +3710,14 @@ msgstr ""
msgid "Enables users to create their own account via web interface." msgid "Enables users to create their own account via web interface."
msgstr "" msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "Enclosed"
msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "Enclosure"
msgstr ""
#: app/assets/javascripts/app/views/agent_ticket_create.jst.eco #: app/assets/javascripts/app/views/agent_ticket_create.jst.eco
#: app/assets/javascripts/app/views/ticket_zoom/article_new.jst.eco #: app/assets/javascripts/app/views/ticket_zoom/article_new.jst.eco
msgid "Encrypt" msgid "Encrypt"
@ -10793,6 +10809,14 @@ msgstr ""
msgid "at" msgid "at"
msgstr "" msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "attached"
msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "attachment"
msgstr ""
#: app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee #: app/assets/javascripts/app/controllers/_ui_element/core_workflow_perform.coffee
msgid "auto select" msgid "auto select"
msgstr "" msgstr ""
@ -10969,6 +10993,14 @@ msgstr ""
msgid "email" msgid "email"
msgstr "" msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "enclosed"
msgstr ""
#: app/assets/javascripts/app/lib/app_post/utils.coffee
msgid "enclosure"
msgstr ""
#: app/assets/javascripts/app/models/ticket.coffee #: app/assets/javascripts/app/models/ticket.coffee
msgid "escalated" msgid "escalated"
msgstr "" msgstr ""

View file

@ -349,6 +349,9 @@ class String
string.gsub!(%r{[[:space:]]*(<br(|/)>[[:space:]]*)*\Z}i, '') string.gsub!(%r{[[:space:]]*(<br(|/)>[[:space:]]*)*\Z}i, '')
string.gsub!(%r{(<p></p>){1,10}\Z}i, '') string.gsub!(%r{(<p></p>){1,10}\Z}i, '')
# https://github.com/zammad/zammad/issues/4112
string.gsub!(%r{&lt;!\[if !supportLists\]&gt;.+?&lt;!\[endif\]&gt;}, '• ')
string.signature_identify('html') string.signature_identify('html')
marker_template = '<span class="js-signatureMarker"></span>' marker_template = '<span class="js-signatureMarker"></span>'

BIN
spec/fixtures/files/image/squares.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
spec/fixtures/files/image/squares2.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
spec/fixtures/files/image/squares3.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1430,6 +1430,20 @@ RSpec.describe String do
<li><a href="http://business-catalogs.example.com/ODtpbGs5MWIzbjUyYzExLTA4Yy06Mmg7N3AvL3R0bmFvY3B0LXlhbW9sc2Nhb3NnYy5lL3RpbXJlZi9lbS9ycnJuaWFpZXMsdGxnY25pLGUsdXJ0b3NVTGVpNWZ8fGZh" rel="nofollow noreferrer noopener" target="_blank" title="http://business-catalogs.example.com/ODtpbGs5MWIzbjUyYzExLTA4Yy06Mmg7N3AvL3R0bmFvY3B0LXlhbW9sc2Nhb3NnYy5lL3RpbXJlZi9lbS9ycnJuaWFpZXMsdGxnY25pLGUsdXJ0b3NVTGVpNWZ8fGZh">Luxemburg</a></li> <li><a href="http://business-catalogs.example.com/ODtpbGs5MWIzbjUyYzExLTA4Yy06Mmg7N3AvL3R0bmFvY3B0LXlhbW9sc2Nhb3NnYy5lL3RpbXJlZi9lbS9ycnJuaWFpZXMsdGxnY25pLGUsdXJ0b3NVTGVpNWZ8fGZh" rel="nofollow noreferrer noopener" target="_blank" title="http://business-catalogs.example.com/ODtpbGs5MWIzbjUyYzExLTA4Yy06Mmg7N3AvL3R0bmFvY3B0LXlhbW9sc2Nhb3NnYy5lL3RpbXJlZi9lbS9ycnJuaWFpZXMsdGxnY25pLGUsdXJ0b3NVTGVpNWZ8fGZh">Luxemburg</a></li>
TEXT TEXT
end end
# https://github.com/zammad/zammad/issues/4112
it 'converts lists from MS Outlook correctly' do
expect(<<~HTML.chomp.html2html_strict).to eq(<<~TEXT.chomp)
<p class="MsoPlainText" style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-family:Symbol;mso-fareast-language:EN-US"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="mso-fareast-language:EN-US">1<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-family:Symbol;mso-fareast-language:EN-US"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="mso-fareast-language:EN-US">2<o:p></o:p></span></p>
HTML
<p> 1</p><p>• 2</p>
TEXT
end
end end
context 'signature recognition' do context 'signature recognition' do

View file

@ -0,0 +1,43 @@
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
require 'rails_helper'
RSpec.describe 'Article Image View', type: :system do
describe 'Switching the photos displayed in the preview does not work with the arrow keys #4030' do
let(:ticket) { create(:ticket, group: Group.first) }
let(:article) do
create(:ticket_article, ticket: ticket, attachments: [
{
data: File.read(Rails.root.join('spec/fixtures/files/image/squares.png')),
filename: 'squares.png',
preferences: { 'Content-Type' => 'image/png', 'resizable' => true, 'content_preview' => true },
},
{
data: File.read(Rails.root.join('spec/fixtures/files/image/squares2.png')),
filename: 'squares2.png',
preferences: { 'Content-Type' => 'image/png', 'resizable' => true, 'content_preview' => true },
},
{
data: File.read(Rails.root.join('spec/fixtures/files/image/squares3.png')),
filename: 'squares3.png',
preferences: { 'Content-Type' => 'image/png', 'resizable' => true, 'content_preview' => true },
},
])
end
before do
visit "#ticket/zoom/#{article.ticket.id}"
end
it 'does switch images via arrow keys' do
first('.ticket-article-item .attachment-icon img').click
images = Store.last(3)
wait.until { page.find('div.imagePreview img')[:src].include?("/#{images[0].id}") }
find('body').send_keys :arrow_right
find('body').send_keys :arrow_right
wait.until { page.find('div.imagePreview img')[:src].include?("/#{images[2].id}") }
find('body').send_keys :arrow_left
wait.until { page.find('div.imagePreview img')[:src].include?("/#{images[1].id}") }
end
end
end