Lost sorting selection on experiment table view [SCI-7813]

This commit is contained in:
Giga Chubinidze 2023-01-26 17:00:03 +04:00
parent 00d99ee296
commit 1fbce23788
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 %>