Skip to content

Commit b7da0c4

Browse files
HRT form tweaks
- Change the 'Save' button text to "Continue" - Add a link to the "Appointment cannot proceed" page.
1 parent dafc424 commit b7da0c4

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

manage_breast_screening/mammograms/jinja2/mammograms/medical_information/other_information/forms/hormone_replacement_therapy.jinja

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@
2323

2424
<div class="nhsuk-button-group">
2525
{{ button({
26-
"text": "Save"
26+
"text": "Continue"
2727
}) }}
2828
</div>
2929
</form>
30+
31+
<p>
32+
<a class="nhsuk-link nhsuk-link--no-visited-state" href="{{ appointment_cannot_proceed_href }}">Appointment cannot proceed</a>
33+
</p>
3034
</div>
3135
</div>
3236
{% endblock %}

manage_breast_screening/mammograms/views/other_information/hormone_replacement_therapy_views.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22

33
from django.shortcuts import redirect
4+
from django.urls import reverse
45

56
from manage_breast_screening.core.views.generic import (
67
AddWithAuditView,
@@ -23,6 +24,20 @@ class AddHormoneReplacementTherapyView(MedicalInformationMixin, AddWithAuditView
2324
template_name = TEMPLATE_NAME
2425
thing_name = THING_NAME
2526

27+
def get_context_data(self, **kwargs):
28+
context = super().get_context_data(**kwargs)
29+
30+
context.update(
31+
{
32+
"appointment_cannot_proceed_href": reverse(
33+
"mammograms:appointment_cannot_go_ahead",
34+
kwargs={"pk": self.appointment.pk},
35+
)
36+
}
37+
)
38+
39+
return context
40+
2641
def dispatch(self, request, *args, **kwargs):
2742
if hasattr(self.appointment, "hormone_replacement_therapy"):
2843
return redirect(

manage_breast_screening/tests/system/clinical/test_add_hormone_replacement_therapy.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def test_adding_hormone_replacement_therapy(self):
1919
self.when_i_click_add_hormone_replacement_therapy()
2020
self.then_i_see_the_add_hormone_replacement_therapy_form()
2121

22-
self.when_i_click_save()
22+
self.when_i_click_continue()
2323
self.then_i_see_validation_error_for_missing_status()
2424

2525
self.when_i_select_no()
26-
self.and_i_click_save()
26+
self.and_i_click_continue()
2727

2828
self.then_i_am_back_on_the_medical_information_page()
2929
self.and_the_message_says_hormone_replacement_therapy_added()
@@ -34,7 +34,7 @@ def test_adding_hormone_replacement_therapy(self):
3434

3535
self.when_i_select_yes()
3636
self.and_enter_a_duration()
37-
self.and_i_click_save()
37+
self.and_i_click_continue()
3838

3939
self.then_i_am_back_on_the_medical_information_page()
4040
self.and_the_message_says_hormone_replacement_therapy_updated()
@@ -103,10 +103,10 @@ def and_enter_a_duration(self):
103103
"August 2024"
104104
)
105105

106-
def and_i_click_save(self):
107-
self.page.get_by_text("Save").click()
106+
def and_i_click_continue(self):
107+
self.page.get_by_text("Continue").click()
108108

109-
when_i_click_save = and_i_click_save
109+
when_i_click_continue = and_i_click_continue
110110

111111
def then_i_see_validation_error_for_missing_status(self):
112112
self.expect_validation_error(

0 commit comments

Comments
 (0)