Commit d5a92b4c authored by Valery Sizov's avatar Valery Sizov

Visible group option

parent 7680ada3
......@@ -4,6 +4,7 @@ v 8.2.0
- When someone as marked as a required approver for a merge request, an email should be sent
- Allow configuring the Jira API path (Alex Lossent)
- Fix "Rebase onto master"
- Allow groups to appear in the `Share with group` share if the group owner allows it
v 8.1.0 (unreleased)
- added an issues template (Hannes Rosenögger)
......
class @GroupsSelect
constructor: ->
$('.ajax-groups-select').each (i, select) =>
skip_ldap = $(select).hasClass('skip_ldap')
skip_group = $(select).data("skip-group")
url = $(select).data("url")
$(select).select2
placeholder: "Search for a group"
multiple: $(select).hasClass('multiselect')
minimumInputLength: 0
query: (query) ->
Api.groups query.term, skip_ldap, (groups) ->
$.ajax(
url: url
data:
search: query.term
per_page: 20
dataType: "json"
).done (groups) ->
data = { results: [] }
for group in groups
......
......@@ -93,6 +93,12 @@ class GroupsController < Groups::ApplicationController
redirect_to root_path, alert: "Group '#{@group.name}' was successfully deleted."
end
def autocomplete
groups = GroupsFinder.new.execute(current_user).search(params[:search]).limit(params[:per_page])
render json: groups.to_json
end
protected
def group
......
......@@ -49,7 +49,7 @@ module SelectsHelper
css_class << (opts[:class] || '')
value = opts[:selected] || ''
hidden_field_tag(id, value, class: css_class, data: { skip_group: opts[:skip_group] })
hidden_field_tag(id, value, class: css_class, data: { skip_group: opts[:skip_group], url: autocomplete_groups_path })
end
def admin_email_select_tag(id, opts = {})
......
......@@ -366,6 +366,10 @@ Gitlab::Application.routes.draw do
get :projects
end
collection do
get :autocomplete
end
scope module: :groups do
resource :ldap, only: [] do
member do
......
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