Commit abb31213 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show only people who have assigned merge requests in assignee dropdown

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 13ecbb04
...@@ -28,7 +28,6 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -28,7 +28,6 @@ class Projects::IssuesController < Projects::ApplicationController
@milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero? @milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero?
sort_param = params[:sort] || 'newest' sort_param = params[:sort] || 'newest'
@sort = sort_param.humanize unless sort_param.empty? @sort = sort_param.humanize unless sort_param.empty?
@assignees = User.where(id: @project.issues.pluck(:assignee_id)) @assignees = User.where(id: @project.issues.pluck(:assignee_id))
respond_to do |format| respond_to do |format|
......
...@@ -28,6 +28,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -28,6 +28,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
assignee_id, milestone_id = params[:assignee_id], params[:milestone_id] assignee_id, milestone_id = params[:assignee_id], params[:milestone_id]
@assignee = @project.team.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero? @assignee = @project.team.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero?
@milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero? @milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero?
@assignees = User.where(id: @project.merge_requests.pluck(:assignee_id))
end end
def show def show
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
Any Any
= link_to project_filter_path(assignee_id: 0) do = link_to project_filter_path(assignee_id: 0) do
Unassigned Unassigned
- @project.team.members.sort_by(&:name).each do |user| - @assignees.sort_by(&:name).each do |user|
%li %li
= link_to project_filter_path(assignee_id: user.id) do = link_to project_filter_path(assignee_id: user.id) do
= image_tag avatar_icon(user.email), class: "avatar s16", alt: '' = image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment