Fixed changing shown columns.
This commit is contained in:
parent
309369090b
commit
2269ef8e4e
2 changed files with 16 additions and 12 deletions
|
@ -98,6 +98,10 @@ class Table extends App.Controller
|
|||
@bind 'ticket_overview_fetch_force', =>
|
||||
@fetch()
|
||||
|
||||
# force fetch ticket overview
|
||||
@bind 'ticket_overview_local', =>
|
||||
@render(true)
|
||||
|
||||
update: (params) =>
|
||||
for key, value of params
|
||||
@[key] = value
|
||||
|
@ -144,16 +148,18 @@ class Table extends App.Controller
|
|||
return data
|
||||
false
|
||||
|
||||
render: =>
|
||||
render: (overview_changed = false) =>
|
||||
#console.log('RENDER', @cache, @view)
|
||||
return if !@cache
|
||||
return if !@cache[@view]
|
||||
|
||||
# use cache
|
||||
overview = @cache[@view].overview
|
||||
tickets_count = @cache[@view].tickets_count
|
||||
ticket_ids = @cache[@view].ticket_ids
|
||||
|
||||
# get meta data
|
||||
# use cache if no local change
|
||||
if !overview_changed
|
||||
App.Overview.refresh( overview, { clear: true } )
|
||||
|
||||
# get ticket list
|
||||
|
@ -505,7 +511,6 @@ class Table extends App.Controller
|
|||
overview_id: @overview.id
|
||||
view_mode: @view_mode
|
||||
container: @el.closest('.content')
|
||||
callback: @render,
|
||||
)
|
||||
|
||||
class App.OverviewSettings extends App.ControllerModal
|
||||
|
@ -696,18 +701,18 @@ class App.OverviewSettings extends App.ControllerModal
|
|||
|
||||
@overview.group_by = params.group_by
|
||||
|
||||
# rerender overview
|
||||
if !@reload_needed
|
||||
@callback()
|
||||
|
||||
@overview.save(
|
||||
done: =>
|
||||
|
||||
# fetch overview data again
|
||||
if @reload_needed
|
||||
App.Event.trigger('ticket_overview_fetch_force')
|
||||
)
|
||||
else
|
||||
App.Event.trigger('ticket_overview_local')
|
||||
|
||||
# hide modal
|
||||
@hide()
|
||||
)
|
||||
|
||||
class Navbar extends App.Controller
|
||||
constructor: ->
|
||||
|
|
|
@ -74,7 +74,6 @@ class AgentTicketOverviewLevel0Test < TestCase
|
|||
# remember current overview count
|
||||
overview_counter_before = overview_counter()
|
||||
|
||||
|
||||
# click options and enable number and article count
|
||||
click( :css => '.active [data-type="settings"]' )
|
||||
|
||||
|
@ -101,7 +100,7 @@ class AgentTicketOverviewLevel0Test < TestCase
|
|||
:css => '.modal input[value="article_count"]',
|
||||
)
|
||||
click( :css => '.modal .js-submit' )
|
||||
sleep 10
|
||||
sleep 4
|
||||
|
||||
# check if number and article count is shown
|
||||
match(
|
||||
|
@ -141,7 +140,7 @@ class AgentTicketOverviewLevel0Test < TestCase
|
|||
:css => '.modal input[value="article_count"]',
|
||||
)
|
||||
click( :css => '.modal .js-submit' )
|
||||
sleep 2
|
||||
sleep 4
|
||||
|
||||
# check if number and article count is gone
|
||||
match_not(
|
||||
|
|
Loading…
Reference in a new issue