diff --git a/app/models/project.rb b/app/models/project.rb index ff417a723..fee5d297b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -272,7 +272,7 @@ class Project < ApplicationRecord report = Report.generate_whole_project_report(self, user, team) page_html_string = - renderer.render 'reports/new.html.erb', + renderer.render 'reports/new_old.html.erb', locals: { export_all: true, obj_filenames: obj_filenames }, assigns: { project: self, report: report } diff --git a/app/models/report.rb b/app/models/report.rb index 4fb598289..3ec07e657 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -103,7 +103,14 @@ class Report < ApplicationRecord end def self.generate_whole_project_report(project, current_user, current_team) - report_contents = gen_element_content(project, Extends::EXPORT_ALL_PROJECT_ELEMENTS) + # report_contents = gen_element_content(project, Extends::EXPORT_ALL_PROJECT_ELEMENTS) + content = { + 'experiments' => {}, + 'repositories' => Repository.accessible_by_teams(project.team).pluck(:id) + } + project.experiments.includes(:my_modules).each do |experiment| + content['experiments'][experiment.id] = experiment.my_modules.pluck(:id) + end report = Report.new report.name = loop do @@ -114,7 +121,8 @@ class Report < ApplicationRecord report.user = current_user report.team = current_team report.last_modified_by = current_user - report.save_with_contents(report_contents) + ReportActions::ReportContent.new(report, content, {}, current_user).save_with_content + # report.save_with_contents(report_contents) report end diff --git a/app/views/reports/new/_report_navigation.html.erb b/app/views/reports/new/_report_navigation.html.erb index 83f7ae95d..eadcd5115 100644 --- a/app/views/reports/new/_report_navigation.html.erb +++ b/app/views/reports/new/_report_navigation.html.erb @@ -26,8 +26,6 @@ diff --git a/app/views/reports/new_old.html.erb b/app/views/reports/new_old.html.erb index c68ac9e45..4ad2f92dc 100644 --- a/app/views/reports/new_old.html.erb +++ b/app/views/reports/new_old.html.erb @@ -3,6 +3,9 @@ <% end %> +<% @settings = @report.settings %> + + <% provide(:head_title, t("projects.reports.new.head_title", project: h(@project.name)).html_safe) %> <%= render partial: "reports/new/report_navigation" %> @@ -77,7 +80,6 @@ -<%= render partial: 'reports/new/save_PDF_to_inventory_modal' %> <%= javascript_include_tag "handsontable.full" %>