Skip to content

Commit

Permalink
Merge pull request #3083 from DFE-Digital/fe-trn-page-content
Browse files Browse the repository at this point in the history
LUPEYALPHA-744 - TRN specific page for FE journey
  • Loading branch information
kenfodder authored Aug 16, 2024
2 parents 9e3a137 + 44fba91 commit bdddb86
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 13 deletions.
6 changes: 5 additions & 1 deletion app/models/journeys/base_answers_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def identity_answers
a << [t("forms.address.questions.your_address"), answers.address, "address"]
a << [t("questions.date_of_birth"), date_of_birth_string, "personal-details"] if show_dob?
a << payroll_gender
a << [t("questions.teacher_reference_number"), answers.teacher_reference_number, "teacher-reference-number"] if show_trn?
a << teacher_reference_number if show_trn?
a << [t("questions.national_insurance_number"), answers.national_insurance_number, "personal-details"] if show_nino?
a << [t("questions.email_address"), answers.email_address, "email-address"] unless show_email_select?
a << [text_for(:select_email), answers.email_address, "select-email"] if show_email_select?
Expand Down Expand Up @@ -72,5 +72,9 @@ def show_mobile_select?
def payroll_gender
[t("forms.gender.questions.payroll_gender"), t("answers.payroll_gender.#{answers.payroll_gender}"), "gender"]
end

def teacher_reference_number
[text_for(:teacher_reference_number), answers.teacher_reference_number, "teacher-reference-number"]
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def payroll_gender
]
end

def teacher_reference_number
[
t("further_education_payments.forms.teacher_reference_number.questions.teacher_reference_number"),
answers.teacher_reference_number,
"teacher-reference-number"
]
end

def teaching_responsibilities
[
t("further_education_payments.forms.teaching_responsibilities.question"),
Expand Down
4 changes: 2 additions & 2 deletions app/views/claims/teacher_reference_number.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for(
:page_title,
page_title(
t("questions.teacher_reference_number"),
@form.t("questions.teacher_reference_number"),
journey: current_journey_routing_name,
show_error: @form.errors.any?)
) %>
Expand All @@ -16,7 +16,7 @@
spellcheck: "false",
autocomplete: "off",
label: {
text: t("questions.teacher_reference_number"),
text: @form.t("questions.teacher_reference_number"),
tag: "h1",
size: "l"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<% content_for(
:page_title,
page_title(
@form.t("questions.teacher_reference_number"),
journey: current_journey_routing_name,
show_error: @form.errors.any?)
) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= form_for @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_error_summary %>

<h1 class="govuk-heading-l">
Teacher reference number (TRN)
</h1>

<p class="govuk-body">
A TRN is a 7-digit number that uniquely identifies you in the education sector in England.
Most people eligible for a TRN will be given one automatically.
</p>

<p class="govuk-body">
If you are unsure what your TRN is, you can:
</p>

<%= govuk_list [
"Check your payslip or Teachers’ Pension Scheme Benefit Statement.",
"Use #{govuk_link_to "Find a lost TRN", "https://find-a-lost-trn.education.gov.uk/start", new_tab: true} to check if you have a TRN or find your TRN.".html_safe],
type: :number %>

<%= f.govuk_text_field :teacher_reference_number,
width: 10,
spellcheck: "false",
autocomplete: "off",
label: {
text: @form.t("questions.teacher_reference_number"),
size: "m"
} %>

<%= f.govuk_submit "Continue" %>
<% end %>
</div>
</div>
4 changes: 3 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ en:
i_cannot_find: "I can't find my address in the list"
no_address_found: "No addresses found matching those details"
date_of_birth: "What is your date of birth?"
teacher_reference_number: "What is your teacher reference number (TRN)?"
email_address: "Email address"
email_address_hint1:
"We recommend you use a non-work email address in case your circumstances change while we process your payment."
Expand Down Expand Up @@ -1077,6 +1076,9 @@ en:
errors:
inclusion:
Select yes if you spend at least half of your timetabled teaching hours teaching these eligible courses
teacher_reference_number:
questions:
teacher_reference_number: "What is your TRN? (optional)"
check_your_answers:
part_one:
primary_heading: Check your answers
Expand Down
2 changes: 1 addition & 1 deletion spec/features/combined_teacher_claim_journey_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
click_on "Continue"

# - What is your teacher reference number
expect(page).to have_text(I18n.t("questions.teacher_reference_number"))
expect(page).to have_text(I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"))

fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"
Expand Down
6 changes: 3 additions & 3 deletions spec/features/early_career_payments_claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
click_on "Continue"

# - What is your teacher reference number
expect(page).to have_text(I18n.t("questions.teacher_reference_number"))
expect(page).to have_text(I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"))

fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"
Expand Down Expand Up @@ -616,7 +616,7 @@
click_on "Continue"

# - What is your teacher reference number
expect(page).to have_text(I18n.t("questions.teacher_reference_number"))
expect(page).to have_text(I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"))

fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"
Expand Down Expand Up @@ -937,7 +937,7 @@
click_on "Continue"

# - What is your teacher reference number
expect(page).to have_text(I18n.t("questions.teacher_reference_number"))
expect(page).to have_text(I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"))

fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
choose "Female"
click_on "Continue"

expect(page).to have_content("What is your teacher reference number (TRN)?")
expect(page).to have_content("Teacher reference number (TRN)")
fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
choose "Female"
click_on "Continue"

expect(page).to have_content("What is your teacher reference number (TRN)?")
expect(page).to have_content("Teacher reference number (TRN)")
fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"

Expand Down
2 changes: 1 addition & 1 deletion spec/features/levelling_up_premium_payments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def claim_up_to_check_your_answers
click_on "Continue"

# - What is your teacher reference number
expect(page).to have_text(I18n.t("questions.teacher_reference_number"))
expect(page).to have_text(I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"))

fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"
Expand Down
2 changes: 1 addition & 1 deletion spec/features/student_loans_claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def fill_in_remaining_personal_details_and_submit

expect(session.reload.answers.payroll_gender).to eq("male")

expect(page).to have_text(I18n.t("questions.teacher_reference_number"))
expect(page).to have_text(I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"))
fill_in "claim-teacher-reference-number-field", with: "1234567"
click_on "Continue"

Expand Down
2 changes: 1 addition & 1 deletion spec/support/journey_answers_presenter_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
[I18n.t("forms.address.questions.your_address"), "Flat 1, 1 Test Road, Test Town, AB1 2CD", "address"],
[I18n.t("questions.date_of_birth"), "10 January 1980", "personal-details"],
[I18n.t("forms.gender.questions.payroll_gender"), "Don’t know", "gender"],
[I18n.t("questions.teacher_reference_number"), "1234567", "teacher-reference-number"],
[I18n.t("forms.teacher_reference_number.questions.teacher_reference_number"), "1234567", "teacher-reference-number"],
[I18n.t("questions.national_insurance_number"), "QQ123456C", "personal-details"],
[I18n.t("questions.email_address"), "[email protected]", "email-address"],
[I18n.t("questions.provide_mobile_number"), "Yes", "provide-mobile-number"],
Expand Down

0 comments on commit bdddb86

Please sign in to comment.