Skip to content

Commit

Permalink
SDIT-2337: ✨ Add in personal detail (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
petergphillips authored Dec 4, 2024
1 parent 08b0209 commit 7e91e07
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
10 changes: 10 additions & 0 deletions integration_tests/e2e/detail.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,15 @@ context('Detail', () => {
Page.verifyOnPageWithTitleParam(DetailPage, 'Firsta Middlea SURNAMEA')

cy.get('[data-qa="dob"]').contains('01/01/1980')
cy.get('[data-qa="gender"]').should('have.text', 'Male')
cy.get('[data-qa="ethnicity"]').should('have.text', 'White')
cy.get('[data-qa="birthCountry"]').should('have.text', 'England')
cy.get('[data-qa="maritalStatus"]').should('have.text', 'Single')
cy.get('[data-qa="nationality"]').should('have.text', 'United Kingdom')
cy.get('[data-qa="religion"]').should('have.text', 'Church Of England')
cy.get('[data-qa="prisonNumber"]').should('have.text', 'AB111111')
cy.get('[data-qa="paroleNumbers"]').should('have.text', 'AA12311')
cy.get('[data-qa="pncNumber"]').should('have.text', '012345/99A')
cy.get('[data-qa="croNumber"]').should('have.text', '012345/99C')
})
})
2 changes: 1 addition & 1 deletion server/views/pages/detail.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block content %}
<div class="govuk-grid-row govuk-body">
<div class="govuk-grid-column-three-quarters">
<h1>{{ personalDetails.firstName | capitalize }} {{ personalDetails.middleName | capitalize }} {{ personalDetails.lastName }}</h1>
<h1>{{ personalDetails.firstName | title }} {{ personalDetails.middleName | title }} {{ personalDetails.lastName }}</h1>
</div>
</div>
<div class="govuk-grid-row">
Expand Down
2 changes: 1 addition & 1 deletion server/views/pages/print.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name: "section",
fieldset: {
legend: {
text: "Which details would you like to save for " + (personalDetails.firstName | capitalize) + " " + personalDetails.lastName + "?",
text: "Which details would you like to save for " + (personalDetails.firstName | title) + " " + personalDetails.lastName + "?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
Expand Down
48 changes: 48 additions & 0 deletions server/views/partials/detail/summary.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,54 @@
{{ summaryListRow("Date of birth", (personalDetails.dob | formatDate) + " (" + personalDetails.dob | getAge + " years)", "dob") }}
</dl>
{% endif %}
{% if personalDetails.sex === 'F' or personalDetails.sex === 'M' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Gender", "Male" if personalDetails.sex === 'M' else "Female", "gender") }}
</dl>
{% endif %}
{% if personalDetails.ethnicity and personalDetails.ethnicity !== 'NOT STATED' and personalDetails.ethnicity !== 'OTHER' and personalDetails.ethnicity !== 'Other' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Ethnicity", personalDetails.ethnicity | title, "ethnicity") }}
</dl>
{% endif %}
{% if personalDetails.maritalStatus and personalDetails.maritalStatus !== 'NOT REQUIRED' and personalDetails.maritalStatus !== 'Refused or Unacceptable Ans.' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Marital status", personalDetails.maritalStatus | title, "maritalStatus") }}
</dl>
{% endif %}
{% if personalDetails.birthCountry and personalDetails.birthCountry !== 'UNKNOWN' and personalDetails.birthCountry !== 'OTHER' and personalDetails.birthCountry !== 'Other' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Country of birth", personalDetails.birthCountry | title, "birthCountry") }}
</dl>
{% endif %}
{% if personalDetails.nationality and personalDetails.nationality !== 'UNAVAILABALE' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Nationality", personalDetails.nationality | title, "nationality") }}
</dl>
{% endif %}
{% if personalDetails.religion and personalDetails.religion !== 'NON PERMITTED RELIGIONS' and personalDetails.religion !== 'OTHER NON PERMITTED RELIGION' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Religion", personalDetails.religion | title, "religion") }}
</dl>
{% endif %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Prison number", personalDetails.prisonNumber, "prisonNumber") }}
</dl>
{% if personalDetails.paroleNumbers %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("Parole numbers", personalDetails.paroleNumbers, "paroleNumbers") }}
</dl>
{% endif %}
{% if personalDetails.pncNumber %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("PNC number", personalDetails.pncNumber, "pncNumber") }}
</dl>
{% endif %}
{% if personalDetails.croNumber %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-0">
{{ summaryListRow("CRO number", personalDetails.croNumber, "croNumber") }}
</dl>
{% endif %}
</div>
</div>
{%- endcall -%}

0 comments on commit 7e91e07

Please sign in to comment.