Commit 21298dd9 authored by Mike Greiling's avatar Mike Greiling

Merge branch '34624-remove-IIFEs-from-project_select.js' into 'master'

Resolve "Remove IIFEs from project_select.js"

Closes #34624

See merge request gitlab-org/gitlab!19288
parents c5099d46 da123cbe
......@@ -30,8 +30,7 @@ const projectSelect = () => {
$(select).select2({
placeholder,
minimumInputLength: 0,
query: (function(_this) {
return function(query) {
query: query => {
var finalCallback, projectsCallback;
finalCallback = function(projects) {
var data;
......@@ -40,7 +39,7 @@ const projectSelect = () => {
};
return query.callback(data);
};
if (_this.includeGroups) {
if (this.includeGroups) {
projectsCallback = function(projects) {
var groupsCallback;
groupsCallback = function(groups) {
......@@ -53,27 +52,27 @@ const projectSelect = () => {
} else {
projectsCallback = finalCallback;
}
if (_this.groupId) {
if (this.groupId) {
return Api.groupProjects(
_this.groupId,
this.groupId,
query.term,
{
with_issues_enabled: _this.withIssuesEnabled,
with_merge_requests_enabled: _this.withMergeRequestsEnabled,
with_shared: _this.withShared,
include_subgroups: _this.includeProjectsInSubgroups,
with_issues_enabled: this.withIssuesEnabled,
with_merge_requests_enabled: this.withMergeRequestsEnabled,
with_shared: this.withShared,
include_subgroups: this.includeProjectsInSubgroups,
},
projectsCallback,
);
} else if (_this.userId) {
} else if (this.userId) {
return Api.userProjects(
_this.userId,
this.userId,
query.term,
{
with_issues_enabled: _this.withIssuesEnabled,
with_merge_requests_enabled: _this.withMergeRequestsEnabled,
with_shared: _this.withShared,
include_subgroups: _this.includeProjectsInSubgroups,
with_issues_enabled: this.withIssuesEnabled,
with_merge_requests_enabled: this.withMergeRequestsEnabled,
with_shared: this.withShared,
include_subgroups: this.includeProjectsInSubgroups,
},
projectsCallback,
);
......@@ -81,16 +80,15 @@ const projectSelect = () => {
return Api.projects(
query.term,
{
order_by: _this.orderBy,
with_issues_enabled: _this.withIssuesEnabled,
with_merge_requests_enabled: _this.withMergeRequestsEnabled,
membership: !_this.allProjects,
order_by: this.orderBy,
with_issues_enabled: this.withIssuesEnabled,
with_merge_requests_enabled: this.withMergeRequestsEnabled,
membership: !this.allProjects,
},
projectsCallback,
);
}
};
})(this),
},
id(project) {
if (simpleFilter) return project.id;
return JSON.stringify({
......
---
title: Remove IIFEs from project_select.js
merge_request: 19288
author: minghuan lei
type: other
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