mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Merge pull request #3361 from okriuchykhin/ok_SCI_5755
Disable edit button for reports of archived projects [SCI-5755]
This commit is contained in:
commit
0010fc83a4
2 changed files with 6 additions and 2 deletions
|
@ -132,6 +132,9 @@
|
|||
.attr('data-retry-count', 0)
|
||||
.attr('data-save-to-inventory-path', data.save_to_inventory)
|
||||
.attr('data-id', data['0']);
|
||||
if (data.archived) {
|
||||
$(row).addClass('archived');
|
||||
}
|
||||
if (data['3'].processing || data['4'].processing) {
|
||||
$(row).addClass('processing');
|
||||
}
|
||||
|
@ -161,6 +164,7 @@
|
|||
$('.single-object-action, .multiple-object-action').removeClass('disabled hidden');
|
||||
|
||||
let $row = $(`.report-row[data-id=${CHECKED_REPORTS[0]}]`);
|
||||
let archived = $row.hasClass('archived');
|
||||
let pdfProcessing = $row.has('.processing.pdf').length > 0;
|
||||
let docxProcessing = $row.has('.processing.docx').length > 0;
|
||||
let docxGenerate = $row.has('.generate-docx').length > 0;
|
||||
|
@ -185,12 +189,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (pdfProcessing || docxProcessing) {
|
||||
if (archived || pdfProcessing || docxProcessing) {
|
||||
$('#edit-report-btn').addClass('disabled');
|
||||
} else {
|
||||
$('#edit-report-btn').removeClass('disabled');
|
||||
}
|
||||
|
||||
} else {
|
||||
$('.single-object-action').removeClass('hidden').addClass('disabled');
|
||||
$('.multiple-object-action').removeClass('disabled hidden');
|
||||
|
|
|
@ -60,6 +60,7 @@ class ReportDatatable < CustomDatatable
|
|||
'6' => sanitize_input(record.modified_by),
|
||||
'7' => I18n.l(record.created_at, format: :full),
|
||||
'8' => I18n.l(record.updated_at, format: :full),
|
||||
'archived' => record.project.archived?,
|
||||
'edit' => edit_project_report_path(record.project_id, record.id),
|
||||
'status' => status_project_report_path(record.project_id, record.id),
|
||||
'generate_pdf' => generate_pdf_project_report_path(record.project_id, record.id),
|
||||
|
|
Loading…
Add table
Reference in a new issue