Fix experiment table sidebar navigation [SCI-7652] (#4741)

This commit is contained in:
ajugo 2023-01-03 12:24:56 +01:00 committed by GitHub
parent b43813366e
commit 6844144503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View file

@ -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 %>
<div class="content-pane flexible experiment-new-my_module <%= params[:view_mode] %>" id="experimentTable">

View file

@ -5,7 +5,11 @@
</li>
<% else %>
<li class="sidebar-leaf">
<%= link_to t('sidebar.my_modules.back_to_active_button'), canvas_experiment_url(experiment), class: 'sidebar-link back-button' %>
<% if params[:action] == 'table' %>
<%= link_to t('sidebar.my_modules.back_to_active_button'), table_experiment_path(experiment), class: 'sidebar-link back-button' %>
<% else %>
<%= link_to t('sidebar.my_modules.back_to_active_button'), canvas_experiment_url(experiment), class: 'sidebar-link back-button' %>
<% end %>
</li>
<% end %>
<% my_modules.each do |my_module| %>

View file

@ -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 %>
<ul class="sidebar-branch">
<li class="sidebar-leaf">
<%= link_to t('sidebar.my_modules.back_button'), project_url(experiment.project), class: 'sidebar-link back-button' %>
@ -15,7 +21,7 @@
</li>
<% end %>
<li class="sidebar-leaf">
<%= link_to module_archive_experiment_url(experiment), class: 'sidebar-link' do %>
<%= link_to @view_mode_link, class: 'sidebar-link' do %>
<i class="fas fa-archive"></i>&nbsp;
<%= t('sidebar.my_modules.archived_button') %>
<% end%>