Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADJUST1-558 DR Confirm delete pages (For all adjustment types) #278

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_tests/pages/tagged-bail/removeTaggedBail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PageElement } from '../page'

export default class RemoveTaggedBailPage extends AdjustmentsPage {
constructor() {
super('Delete Tagged Bail')
super('Delete tagged bail')
}

public submit = (): PageElement => cy.get('[data-qa=remove-button]')
Expand Down
1 change: 0 additions & 1 deletion server/routes/adjustmentRoutes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ describe('Adjustment routes tests', () => {
.expect(res => {
expect(res.text).toContain('5 Apr 2023')
expect(res.text).toContain('22')
expect(res.text).toContain('Are you sure you want to delete this RADA?')
})
})

Expand Down
6 changes: 3 additions & 3 deletions server/routes/taggedBailRoutes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('Tagged bail routes tests', () => {
.get(`/${NOMS_ID}/tagged-bail/remove/1`)
.expect(200)
.expect(res => {
expect(res.text).toContain('Delete Tagged Bail')
expect(res.text).toContain('Delete tagged bail')
expect(res.text).toContain('Court 2 <span class="vertical-bar"></span> CASE001 <br>19 Aug 2021')
expect(res.text).toContain('9955')
})
Expand All @@ -189,7 +189,7 @@ describe('Tagged bail routes tests', () => {
.get(`/${NOMS_ID}/tagged-bail/remove/1`)
.expect(200)
.expect(res => {
expect(res.text).toContain('Delete Tagged Bail')
expect(res.text).toContain('Delete tagged bail')
expect(res.text).toContain('Court 2 <span class="vertical-bar"></span> CASE001 <br>19 Aug 2021')
expect(res.text).toContain('9955')
})
Expand All @@ -208,7 +208,7 @@ describe('Tagged bail routes tests', () => {
.get(`/${NOMS_ID}/tagged-bail/remove/1`)
.expect(200)
.expect(res => {
expect(res.text).toContain('Delete Tagged Bail')
expect(res.text).toContain('Delete tagged bail')
expect(res.text).toContain(
'The updates will change the amount of unused deductions. Check the unused remand alert on NOMIS',
)
Expand Down
18 changes: 12 additions & 6 deletions server/views/pages/adjustments/remand/remove.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<h1 class="govuk-heading-xl"><span class="govuk-caption-xl">Adjustments</span>
Delete remand
</h1>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-m">
Remand details
</h1>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
Expand All @@ -29,18 +36,17 @@
offenderNo: prisoner.prisonerNumber
}) }}

<div class="govuk-!-margin-bottom-6">
<h2 class="govuk-heading-m">Are you sure you want to delete this period of remand?</h2>
{% if model.showUnusedMessage %}
{% if model.showUnusedMessage %}
<div class="govuk-!-margin-bottom-6">
<p>The remand time will be removed. This will change the amount of unused deductions. Check the unused remand alert on NOMIS.</p>
{% endif %}
</div>
</div>
{% endif %}

<form method="post">
<input type="hidden" name="_csrf" value="{{ csrfToken }}"/>
<div class="govuk-button-group">
{{ govukButton({
text: "Delete remand",
text: "Delete",
type: submit,
preventDoubleClick: true,
attributes: { 'data-qa': 'remove-button' }
Expand Down
12 changes: 8 additions & 4 deletions server/views/pages/adjustments/remove.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@
</h1>
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-m">
{{model.adjustmentType.shortText}} details
</h1>
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
{{ govukSummaryList({
rows: model.summaryRows()
}) }}
<div class="govuk-!-margin-bottom-6">
<h2 class="govuk-heading-m">Are you sure you want to delete this {{ model.adjustmentType.shortText }}?</h2>
</div>
<form method="post">
<input type="hidden" name="_csrf" value="{{ csrfToken }}"/>
<div class="govuk-button-group">
{{ govukButton({
text: "Delete " + model.adjustmentType.shortText,
text: "Delete",
type: submit,
preventDoubleClick: true,
attributes: { 'data-qa': 'remove-button' }
Expand Down
14 changes: 7 additions & 7 deletions server/views/pages/adjustments/tagged-bail/remove.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Delete Tagged Bail
<span class="govuk-caption-xl">Adjustments</span>
Delete tagged bail
</h1>
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-m">
Tagged Bail details
Tagged bail details
</h1>
</div>
</div>
Expand All @@ -35,12 +36,11 @@
{{ govukTable(
model.table()
) }}
<div class="govuk-!-margin-bottom-6">
<h2 class="govuk-heading-m">Are you sure you want to delete this period of tagged bail?</h2>
{% if model.showUnusedMessage %}
{% if model.showUnusedMessage %}
<div class="govuk-!-margin-bottom-6">
<p>The updates will change the amount of unused deductions. Check the unused remand alert on NOMIS.</p>
{% endif %}
</div>
</div>
{% endif %}
<form method="post">
<input type="hidden" name="_csrf" value="{{ csrfToken }}"/>
<div class="govuk-button-group">
Expand Down