Skip to content

Commit

Permalink
WFP-2381: add registration flags to active/inactive regist… (#904)
Browse files Browse the repository at this point in the history
* ✨ WFP-2381: add registration flags to active/inactive registrations table

* ✨ WFP-2381: remove null flag from mock data and int test
  • Loading branch information
katie-cawthorne authored Apr 17, 2024
1 parent 7850d90 commit d5364fe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions integration_tests/integration/risk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@ context('Risk', () => {
.getTable()
.should('deep.equal', [
{
Flag: 'RoSH',
Type: 'Suicide/self-harm',
Registered: '13 December 2020',
Notes: 'Previous suicide /self-harm attempt. Needs further investigating.',
},
{
Flag: 'Alerts',
Type: 'Child concerns',
Registered: '13 December 2020',
Notes: 'Awaiting outcome of social services enquiry.',
},
{
Flag: 'Safeguarding',
Type: 'Medium RoSH',
Registered: '9 November 2021',
Notes: '-',
Expand All @@ -103,12 +106,14 @@ context('Risk', () => {
.getTable()
.should('deep.equal', [
{
Flag: 'Information',
Type: 'Domestic abuse perpetrator',
Registered: '14 June 2012',
'End date': '26 November 2019',
Notes: '-',
},
{
Flag: 'Public protection',
Type: 'Mental health issues',
Registered: '13 December 2017',
'End date': '13 June 2019',
Expand Down
5 changes: 5 additions & 0 deletions integration_tests/mockApis/risk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ export default {
registered: '2020-12-13',
nextReviewDate: '2022-06-13',
notes: 'Previous suicide /self-harm attempt. Needs further investigating.',
flag: 'RoSH',
},
{
type: 'Child concerns',
registered: '2020-12-13',
nextReviewDate: '2022-03-13',
notes: 'Awaiting outcome of social services enquiry.',
flag: 'Alerts',
},
{
type: 'Medium RoSH',
registered: '2021-11-09',
nextReviewDate: '2022-05-09',
notes: null,
flag: 'Safeguarding',
},
],
inactiveRegistrations: [
Expand All @@ -41,12 +44,14 @@ export default {
registered: '2012-06-14',
endDate: '2019-11-26',
notes: null,
flag: 'Information',
},
{
type: 'Mental health issues',
registered: '2017-12-13',
endDate: '2019-06-13',
notes: null,
flag: 'Public protection',
},
],
roshRisk: {
Expand Down
1 change: 1 addition & 0 deletions server/models/Registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export default interface Registration {
registered: string
notes: string
endDate: string
flag: string
}
14 changes: 12 additions & 2 deletions server/views/pages/risk.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
classes: 'active-registrations-table',
caption: 'Active registrations',
captionClasses: 'govuk-table__caption--m',
firstCellIsHeader: true,
head: [
{ text: 'Flag'},
{ text: 'Type'},
{ text: 'Registered'},
{ text: 'Notes'}
Expand All @@ -20,7 +22,10 @@
{% for registration in data.activeRegistrations %}
{{
activeRegistrationsData.rows.push([
{ text: registration.type },
{ text: registration.flag },
{ text: registration.type,
classes: 'govuk-table__header'
},
{ text: registration.registered | dateFormat },
{ text: registration.notes if registration.notes | length else '-'}
])
Expand All @@ -31,7 +36,9 @@
classes: 'inactive-registrations-table',
caption: 'Inactive registrations',
captionClasses: 'govuk-table__caption--m',
firstCellIsHeader: true,
head: [
{ text: 'Flag'},
{ text: 'Type'},
{ text: 'Registered'},
{ text: 'End date'},
Expand All @@ -43,7 +50,10 @@
{% for registration in data.inactiveRegistrations %}
{{
inactiveRegistrationsData.rows.push([
{ text: registration.type },
{ text: registration.flag },
{ text: registration.type,
classes: 'govuk-table__header'
},
{ text: registration.registered | dateFormat},
{ text: registration.endDate | dateFormat},
{ text: registration.notes if registration.notes | length else '-'}
Expand Down

0 comments on commit d5364fe

Please sign in to comment.