Add warning modal to report edit mode [SCI-5621] (#3266)

* Add warning modal to report edit mode [SCI-5621]

* Move report editing modal to partial [SCI-5621]
This commit is contained in:
aignatov-bio 2021-05-03 15:17:23 +02:00 committed by GitHub
parent 7752267808
commit 01dfd305ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View file

@ -1299,6 +1299,8 @@ function reportHandsonTableConverter() {
});
}
$('#reportWizardEditWarning').modal('show');
initGenerateButton();
initReportWizard();
initDropdowns();

View file

@ -0,0 +1,19 @@
<div class="modal" id="reportWizardEditWarning" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<%= t("projects.reports.new.edit_warning_modal.title") %>
</h4>
</div>
<div class="modal-body">
<%= t("projects.reports.new.edit_warning_modal.description") %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%= t("projects.reports.new.edit_warning_modal.button") %>
</button>
</div>
</div>
</div>
</div>

View file

@ -87,4 +87,8 @@
</div>
</div>
<% if @edit %>
<%= render partial: 'report_edit_warning_modal' %>
<% end %>
<%= javascript_include_tag("reports/new") %>

View file

@ -602,6 +602,10 @@ en:
unsaved_work: "Are you sure you want to leave this page? All unsaved data will be lost."
no_content_for_PDF_html: "<h1>No content</h1>"
no_permissions: "You don't have permission to manage this column"
edit_warning_modal:
title: "Report content"
description: "The content of Project, Experiments and Tasks included in this report might have been updated in SciNote since the report was last generated. Therefore the content of the report you are about to edit might be different from the saved version."
button: "Okay"
save_PDF_to_inventory_modal:
pdf_not_ready: "The PDF of this report isn't ready yet, please try again in a minute"
description_one: "Here you can save PDF report to an inventory item."