mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Merge pull request #4893 from G-Chubinidze/gc_SCI_7813
Lost sorting selection on experiment table view [SCI-7813]
This commit is contained in:
commit
c88e63f8d9
2 changed files with 10 additions and 1 deletions
|
@ -92,6 +92,15 @@ class ExperimentsController < ApplicationController
|
|||
@project = @experiment.project
|
||||
@experiment.current_view_state(current_user)
|
||||
@my_module_visible_table_columns = current_user.my_module_visible_table_columns
|
||||
|
||||
view_state = @experiment.current_view_state(current_user)
|
||||
@current_sort = view_state.state.dig('my_modules', my_modules_view_mode(@project), 'sort') || 'atoz'
|
||||
end
|
||||
|
||||
def my_modules_view_mode(my_module)
|
||||
return 'archived' if my_module.archived?
|
||||
|
||||
params[:view_mode] == 'archived' ? 'archived' : 'active'
|
||||
end
|
||||
|
||||
def load_table
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<% Experiments::TableViewService::COLUMNS.each do |col| %>
|
||||
<div class="column-container <%= col %> visible">
|
||||
<% if col == :archived && params[:view_mode] != 'archived' %>
|
||||
<i class="fas fa-eye disabled" data-column="<%= col %>"></i>
|
||||
<i class="fas fa-eye-slash disabled" data-column="<%= col %>"></i>
|
||||
<% elsif col != :task_name %>
|
||||
<i class="fas fa-<%= col.to_s.in?(@my_module_visible_table_columns) ? 'eye' : 'eye-slash' %>" data-column="<%= col %>"></i>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue