Small bugfixes [SCI-5432] (#3107)

This commit is contained in:
Alex Kriuchykhin 2021-01-21 11:24:25 +01:00 committed by GitHub
parent 172c366828
commit adb9442677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 16 deletions

View file

@ -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',

View file

@ -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!

View file

@ -2,18 +2,10 @@
<% text = query.present? ? highlight(experiment.name, query.strip.split(/\s+/)) : experiment.name %>
<% if experiment.archived? %>
<span class="label label-warning"><%=t 'search.index.archived' %></span>
<% 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 %>
<span class="label label-warning"><%= t('search.index.archived') %></span>
<% end %>
<% if can_read_experiment?(experiment) %>
<%= route_to_other_team(canvas_experiment_path(experiment), experiment.project.team, text) %>
<% else %>
<%= text %>
<% end %>