Fix sorting in reports [SCI-1263]

This commit is contained in:
Oleksii Kriuchykhin 2017-05-12 16:04:19 +02:00
parent 213425b493
commit 5a2d618b1d

View file

@ -72,9 +72,9 @@ module ReportActions
ReportExtends::MODULE_CONTENTS.each do |contents| ReportExtends::MODULE_CONTENTS.each do |contents|
protocol = contents.element == :step ? my_module.protocol.present? : true protocol = contents.element == :step ? my_module.protocol.present? : true
next unless in_params?("module_#{contents.element}".to_sym) && protocol next unless in_params?("module_#{contents.element}".to_sym) && protocol
res << generate_new_el(false)
if contents.children if contents.children
contents.collection(my_module).each do |report_el| contents.collection(my_module).each do |report_el|
res << generate_new_el(false)
el = generate_el( el = generate_el(
"reports/elements/my_module_#{contents "reports/elements/my_module_#{contents
.element .element
@ -88,11 +88,11 @@ module ReportActions
el[:children] = generate_result_contents_json(report_el) el[:children] = generate_result_contents_json(report_el)
end end
res << el res << el
res << generate_new_el(false)
end end
else else
file_name = contents.file_name file_name = contents.file_name
file_name = contents.element if contents.element == :samples file_name = contents.element if contents.element == :samples
res << generate_new_el(false)
res << generate_el( res << generate_el(
"reports/elements/my_module_#{file_name}_element.html.erb", "reports/elements/my_module_#{file_name}_element.html.erb",
contents.parse_locals([my_module, :asc]) contents.parse_locals([my_module, :asc])