diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-26 18:06:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-26 18:06:29 +0000 |
commit | e66d6781ef36e39d15b1b9bc84cc30e87969edad (patch) | |
tree | 0165ff173dee501a55115d605dd8fa8a09f8d313 /lib/api | |
parent | 4e9f718e190a944c39fda2a178eb8b901e7e6ec7 (diff) | |
download | gitlab-ce-e66d6781ef36e39d15b1b9bc84cc30e87969edad.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/group_labels.rb | 4 | ||||
-rw-r--r-- | lib/api/helpers/groups_helpers.rb | 2 | ||||
-rw-r--r-- | lib/api/helpers/label_helpers.rb | 4 | ||||
-rw-r--r-- | lib/api/labels.rb | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/lib/api/group_labels.rb b/lib/api/group_labels.rb index 79a44941c81..cb044d4095f 100644 --- a/lib/api/group_labels.rb +++ b/lib/api/group_labels.rb @@ -18,10 +18,12 @@ module API params do optional :with_counts, type: Boolean, default: false, desc: 'Include issue and merge request counts' + optional :include_ancestor_groups, type: Boolean, default: true, + desc: 'Include ancestor groups' use :pagination end get ':id/labels' do - get_labels(user_group, Entities::GroupLabel) + get_labels(user_group, Entities::GroupLabel, include_ancestor_groups: params[:include_ancestor_groups]) end desc 'Create a new label' do diff --git a/lib/api/helpers/groups_helpers.rb b/lib/api/helpers/groups_helpers.rb index 585ae1eb5c4..abe9d457a5b 100644 --- a/lib/api/helpers/groups_helpers.rb +++ b/lib/api/helpers/groups_helpers.rb @@ -10,8 +10,6 @@ module API optional :description, type: String, desc: 'The description of the group' optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values, - default: Gitlab::VisibilityLevel.string_level( - Gitlab::CurrentSettings.current_application_settings.default_group_visibility), desc: 'The visibility of the group' optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group' optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access' diff --git a/lib/api/helpers/label_helpers.rb b/lib/api/helpers/label_helpers.rb index ec5b688dd1c..126747e4f34 100644 --- a/lib/api/helpers/label_helpers.rb +++ b/lib/api/helpers/label_helpers.rb @@ -18,8 +18,8 @@ module API label || not_found!('Label') end - def get_labels(parent, entity) - present paginate(available_labels_for(parent)), + def get_labels(parent, entity, include_ancestor_groups: true) + present paginate(available_labels_for(parent, include_ancestor_groups: include_ancestor_groups)), with: entity, current_user: current_user, parent: parent, diff --git a/lib/api/labels.rb b/lib/api/labels.rb index de89e94b0c0..12553cbbbfa 100644 --- a/lib/api/labels.rb +++ b/lib/api/labels.rb @@ -17,10 +17,12 @@ module API params do optional :with_counts, type: Boolean, default: false, desc: 'Include issue and merge request counts' + optional :include_ancestor_groups, type: Boolean, default: true, + desc: 'Include ancestor groups' use :pagination end get ':id/labels' do - get_labels(user_project, Entities::ProjectLabel) + get_labels(user_project, Entities::ProjectLabel, include_ancestor_groups: params[:include_ancestor_groups]) end desc 'Create a new label' do |