diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-30 16:32:39 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-30 16:32:39 +0300 |
commit | 52a3d4372c6e45e4ffb792a9fe7bfca84f3573a3 (patch) | |
tree | 35b80fd5034ce411af8d4c5102756cadfdda0256 /lib | |
parent | 83550c02c0b3eea942ec34969d406e953d53b587 (diff) | |
parent | a7349560b2d13ea7894a462738b3a7687fdbae72 (diff) |
Merge branch '19107-404-when-creating-new-milestone-or-issue-for-project-that-has-issues-disabled' into 'master'
'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled
Closes #19107
See merge request !11754
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index ed5004e8d1a..d4fe5c023bf 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -58,6 +58,8 @@ module API optional :owned, type: Boolean, default: false, desc: 'Limit by owned by authenticated user' optional :starred, type: Boolean, default: false, desc: 'Limit by starred status' optional :membership, type: Boolean, default: false, desc: 'Limit by projects that the current user is a member of' + optional :with_issues_enabled, type: Boolean, default: false, desc: 'Limit by enabled issues feature' + optional :with_merge_requests_enabled, type: Boolean, default: false, desc: 'Limit by enabled merge requests feature' end params :create_params do @@ -69,11 +71,15 @@ module API options = options.reverse_merge( with: Entities::Project, current_user: current_user, - simple: params[:simple] + simple: params[:simple], + with_issues_enabled: params[:with_issues_enabled], + with_merge_requests_enabled: params[:with_merge_requests_enabled] ) projects = filter_projects(projects) projects = projects.with_statistics if options[:statistics] + projects = projects.with_issues_enabled if options[:with_issues_enabled] + projects = projects.with_merge_requests_enabled if options[:with_merge_requests_enabled] options[:with] = Entities::BasicProjectDetails if options[:simple] present paginate(projects), options |