diff --git a/app/assets/javascripts/app/controllers/_integration/placetel.coffee b/app/assets/javascripts/app/controllers/_integration/placetel.coffee index aa29aa56a..9cd47f2c7 100644 --- a/app/assets/javascripts/app/controllers/_integration/placetel.coffee +++ b/app/assets/javascripts/app/controllers/_integration/placetel.coffee @@ -60,6 +60,30 @@ class Form extends App.Controller placetel_token: App.Setting.get('placetel_token') ) + configure_attributes = [ + { + name: 'view_limit', + display: '', + tag: 'select', + null: false, + options: [ + { name: 60, value: 60 } + { name: 120, value: 120 } + { name: 180, value: 180 } + { name: 240, value: 240 } + { name: 300, value: 300 } + ] + }, + ] + new App.ControllerForm( + el: @$('.js-viewLimit') + model: + configure_attributes: configure_attributes, + params: + view_limit: @config['view_limit'] + autofocus: false + ) + updateCurrentConfig: => config = @config cleanupInput = @cleanupInput @@ -70,6 +94,10 @@ class Form extends App.Controller default_caller_id = @$('input[name=default_caller_id]').val() config.outbound.default_caller_id = cleanupInput(default_caller_id) + # default view limit + view_limit = @$('select[name=view_limit]').val() + config.view_limit = parseInt(view_limit) + # routing table config.outbound.routing_table = [] @$('.js-outboundRouting .js-row').each(-> diff --git a/app/assets/javascripts/app/controllers/_integration/sipgate_io.coffee b/app/assets/javascripts/app/controllers/_integration/sipgate_io.coffee index 68aa46fd6..51bfba37a 100644 --- a/app/assets/javascripts/app/controllers/_integration/sipgate_io.coffee +++ b/app/assets/javascripts/app/controllers/_integration/sipgate_io.coffee @@ -59,6 +59,30 @@ class Form extends App.Controller config: @config ) + configure_attributes = [ + { + name: 'view_limit', + display: '', + tag: 'select', + null: false, + options: [ + { name: 60, value: 60 } + { name: 120, value: 120 } + { name: 180, value: 180 } + { name: 240, value: 240 } + { name: 300, value: 300 } + ] + }, + ] + new App.ControllerForm( + el: @$('.js-viewLimit') + model: + configure_attributes: configure_attributes, + params: + view_limit: @config['view_limit'] + autofocus: false + ) + updateCurrentConfig: => config = @config cleanupInput = @cleanupInput @@ -70,6 +94,10 @@ class Form extends App.Controller default_caller_id = @$('input[name=default_caller_id]').val() config.outbound.default_caller_id = cleanupInput(default_caller_id) + # default view limit + view_limit = @$('select[name=view_limit]').val() + config.view_limit = parseInt(view_limit) + # routing table config.outbound.routing_table = [] @$('.js-outboundRouting .js-row').each(-> diff --git a/app/assets/javascripts/app/views/integration/cti.jst.eco b/app/assets/javascripts/app/views/integration/cti.jst.eco index 3c773dba5..4cdbff6d0 100644 --- a/app/assets/javascripts/app/views/integration/cti.jst.eco +++ b/app/assets/javascripts/app/views/integration/cti.jst.eco @@ -82,7 +82,7 @@ - diff --git a/app/assets/javascripts/app/views/integration/placetel.jst.eco b/app/assets/javascripts/app/views/integration/placetel.jst.eco index 48d939b51..273a87497 100644 --- a/app/assets/javascripts/app/views/integration/placetel.jst.eco +++ b/app/assets/javascripts/app/views/integration/placetel.jst.eco @@ -91,24 +91,30 @@
<%- @T('Name') %> + <%- @T('Value') %> <%- @T('Description') %>
+--> -

<%- @T('Default caller id.') %> +

<%- @T('Settings') %>

- + + +
<%- @T('Default caller id') %> - <%- @T('Note') %> + <%- @T('Value') %> + <%- @T('Description') %>
+ <%- @T('Shown records in caller log.') %>
---> +

<%- @T('User assignment to telephones') %>

<%- @T('User assignment to telephones to be able to offer extended like open new ticket screen on answering a call.') %> @@ -137,4 +143,4 @@ - \ No newline at end of file + diff --git a/app/assets/javascripts/app/views/integration/sipgate.jst.eco b/app/assets/javascripts/app/views/integration/sipgate.jst.eco index 245891f79..19a2cd2d3 100644 --- a/app/assets/javascripts/app/views/integration/sipgate.jst.eco +++ b/app/assets/javascripts/app/views/integration/sipgate.jst.eco @@ -79,19 +79,22 @@ -

<%- @T('Default caller id.') %> +

<%- @T('Settings') %>

- +
<%- @T('Default caller id') %> - <%- @T('Note') %> + <%- @T('Value') %> + <%- @T('Description') %>
<%- @T('Default caller id for outbound calls.') %> +
+ <%- @T('Shown records in caller log.') %>
@@ -143,4 +146,4 @@ - \ No newline at end of file + diff --git a/spec/system/sipgate_spec.rb b/spec/system/sipgate_spec.rb index 89abc9a83..7633b09aa 100644 --- a/spec/system/sipgate_spec.rb +++ b/spec/system/sipgate_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe 'Caller log', type: :system, authenticated_as: :agent do +RSpec.describe 'Caller log', type: :system, authenticated_as: :authenticate do let(:agent_phone) { '0190111' } let(:customer_phone) { '0190333' } let(:agent) { create(:agent, phone: agent_phone) } @@ -27,12 +27,11 @@ RSpec.describe 'Caller log', type: :system, authenticated_as: :agent do post "#{Capybara.app_host}/api/v1/sipgate/in", params: second_params end - let(:prepare) do + def authenticate Setting.set('sipgate_integration', sipgate_on) + agent end - before { prepare } - context 'when sipgate integration is on' do it 'shows the phone menu in nav bar' do