Skip to content

Commit

Permalink
Maintenance: Improve default selection of download backend when switc…
Browse files Browse the repository at this point in the history
…hing metrics.
  • Loading branch information
rolfschmidt committed Apr 19, 2024
1 parent 6fa0ae2 commit c4dee12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/assets/javascripts/app/controllers/report.coffee
Expand Up @@ -295,6 +295,11 @@ class Download extends App.Controller
@tableUpdate()

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

profile_id = 0
for key, value of @params.profileSelected
if value
Expand Down Expand Up @@ -358,6 +363,8 @@ class Download extends App.Controller
@table = new App.ControllerTable(params)

tableUpdate: =>
return @tableRender([], 0) if !@params.downloadBackendSelected

state = {
metric: @params.metric
year: @params.year
Expand Down Expand Up @@ -582,7 +589,8 @@ class Sidebar extends App.Controller
return if $(e.target).closest('.panel').find('.collapse.in').get(0)
metric = $(e.target).closest('.panel').data('metric')
return if @params.metric is metric
@params.metric = metric
@params.metric = metric
@params.downloadBackendSelected = undefined
App.Event.trigger('ui:report:rerender')
@ui.storeParams()

Expand Down

0 comments on commit c4dee12

Please sign in to comment.