summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-04-10 10:25:59 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-04-10 10:25:59 +0000
commit33a4439e8f079303fcf7c71267936e5c8f694958 (patch)
tree828c3c6dc55058e95927d36a3a03db9fd0263766 /app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
parent2db218f8bf186c509c927ce3e9d0502fee4f8349 (diff)
parent174950b6562226beed7eef135a2450bfee60e21f (diff)
downloadgitlab-ce-33a4439e8f079303fcf7c71267936e5c8f694958.tar.gz
Merge branch 'master' into 'stuartnelson3/gitlab-ce-stn/issue-due-email'
# Conflicts: # db/schema.rb
Diffstat (limited to 'app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js')
-rw-r--r--app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js b/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
index e6390f0855b..d7e1de18d09 100644
--- a/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
+++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
@@ -26,8 +26,8 @@ export default class FilteredSearchDropdownManager {
this.filteredSearchInput = this.container.querySelector('.filtered-search');
this.page = page;
this.groupsOnly = isGroup;
- this.groupAncestor = isGroupAncestor;
- this.isGroupDecendent = isGroupDecendent;
+ this.includeAncestorGroups = isGroupAncestor;
+ this.includeDescendantGroups = isGroupDecendent;
this.setupMapping();
@@ -108,7 +108,19 @@ export default class FilteredSearchDropdownManager {
}
getLabelsEndpoint() {
- const endpoint = `${this.baseEndpoint}/labels.json`;
+ let endpoint = `${this.baseEndpoint}/labels.json?`;
+
+ if (this.groupsOnly) {
+ endpoint = `${endpoint}only_group_labels=true&`;
+ }
+
+ if (this.includeAncestorGroups) {
+ endpoint = `${endpoint}include_ancestor_groups=true&`;
+ }
+
+ if (this.includeDescendantGroups) {
+ endpoint = `${endpoint}include_descendant_groups=true`;
+ }
return endpoint;
}