Merge pull request #3299 from okriuchykhin/ok_SCI_5553

Add link to generated report preview in notifications [SCI-5553]
This commit is contained in:
Alex Kriuchykhin 2021-05-07 18:30:16 +02:00 committed by GitHub
commit b829921405
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -22,7 +22,8 @@ module Reports
docx.save docx.save
report.docx_file.attach(io: file, filename: 'report.docx') report.docx_file.attach(io: file, filename: 'report.docx')
report.update!(docx_file_processing: false) 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( notification = Notification.create(
type_of: :deliver, type_of: :deliver,
title: I18n.t('projects.reports.index.generation.completed_docx_notification_title'), 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.pdf_file.attach(io: file, filename: 'report.pdf')
report.update!(pdf_file_processing: false) 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( notification = Notification.create(
type_of: :deliver, type_of: :deliver,
title: I18n.t('projects.reports.index.generation.completed_pdf_notification_title'), title: I18n.t('projects.reports.index.generation.completed_pdf_notification_title'),