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:
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 /app/helpers/labels_helper.rb
parentaff9bf11d98febc038b7deedfafb3b361ad392b2 (diff)
Allow assigning and filtering issuables by ancestor group labels
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r--app/helpers/labels_helper.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb
index 87ff607dc3f..c4a6a1e4bb3 100644
--- a/app/helpers/labels_helper.rb
+++ b/app/helpers/labels_helper.rb
@@ -129,13 +129,17 @@ module LabelsHelper
end
end
- def labels_filter_path(only_group_labels = false)
+ def labels_filter_path(only_group_labels = false, include_ancestor_groups: true, include_descendant_groups: false)
project = @target_project || @project
+ options = {}
+ options[:include_ancestor_groups] = include_ancestor_groups if include_ancestor_groups
+ options[:include_descendant_groups] = include_descendant_groups if include_descendant_groups
+
if project
- project_labels_path(project, :json)
+ project_labels_path(project, :json, options)
elsif @group
- options = { only_group_labels: only_group_labels } if only_group_labels
+ options[:only_group_labels] = only_group_labels if only_group_labels
group_labels_path(@group, :json, options)
else
dashboard_labels_path(:json)