From 2e2308e866b20f757d3d58b5a680d84ba2200b08 Mon Sep 17 00:00:00 2001 From: Andrej Date: Fri, 25 Oct 2024 10:30:33 +0200 Subject: [PATCH] Add option to add task name into results [SCI-11220] --- app/services/reports/docx/draw_results.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/services/reports/docx/draw_results.rb b/app/services/reports/docx/draw_results.rb index ffa398081..a708c262e 100644 --- a/app/services/reports/docx/draw_results.rb +++ b/app/services/reports/docx/draw_results.rb @@ -1,12 +1,21 @@ # frozen_string_literal: true module Reports::Docx::DrawResults - def draw_results(my_module) + def draw_results(my_module, with_my_module_name: false) color = @color settings = @settings + scinote_url = @scinote_url + link_style = @link_style return unless can_read_my_module?(@user, my_module) if my_module.results.any? && (%w(file_results table_results text_results).any? { |k| @settings.dig('task', k) }) + if with_my_module_name + @docx.h3 do + link my_module.name, + scinote_url + Rails.application.routes.url_helpers.protocols_my_module_path(my_module), + link_style + end + end @docx.h4 I18n.t('Results') order_results_for_report(my_module.results, @settings.dig('task', 'result_order')).each do |result| @docx.p do