diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2019-02-06 13:31:56 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-02-21 14:02:38 +0100 |
commit | bd9ae901ec0bc0f9d1060e9128ecd5f8d8127671 (patch) | |
tree | 2b0db5ffbc5c37d8e78ff30387c1b48394a687fd /app/finders | |
parent | 3de4c8d0462aba1e254a255c438c80092109edf7 (diff) | |
download | gitlab-ce-bd9ae901ec0bc0f9d1060e9128ecd5f8d8127671.tar.gz |
Ability to filter confidential issues
Add a new search bar filter for confidential issues. Add filtering
support to the IssuesFinder.
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issues_finder.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb index a0504ca0879..d0a094ea4a6 100644 --- a/app/finders/issues_finder.rb +++ b/app/finders/issues_finder.rb @@ -69,9 +69,22 @@ class IssuesFinder < IssuableFinder end def filter_items(items) - by_due_date(super) + issues = by_due_date(super) + by_confidential(issues) end + # rubocop: disable CodeReuse/ActiveRecord + def by_confidential(items) + if params[:confidential] == 'yes' + items.where('issues.confidential = TRUE') + elsif params[:confidential] == 'no' + items.where.not('issues.confidential = TRUE') + else + items + end + end + # rubocop: enable CodeReuse/ActiveRecord + def by_due_date(items) if due_date? if filter_by_no_due_date? |