From 93b7c472ac8ef271c9b23bfc6ea85d78a713b7eb Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Mon, 15 Jul 2019 16:16:41 +0200 Subject: [PATCH 1/3] SCI-3702 replace _to_text with _to_html --- app/services/reports/docx/draw_step_checklist.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/services/reports/docx/draw_step_checklist.rb b/app/services/reports/docx/draw_step_checklist.rb index c3b9e8c79..c46634ce6 100644 --- a/app/services/reports/docx/draw_step_checklist.rb +++ b/app/services/reports/docx/draw_step_checklist.rb @@ -19,13 +19,11 @@ module DrawStepChecklist text I18n.t('projects.reports.elements.step_checklist.user_time', timestamp: I18n.l(timestamp, format: :full)), color: color[:gray] end - @docx.ul do - items.each do |item| - li do - text SmartAnnotations::TagToText.new(@user, @report_team, item.text).text - text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked - end - end + items.each do |item| + html = custom_auto_link(item.text, team: @report_team) + html_to_word_converter(html) + @docx.p " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked end + end end From 1c84e46a21b63287af8a59697747c76614e444ec Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Mon, 15 Jul 2019 16:18:26 +0200 Subject: [PATCH 2/3] Revert "SCI-3702 replace _to_text with _to_html" This reverts commit 93b7c472ac8ef271c9b23bfc6ea85d78a713b7eb. --- app/services/reports/docx/draw_step_checklist.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/services/reports/docx/draw_step_checklist.rb b/app/services/reports/docx/draw_step_checklist.rb index c46634ce6..c3b9e8c79 100644 --- a/app/services/reports/docx/draw_step_checklist.rb +++ b/app/services/reports/docx/draw_step_checklist.rb @@ -19,11 +19,13 @@ module DrawStepChecklist text I18n.t('projects.reports.elements.step_checklist.user_time', timestamp: I18n.l(timestamp, format: :full)), color: color[:gray] end - items.each do |item| - html = custom_auto_link(item.text, team: @report_team) - html_to_word_converter(html) - @docx.p " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked + @docx.ul do + items.each do |item| + li do + text SmartAnnotations::TagToText.new(@user, @report_team, item.text).text + text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked + end + end end - end end From 47d3315d82594c6f534465ac5982aef2e3007dbd Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Mon, 15 Jul 2019 16:20:39 +0200 Subject: [PATCH 3/3] SCI-3702 revert the fix and use local variables --- app/services/reports/docx/draw_step_checklist.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/reports/docx/draw_step_checklist.rb b/app/services/reports/docx/draw_step_checklist.rb index c3b9e8c79..f44c4bd95 100644 --- a/app/services/reports/docx/draw_step_checklist.rb +++ b/app/services/reports/docx/draw_step_checklist.rb @@ -2,6 +2,8 @@ module DrawStepChecklist def draw_step_checklist(subject) + team = @report_team + user = @user checklist = Checklist.find_by_id(subject['id']['checklist_id']) return unless checklist @@ -22,7 +24,7 @@ module DrawStepChecklist @docx.ul do items.each do |item| li do - text SmartAnnotations::TagToText.new(@user, @report_team, item.text).text + text SmartAnnotations::TagToText.new(user, team, item.text).text text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked end end