Fix issue with missing archived items on task page [SCI-4854]

This commit is contained in:
Oleksii Kriuchykhin 2020-07-10 11:43:06 +02:00
parent 12a8d50098
commit c7fcc3f89b
2 changed files with 5 additions and 6 deletions

View file

@ -32,7 +32,7 @@
function initRepositoriesDataTable(tableContainer, archived = false) { function initRepositoriesDataTable(tableContainer, archived = false) {
var tableTemplate = $('#RepositoriesListTable').html(); var tableTemplate = $('#RepositoriesListTable').html();
$.get($(tableTemplate).data('source'), {archived: archived}, function(data) { $.get($(tableTemplate).data('source'), { archived: archived }, function(data) {
if (REPOSITORIES_TABLE) REPOSITORIES_TABLE.destroy(); if (REPOSITORIES_TABLE) REPOSITORIES_TABLE.destroy();
CHECKBOX_SELECTOR = null; CHECKBOX_SELECTOR = null;
$('.content-body').html(tableTemplate); $('.content-body').html(tableTemplate);

View file

@ -61,11 +61,10 @@ class RepositoryDatatableService
end end
def fetch_rows(search_value) def fetch_rows(search_value)
repository_rows = if @repository.archived? repository_rows = @repository.repository_rows
@repository.repository_rows if @params[:archived] && !@repository.archived?
else repository_rows = repository_rows.where(archived: @params[:archived])
@repository.repository_rows.where(archived: @params[:archived] || false) end
end
@all_count = @all_count =
if @my_module && @params[:assigned] == 'assigned' if @my_module && @params[:assigned] == 'assigned'