Merge pull request #4893 from G-Chubinidze/gc_SCI_7813

Lost sorting selection on experiment table view [SCI-7813]
This commit is contained in:
artoscinote 2023-02-01 09:30:27 +01:00 committed by GitHub
commit c88e63f8d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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 %>