From 8fd876ab845bdbc3e005194080c7a738709995e3 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Thu, 20 May 2021 15:54:36 +0200 Subject: [PATCH] Use the same ordering in PDF report for full results file previews as in the main results section [SCI-5742] --- app/jobs/reports/pdf_job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/jobs/reports/pdf_job.rb b/app/jobs/reports/pdf_job.rb index 712688e3e..64e80e270 100644 --- a/app/jobs/reports/pdf_job.rb +++ b/app/jobs/reports/pdf_job.rb @@ -96,7 +96,8 @@ module Reports def append_result_asset_previews(report, report_file) Dir.mktmpdir do |tmp_dir| report.report_elements.my_module.each do |my_module_element| - my_module_element.my_module.results.each do |result| + results = my_module_element.my_module.results + order_results_for_report(results, report.settings.dig(:task, :result_order)).each do |result| next unless result.is_asset && PREVIEW_EXTENSIONS.include?(result.asset.file.blob.filename.extension) asset = result.asset