Merge branch 'develop' of git.znuny.com:zammad/zammad into develop
This commit is contained in:
commit
d044219cf9
10 changed files with 316 additions and 26 deletions
16
Gemfile
16
Gemfile
|
@ -115,6 +115,10 @@ gem 'viewpoint'
|
||||||
# in production environments by default.
|
# in production environments by default.
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
|
|
||||||
|
# debugging
|
||||||
|
gem 'pry-rails'
|
||||||
|
gem 'pry-remote'
|
||||||
|
|
||||||
# test frameworks
|
# test frameworks
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
gem 'test-unit'
|
gem 'test-unit'
|
||||||
|
@ -157,8 +161,10 @@ group :development, :test do
|
||||||
gem 'webmock'
|
gem 'webmock'
|
||||||
end
|
end
|
||||||
|
|
||||||
# load onw gems for development and testing purposes
|
# Want to extend Zammad with additional gems?
|
||||||
local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
|
# ZAMMAD USERS: Specify them in Gemfile.local
|
||||||
if File.exist?(local_gemfile)
|
# (That way, you can customize the Gemfile
|
||||||
eval_gemfile local_gemfile
|
# without having your changes overwritten during upgrades.)
|
||||||
end
|
# ZAMMAD DEVS: Consult the internal wiki
|
||||||
|
# (or else risk pushing unwanted changes to Gemfile.lock!)
|
||||||
|
eval_gemfile 'Gemfile.local' if File.exist?('Gemfile.local')
|
||||||
|
|
|
@ -296,6 +296,11 @@ GEM
|
||||||
pry (0.11.3)
|
pry (0.11.3)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.9.0)
|
method_source (~> 0.9.0)
|
||||||
|
pry-rails (0.3.6)
|
||||||
|
pry (>= 0.10.4)
|
||||||
|
pry-remote (0.1.8)
|
||||||
|
pry (~> 0.9)
|
||||||
|
slop (~> 3.0)
|
||||||
public_suffix (3.0.1)
|
public_suffix (3.0.1)
|
||||||
puma (3.11.0)
|
puma (3.11.0)
|
||||||
rack (2.0.4)
|
rack (2.0.4)
|
||||||
|
@ -395,6 +400,7 @@ GEM
|
||||||
simplecov-rcov (0.2.3)
|
simplecov-rcov (0.2.3)
|
||||||
simplecov (>= 0.4.1)
|
simplecov (>= 0.4.1)
|
||||||
slack-notifier (2.3.1)
|
slack-notifier (2.3.1)
|
||||||
|
slop (3.6.0)
|
||||||
sprockets (3.7.1)
|
sprockets (3.7.1)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
|
@ -516,6 +522,8 @@ DEPENDENCIES
|
||||||
omniauth-weibo-oauth2
|
omniauth-weibo-oauth2
|
||||||
pg
|
pg
|
||||||
pre-commit
|
pre-commit
|
||||||
|
pry-rails
|
||||||
|
pry-remote
|
||||||
puma
|
puma
|
||||||
rack-livereload
|
rack-livereload
|
||||||
rails (= 5.1.5)
|
rails (= 5.1.5)
|
||||||
|
|
|
@ -7,12 +7,33 @@ class App.TicketCreate extends App.Controller
|
||||||
'submit form': 'submit'
|
'submit form': 'submit'
|
||||||
'click .js-cancel': 'cancel'
|
'click .js-cancel': 'cancel'
|
||||||
|
|
||||||
|
types: {
|
||||||
|
'phone-in': {
|
||||||
|
icon: 'received-calls',
|
||||||
|
label: 'Received Call'
|
||||||
|
},
|
||||||
|
'phone-out': {
|
||||||
|
icon: 'outbound-calls',
|
||||||
|
label: 'Outbound Call'
|
||||||
|
},
|
||||||
|
'email-out': {
|
||||||
|
icon: 'email',
|
||||||
|
label: 'Send Email'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
constructor: (params) ->
|
constructor: (params) ->
|
||||||
super
|
super
|
||||||
@sidebarState = {}
|
@sidebarState = {}
|
||||||
|
|
||||||
# define default type
|
# define default type and available types
|
||||||
@default_type = 'phone-in'
|
@defaultType = @Config.get('ui_ticket_create_default_type')
|
||||||
|
@availableTypes = @Config.get('ui_ticket_create_available_types') || []
|
||||||
|
if !_.isArray(@availableTypes)
|
||||||
|
@availableTypes = [@availableTypes]
|
||||||
|
|
||||||
|
if !_.contains(@availableTypes, @defaultType)
|
||||||
|
@defaultType = @availableTypes[0]
|
||||||
|
|
||||||
@formId = App.ControllerForm.formId()
|
@formId = App.ControllerForm.formId()
|
||||||
|
|
||||||
|
@ -50,7 +71,7 @@ class App.TicketCreate extends App.Controller
|
||||||
if !type
|
if !type
|
||||||
type = @$('.type-tabs .tab.active').data('type')
|
type = @$('.type-tabs .tab.active').data('type')
|
||||||
if !type
|
if !type
|
||||||
type = @default_type
|
type = @defaultType
|
||||||
type
|
type
|
||||||
|
|
||||||
changeFormType: (e) =>
|
changeFormType: (e) =>
|
||||||
|
@ -239,10 +260,12 @@ class App.TicketCreate extends App.Controller
|
||||||
@formId = params['form_id']
|
@formId = params['form_id']
|
||||||
|
|
||||||
@html(App.view('agent_ticket_create')(
|
@html(App.view('agent_ticket_create')(
|
||||||
head: 'New Ticket'
|
head: 'New Ticket'
|
||||||
agent: @permissionCheck('ticket.agent')
|
agent: @permissionCheck('ticket.agent')
|
||||||
admin: @permissionCheck('admin')
|
admin: @permissionCheck('admin')
|
||||||
form_id: @formId
|
types: @types,
|
||||||
|
availableTypes: @availableTypes
|
||||||
|
form_id: @formId
|
||||||
))
|
))
|
||||||
|
|
||||||
App.Ticket.configure_attributes.push {
|
App.Ticket.configure_attributes.push {
|
||||||
|
|
|
@ -7,20 +7,16 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<ul class="tabs type-tabs">
|
<% if !_.isEmpty(@availableTypes) && @availableTypes.length > 1: %>
|
||||||
<li class="tab u-textTruncate" data-type="phone-in">
|
<ul class="tabs type-tabs">
|
||||||
<%- @Icon('received-calls', 'tab-icon') %>
|
<% for type in @availableTypes: %>
|
||||||
<%- @T('Received Call') %>
|
<li class="tab u-textTruncate" data-type="<%= type %>">
|
||||||
</li>
|
<%- @Icon(@types[type]['icon'], 'tab-icon') %>
|
||||||
<li class="tab u-textTruncate" data-type="phone-out">
|
<%- @T(@types[type]['label']) %>
|
||||||
<%- @Icon('outbound-calls', 'tab-icon') %>
|
</li>
|
||||||
<%- @T('Outbound Call') %>
|
<% end %>
|
||||||
</li>
|
</ul>
|
||||||
<li class="tab u-textTruncate" data-type="email-out">
|
<% end %>
|
||||||
<%- @Icon('email', 'tab-icon') %>
|
|
||||||
<%- @T('Send Email') %>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<% if !_.isEmpty(@C('ui_ticket_create_notes')): %>
|
<% if !_.isEmpty(@C('ui_ticket_create_notes')): %>
|
||||||
<% for type, note of @C('ui_ticket_create_notes'): %>
|
<% for type, note of @C('ui_ticket_create_notes'): %>
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
class TicketCreateTypesSettingIssue1987 < ActiveRecord::Migration[5.1]
|
||||||
|
def up
|
||||||
|
# return if it's a new setup
|
||||||
|
return if !Setting.find_by(name: 'system_init_done')
|
||||||
|
|
||||||
|
Setting.create_if_not_exists(
|
||||||
|
title: 'Default type for a new ticket',
|
||||||
|
name: 'ui_ticket_create_default_type',
|
||||||
|
area: 'UI::TicketCreate',
|
||||||
|
description: 'Select default ticket type',
|
||||||
|
options: {
|
||||||
|
form: [
|
||||||
|
{
|
||||||
|
display: '',
|
||||||
|
null: false,
|
||||||
|
multiple: false,
|
||||||
|
name: 'ui_ticket_create_default_type',
|
||||||
|
tag: 'select',
|
||||||
|
options: {
|
||||||
|
'phone-in' => '1. Phone inbound',
|
||||||
|
'phone-out' => '2. Phone outbound',
|
||||||
|
'email-out' => '3. Email outbound',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
state: 'phone-in',
|
||||||
|
preferences: {
|
||||||
|
permission: ['admin.ui']
|
||||||
|
},
|
||||||
|
frontend: true
|
||||||
|
)
|
||||||
|
|
||||||
|
Setting.create_if_not_exists(
|
||||||
|
title: 'Available types for a new ticket',
|
||||||
|
name: 'ui_ticket_create_available_types',
|
||||||
|
area: 'UI::TicketCreate',
|
||||||
|
description: 'Set available ticket types',
|
||||||
|
options: {
|
||||||
|
form: [
|
||||||
|
{
|
||||||
|
display: '',
|
||||||
|
null: false,
|
||||||
|
multiple: true,
|
||||||
|
name: 'ui_ticket_create_available_types',
|
||||||
|
tag: 'select',
|
||||||
|
options: {
|
||||||
|
'phone-in' => '1. Phone inbound',
|
||||||
|
'phone-out' => '2. Phone outbound',
|
||||||
|
'email-out' => '3. Email outbound',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
state: %w[phone-in phone-out email-out],
|
||||||
|
preferences: {
|
||||||
|
permission: ['admin.ui']
|
||||||
|
},
|
||||||
|
frontend: true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
|
@ -795,6 +795,62 @@ Setting.create_if_not_exists(
|
||||||
frontend: true
|
frontend: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Setting.create_if_not_exists(
|
||||||
|
title: 'Default type for a new ticket',
|
||||||
|
name: 'ui_ticket_create_default_type',
|
||||||
|
area: 'UI::TicketCreate',
|
||||||
|
description: 'Select default ticket type',
|
||||||
|
options: {
|
||||||
|
form: [
|
||||||
|
{
|
||||||
|
display: '',
|
||||||
|
null: false,
|
||||||
|
multiple: false,
|
||||||
|
name: 'ui_ticket_create_default_type',
|
||||||
|
tag: 'select',
|
||||||
|
options: {
|
||||||
|
'phone-in' => '1. Phone inbound',
|
||||||
|
'phone-out' => '2. Phone outbound',
|
||||||
|
'email-out' => '3. Email outbound',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
state: 'phone-in',
|
||||||
|
preferences: {
|
||||||
|
permission: ['admin.ui']
|
||||||
|
},
|
||||||
|
frontend: true
|
||||||
|
)
|
||||||
|
|
||||||
|
Setting.create_if_not_exists(
|
||||||
|
title: 'Available types for a new ticket',
|
||||||
|
name: 'ui_ticket_create_available_types',
|
||||||
|
area: 'UI::TicketCreate',
|
||||||
|
description: 'Set available ticket types',
|
||||||
|
options: {
|
||||||
|
form: [
|
||||||
|
{
|
||||||
|
display: '',
|
||||||
|
null: false,
|
||||||
|
multiple: true,
|
||||||
|
name: 'ui_ticket_create_available_types',
|
||||||
|
tag: 'select',
|
||||||
|
options: {
|
||||||
|
'phone-in' => '1. Phone inbound',
|
||||||
|
'phone-out' => '2. Phone outbound',
|
||||||
|
'email-out' => '3. Email outbound',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
state: %w[phone-in phone-out email-out],
|
||||||
|
preferences: {
|
||||||
|
permission: ['admin.ui']
|
||||||
|
},
|
||||||
|
frontend: true
|
||||||
|
)
|
||||||
|
|
||||||
Setting.create_if_not_exists(
|
Setting.create_if_not_exists(
|
||||||
title: 'Open ticket indicator',
|
title: 'Open ticket indicator',
|
||||||
name: 'ui_sidebar_open_ticket_indicator_colored',
|
name: 'ui_sidebar_open_ticket_indicator_colored',
|
||||||
|
|
|
@ -35,6 +35,7 @@ write a cache
|
||||||
Rails.cache.write(key.to_s, data, params)
|
Rails.cache.write(key.to_s, data, params)
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error "Can't write cache #{key}: #{e.inspect}"
|
Rails.logger.error "Can't write cache #{key}: #{e.inspect}"
|
||||||
|
Rails.logger.error e
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ if [ "$LEVEL" == '1' ]; then
|
||||||
# test/browser/agent_organization_profile_test.rb
|
# test/browser/agent_organization_profile_test.rb
|
||||||
rm test/browser/agent_ticket_attachment_test.rb
|
rm test/browser/agent_ticket_attachment_test.rb
|
||||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_available_types_test.rb
|
||||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_default_type_test.rb
|
||||||
rm test/browser/agent_ticket_create_reset_customer_selection_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_create_template_test.rb
|
||||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||||
|
@ -92,7 +94,9 @@ elif [ "$LEVEL" == '2' ]; then
|
||||||
rm test/browser/agent_organization_profile_test.rb
|
rm test/browser/agent_organization_profile_test.rb
|
||||||
rm test/browser/agent_ticket_attachment_test.rb
|
rm test/browser/agent_ticket_attachment_test.rb
|
||||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_available_types_test.rb
|
||||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_default_type_test.rb
|
||||||
rm test/browser/agent_ticket_create_reset_customer_selection_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_create_template_test.rb
|
||||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||||
|
@ -160,7 +164,9 @@ elif [ "$LEVEL" == '3' ]; then
|
||||||
rm test/browser/agent_organization_profile_test.rb
|
rm test/browser/agent_organization_profile_test.rb
|
||||||
# test/browser/agent_ticket_attachment_test.rb
|
# test/browser/agent_ticket_attachment_test.rb
|
||||||
# test/browser/agent_ticket_auto_assignment_test.rb
|
# test/browser/agent_ticket_auto_assignment_test.rb
|
||||||
|
# rm test/browser/agent_ticket_create_available_types_test.rb
|
||||||
#rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
#rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||||
|
# rm test/browser/agent_ticket_create_default_type_test.rb
|
||||||
# test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
# test/browser/agent_ticket_create_reset_customer_selection_test.rb
|
||||||
# test/browser/agent_ticket_create_template_test.rb
|
# test/browser/agent_ticket_create_template_test.rb
|
||||||
# test/browser/agent_ticket_email_reply_keep_body_test.rb
|
# test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||||
|
@ -228,7 +234,9 @@ elif [ "$LEVEL" == '4' ]; then
|
||||||
rm test/browser/agent_organization_profile_test.rb
|
rm test/browser/agent_organization_profile_test.rb
|
||||||
rm test/browser/agent_ticket_attachment_test.rb
|
rm test/browser/agent_ticket_attachment_test.rb
|
||||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_available_types_test.rb
|
||||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_default_type_test.rb
|
||||||
rm test/browser/agent_ticket_create_reset_customer_selection_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_create_template_test.rb
|
||||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||||
|
@ -295,7 +303,9 @@ elif [ "$LEVEL" == '5' ]; then
|
||||||
rm test/browser/agent_organization_profile_test.rb
|
rm test/browser/agent_organization_profile_test.rb
|
||||||
rm test/browser/agent_ticket_attachment_test.rb
|
rm test/browser/agent_ticket_attachment_test.rb
|
||||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_available_types_test.rb
|
||||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_default_type_test.rb
|
||||||
rm test/browser/agent_ticket_create_reset_customer_selection_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_create_template_test.rb
|
||||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||||
|
@ -365,7 +375,9 @@ elif [ "$LEVEL" == '6' ]; then
|
||||||
rm test/browser/agent_organization_profile_test.rb
|
rm test/browser/agent_organization_profile_test.rb
|
||||||
rm test/browser/agent_ticket_attachment_test.rb
|
rm test/browser/agent_ticket_attachment_test.rb
|
||||||
rm test/browser/agent_ticket_auto_assignment_test.rb
|
rm test/browser/agent_ticket_auto_assignment_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_available_types_test.rb
|
||||||
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
rm test/browser/agent_ticket_create_cc_tokenizer_test.rb
|
||||||
|
rm test/browser/agent_ticket_create_default_type_test.rb
|
||||||
rm test/browser/agent_ticket_create_reset_customer_selection_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_create_template_test.rb
|
||||||
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
rm test/browser/agent_ticket_email_reply_keep_body_test.rb
|
||||||
|
|
45
test/browser/agent_ticket_create_available_types_test.rb
Normal file
45
test/browser/agent_ticket_create_available_types_test.rb
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
|
||||||
|
require 'browser_test_helper'
|
||||||
|
|
||||||
|
# Regression test for UI enhancement
|
||||||
|
# https://github.com/zammad/zammad/issues/1987
|
||||||
|
# Ensure that available ticket types are rendered correctly
|
||||||
|
class AgentTicketCreateAvailableTypesTest < TestCase
|
||||||
|
def test_ticket_create_type
|
||||||
|
@browser = browser_instance
|
||||||
|
login(
|
||||||
|
username: 'agent1@example.com',
|
||||||
|
password: 'test',
|
||||||
|
url: browser_url,
|
||||||
|
)
|
||||||
|
tasks_close_all()
|
||||||
|
|
||||||
|
click(
|
||||||
|
css: 'a[href="#ticket/create"]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li.active[data-type=phone-in]'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_ticket_create_solo_type
|
||||||
|
@browser = browser_instance
|
||||||
|
login(
|
||||||
|
username: 'agent1@example.com',
|
||||||
|
password: 'test',
|
||||||
|
url: browser_url,
|
||||||
|
)
|
||||||
|
tasks_close_all()
|
||||||
|
|
||||||
|
@browser.execute_script("App.Config.set('ui_ticket_create_default_type', 'email-out')")
|
||||||
|
|
||||||
|
click(
|
||||||
|
css: 'a[href="#ticket/create"]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li.active[data-type=email-out]'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
81
test/browser/agent_ticket_create_default_type_test.rb
Normal file
81
test/browser/agent_ticket_create_default_type_test.rb
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
|
||||||
|
require 'browser_test_helper'
|
||||||
|
|
||||||
|
# Regression test for UI enhancement
|
||||||
|
# https://github.com/zammad/zammad/issues/1987
|
||||||
|
# Ensure that available ticket types are rendered correctly
|
||||||
|
class AgentTicketCreateDefaultTypeTest < TestCase
|
||||||
|
def test_ticket_create_type
|
||||||
|
@browser = browser_instance
|
||||||
|
login(
|
||||||
|
username: 'agent1@example.com',
|
||||||
|
password: 'test',
|
||||||
|
url: browser_url,
|
||||||
|
)
|
||||||
|
tasks_close_all()
|
||||||
|
|
||||||
|
click(
|
||||||
|
css: 'a[href="#ticket/create"]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li[data-type=phone-in]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li[data-type=phone-out]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li[data-type=email-out]'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_ticket_create_disabled_type
|
||||||
|
@browser = browser_instance
|
||||||
|
login(
|
||||||
|
username: 'agent1@example.com',
|
||||||
|
password: 'test',
|
||||||
|
url: browser_url,
|
||||||
|
)
|
||||||
|
tasks_close_all()
|
||||||
|
|
||||||
|
@browser.execute_script("App.Config.set('ui_ticket_create_available_types', ['email-out', 'phone-out'])")
|
||||||
|
|
||||||
|
click(
|
||||||
|
css: 'a[href="#ticket/create"]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists_not(
|
||||||
|
css: '.type-tabs li[data-type=phone-in]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li[data-type=phone-out]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists(
|
||||||
|
css: '.type-tabs li[data-type=email-out]'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_ticket_create_solo_type
|
||||||
|
@browser = browser_instance
|
||||||
|
login(
|
||||||
|
username: 'agent1@example.com',
|
||||||
|
password: 'test',
|
||||||
|
url: browser_url,
|
||||||
|
)
|
||||||
|
tasks_close_all()
|
||||||
|
|
||||||
|
@browser.execute_script("App.Config.set('ui_ticket_create_available_types', ['email-out'])")
|
||||||
|
|
||||||
|
click(
|
||||||
|
css: 'a[href="#ticket/create"]'
|
||||||
|
)
|
||||||
|
|
||||||
|
exists_not(
|
||||||
|
css: '.type-tabs'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue