Commit 65acdc6e authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ldap' into 'master'

Remove var from ldap_groups_select.js

Closes #36264

See merge request gitlab-org/gitlab!20104
parents 87b409d7 4d58b76b
/* eslint-disable no-var, one-var, consistent-return, func-names */ /* eslint-disable consistent-return, func-names */
import $ from 'jquery'; import $ from 'jquery';
import Api from 'ee/api'; import Api from 'ee/api';
import { __ } from '~/locale'; import { __ } from '~/locale';
export default function initLDAPGroupsSelect() { export default function initLDAPGroupsSelect() {
var groupFormatSelection, ldapGroupResult; const ldapGroupResult = function(group) {
ldapGroupResult = function(group) {
return group.cn; return group.cn;
}; };
groupFormatSelection = function(group) { const groupFormatSelection = function(group) {
return group.cn; return group.cn;
}; };
import(/* webpackChunkName: 'select2' */ 'select2/select2') import(/* webpackChunkName: 'select2' */ 'select2/select2')
...@@ -22,19 +21,16 @@ export default function initLDAPGroupsSelect() { ...@@ -22,19 +21,16 @@ export default function initLDAPGroupsSelect() {
placeholder: __('Search for a LDAP group'), placeholder: __('Search for a LDAP group'),
minimumInputLength: 1, minimumInputLength: 1,
query(query) { query(query) {
var provider; const provider = $('#ldap_group_link_provider').val();
provider = $('#ldap_group_link_provider').val();
return Api.ldapGroups(query.term, provider, groups => { return Api.ldapGroups(query.term, provider, groups => {
var data; const data = {
data = {
results: groups, results: groups,
}; };
return query.callback(data); return query.callback(data);
}); });
}, },
initSelection(element, callback) { initSelection(element, callback) {
var id; const id = $(element).val();
id = $(element).val();
if (id !== '') { if (id !== '') {
return callback({ return callback({
cn: id, cn: id,
......
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