Commit a65da7c5 authored by Valery Sizov's avatar Valery Sizov

Group Approvers. Fixes after review

parent 33416a7e
......@@ -6,7 +6,7 @@ class GroupsController < Groups::ApplicationController
respond_to :html
before_action :authenticate_user!, only: [:new, :create]
before_action :group, except: [:index, :new, :create, :autocomplete]
before_action :group, except: [:index, :new, :create]
# Authorize
before_action :authorize_admin_group!, only: [:edit, :update, :destroy, :projects]
......@@ -92,12 +92,6 @@ class GroupsController < Groups::ApplicationController
redirect_to root_path, alert: "Group '#{@group.name}' was scheduled for deletion."
end
def autocomplete
groups = Group.search(params[:search]).where.not(path: params[:skip_groups]).limit(params[:per_page])
render json: groups.to_json
end
protected
def setup_projects
......
......@@ -63,7 +63,7 @@
Add an approver suggestion for each merge request
= f.label :approver_group_ids, class: 'label-light' do
Approver groups
- skip_groups = @project.approver_groups.includes(:group).map { |ag| ag.group.id }
- skip_groups = @project.approver_groups.pluck(:group_id)
= groups_select_tag('project[approver_group_ids]', multiple: true, data: { skip_groups: skip_groups, all_available: true }, class: 'input-large')
.help-block
Add a group as an approver suggestion for each merge request
......
......@@ -21,7 +21,7 @@
This merge request must be approved by these users.
You can override the project settings by setting your own list of approvers.
- skip_groups = issuable.overall_approver_groups.includes(:group).map { |ag| ag.group.id }
- skip_groups = issuable.overall_approver_groups.pluck(:group_id)
= groups_select_tag('merge_request[approver_group_ids]', multiple: true, data: { skip_groups: skip_groups, all_available: true }, class: 'input-large')
.help-block
This merge request must be approved by members of these groups.
......
......@@ -14,12 +14,6 @@ resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do
get :activity
end
## EE-specific
collection do
get :autocomplete
end
## EE-specific
scope module: :groups do
## EE-specific
resource :analytics, only: [:show]
......
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