From 9126d990e371640f635eba01343df6d52ea1c0e1 Mon Sep 17 00:00:00 2001 From: Alkesh Vaghmaria Date: Thu, 26 Sep 2024 12:06:55 +0100 Subject: [PATCH 1/3] EY practitioner personal details --- .../early_years_payment/practitioner/slug_sequence.rb | 1 + ...onal_details.html.erb => enter_home_address.html.erb} | 0 .../early_years_payment/practitioner/happy_path_spec.rb | 9 +++++++++ 3 files changed, 10 insertions(+) rename app/views/early_years_payment/practitioner/claims/{personal_details.html.erb => enter_home_address.html.erb} (100%) diff --git a/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb b/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb index e2119be7c6..3ff06fdeda 100644 --- a/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb +++ b/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb @@ -7,6 +7,7 @@ class SlugSequence one-login-sign-in how-we-use-your-information personal-details + enter-home-address ].freeze def self.start_page_url diff --git a/app/views/early_years_payment/practitioner/claims/personal_details.html.erb b/app/views/early_years_payment/practitioner/claims/enter_home_address.html.erb similarity index 100% rename from app/views/early_years_payment/practitioner/claims/personal_details.html.erb rename to app/views/early_years_payment/practitioner/claims/enter_home_address.html.erb diff --git a/spec/features/early_years_payment/practitioner/happy_path_spec.rb b/spec/features/early_years_payment/practitioner/happy_path_spec.rb index c6c07025c6..fcb336aba7 100644 --- a/spec/features/early_years_payment/practitioner/happy_path_spec.rb +++ b/spec/features/early_years_payment/practitioner/happy_path_spec.rb @@ -16,5 +16,14 @@ expect(page.title).to have_text("How we’ll use the information you provide") expect(page).to have_content("How we’ll use the information you provide") click_on "Continue" + + expect(page).to have_content("Personal details") + fill_in "First name", with: "John" + fill_in "Last name", with: "Doe" + fill_in "Day", with: "28" + fill_in "Month", with: "2" + fill_in "Year", with: "1988" + fill_in "National Insurance number", with: "PX321499A" + click_on "Continue" end end From 77c8d27b5cd63eac63661e9f5699912097ca7826 Mon Sep 17 00:00:00 2001 From: Alkesh Vaghmaria Date: Thu, 26 Sep 2024 12:41:21 +0100 Subject: [PATCH 2/3] adding placeholder text to make reviewing app nicer --- .../practitioner/claims/enter_home_address.html.erb | 1 + .../practitioner/claims/find_reference.html.erb | 1 + .../practitioner/claims/one_login_sign_in.html.erb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/views/early_years_payment/practitioner/claims/enter_home_address.html.erb b/app/views/early_years_payment/practitioner/claims/enter_home_address.html.erb index e69de29bb2..c44cd22b03 100644 --- a/app/views/early_years_payment/practitioner/claims/enter_home_address.html.erb +++ b/app/views/early_years_payment/practitioner/claims/enter_home_address.html.erb @@ -0,0 +1 @@ +

enter home address page goes here

diff --git a/app/views/early_years_payment/practitioner/claims/find_reference.html.erb b/app/views/early_years_payment/practitioner/claims/find_reference.html.erb index 6a5966adca..c8b06f98a5 100644 --- a/app/views/early_years_payment/practitioner/claims/find_reference.html.erb +++ b/app/views/early_years_payment/practitioner/claims/find_reference.html.erb @@ -1 +1,2 @@ +

find reference page goes here

<%= govuk_button_to "Continue", claim_path(current_journey_routing_name), method: :patch %> diff --git a/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb b/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb index e05d02bca9..f1defd23b9 100644 --- a/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb +++ b/app/views/early_years_payment/practitioner/claims/one_login_sign_in.html.erb @@ -1,3 +1,4 @@ +

one login page goes here

<%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder, html: { novalidate: false } do |f| %> <%= f.govuk_submit %> <% end %> From 098322bdf033f36c828a5bea8b4164eb423818c1 Mon Sep 17 00:00:00 2001 From: Alkesh Vaghmaria Date: Thu, 26 Sep 2024 16:49:56 +0100 Subject: [PATCH 3/3] make personal details a partial, allowing for different heading sizes --- .../claims/_personal_details_page.html.erb | 70 ++++++++++++++++++ app/views/claims/personal_details.html.erb | 71 +------------------ .../claims/personal_details.html.erb | 1 + 3 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 app/views/claims/_personal_details_page.html.erb create mode 100644 app/views/early_years_payment/practitioner/claims/personal_details.html.erb diff --git a/app/views/claims/_personal_details_page.html.erb b/app/views/claims/_personal_details_page.html.erb new file mode 100644 index 0000000000..092511febc --- /dev/null +++ b/app/views/claims/_personal_details_page.html.erb @@ -0,0 +1,70 @@ +<% content_for(:page_title, page_title(t("questions.personal_details"), journey: current_journey_routing_name, show_error: @form.errors.any?)) %> + +
+
+ <%= form_for @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> + <%= f.govuk_error_summary %> + +

+ <%= t("questions.personal_details") %> +

+ + <% if @form.show_name_section? %> +
+ <%= f.govuk_fieldset legend: { + text: "What is your full name?", + tag: "h2", + size: subheading_size + } do %> + <%= f.govuk_text_field :first_name, + label: { text: "First name" }, + autocomplete: "given-name" + %> + + <%= f.govuk_text_field :middle_name, + label: { text: "Middle names" }, + autocomplete: "additional-name" + %> + + <%= f.govuk_text_field :surname, + label: { text: "Last name" }, + autocomplete: "family-name" + %> + <% end %> +
+ <% end %> + + <% if @form.show_date_of_birth_section? %> +
+ <%= f.govuk_date_field :date_of_birth, + date_of_birth: true, + legend: { + text: "What is your date of birth?", + tag: "h2", + size: subheading_size + }, + hint: { text: "For example, 31 03 1980. We need this information to verify your identity." } %> +
+ <% end %> + + <% if @form.show_nino_section? %> +
+ <%= f.govuk_text_field :national_insurance_number, + width: 10, + spellcheck: false, + autocomplete: "off", + label: { + text: t("questions.national_insurance_number"), + size: subheading_size, + tag: "h2" + }, + hint: -> do %> + It’s on your National Insurance card, benefit letter, payslip or P60. For example ‘QQ123456C’. + <% end %> +
+ <% end %> + + <%= f.govuk_submit "Continue" %> + <% end %> +
+
diff --git a/app/views/claims/personal_details.html.erb b/app/views/claims/personal_details.html.erb index 62fba12c2b..71721229e9 100644 --- a/app/views/claims/personal_details.html.erb +++ b/app/views/claims/personal_details.html.erb @@ -1,70 +1 @@ -<% content_for(:page_title, page_title(t("questions.personal_details"), journey: current_journey_routing_name, show_error: @form.errors.any?)) %> - -
-
- <%= form_for @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> - <%= f.govuk_error_summary %> - -

- <%= t("questions.personal_details") %> -

- - <% if @form.show_name_section? %> -
- <%= f.govuk_fieldset legend: { - text: "What is your full name?", - tag: "h2", - size: "l" - } do %> - <%= f.govuk_text_field :first_name, - label: { text: "First name" }, - autocomplete: "given-name" - %> - - <%= f.govuk_text_field :middle_name, - label: { text: "Middle names" }, - autocomplete: "additional-name" - %> - - <%= f.govuk_text_field :surname, - label: { text: "Last name" }, - autocomplete: "family-name" - %> - <% end %> -
- <% end %> - - <% if @form.show_date_of_birth_section? %> -
- <%= f.govuk_date_field :date_of_birth, - date_of_birth: true, - legend: { - text: "What is your date of birth?", - tag: "h2", - size: "l" - }, - hint: { text: "For example, 31 03 1980. We need this information to verify your identity." } %> -
- <% end %> - - <% if @form.show_nino_section? %> -
- <%= f.govuk_text_field :national_insurance_number, - width: 10, - spellcheck: false, - autocomplete: "off", - label: { - text: t("questions.national_insurance_number"), - size: "l", - tag: "h2" - }, - hint: -> do %> - It’s on your National Insurance card, benefit letter, payslip or P60. For example ‘QQ123456C’. - <% end %> -
- <% end %> - - <%= f.govuk_submit "Continue" %> - <% end %> -
-
+<%= render "personal_details_page", heading_size: "xl", subheading_size: "l" %> diff --git a/app/views/early_years_payment/practitioner/claims/personal_details.html.erb b/app/views/early_years_payment/practitioner/claims/personal_details.html.erb new file mode 100644 index 0000000000..f3f1eb1a5c --- /dev/null +++ b/app/views/early_years_payment/practitioner/claims/personal_details.html.erb @@ -0,0 +1 @@ +<%= render "personal_details_page", heading_size: "l", subheading_size: "m" %>