Fixes #3461 - Dashboard stats widgets are sometimes lost/empty
This commit is contained in:
parent
53ceb9de9d
commit
68d815da27
8 changed files with 93 additions and 102 deletions
|
@ -19,8 +19,17 @@ class App.DashboardStats extends App.Controller
|
||||||
for widget in widgets
|
for widget in widgets
|
||||||
if @permissionCheck(widget.permission)
|
if @permissionCheck(widget.permission)
|
||||||
try
|
try
|
||||||
|
|
||||||
|
el = @el.find(".column.#{widget.className}")
|
||||||
|
localEl = $("<div class=\"column #{widget.className}\"></div>")
|
||||||
|
|
||||||
|
if !el.get(0)
|
||||||
|
@el.append(localEl)
|
||||||
|
else
|
||||||
|
el.replaceWith(localEl)
|
||||||
|
|
||||||
new widget.controller(
|
new widget.controller(
|
||||||
parentEl: @el
|
el: localEl
|
||||||
className: widget.className
|
className: widget.className
|
||||||
)
|
)
|
||||||
@$('.js-stat-help').tooltip()
|
@$('.js-stat-help').tooltip()
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
class App.ControllerDashboardStatsBase extends App.Controller
|
class App.ControllerDashboardStatsBase extends App.Controller
|
||||||
constructor: (params) ->
|
constructor: ->
|
||||||
if params.parentEl
|
super
|
||||||
el = params.parentEl.find(".column.#{params.className}")
|
|
||||||
if !el.get(0)
|
|
||||||
el = $("<div class=\"column #{params.className}\"></div>")
|
|
||||||
params.parentEl.append(el)
|
|
||||||
params.el = el
|
|
||||||
super(params)
|
|
||||||
@load()
|
@load()
|
||||||
|
|
||||||
load: =>
|
load: =>
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="column ticket_channel_distribution">
|
|
||||||
<div class="stat-widget vertical">
|
<div class="stat-widget vertical">
|
||||||
<div class="stat-title">
|
<div class="stat-title">
|
||||||
<%- @T('Channel Distribution') %>
|
<%- @T('Channel Distribution') %>
|
||||||
|
@ -22,4 +21,3 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="column ticket_escalation">
|
|
||||||
<div class="stat-widget vertical">
|
<div class="stat-widget vertical">
|
||||||
<div class="stat-title">
|
<div class="stat-title">
|
||||||
<%- @T('Mood') %>
|
<%- @T('Mood') %>
|
||||||
|
@ -12,4 +11,3 @@
|
||||||
<div class="stat-label"><%- @T('%s of my tickets escalated.', @StatsTicketEscalation.own) %></div>
|
<div class="stat-label"><%- @T('%s of my tickets escalated.', @StatsTicketEscalation.own) %></div>
|
||||||
<div class="stat-detail"><%- @T('Total: %s', @StatsTicketEscalation.total) %></div>
|
<div class="stat-detail"><%- @T('Total: %s', @StatsTicketEscalation.total) %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="column ticket_in_process">
|
|
||||||
<div class="stat-widget vertical">
|
<div class="stat-widget vertical">
|
||||||
<div class="stat-title">
|
<div class="stat-title">
|
||||||
<%- @T('Your tickets in process') %>
|
<%- @T('Your tickets in process') %>
|
||||||
|
@ -12,4 +11,3 @@
|
||||||
<div class="stat-label" title="<%- @T('%s of your tickets are currently in process.', @StatsTicketInProcess.in_process) %>"><%- @T('%s% are currently in process', @StatsTicketInProcess.percent) %></div>
|
<div class="stat-label" title="<%- @T('%s of your tickets are currently in process.', @StatsTicketInProcess.in_process) %>"><%- @T('%s% are currently in process', @StatsTicketInProcess.percent) %></div>
|
||||||
<div class="stat-detail"><%- @T('Average: %s%', @StatsTicketInProcess.average_per_agent) %></div>
|
<div class="stat-detail"><%- @T('Average: %s%', @StatsTicketInProcess.average_per_agent) %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="column ticket_load_measure">
|
|
||||||
<div class="stat-widget vertical">
|
<div class="stat-widget vertical">
|
||||||
<div class="stat-title">
|
<div class="stat-title">
|
||||||
<%- @T('Assigned') %>
|
<%- @T('Assigned') %>
|
||||||
|
@ -19,4 +18,3 @@
|
||||||
<div class="stat-label"><%- @T('Tickets assigned to me: %s of %s', @StatsTicketLoadMeasure.own, @StatsTicketLoadMeasure.total) %></div>
|
<div class="stat-label"><%- @T('Tickets assigned to me: %s of %s', @StatsTicketLoadMeasure.own, @StatsTicketLoadMeasure.total) %></div>
|
||||||
<div class="stat-detail"><%- @T('Average: %s', @StatsTicketLoadMeasure.average_per_agent) %></div>
|
<div class="stat-detail"><%- @T('Average: %s', @StatsTicketLoadMeasure.average_per_agent) %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="column ticket_reopen">
|
|
||||||
<div class="stat-widget vertical">
|
<div class="stat-widget vertical">
|
||||||
<div class="stat-title">
|
<div class="stat-title">
|
||||||
<%- @T('Reopening rate') %>
|
<%- @T('Reopening rate') %>
|
||||||
|
@ -12,4 +11,3 @@
|
||||||
<div class="stat-label"><%- @T('%s% have been reopened', @StatsTicketReopen.percent) %></div>
|
<div class="stat-label"><%- @T('%s% have been reopened', @StatsTicketReopen.percent) %></div>
|
||||||
<div class="stat-detail"><%- @T('Average: %s%', @StatsTicketReopen.average_per_agent) %></div>
|
<div class="stat-detail"><%- @T('Average: %s%', @StatsTicketReopen.average_per_agent) %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="column ticket_waiting_time">
|
|
||||||
<div class="time stat-widget vertical">
|
<div class="time stat-widget vertical">
|
||||||
<div class="stat-title">
|
<div class="stat-title">
|
||||||
<%- @T('∅ Waiting time today') %>
|
<%- @T('∅ Waiting time today') %>
|
||||||
|
@ -16,4 +15,3 @@
|
||||||
<div class="stat-label"><%- @T('My handling time: %s minutes', @StatsTicketWaitingTime.handling_time) %></div>
|
<div class="stat-label"><%- @T('My handling time: %s minutes', @StatsTicketWaitingTime.handling_time) %></div>
|
||||||
<div class="stat-detail"><%- @T('Average: %s minutes', @StatsTicketWaitingTime.average_per_agent) %></div>
|
<div class="stat-detail"><%- @T('Average: %s minutes', @StatsTicketWaitingTime.average_per_agent) %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
Loading…
Reference in a new issue