diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index d6515811f..2141cd55f 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -632,7 +632,6 @@ ul.double-line > li { } #project-show, -#project-show-archive, #module-archive, #result-archive { .panel-default { diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 79c506c29..429b9a51f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -11,13 +11,13 @@ class ProjectsController < ApplicationController helper_method :current_folder before_action :switch_team_with_param, only: :index - before_action :load_vars, only: %i(show edit update notifications experiment_archive sidebar experiments_cards) - before_action :load_current_folder, only: %i(index cards new show experiment_archive) - before_action :check_view_permissions, only: %i(show notifications experiment_archive sidebar experiments_cards) + before_action :load_vars, only: %i(show edit update notifications sidebar experiments_cards) + before_action :load_current_folder, only: %i(index cards new show) + before_action :check_view_permissions, only: %i(show notifications sidebar experiments_cards) before_action :check_create_permissions, only: %i(new create) before_action :check_manage_permissions, only: :edit before_action :set_inline_name_editing, only: %i(show) - before_action :load_exp_sort_var, only: %i(show experiment_archive) + before_action :load_exp_sort_var, only: %i(show) before_action :reset_invalid_view_state, only: %i(index cards) layout 'fluid' @@ -258,6 +258,9 @@ class ProjectsController < ApplicationController def show # This is the "info" view current_team_switch(@project.team) + + view_state = @project.current_view_state(current_user) + @current_sort = view_state.state.dig('experiments', experiments_view_mode(@project), 'sort') || 'atoz' end def experiments_cards @@ -287,10 +290,6 @@ class ProjectsController < ApplicationController end end - def experiment_archive - current_team_switch(@project.team) - end - def users_filter users = current_team.users.search(false, params[:query]).map do |u| { value: u.id, label: sanitize_input(u.name), params: { avatar_url: avatar_path(u, :icon_small) } } @@ -349,7 +348,6 @@ class ProjectsController < ApplicationController @project.save end @current_sort = @project.experiments_order || 'new' - @current_sort = 'new' if @current_sort.include?('arch') && action_name != 'experiment_archive' end def filters_included? diff --git a/app/helpers/global_activities_helper.rb b/app/helpers/global_activities_helper.rb index 1e95c8afc..dbebb23e5 100644 --- a/app/helpers/global_activities_helper.rb +++ b/app/helpers/global_activities_helper.rb @@ -63,7 +63,7 @@ module GlobalActivitiesHelper when Experiment return current_value unless obj.navigable? - path = obj.archived? ? experiment_archive_project_path(obj.project) : canvas_experiment_path(obj) + path = obj.archived? ? project_path(obj.project, view_mode: :archived) : canvas_experiment_path(obj) when MyModule return current_value unless obj.navigable? diff --git a/app/views/global_activities/references/_experiment.html.erb b/app/views/global_activities/references/_experiment.html.erb index 5c8842700..7f3ac622c 100644 --- a/app/views/global_activities/references/_experiment.html.erb +++ b/app/views/global_activities/references/_experiment.html.erb @@ -3,7 +3,7 @@