Skip to content

Commit

Permalink
Merge pull request #3234 from DFE-Digital/LUPEYALPHA-983-EY-practitio…
Browse files Browse the repository at this point in the history
…ner-personal-details

[LUPEYALPHA-983] EY practitioner personal details
  • Loading branch information
alkesh authored Sep 26, 2024
2 parents 36e7d73 + 098322b commit 2dc4877
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
70 changes: 70 additions & 0 deletions app/views/claims/_personal_details_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<% content_for(:page_title, page_title(t("questions.personal_details"), 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-<%= heading_size %>">
<%= t("questions.personal_details") %>
</h1>

<% if @form.show_name_section? %>
<div class="govuk-form-group govuk-!-padding-bottom-6">
<%= 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 %>
</div>
<% end %>

<% if @form.show_date_of_birth_section? %>
<div class="govuk-!-padding-bottom-6">
<%= 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." } %>
</div>
<% end %>

<% if @form.show_nino_section? %>
<div class="govuk-!-padding-bottom-6">
<%= 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 %>
</div>
<% end %>

<%= f.govuk_submit "Continue" %>
<% end %>
</div>
</div>
71 changes: 1 addition & 70 deletions app/views/claims/personal_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,70 +1 @@
<% content_for(:page_title, page_title(t("questions.personal_details"), 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-xl">
<%= t("questions.personal_details") %>
</h1>

<% if @form.show_name_section? %>
<div class="govuk-form-group govuk-!-padding-bottom-6">
<%= 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 %>
</div>
<% end %>

<% if @form.show_date_of_birth_section? %>
<div class="govuk-!-padding-bottom-6">
<%= 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." } %>
</div>
<% end %>

<% if @form.show_nino_section? %>
<div class="govuk-!-padding-bottom-6">
<%= 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 %>
</div>
<% end %>

<%= f.govuk_submit "Continue" %>
<% end %>
</div>
</div>
<%= render "personal_details_page", heading_size: "xl", subheading_size: "l" %>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="govuk-body">enter home address page goes here</p>
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<p class="govuk-body">find reference page goes here</p>
<%= govuk_button_to "Continue", claim_path(current_journey_routing_name), method: :patch %>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<p class="govuk-body">one login page goes here</p>
<%= 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 %>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= render "personal_details_page", heading_size: "l", subheading_size: "m" %>
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2dc4877

Please sign in to comment.