mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 13:12:13 +08:00
Merge pull request #2623 from aignatov-bio/ai-sci-4709-filter-assigned-private-tasks
Filter private assigned tasks [SCI-4709]
This commit is contained in:
commit
c6291ef09e
1 changed files with 5 additions and 6 deletions
|
@ -154,14 +154,13 @@ class RepositoryRowsController < ApplicationController
|
|||
|
||||
def assigned_task_list
|
||||
assigned_modules = @repository_row.my_modules.joins(experiment: :project)
|
||||
.where_attributes_like(
|
||||
['my_modules.name', 'experiments.name', 'projects.name'],
|
||||
params[:query],
|
||||
whole_phrase: true
|
||||
)
|
||||
viewable_modules = assigned_modules.viewable_by_user(current_user, current_user.teams)
|
||||
private_modules = assigned_modules - viewable_modules
|
||||
|
||||
viewable_modules = viewable_modules.where_attributes_like(
|
||||
['my_modules.name', 'experiments.name', 'projects.name'],
|
||||
params[:query],
|
||||
whole_phrase: true
|
||||
)
|
||||
render json: {
|
||||
html: render_to_string(partial: 'shared/my_modules_list_partial.html.erb', locals: {
|
||||
my_modules: viewable_modules,
|
||||
|
|
Loading…
Reference in a new issue