diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-30 07:35:49 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-30 07:35:49 +0300 |
commit | a7349560b2d13ea7894a462738b3a7687fdbae72 (patch) | |
tree | 6b06e74b4934e57c99d7a1684592ae97aa276394 /app/assets/javascripts/project_select.js | |
parent | e5226177ac667c8ad4cc07270bbdef24031eb8a2 (diff) |
'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled
Diffstat (limited to 'app/assets/javascripts/project_select.js')
-rw-r--r-- | app/assets/javascripts/project_select.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/project_select.js b/app/assets/javascripts/project_select.js index 0ff0a3b6cc4..9896b88d487 100644 --- a/app/assets/javascripts/project_select.js +++ b/app/assets/javascripts/project_select.js @@ -51,6 +51,9 @@ import Api from './api'; this.groupId = $(select).data('group-id'); this.includeGroups = $(select).data('include-groups'); this.orderBy = $(select).data('order-by') || 'id'; + this.withIssuesEnabled = $(select).data('with-issues-enabled'); + this.withMergeRequestsEnabled = $(select).data('with-merge-requests-enabled'); + placeholder = "Search for project"; if (this.includeGroups) { placeholder += " or group"; @@ -84,7 +87,11 @@ import Api from './api'; if (_this.groupId) { return Api.groupProjects(_this.groupId, query.term, projectsCallback); } else { - return Api.projects(query.term, { order_by: _this.orderBy }, projectsCallback); + return Api.projects(query.term, { + order_by: _this.orderBy, + with_issues_enabled: _this.withIssuesEnabled, + with_merge_requests_enabled: _this.withMergeRequestsEnabled + }, projectsCallback); } }; })(this), |