Merge pull request #2231 from biosistemika/SCI-4108-bug-at-report-generation

SCI-4108 Docx report error because of checklist does not have any item
This commit is contained in:
Miha Mencin 2019-11-25 17:33:20 +01:00 committed by GitHub
commit d74cad3b8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,11 +21,13 @@ module Reports::Docx::DrawStepChecklist
text I18n.t('projects.reports.elements.step_checklist.user_time', text I18n.t('projects.reports.elements.step_checklist.user_time',
timestamp: I18n.l(timestamp, format: :full)), color: color[:gray] timestamp: I18n.l(timestamp, format: :full)), color: color[:gray]
end end
@docx.ul do if items.any?
items.each do |item| @docx.ul do
li do items.each do |item|
text SmartAnnotations::TagToText.new(user, team, item.text).text li do
text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked 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 end
end end
end end