Skip to content

Commit

Permalink
MAN-218 add new section card to personal details
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj committed Jan 24, 2025
1 parent f0310cd commit b55f31d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
5 changes: 4 additions & 1 deletion integration_tests/e2e/personalDetails.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ context('Personal Details', () => {
page
.getRowData('personalDetails', 'criminogenicNeeds', 'Value')
.should('contain.text', 'Education, Training and Employability')
page.getRowData('personalDetails', 'crn', 'Value').should('contain.text', 'X000001')
page.getRowData('personalDetails', 'documents', 'Value').should('contain.text', 'Eula-Schmeler-X000001-UPW.pdf')

page.getRowData('identityNumber', 'crn', 'Value').should('contain.text', 'X000001')
page.getRowData('identityNumber', 'pnc', 'Value').should('contain.text', '1954/0018147W')
page.getRowData('identityNumber', 'noms', 'Value').should('contain.text', 'G9566GQ')

page.getRowData('equalityMonitoring', 'religionOrBelief', 'Value').should('contain.text', 'Scientology')
page.getRowData('equalityMonitoring', 'sex', 'Value').should('contain.text', 'Female')
page.getRowData('equalityMonitoring', 'genderIdentity', 'Value').should('contain.text', 'Non-Binary')
Expand Down
35 changes: 27 additions & 8 deletions server/views/pages/personal-details.njk
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,6 @@
key: { html: '<span data-qa="criminogenicNeedsLabel">Criminogenic needs</span>' },
value: { html: '<span data-qa="criminogenicNeedsValue">' + criminogenicNeeds + '</span>' }
},
{
key: { html: '<span data-qa="pncLabel">PNC</span>' },
value: { html: '<span data-qa="pncValue" class="app-!-font-family-tabular">' + personalDetails.pnc + '</span>' }
} if personalDetails.pnc,
{
key: { html: '<span data-qa="crnLabel">CRN</span>' },
value: { html: '<span data-qa="crnValue" class="app-!-font-family-tabular">' + personalDetails.crn + '</span>' }
},
{
key: { html: '<span data-qa="documentsLabel">Personal documents</span>' },
value: { html: '<span data-qa="documentsValue">' + documents + '</span>' }
Expand All @@ -344,6 +336,33 @@
actions: {}
}) }}

{% set identityNumbers %}
{{ govukSummaryList({
rows: [
{
key: { html: '<span data-qa="crnLabel">CRN</span>' },
value: { html: '<span data-qa="crnValue" class="app-!-font-family-tabular">' + personalDetails.crn + '</span>' }
},
{
key: { html: '<span data-qa="pncLabel">PNC number</span>' },
value: { html: '<span data-qa="pncValue" class="app-!-font-family-tabular">' + personalDetails.pnc + '</span>' }
} if personalDetails.pnc,
{
key: { html: '<span data-qa="nomsLabel">Prison number</span>' },
value: { html: '<span data-qa="nomsValue" class="app-!-font-family-tabular">' + personalDetails.noms + '</span>' }
} if personalDetails.noms
]
}) }}
{% endset %}

{{ appSummaryCard({
attributes: {'data-qa': 'identityNumberCard'},
titleText: "Identity numbers",
classes: 'govuk-!-margin-bottom-6 app-summary-card--large-title',
html: identityNumbers,
actions: {}
}) }}

{% set equality %}
{{ govukSummaryList({
rows: [
Expand Down
2 changes: 2 additions & 0 deletions wiremock/mappings/X000001-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@
"status": 200,
"jsonBody": {
"crn": "X000001",
"pnc": "1954/0018147W",
"noms": "G9566GQ",
"name": {
"forename": "Eula",
"middleName": "",
Expand Down

0 comments on commit b55f31d

Please sign in to comment.