Fix active repository datatables on shared tasks [SCI-11189] (#7970)

This commit is contained in:
Alex Kriuchykhin 2024-10-14 16:24:17 +02:00 committed by GitHub
parent a23d998fb7
commit 5e02fff4b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -62,7 +62,7 @@ class MyModuleShareableLinksController < ApplicationController
@draw = params[:draw].to_i
per_page = params[:length].to_i < 1 ? Constants::REPOSITORY_DEFAULT_PAGE_SIZE : params[:length].to_i
page = (params[:start].to_i / per_page) + 1
datatable_service = RepositoryDatatableService.new(@repository, params, nil, @my_module, preload_cells: false)
datatable_service = RepositoryDatatableService.new(@repository, params, nil, @my_module, preload_cells: false, disable_reminders: true)
@datatable_params = {
view_mode: params[:view_mode],

View file

@ -13,11 +13,12 @@ class RepositoryDatatableService
PREDEFINED_COLUMNS = %w(row_id row_name added_on added_by archived_on archived_by
assigned relationships updated_on updated_by).freeze
def initialize(repository, params, user, my_module = nil, preload_cells: true)
def initialize(repository, params, user, my_module = nil, preload_cells: true, disable_reminders: false)
@repository = repository
@user = user
@my_module = my_module
@preload_cells = preload_cells
@disable_reminders = disable_reminders
@params = params
@assigned_view = @params[:assigned].in?(%w(assigned assigned_simple))
@sortable_columns = build_sortable_columns
@ -79,7 +80,7 @@ class RepositoryDatatableService
end
end
if Repository.reminders_enabled?
if Repository.reminders_enabled? && !@disable_reminders
repository_rows =
if @repository.archived? || @repository.is_a?(RepositorySnapshot)
# don't load reminders for archived repositories or snapshots