Add name order for porject/experiment/task sidebar

This commit is contained in:
aignatov-bio 2020-05-27 13:31:00 +02:00
parent 183f5af7de
commit aaff5eb67f
4 changed files with 4 additions and 4 deletions

View file

@ -286,7 +286,7 @@ class ExperimentsController < ApplicationController
def load_projects_tree def load_projects_tree
# Switch to correct team # Switch to correct team
current_team_switch(@experiment.project.team) unless @experiment.project.nil? current_team_switch(@experiment.project.team) unless @experiment.project.nil?
@projects_tree = current_user.projects_tree(current_team, nil) @projects_tree = current_user.projects_tree(current_team, 'atoz')
end end
def check_view_permissions def check_view_permissions

View file

@ -582,7 +582,7 @@ class MyModulesController < ApplicationController
def load_projects_tree def load_projects_tree
# Switch to correct team # Switch to correct team
current_team_switch(@project.team) unless @project.nil? current_team_switch(@project.team) unless @project.nil?
@projects_tree = current_user.projects_tree(current_team, nil) @projects_tree = current_user.projects_tree(current_team, 'atoz')
end end
def check_manage_permissions def check_manage_permissions

View file

@ -19,7 +19,7 @@ class Experiment < ApplicationRecord
has_many :my_modules, inverse_of: :experiment, dependent: :destroy has_many :my_modules, inverse_of: :experiment, dependent: :destroy
has_many :active_my_modules, has_many :active_my_modules,
-> { where(archived: false).order(:workflow_order) }, -> { where(archived: false).order(:name) },
class_name: 'MyModule' class_name: 'MyModule'
has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy
has_many :report_elements, inverse_of: :experiment, dependent: :destroy has_many :report_elements, inverse_of: :experiment, dependent: :destroy

View file

@ -1,6 +1,6 @@
<% if project.active_experiments.present? %> <% if project.active_experiments.present? %>
<ul class="tree-child hidden" data-branch-id="pro<%= project.id %>"> <ul class="tree-child hidden" data-branch-id="pro<%= project.id %>">
<% project.active_experiments.each do |experiment| %> <% project.sorted_active_experiments('atoz').each do |experiment| %>
<% cache [action_name, current_user, experiment] do %> <% cache [action_name, current_user, experiment] do %>
<li data-parent="candidate" class="branch"> <li data-parent="candidate" class="branch">
<span class="tree-link first-indent" title="<%= experiment.name %>"> <span class="tree-link first-indent" title="<%= experiment.name %>">