mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Fix active repository datatables on shared tasks [SCI-11189] (#7970)
This commit is contained in:
parent
a23d998fb7
commit
5e02fff4b3
2 changed files with 4 additions and 3 deletions
|
@ -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],
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue