diff --git a/app/assets/stylesheets/shared/my_modules_list_partial.scss b/app/assets/stylesheets/shared/my_modules_list_partial.scss index e42834c12..dcef1bf8b 100644 --- a/app/assets/stylesheets/shared/my_modules_list_partial.scss +++ b/app/assets/stylesheets/shared/my_modules_list_partial.scss @@ -57,6 +57,13 @@ } } + .private-tasks-counter { + @include font-button; + border-top: $border-tertiary; + color: $color-silver-chalice; + padding-top: .5em; + } + .archived { @include font-small; background: $brand-warning; diff --git a/app/controllers/repository_rows_controller.rb b/app/controllers/repository_rows_controller.rb index dce0099d5..9bb325016 100644 --- a/app/controllers/repository_rows_controller.rb +++ b/app/controllers/repository_rows_controller.rb @@ -49,8 +49,9 @@ class RepositoryRowsController < ApplicationController end def show - @assigned_modules = MyModuleRepositoryRow.eager_load(my_module: [{ experiment: :project }]) - .where(repository_row: @repository_row) + @assigned_modules = @repository_row.my_modules.joins(experiment: :project) + @viewable_modules = @assigned_modules.viewable_by_user(current_user, current_user.teams) + @private_modules = @assigned_modules - @viewable_modules respond_to do |format| format.json do @@ -152,11 +153,13 @@ class RepositoryRowsController < ApplicationController end def assigned_task_list - my_modules = @repository_row.my_modules.joins(experiment: :project) - .search_by_name(current_user, current_team, params[:query]) + assigned_modules = @repository_row.my_modules.joins(experiment: :project) + private_modules = assigned_modules - assigned_modules.viewable_by_user(current_user, current_user.teams) + viewable_modules = assigned_modules.search_by_name(current_user, current_user.teams, params[:query]) render json: { html: render_to_string(partial: 'shared/my_modules_list_partial.html.erb', locals: { - my_modules: my_modules + my_modules: viewable_modules, + private_modules: private_modules }) } end diff --git a/app/views/repositories/_repository_row_info_modal.html.erb b/app/views/repositories/_repository_row_info_modal.html.erb index 618da9ec5..ce9ed0173 100644 --- a/app/views/repositories/_repository_row_info_modal.html.erb +++ b/app/views/repositories/_repository_row_info_modal.html.erb @@ -40,36 +40,38 @@
<% if @repository_row.repository.is_a?(Repository) %> - <% if @assigned_modules.size > 0 %> + <% if @assigned_modules.size.positive? %>