From 6844144503d374e2cffd47a8ac3ae05ba3a5c416 Mon Sep 17 00:00:00 2001 From: ajugo Date: Tue, 3 Jan 2023 12:24:56 +0100 Subject: [PATCH] Fix experiment table sidebar navigation [SCI-7652] (#4741) --- app/views/experiments/table.html.erb | 6 +++++- app/views/shared/sidebar/_archived_my_modules.html.erb | 6 +++++- app/views/shared/sidebar/_my_modules.html.erb | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/experiments/table.html.erb b/app/views/experiments/table.html.erb index 977e9dee1..8e6072964 100644 --- a/app/views/experiments/table.html.erb +++ b/app/views/experiments/table.html.erb @@ -4,7 +4,11 @@ <% provide(:container_class, 'no-second-nav-container') %> <%= content_for :sidebar do %> - <%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @my_modules } %> + <% if params[:view_mode] == 'archived' %> + <%= render partial: 'shared/sidebar/archived_my_modules.html.erb', locals: { experiment: @experiment, my_modules: @my_modules } %> + <% else %> + <%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @my_modules } %> + <% end %> <% end %>
diff --git a/app/views/shared/sidebar/_archived_my_modules.html.erb b/app/views/shared/sidebar/_archived_my_modules.html.erb index 3e8508b0d..aceddf93b 100644 --- a/app/views/shared/sidebar/_archived_my_modules.html.erb +++ b/app/views/shared/sidebar/_archived_my_modules.html.erb @@ -5,7 +5,11 @@ <% else %> <% end %> <% my_modules.each do |my_module| %> diff --git a/app/views/shared/sidebar/_my_modules.html.erb b/app/views/shared/sidebar/_my_modules.html.erb index 69e75234e..e4143946e 100644 --- a/app/views/shared/sidebar/_my_modules.html.erb +++ b/app/views/shared/sidebar/_my_modules.html.erb @@ -1,3 +1,9 @@ +<% if params[:action] == 'table' %> + <% @view_mode_link = table_experiment_path(@experiment, view_mode: 'archived') %> +<% else %> + <% @view_mode_link = module_archive_experiment_url(experiment) %> +<% end %> +