From a5438ff1496d35c5904cfaabcd1a195c75b5a4cd Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 14 Dec 2020 11:24:53 +0100 Subject: [PATCH] Fixes #3334 - Trigger-conditions 'Email' required the @ sign. --- .../controllers/_ui_element/ticket_selector.coffee | 2 ++ spec/system/manage/trigger_spec.rb | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee b/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee index 90ed255f4..bba0dedf6 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee @@ -92,6 +92,8 @@ class App.UiElement.ticket_selector # ignore passwords and relations if row.type isnt 'password' && row.name.substr(row.name.length-4,4) isnt '_ids' && row.searchable isnt false config = _.clone(row) + if config.type is 'email' + config.type = 'text' for operatorRegEx, operator of operators_type myRegExp = new RegExp(operatorRegEx, 'i') if config.tag && config.tag.match(myRegExp) diff --git a/spec/system/manage/trigger_spec.rb b/spec/system/manage/trigger_spec.rb index 3503c9618..f774aebcd 100644 --- a/spec/system/manage/trigger_spec.rb +++ b/spec/system/manage/trigger_spec.rb @@ -33,6 +33,19 @@ RSpec.describe 'Manage > Trigger', type: :system do end end end + + it 'sets a customer email address with no @ character' do + visit '/#manage/trigger' + + click '.page-header-meta .btn--success' + modal_ready + + find(".js-attributeSelector select option[value='customer.email']").select_option + fill_in 'condition::customer.email::value', with: 'zammad.com' + fill_in 'Name', with: 'trigger 1' + click '.js-submit' + modal_disappear + end end context 'Perform' do