mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-17 14:19: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
|
@project = @experiment.project
|
||||||
@experiment.current_view_state(current_user)
|
@experiment.current_view_state(current_user)
|
||||||
@my_module_visible_table_columns = current_user.my_module_visible_table_columns
|
@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
|
end
|
||||||
|
|
||||||
def load_table
|
def load_table
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<% Experiments::TableViewService::COLUMNS.each do |col| %>
|
<% Experiments::TableViewService::COLUMNS.each do |col| %>
|
||||||
<div class="column-container <%= col %> visible">
|
<div class="column-container <%= col %> visible">
|
||||||
<% if col == :archived && params[:view_mode] != 'archived' %>
|
<% 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 %>
|
<% elsif col != :task_name %>
|
||||||
<i class="fas fa-<%= col.to_s.in?(@my_module_visible_table_columns) ? 'eye' : 'eye-slash' %>" data-column="<%= col %>"></i>
|
<i class="fas fa-<%= col.to_s.in?(@my_module_visible_table_columns) ? 'eye' : 'eye-slash' %>" data-column="<%= col %>"></i>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue