From adb9442677b864efa3dac4adf8f1814ec9574698 Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Thu, 21 Jan 2021 11:24:25 +0100 Subject: [PATCH] Small bugfixes [SCI-5432] (#3107) --- app/controllers/my_modules_controller.rb | 2 +- app/helpers/projects_helper.rb | 3 ++- .../partials/_experiment_text.html.erb | 20 ++++++------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index 7f69c5713..d4206d405 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -157,7 +157,7 @@ class MyModulesController < ApplicationController ), due_date_label: render_to_string( partial: 'my_modules/due_date_label.html.erb', - locals: { my_module: @my_module } + locals: { my_module: @my_module, my_module_editable: true } ), card_due_date_label: render_to_string( partial: 'my_modules/card_due_date_label.html.erb', diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 84c4b6aaa..37c9ee338 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -32,14 +32,15 @@ module ProjectsHelper end def sidebar_folders_tree(team, user, sort, folders_only: false) + sort ||= team.current_view_state(user).state.dig('projects', 'active', 'sort') if projects_view_mode_archived? records = ProjectFolder.archived.inner_folders(team) records += team.projects.archived.visible_to(user, team) unless folders_only else records = ProjectFolder.active.inner_folders(team) records += team.projects.active.visible_to(user, team) unless folders_only + sort = 'new' if %w(archived_old archived_new).include?(sort) end - sort ||= team.current_view_state(user).state.dig('projects', 'active', 'sort') records = case sort when 'new' records.sort_by(&:created_at).reverse! diff --git a/app/views/search/results/partials/_experiment_text.html.erb b/app/views/search/results/partials/_experiment_text.html.erb index d6e672155..82d2e2248 100644 --- a/app/views/search/results/partials/_experiment_text.html.erb +++ b/app/views/search/results/partials/_experiment_text.html.erb @@ -2,18 +2,10 @@ <% text = query.present? ? highlight(experiment.name, query.strip.split(/\s+/)) : experiment.name %> <% if experiment.archived? %> - <%=t 'search.index.archived' %> - <% if can_read_experiment?(experiment) && can_restore_experiment?(experiment.project) %> - <%= route_to_other_team root_path, experiment.project.team, text %> - <% else %> - <%= text %> - <% end %> -<% else %> - <% if can_read_experiment?(experiment) %> - <%= route_to_other_team canvas_experiment_path(experiment), - experiment.project.team, - text %> - <% else %> - <%= text %> - <% end %> + <%= t('search.index.archived') %> +<% end %> +<% if can_read_experiment?(experiment) %> + <%= route_to_other_team(canvas_experiment_path(experiment), experiment.project.team, text) %> +<% else %> + <%= text %> <% end %>