Use the same ordering in PDF report for full results file previews as in the main results section [SCI-5742]

This commit is contained in:
Oleksii Kriuchykhin 2021-05-20 15:54:36 +02:00
parent 32682efd92
commit 8fd876ab84

View file

@ -96,7 +96,8 @@ module Reports
def append_result_asset_previews(report, report_file) def append_result_asset_previews(report, report_file)
Dir.mktmpdir do |tmp_dir| Dir.mktmpdir do |tmp_dir|
report.report_elements.my_module.each do |my_module_element| 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) next unless result.is_asset && PREVIEW_EXTENSIONS.include?(result.asset.file.blob.filename.extension)
asset = result.asset asset = result.asset