Skip to content

Commit

Permalink
MAN-28 - preserve line breaks in notes
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj committed Oct 21, 2024
1 parent 2e66684 commit 6892b2d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
4 changes: 4 additions & 0 deletions assets/scss/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ $govuk-page-width: $moj-page-width;
.secondary-text {color: $govuk-secondary-text-colour; /* Using a GOV.UK Design System color */}
.strong { font-weight: 900;}

.line-break {
white-space: preserve-breaks;
}

.govuk-filter-background {
background-color: #f3f2f1;
padding: 32px 32px 5px 32px;
Expand Down
9 changes: 0 additions & 9 deletions integration_tests/e2e/licence-condition-note.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,5 @@ context('Sentence', () => {
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(3).should('contain.text', '22 April 2024'))

cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(4).should('contain.text', 'Note'))
cy.get(`[class=app-summary-card__body]`).within(() =>
cy
.get('dd')
.eq(4)
.should(
'contain.text',
'Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer. Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer.Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as desi123456\n',
),
)
})
})
2 changes: 1 addition & 1 deletion server/views/pages/licence-condition-note.njk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
{
key: { text: 'Note'},
value: { text: licenceNoteDetails.licenceCondition.licenceNote.note }
value: { html: '<p class="govuk-body line-break">' + licenceNoteDetails.licenceCondition.licenceNote.note + '<\p>' }
}
]
}) }}
Expand Down
4 changes: 2 additions & 2 deletions server/views/pages/sentence.njk
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@
{% for lcNote in licenceCondition.notes %}
{% set notes %}
{% if lcNote.hasNotesBeenTruncated === true %}
<p class="govuk-body">{{ lcNote.note }}...<a href="/case/{{ crn }}/sentence/licence-condition/{{ licenceCondition.id }}/note/{{ lcNote.id }}">View full note</a>
<p class="govuk-body line-break">{{ lcNote.note }}...<a href="/case/{{ crn }}/sentence/licence-condition/{{ licenceCondition.id }}/note/{{ lcNote.id }}">View full note</a>
</p>
{% else %}
<p class="govuk-body">{{ lcNote.note }} </p>
<p class="govuk-body line-break">{{ lcNote.note }} </p>
{% endif %}

{% if lcNote.createdBy %}
Expand Down
2 changes: 1 addition & 1 deletion wiremock/mappings/X000001-licence-note-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"id": 0,
"createdBy": "CVL Service",
"createdByDate": "2024-04-22",
"note": "Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer. Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer.Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as desi123456\n"
"note": "Licence Condition created automatically from the Create and Vary a licence system of\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer. Licence Condition created automatically from the Create and Vary a licence system of\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer.Licence Condition created automatically from the Create and Vary a licence system of\nAllow person(s) as desi123456\n"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions wiremock/mappings/X000001-sentence.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"id": 0,
"createdBy": "Jon Jones",
"createdByDate": "2024-08-21",
"note": "Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer. Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer.Licence Condition created automatically from the Create and Vary a licence system of\\nAllow person(s) as desi",
"note": "Licence Condition created automatically from the Create and Vary a licence system of\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer. Licence Condition created automatically from the Create and Vary a licence system of\nAllow person(s) as designated by your supervising officer to install an electronic monitoring tag on you and access to install any associated equipment in your property, and for the purpose of ensuring that equipment is functioning correctly. You must not damage or tamper with these devices and ensure that the tag is charged, and report to your supervising officer and the EM provider immediately if the tag or the associated equipment are not working correctly. This will be for the purpose of monitoring your alcohol abstinence licence condition(s) unless otherwise authorised by your supervising officer.Licence Condition created automatically from the Create and Vary a licence system of\nAllow person(s) as desi",
"hasNotesBeenTruncated": true
}
]
Expand All @@ -96,7 +96,7 @@
"notes": [
{
"id": 1,
"note": "Not to go to a football game.",
"note": "Not to go to a football game.\nmulti-line\n\nnote\n\nthis is the forth line",
"hasNotesBeenTruncated": false
}
]
Expand Down

0 comments on commit 6892b2d

Please sign in to comment.