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:
Diffstat (limited to 'app/finders/issues_finder.rb')
-rw-r--r--app/finders/issues_finder.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index 0ba93a76342..2297c0569d9 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -109,6 +109,21 @@ class IssuesFinder < IssuableFinder
super.with_projects_matching_search_data
end
+ override :by_parent
+ def by_parent(items)
+ return super unless include_namespace_level_work_items?
+
+ items.in_namespaces(
+ Namespace.from_union(
+ [
+ Group.id_in(params.group).select(:id),
+ params.projects.select(:project_namespace_id)
+ ],
+ remove_duplicates: false
+ )
+ )
+ end
+
def by_confidential(items)
return items if params[:confidential].nil?
@@ -157,6 +172,12 @@ class IssuesFinder < IssuableFinder
def model_class
Issue
end
+
+ def include_namespace_level_work_items?
+ params.group? &&
+ Array(params[:issue_types]).map(&:to_s).include?('epic') &&
+ Feature.enabled?(:namespace_level_work_items, params.group)
+ end
end
IssuesFinder.prepend_mod_with('IssuesFinder')