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
path: root/lib/api
diff options
context:
space:
mode:
authorFelipe Artur <fcardozo@gitlab.com>2018-04-04 18:40:29 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-04-04 18:40:29 +0300
commitad7148d9ead6e76a80840c069ca0921f7e790041 (patch)
tree7681db499ad5bf3e0300b578a223717788cfc95a /lib/api
parentaff9bf11d98febc038b7deedfafb3b361ad392b2 (diff)
Allow assigning and filtering issuables by ancestor group labels
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/helpers.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index e59e8a45908..61c138a7dec 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -83,12 +83,13 @@ module API
end
def available_labels_for(label_parent)
- search_params =
- if label_parent.is_a?(Project)
- { project_id: label_parent.id }
- else
- { group_id: label_parent.id, only_group_labels: true }
- end
+ search_params = { include_ancestor_groups: true }
+
+ if label_parent.is_a?(Project)
+ search_params[:project_id] = label_parent.id
+ else
+ search_params.merge!(group_id: label_parent.id, only_group_labels: true)
+ end
LabelsFinder.new(current_user, search_params).execute
end