Skip to content

Commit acdeb3b

Browse files
authored
Merge pull request #4021 from nhsuk/revert-4009-hide-get-new-consent-response-button
Revert "Hide "Get a new consent response" button"
2 parents a79bb53 + 387b835 commit acdeb3b

3 files changed

Lines changed: 5 additions & 26 deletions

File tree

app/components/app_patient_session_consent_component.html.erb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@
2828
secondary: true %>
2929
<% end %>
3030

31-
<% if can_record_new_response? %>
32-
<%= govuk_button_to "Record a new consent response",
33-
session_patient_programme_consents_path(
34-
session, patient, programme
35-
),
36-
secondary: true %>
37-
<% end %>
31+
<%= govuk_button_to "Record a new consent response",
32+
session_patient_programme_consents_path(
33+
session, patient, programme
34+
),
35+
secondary: true %>
3836
</div>
3937

4038
<%= render AppGillickAssessmentComponent.new(patient_session:, programme:) %>

app/components/app_patient_session_consent_component.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ def consents
4141
.order(created_at: :desc)
4242
end
4343

44-
def gillick_assessment
45-
@gillick_assessment ||=
46-
patient_session
47-
.gillick_assessments
48-
.order(created_at: :desc)
49-
.find_by(programme:)
50-
end
51-
5244
def consent_status
5345
@consent_status ||= patient.consent_status(programme:)
5446
end
@@ -62,10 +54,6 @@ def can_send_consent_request?
6254
session.open_for_consent? && patient.parents.any?
6355
end
6456

65-
def can_record_new_response?
66-
!consent_status.given? || gillick_assessment&.gillick_competent?
67-
end
68-
6957
def grouped_consents
7058
@grouped_consents ||= ConsentGrouper.call(consents, programme:)
7159
end

spec/components/app_patient_session_consent_component_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,5 @@
5858

5959
it { should have_css(".app-card--aqua-green", text: "Consent given") }
6060
it { should_not have_css("a", text: "Contact #{consent.parent.full_name}") }
61-
it { should_not have_css("button", text: "Record a new consent response") }
62-
63-
context "when patient is Gillick competent" do
64-
before { create(:gillick_assessment, :competent, patient_session:) }
65-
66-
it { should have_css("button", text: "Record a new consent response") }
67-
end
6861
end
6962
end

0 commit comments

Comments
 (0)