diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/finders/issues_finder.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/finders/issues_finder.rb')
-rw-r--r-- | app/finders/issues_finder.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb index 2b2e6b377b4..bbb624f543b 100644 --- a/app/finders/issues_finder.rb +++ b/app/finders/issues_finder.rb @@ -25,6 +25,7 @@ # updated_after: datetime # updated_before: datetime # confidential: boolean +# issue_type: array of strings (one of Issue.issue_types) # class IssuesFinder < IssuableFinder CONFIDENTIAL_ACCESS_LEVEL = Gitlab::Access::REPORTER @@ -73,6 +74,7 @@ class IssuesFinder < IssuableFinder issues = super issues = by_due_date(issues) issues = by_confidential(issues) + issues = by_issue_types(issues) issues end @@ -97,6 +99,14 @@ class IssuesFinder < IssuableFinder items.due_between(Date.today - 2.weeks, (Date.today + 1.month).end_of_month) end end + + def by_issue_types(items) + issue_type_params = Array(params[:issue_types]).map(&:to_s) + return items if issue_type_params.blank? + return Issue.none unless (Issue.issue_types.keys & issue_type_params).sort == issue_type_params.sort + + items.with_issue_type(params[:issue_types]) + end end IssuesFinder.prepend_if_ee('EE::IssuesFinder') |