Commit a1484cb6 authored by Stan Hu's avatar Stan Hu

Merge branch 'sy-rename-confidential-to-unpublished' into 'master'

Rename AlertsFinder option include_confidential to include_nonpublished

See merge request gitlab-org/gitlab!31380
parents 2b41b178 adec7a90
......@@ -13,7 +13,7 @@
# # A single issue which includes confidential issues by default)
# issue = finder.find_by_id(issue_id)
# # Find a "public only" issue
# issue = finder.find_by_id(issue_id, include_confidential: false)
# issue = finder.find_by_id(issue_id, include_nonpublished: false)
#
# # Most recent 20 non-confidential issues
# issues = finder.all
......@@ -26,8 +26,8 @@ module StatusPage
@project_id = project_id
end
def find_by_id(issue_id, include_confidential: true)
execute(include_confidential: include_confidential)
def find_by_id(issue_id, include_nonpublished: true)
execute(include_nonpublished: include_nonpublished)
.find_by_id(issue_id)
end
......@@ -40,9 +40,9 @@ module StatusPage
attr_reader :project_id
def execute(sorted: false, include_confidential: false)
def execute(sorted: false, include_nonpublished: false)
issues = init_collection
issues = public_only(issues) unless include_confidential
issues = published_only(issues) unless include_nonpublished
issues = by_project(issues)
issues = reverse_chronological(issues) if sorted
issues
......@@ -52,7 +52,7 @@ module StatusPage
Issue
end
def public_only(issues)
def published_only(issues)
issues.public_only
end
......
......@@ -41,8 +41,8 @@ describe StatusPage::IncidentsFinder do
end
end
context 'with include_confidential' do
let(:params) { { include_confidential: false } }
context 'with include_nonpublished' do
let(:params) { { include_nonpublished: false } }
context 'for confidential issue' do
let(:issue) { issues.fetch(:confidential) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment