Merge branch 'develop' of git.znuny.com:zammad/zammad into develop
This commit is contained in:
commit
cd0a6fe596
5 changed files with 68 additions and 16 deletions
|
@ -33,6 +33,7 @@ class App.TicketCreate extends App.Controller
|
|||
@bind('ui:rerender', =>
|
||||
return if !@authenticateCheck()
|
||||
@renderQueue()
|
||||
@tokanice()
|
||||
)
|
||||
|
||||
# listen to rerender sidebars
|
||||
|
@ -55,6 +56,7 @@ class App.TicketCreate extends App.Controller
|
|||
changeFormType: (e) =>
|
||||
type = $(e.currentTarget).data('type')
|
||||
@setFormTypeInUi(type)
|
||||
@tokanice()
|
||||
|
||||
setFormTypeInUi: (type) =>
|
||||
|
||||
|
@ -347,6 +349,11 @@ class App.TicketCreate extends App.Controller
|
|||
# update taskbar with new meta data
|
||||
App.TaskManager.touch(@taskKey)
|
||||
|
||||
@tokanice()
|
||||
|
||||
tokanice: ->
|
||||
App.Utils.tokaniceEmails('.content.active input[name=cc]')
|
||||
|
||||
localUserInfo: (e) =>
|
||||
return if !@sidebarWidget
|
||||
params = App.ControllerForm.params($(e.target).closest('form'))
|
||||
|
|
|
@ -103,22 +103,7 @@ class App.TicketZoomArticleNew extends App.Controller
|
|||
)
|
||||
|
||||
tokanice: ->
|
||||
source = "#{App.Config.get('api_path')}/users/search"
|
||||
a = ->
|
||||
$('.content.active .js-to, .js-cc, js-bcc').tokenfield(
|
||||
createTokensOnBlur: true
|
||||
autocomplete: {
|
||||
source: source
|
||||
minLength: 2
|
||||
},
|
||||
).on('tokenfield:createtoken', (e) ->
|
||||
if !e.attrs.value.match(/@/) || e.attrs.value.match(/\s/)
|
||||
e.preventDefault()
|
||||
return false
|
||||
e.attrs.label = e.attrs.value
|
||||
true
|
||||
)
|
||||
App.Delay.set(a, 500, undefined, 'tags')
|
||||
App.Utils.tokaniceEmails('.content.active .js-to, .js-cc, js-bcc')
|
||||
|
||||
setPossibleArticleTypes: =>
|
||||
@articleTypes = []
|
||||
|
|
|
@ -1060,3 +1060,23 @@ class App.Utils
|
|||
articleNew.cc = addAddresses(article.cc, articleNew.cc)
|
||||
|
||||
articleNew
|
||||
|
||||
# apply email token field with autocompletion
|
||||
@tokaniceEmails: (selector) ->
|
||||
source = "#{App.Config.get('api_path')}/users/search"
|
||||
a = ->
|
||||
$(selector).tokenfield(
|
||||
createTokensOnBlur: true
|
||||
autocomplete: {
|
||||
source: source
|
||||
minLength: 2
|
||||
},
|
||||
).on('tokenfield:createtoken', (e) ->
|
||||
if !e.attrs.value.match(/@/) || e.attrs.value.match(/\s/)
|
||||
e.preventDefault()
|
||||
return false
|
||||
e.attrs.label = e.attrs.value
|
||||
true
|
||||
)
|
||||
App.Delay.set(a, 500, undefined, 'tags')
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ if [ "$LEVEL" == '1' ]; then
|
|||
# test/browser/agent_organization_profile_test.rb
|
||||
rm test/browser/agent_ticket_attachment_test.rb
|
||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||
rm test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||
rm test/browser/agent_ticket_create_template_test.rb
|
||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||
|
@ -89,6 +90,7 @@ elif [ "$LEVEL" == '2' ]; then
|
|||
rm test/browser/agent_organization_profile_test.rb
|
||||
rm test/browser/agent_ticket_attachment_test.rb
|
||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||
rm test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||
rm test/browser/agent_ticket_create_template_test.rb
|
||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||
|
@ -155,6 +157,7 @@ elif [ "$LEVEL" == '3' ]; then
|
|||
rm test/browser/agent_organization_profile_test.rb
|
||||
# test/browser/agent_ticket_attachment_test.rb
|
||||
# test/browser/agent_ticket_auto_assignment_test.rb
|
||||
#rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||
# test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||
# test/browser/agent_ticket_create_template_test.rb
|
||||
# test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||
|
@ -221,6 +224,7 @@ elif [ "$LEVEL" == '4' ]; then
|
|||
rm test/browser/agent_organization_profile_test.rb
|
||||
rm test/browser/agent_ticket_attachment_test.rb
|
||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||
rm test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||
rm test/browser/agent_ticket_create_template_test.rb
|
||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||
|
@ -286,6 +290,7 @@ elif [ "$LEVEL" == '5' ]; then
|
|||
rm test/browser/agent_organization_profile_test.rb
|
||||
rm test/browser/agent_ticket_attachment_test.rb
|
||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||
rm test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||
rm test/browser/agent_ticket_create_template_test.rb
|
||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||
|
@ -354,6 +359,7 @@ elif [ "$LEVEL" == '6' ]; then
|
|||
rm test/browser/agent_organization_profile_test.rb
|
||||
rm test/browser/agent_ticket_attachment_test.rb
|
||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||
rm test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||
rm test/browser/agent_ticket_create_template_test.rb
|
||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||
|
|
34
test/browser/agent_ticket_create_cc_tokenizer_test.rb
Normal file
34
test/browser/agent_ticket_create_cc_tokenizer_test.rb
Normal file
|
@ -0,0 +1,34 @@
|
|||
require 'browser_test_helper'
|
||||
|
||||
# Regression test for UI bugfix
|
||||
# https://github.com/zammad/zammad/issues/1990
|
||||
#
|
||||
# Ensure that CC field when creating a new ticket is autocompleting user emails
|
||||
|
||||
class AgentTicketCreateResetCustomerSelectionTest < TestCase
|
||||
def test_tokenizer
|
||||
@browser = browser_instance
|
||||
|
||||
login(
|
||||
username: 'agent1@example.com',
|
||||
password: 'test',
|
||||
url: browser_url,
|
||||
)
|
||||
tasks_close_all()
|
||||
|
||||
click(
|
||||
css: 'a[href="#ticket/create"]'
|
||||
)
|
||||
|
||||
@browser.find_element(:css, 'li[data-type=email-out]').click
|
||||
|
||||
elem = @browser.find_element(:name, 'cc')
|
||||
elem.send_keys 'test@example.com'
|
||||
elem.send_keys :enter
|
||||
|
||||
exists(
|
||||
css: '.token-label',
|
||||
value: 'test@example.com'
|
||||
)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue