diff --git a/app/components/support_interface/reference_with_feedback_component.html.erb b/app/components/support_interface/reference_with_feedback_component.html.erb
index ed1fecc85c5..a11c737a244 100644
--- a/app/components/support_interface/reference_with_feedback_component.html.erb
+++ b/app/components/support_interface/reference_with_feedback_component.html.erb
@@ -1,5 +1,5 @@
- <%= render SummaryCardComponent.new(rows: rows, editable: true) do %>
+ <%= render SummaryCardComponent.new(rows:, editable: true, warning_text:) do %>
<%= render(SummaryCardHeaderComponent.new(title: title, heading_level: 3)) do %>
diff --git a/app/components/support_interface/reference_with_feedback_component.rb b/app/components/support_interface/reference_with_feedback_component.rb
index 0582fda88ce..3db872ed76d 100644
--- a/app/components/support_interface/reference_with_feedback_component.rb
+++ b/app/components/support_interface/reference_with_feedback_component.rb
@@ -28,6 +28,7 @@ def rows
email_address_row,
relationship_row,
feedback_row,
+ confidentiality_row,
date_rows,
sign_in_as_referee_row,
history_row,
@@ -40,6 +41,13 @@ def title
reference.name
end
+ def warning_text
+ return unless reference&.confidential == true
+ return unless reference&.feedback_provided?
+
+ t('support_interface.confidential_warning')
+ end
+
private
def status_row
@@ -215,6 +223,15 @@ def sign_in_as_referee_row
end
end
+ def confidentiality_row
+ return unless reference.feedback_provided?
+
+ {
+ key: 'Can this reference be shared with the candidate?',
+ value: confidentiality_value,
+ }
+ end
+
def history_row
return if reference.not_requested_yet?
@@ -254,6 +271,10 @@ def feedback_status_colour(reference)
end
end
+ def confidentiality_value
+ t("support_interface.references.confidential_warning.#{reference.confidential}")
+ end
+
attr_reader :reference
end
end
diff --git a/config/locales/support_interface/reference_status.yml b/config/locales/support_interface/reference_status.yml
index 571813a21ba..5f49fc09485 100644
--- a/config/locales/support_interface/reference_status.yml
+++ b/config/locales/support_interface/reference_status.yml
@@ -8,3 +8,5 @@ en:
feedback_provided: Feedback provided
feedback_refused: Reference declined
email_bounced: Email bounced
+ confidential_warning: 'Confidential: do not share with the candidate'
+
diff --git a/config/locales/support_interface/support_interface.yml b/config/locales/support_interface/support_interface.yml
index a259f3aa90d..d4f86543301 100644
--- a/config/locales/support_interface/support_interface.yml
+++ b/config/locales/support_interface/support_interface.yml
@@ -1,5 +1,9 @@
en:
support_interface:
+ references:
+ confidential_warning:
+ true: No, this reference is confidential. Do not share it.
+ false: Yes, if they request it.
page_titles:
visa_or_immigration_status: Edit applicant visa or immigration status
diff --git a/spec/components/support_interface/reference_with_feedback_component_spec.rb b/spec/components/support_interface/reference_with_feedback_component_spec.rb
index ff6dc0909d4..f255956a4e1 100644
--- a/spec/components/support_interface/reference_with_feedback_component_spec.rb
+++ b/spec/components/support_interface/reference_with_feedback_component_spec.rb
@@ -115,4 +115,48 @@
expect(rendered_content).to have_css('h3', text: 'Jane Smith')
end
end
+
+ describe 'Confidentiality row' do
+ context 'when the reference is confidential' do
+ before do
+ reference.update(confidential: true, feedback_status: 'feedback_provided')
+ render_inline(described_class.new(reference:, reference_number: 1, editable:))
+ end
+
+ it 'shows that the reference is confidential' do
+ expect(rendered_content).to summarise(
+ key: 'Can this reference be shared with the candidate?',
+ value: 'No, this reference is confidential. Do not share it.',
+ )
+ end
+ end
+
+ context 'when the reference is not confidential' do
+ before do
+ reference.update(confidential: false, feedback_status: 'feedback_provided')
+ render_inline(described_class.new(reference:, reference_number: 1, editable:))
+ end
+
+ it 'shows that the reference is not confidential' do
+ expect(rendered_content).to summarise(
+ key: 'Can this reference be shared with the candidate?',
+ value: 'Yes, if they request it.',
+ )
+ end
+ end
+
+ context 'when feedback has not been provided' do
+ before do
+ reference.update(confidential: true, feedback_status: 'feedback_requested')
+ render_inline(described_class.new(reference:, reference_number: 1, editable:))
+ end
+
+ it 'does not show the confidentiality row' do
+ expect(rendered_content).not_to summarise(
+ key: 'Can this reference be shared with the candidate?',
+ value: 'No, this reference is confidential. Do not share it.',
+ )
+ end
+ end
+ end
end