Merge pull request #5461 from G-Chubinidze/gc_SCI_8370

Revamp of (top) toolbar - Reports [SCI-8370]
This commit is contained in:
aignatov-bio 2023-05-24 12:07:17 +02:00 committed by GitHub
commit 1da074bc2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 17 deletions

View file

@ -173,7 +173,7 @@
var $table = $('#reports-table');
CHECKBOX_SELECTOR = null;
REPORTS_TABLE = $table.DataTable({
dom: "Rt<'pagination-row hidden'<'pagination-info'li><'pagination-actions'p>>",
dom: "R<'reports-toolbar'f>t<'pagination-row hidden'<'pagination-info'li><'pagination-actions'p>>",
order: [[9, 'desc']],
sScrollX: '100%',
stateSave: true,
@ -221,10 +221,17 @@
});
DataTableHelpers.initLengthAppearance($table.closest('.dataTables_wrapper'));
DataTableHelpers.initSearchField(
$table.closest('.dataTables_wrapper'),
I18n.t('projects.reports.index.search_reports')
);
$('.pagination-row').removeClass('hidden');
$('.report-row.processing').each(function() {
setTimeout(() => { checkProcessingStatus($(this).data('id')); }, START_POLLING_INTERVAL);
});
let topToolbar = $('#toolbarWrapper').detach().html();
$('.reports-datatable .reports-toolbar').prepend(topToolbar);
},
drawCallback: function() {
if (CHECKBOX_SELECTOR) CHECKBOX_SELECTOR.checkSelectAllStatus();
@ -342,11 +349,6 @@
});
}
$('.reports-index').on('keyup', '.report-search', function() {
REPORTS_TABLE.search($(this).val()).draw();
});
$('.reports-index').on('click', '.generate-docx', function(e) {
var reportId = $(this).closest('.report-row').attr('data-id');
e.preventDefault();

View file

@ -18,13 +18,6 @@
}
}
}
.search-report-container {
display: inline-block;
float: right;
margin-right: 2em;
width: 200px;
}
}
.reports-datatable {
@ -35,6 +28,12 @@
flex-direction: column;
height: 100%;
.reports-toolbar {
display: flex;
justify-content: space-between;
padding-bottom: 1em;
}
.dataTables_scroll {
display: flex;
flex-direction: column;

View file

@ -5,8 +5,4 @@
<span class="hidden-xs"><%= t("projects.reports.index.new") %></span>
<% end %>
</div>
<div class="sci-input-container left-icon search-report-container">
<input type="text" class="sci-input-field report-search" placeholder="<%= t("projects.reports.index.search_reports") %>"></input>
<i class="fas fa-search"></i>
</div>
<% end %>