From 5e02fff4b36c961c702e8ad32964bdfc57f389f9 Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Mon, 14 Oct 2024 16:24:17 +0200 Subject: [PATCH] Fix active repository datatables on shared tasks [SCI-11189] (#7970) --- app/controllers/my_module_shareable_links_controller.rb | 2 +- app/services/repository_datatable_service.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/my_module_shareable_links_controller.rb b/app/controllers/my_module_shareable_links_controller.rb index d49a6be5d..594d6cf8b 100644 --- a/app/controllers/my_module_shareable_links_controller.rb +++ b/app/controllers/my_module_shareable_links_controller.rb @@ -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], diff --git a/app/services/repository_datatable_service.rb b/app/services/repository_datatable_service.rb index ade46fb1f..fa3911d71 100644 --- a/app/services/repository_datatable_service.rb +++ b/app/services/repository_datatable_service.rb @@ -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