Project

General

Profile

Defect #40100 » user_sorting_20240123193437.patch

proposal for assignee drop_down_list and watcher fix - philippe lhardy, 2024-01-23 19:37

View differences:

app/helpers/application_helper.rb
s << content_tag('option', "<< #{l(:label_me)} >>", :value => User.current.id)
end
groups = +''
collection.sort.each do |element|
collection.each do |element|
if option_value_selected?(element, selected) || element.id.to_s == selected
selected_attribute = ' selected="selected"'
end
app/helpers/issues_helper.rb
users = issue.watcher_users.select{|u| u.status == User::STATUS_ACTIVE}
assignable_watchers = issue.project.principals.assignable_watchers.limit(21)
if assignable_watchers.size <= 20
users += assignable_watchers.sort
users += assignable_watchers.sorted
end
users.uniq
end
app/models/issue.rb
if assigned_to_id_was.present? && assignee = Principal.find_by_id(assigned_to_id_was)
users << assignee
end
users.uniq.sort
users.uniq
end
# Versions that the issue can be assigned to
(4-4/4)