mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Improve speed of assigned modules popout [SCI-6350] (#3754)
This commit is contained in:
parent
9c0582543b
commit
7c4143249e
2 changed files with 38 additions and 37 deletions
|
@ -213,12 +213,12 @@ class RepositoryRowsController < ApplicationController
|
||||||
params[:query],
|
params[:query],
|
||||||
whole_phrase: true
|
whole_phrase: true
|
||||||
)
|
)
|
||||||
viewable_modules = assigned_modules.viewable_by_user(current_user, current_user.teams)
|
viewable_modules = assigned_modules.viewable_by_user(current_user, current_team)
|
||||||
private_modules = assigned_modules - viewable_modules
|
private_modules_number = assigned_modules.where.not(id: viewable_modules).count
|
||||||
render json: {
|
render json: {
|
||||||
html: render_to_string(partial: 'shared/my_modules_list_partial.html.erb', locals: {
|
html: render_to_string(partial: 'shared/my_modules_list_partial.html.erb', locals: {
|
||||||
my_modules: viewable_modules,
|
my_modules: viewable_modules,
|
||||||
private_modules: private_modules
|
private_modules_number: private_modules_number
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<div class="my-modules-list-partial">
|
<div class="my-modules-list-partial">
|
||||||
<% grouped_by_prj_exp(my_modules).each do |task_group| %>
|
<% grouped_my_modules = grouped_by_prj_exp(my_modules) %>
|
||||||
|
<% grouped_my_modules.each do |task_group| %>
|
||||||
<div class="task-group">
|
<div class="task-group">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<% if task_group[:project_archived] %>
|
<% if task_group[:project_archived] %>
|
||||||
|
@ -16,21 +17,21 @@
|
||||||
<% task_group[:tasks].each do |task| %>
|
<% task_group[:tasks].each do |task| %>
|
||||||
<div class="task">
|
<div class="task">
|
||||||
<%= draw_custom_icon('task-icon') %>
|
<%= draw_custom_icon('task-icon') %>
|
||||||
<% if task.archived %>
|
<% if task.archived? %>
|
||||||
<span class="archived"><%= t('general.archived') %></span>
|
<span class="archived"><%= t('general.archived') %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to(task.name, protocols_my_module_path(task.id), {class: "task-link", title: task.name, target: "_blank"}) %>
|
<%= link_to(task.name, protocols_my_module_path(task.id), { class: 'task-link', title: task.name, target: '_blank' }) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if defined?(private_modules) && private_modules.size.positive? %>
|
<% if defined?(private_modules_number) && private_modules_number.positive? %>
|
||||||
<div class="private-tasks-counter">
|
<div class="private-tasks-counter">
|
||||||
<%= t('my_modules.modules_list_partial.private_tasks_html', nr: private_modules.size ) %>
|
<%= t('my_modules.modules_list_partial.private_tasks_html', nr: private_modules_number) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% unless my_modules.any? || (defined?(private_modules) && private_modules.any?) %>
|
<% unless grouped_my_modules.present? || (defined?(private_modules_number) && private_modules_number.positive?) %>
|
||||||
<div class="no-results-placeholder">
|
<div class="no-results-placeholder">
|
||||||
<span class="fa-stack">
|
<span class="fa-stack">
|
||||||
<i class="fas fa-search fa-stack-1x"></i>
|
<i class="fas fa-search fa-stack-1x"></i>
|
||||||
|
|
Loading…
Add table
Reference in a new issue