Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-04 12:06:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-04 12:06:21 +0300
commit2b7a5214342baa2575b35868316ea9413d2afe1f (patch)
treef80a862f7fa382620b8f8a695d07b6d1734fc5f5 /app/assets/javascripts/project_select.js
parent15a2d004be2f79160752d77f701c0f08e7f96973 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/project_select.js')
-rw-r--r--app/assets/javascripts/project_select.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/project_select.js b/app/assets/javascripts/project_select.js
index 0fbb7e5ca42..81f2fc2e686 100644
--- a/app/assets/javascripts/project_select.js
+++ b/app/assets/javascripts/project_select.js
@@ -9,7 +9,9 @@ const projectSelect = () => {
$('.ajax-project-select').each(function(i, select) {
var placeholder;
const simpleFilter = $(select).data('simpleFilter') || false;
+ const isInstantiated = $(select).data('select2');
this.groupId = $(select).data('groupId');
+ this.userId = $(select).data('userId');
this.includeGroups = $(select).data('includeGroups');
this.allProjects = $(select).data('allProjects') || false;
this.orderBy = $(select).data('orderBy') || 'id';
@@ -63,6 +65,18 @@ const projectSelect = () => {
},
projectsCallback,
);
+ } else if (_this.userId) {
+ return Api.userProjects(
+ _this.userId,
+ query.term,
+ {
+ with_issues_enabled: _this.withIssuesEnabled,
+ with_merge_requests_enabled: _this.withMergeRequestsEnabled,
+ with_shared: _this.withShared,
+ include_subgroups: _this.includeProjectsInSubgroups,
+ },
+ projectsCallback,
+ );
} else {
return Api.projects(
query.term,
@@ -96,7 +110,7 @@ const projectSelect = () => {
dropdownCssClass: 'ajax-project-dropdown',
});
- if (simpleFilter) return select;
+ if (isInstantiated || simpleFilter) return select;
return new ProjectSelectComboButton(select);
});
};