Skip to content

Commit

Permalink
Change ordering of Saved Chargeback reports
Browse files Browse the repository at this point in the history
fixing https://bugzilla.redhat.com/show_bug.cgi?id=1420133

Change ordering of Saved Chargeback reports
in Cloud Intel -> Chargeback -> Reports
or Cloud Intel -> Reports -> Saved Reports.
  • Loading branch information
Hilda Stastna committed Feb 22, 2017
1 parent 98d07bd commit 1da38ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/chargeback_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def cb_rpts_get_all_reps(nodeid)
miq_report = MiqReport.find(@sb[:miq_report_id])
saved_reports = miq_report.miq_report_results.with_current_user_groups
.select("id, miq_report_id, name, last_run_on, report_source")
.order(:last_run_on)
.order(:last_run_on => :desc)

@sb[:tree_typ] = "reports"
@right_cell_text = _("Report \"%{report_name}\"") % {:report_name => miq_report.name}
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/tree_builder_chargeback_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def x_get_tree_roots(count_only, _options)
def x_get_tree_custom_kids(object, count_only, _options)
objects = MiqReportResult.with_saved_chargeback_reports(from_cid(object[:id].split('-').first))
.select(:id, :miq_report_id, :name, :last_run_on, :miq_task_id)
.order(:last_run_on)
.order(:last_run_on => :desc)

count_only_or_objects(count_only, objects, "name")
end
Expand Down

0 comments on commit 1da38ed

Please sign in to comment.