Fix visibility of archived by and on column in repository [SCI-7674][7924] (#4973)

This commit is contained in:
ajugo 2023-02-14 16:27:17 +01:00 committed by GitHub
parent 20339a6723
commit aa3ea584a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -567,6 +567,9 @@ var RepositoryDatatable = (function(global) {
return columns;
}()),
drawCallback: function() {
var archived = $('.repository-show').hasClass('archived');
var archivedOnIndex = TABLE.column('#archived-on').index();
var archivedByIndex = TABLE.column('#archived-by').index();
animateSpinner(this, false);
changeToViewMode();
updateDataTableSelectAllCtrl();
@ -581,9 +584,7 @@ var RepositoryDatatable = (function(global) {
// Hide edit button if not all selected rows are on the current page
$('#editRepositoryRecord').prop('disabled', !allSelectedRowsAreOnPage());
if ($('.repository-show').hasClass('archived')) {
TABLE.columns([6, 7]).visible(true);
}
TABLE.columns([archivedOnIndex, archivedByIndex]).visible(archived);
},
preDrawCallback: function() {
var archived = $('.repository-show').hasClass('archived');

View file

@ -152,12 +152,12 @@
viewSwitch.on('click', '.view-switch-archived', function() {
$('.repository-show').removeClass('active').addClass('archived');
$('#manage-repository-column').removeClass('active').addClass('archived');
initTable();
RepositoryDatatable.reload();
});
viewSwitch.on('click', '.view-switch-active', function() {
$('.repository-show').removeClass('archived').addClass('active');
$('#manage-repository-column').removeClass('archived').addClass('active');
initTable();
RepositoryDatatable.reload();
});
}