Skip to content

Commit

Permalink
Fixes #5137 - Reporting: No button and output when no tickets found i…
Browse files Browse the repository at this point in the history
…n a time range.

Co-authored-by: Florian Liebe <fl@zammad.com>
  • Loading branch information
rolfschmidt and fliebe92 committed Apr 19, 2024
1 parent f430093 commit 379b0dc
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions app/assets/javascripts/app/controllers/report.coffee
Expand Up @@ -295,20 +295,19 @@ class Download extends App.Controller
@tableUpdate()

tableRender: (tickets, count) =>
if _.isEmpty(tickets)
@$('.js-dataDownloadButton').html('')
@$('.js-dataDownloadTable').html('')
return

profile_id = 0
for key, value of @params.profileSelected
if value
profile_id = key
downloadUrl = "#{@apiPath}/reports/sets?sheet=true;metric=#{@params.metric};year=#{@params.year};month=#{@params.month};week=#{@params.week};day=#{@params.day};timeRange=#{@params.timeRange};profile_id=#{profile_id};downloadBackendSelected=#{@params.downloadBackendSelected}"
@$('.js-dataDownloadButton').html(App.view('report/download_button')(
count: count
downloadUrl: downloadUrl
))

if count > 0
@$('.js-dataDownloadButton').html(App.view('report/download_button')(
count: count
downloadUrl: downloadUrl
))
else
@$('.js-dataDownloadButton').html('')

openTicket = (id,e) =>
ticket = App.Ticket.findNative(id)
Expand Down

0 comments on commit 379b0dc

Please sign in to comment.