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 Api from 'ee/api';
import { __ } from '~/locale';
export default function initLDAPGroupsSelect() {
var groupFormatSelection, ldapGroupResult;
ldapGroupResult = function(group) {
const ldapGroupResult = function(group) {
return group.cn;
};
groupFormatSelection = function(group) {
const groupFormatSelection = function(group) {
return group.cn;
};
import(/* webpackChunkName: 'select2' */ 'select2/select2')
......@@ -22,19 +21,16 @@ export default function initLDAPGroupsSelect() {
placeholder: __('Search for a LDAP group'),
minimumInputLength: 1,
query(query) {
var provider;
provider = $('#ldap_group_link_provider').val();
const provider = $('#ldap_group_link_provider').val();
return Api.ldapGroups(query.term, provider, groups => {
var data;
data = {
const data = {
results: groups,
};
return query.callback(data);
});
},
initSelection(element, callback) {
var id;
id = $(element).val();
const id = $(element).val();
if (id !== '') {
return callback({
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