Add link to generated report preview in notifications [SCI-5553]

This commit is contained in:
Oleksii Kriuchykhin 2021-05-07 17:21:44 +02:00
parent ac97f38247
commit f5eea49116
2 changed files with 4 additions and 2 deletions

View file

@ -22,7 +22,8 @@ module Reports
docx.save
report.docx_file.attach(io: file, filename: 'report.docx')
report.update!(docx_file_processing: false)
report_path = Rails.application.routes.url_helpers.reports_path
report_path = Rails.application.routes.url_helpers
.reports_path(team: report.team.id, preview_report_id: report.id, preview_type: :docx)
notification = Notification.create(
type_of: :deliver,
title: I18n.t('projects.reports.index.generation.completed_docx_notification_title'),

View file

@ -53,7 +53,8 @@ module Reports
report.pdf_file.attach(io: file, filename: 'report.pdf')
report.update!(pdf_file_processing: false)
report_path = Rails.application.routes.url_helpers.reports_path
report_path = Rails.application.routes.url_helpers
.reports_path(team: report.team.id, preview_report_id: report.id, preview_type: :pdf)
notification = Notification.create(
type_of: :deliver,
title: I18n.t('projects.reports.index.generation.completed_pdf_notification_title'),