Fixes #3852 - Number of to show caller log entries is inconsistent setting wise.

This commit is contained in:
Rolf Schmidt 2021-11-16 08:51:17 +01:00
parent 64a87b1c67
commit ccc9628804
6 changed files with 78 additions and 14 deletions

View file

@ -60,6 +60,30 @@ class Form extends App.Controller
placetel_token: App.Setting.get('placetel_token') 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: => updateCurrentConfig: =>
config = @config config = @config
cleanupInput = @cleanupInput cleanupInput = @cleanupInput
@ -70,6 +94,10 @@ class Form extends App.Controller
default_caller_id = @$('input[name=default_caller_id]').val() default_caller_id = @$('input[name=default_caller_id]').val()
config.outbound.default_caller_id = cleanupInput(default_caller_id) 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 # routing table
config.outbound.routing_table = [] config.outbound.routing_table = []
@$('.js-outboundRouting .js-row').each(-> @$('.js-outboundRouting .js-row').each(->

View file

@ -59,6 +59,30 @@ class Form extends App.Controller
config: @config 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: => updateCurrentConfig: =>
config = @config config = @config
cleanupInput = @cleanupInput cleanupInput = @cleanupInput
@ -70,6 +94,10 @@ class Form extends App.Controller
default_caller_id = @$('input[name=default_caller_id]').val() default_caller_id = @$('input[name=default_caller_id]').val()
config.outbound.default_caller_id = cleanupInput(default_caller_id) 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 # routing table
config.outbound.routing_table = [] config.outbound.routing_table = []
@$('.js-outboundRouting .js-row').each(-> @$('.js-outboundRouting .js-row').each(->

View file

@ -82,7 +82,7 @@
<table class="settings-list" style="width: 100%;"> <table class="settings-list" style="width: 100%;">
<thead> <thead>
<tr> <tr>
<th width="50%"><%- @T('Name') %> <th width="50%"><%- @T('Value') %>
<th width="50%"><%- @T('Description') %> <th width="50%"><%- @T('Description') %>
</thead> </thead>
<tbody> <tbody>

View file

@ -91,24 +91,30 @@
</tbody> </tbody>
</table> </table>
</div> </div>
-->
<p><%- @T('Default caller id.') %> <p><%- @T('Settings') %>
<div class="settings-entry"> <div class="settings-entry">
<table class="settings-list" style="width: 100%;"> <table class="settings-list" style="width: 100%;">
<thead> <thead>
<tr> <tr>
<th width="50%"><%- @T('Default caller id') %> <th width="50%"><%- @T('Value') %>
<th width="50%"><%- @T('Note') %> <th width="50%"><%- @T('Description') %>
</thead> </thead>
<tbody> <tbody>
<!--
<tr> <tr>
<td class="settings-list-control-cell"><input name="default_caller_id" value="<%= @config.outbound.default_caller_id %>" placeholder="4930609854189" class="form-control form-control--small js-summary"> <td class="settings-list-control-cell"><input name="default_caller_id" value="<%= @config.outbound.default_caller_id %>" placeholder="4930609854189" class="form-control form-control--small js-summary">
<td class="settings-list-row-control"><%- @T('Default caller id for outbound calls.') %> <td class="settings-list-row-control"><%- @T('Default caller id for outbound calls.') %>
-->
<tr>
<td class="settings-list-control-cell js-viewLimit">
<td class="settings-list-row-control"><%- @T('Shown records in caller log.') %>
</tbody> </tbody>
</table> </table>
</div> </div>
-->
<h2><%- @T('User assignment to telephones') %></h2> <h2><%- @T('User assignment to telephones') %></h2>
<p><%- @T('User assignment to telephones to be able to offer extended like open new ticket screen on answering a call.') %> <p><%- @T('User assignment to telephones to be able to offer extended like open new ticket screen on answering a call.') %>

View file

@ -79,19 +79,22 @@
</table> </table>
</div> </div>
<p><%- @T('Default caller id.') %> <p><%- @T('Settings') %>
<div class="settings-entry"> <div class="settings-entry">
<table class="settings-list" style="width: 100%;"> <table class="settings-list" style="width: 100%;">
<thead> <thead>
<tr> <tr>
<th width="50%"><%- @T('Default caller id') %> <th width="50%"><%- @T('Value') %>
<th width="50%"><%- @T('Note') %> <th width="50%"><%- @T('Description') %>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td class="settings-list-control-cell"><input name="default_caller_id" value="<%= @config.outbound.default_caller_id %>" placeholder="4930609854189" class="form-control form-control--small js-summary"> <td class="settings-list-control-cell"><input name="default_caller_id" value="<%= @config.outbound.default_caller_id %>" placeholder="4930609854189" class="form-control form-control--small js-summary">
<td class="settings-list-row-control"><%- @T('Default caller id for outbound calls.') %> <td class="settings-list-row-control"><%- @T('Default caller id for outbound calls.') %>
<tr>
<td class="settings-list-control-cell js-viewLimit">
<td class="settings-list-row-control"><%- @T('Shown records in caller log.') %>
</tbody> </tbody>
</table> </table>
</div> </div>

View file

@ -2,7 +2,7 @@
require 'rails_helper' 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(:agent_phone) { '0190111' }
let(:customer_phone) { '0190333' } let(:customer_phone) { '0190333' }
let(:agent) { create(:agent, phone: agent_phone) } 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 post "#{Capybara.app_host}/api/v1/sipgate/in", params: second_params
end end
let(:prepare) do def authenticate
Setting.set('sipgate_integration', sipgate_on) Setting.set('sipgate_integration', sipgate_on)
agent
end end
before { prepare }
context 'when sipgate integration is on' do context 'when sipgate integration is on' do
it 'shows the phone menu in nav bar' do it 'shows the phone menu in nav bar' do