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 @@ ...@@ -13,7 +13,7 @@
# # A single issue which includes confidential issues by default) # # A single issue which includes confidential issues by default)
# issue = finder.find_by_id(issue_id) # issue = finder.find_by_id(issue_id)
# # Find a "public only" issue # # 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 # # Most recent 20 non-confidential issues
# issues = finder.all # issues = finder.all
...@@ -26,8 +26,8 @@ module StatusPage ...@@ -26,8 +26,8 @@ module StatusPage
@project_id = project_id @project_id = project_id
end end
def find_by_id(issue_id, include_confidential: true) def find_by_id(issue_id, include_nonpublished: true)
execute(include_confidential: include_confidential) execute(include_nonpublished: include_nonpublished)
.find_by_id(issue_id) .find_by_id(issue_id)
end end
...@@ -40,9 +40,9 @@ module StatusPage ...@@ -40,9 +40,9 @@ module StatusPage
attr_reader :project_id attr_reader :project_id
def execute(sorted: false, include_confidential: false) def execute(sorted: false, include_nonpublished: false)
issues = init_collection issues = init_collection
issues = public_only(issues) unless include_confidential issues = published_only(issues) unless include_nonpublished
issues = by_project(issues) issues = by_project(issues)
issues = reverse_chronological(issues) if sorted issues = reverse_chronological(issues) if sorted
issues issues
...@@ -52,7 +52,7 @@ module StatusPage ...@@ -52,7 +52,7 @@ module StatusPage
Issue Issue
end end
def public_only(issues) def published_only(issues)
issues.public_only issues.public_only
end end
......
...@@ -41,8 +41,8 @@ describe StatusPage::IncidentsFinder do ...@@ -41,8 +41,8 @@ describe StatusPage::IncidentsFinder do
end end
end end
context 'with include_confidential' do context 'with include_nonpublished' do
let(:params) { { include_confidential: false } } let(:params) { { include_nonpublished: false } }
context 'for confidential issue' do context 'for confidential issue' do
let(:issue) { issues.fetch(:confidential) } 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