From 7f771d0e4e6cc84623c78b19b82fcaa7d2c457b5 Mon Sep 17 00:00:00 2001 From: Becky Ransome <91424856+Beckyrose200@users.noreply.github.com> Date: Fri, 24 May 2024 09:30:45 +0100 Subject: [PATCH] Two-part tariff review pages housekeeping (#1050) During work on one of the final two-part tariff review pages, it was pointed out there are a few inconsistency's in some of the pages code. This PR is for updating all the buttons on the two-part tariff review pages to have the preventDoubleClick attributes set as true. This is currently done on some pages but not all. This PR is also removing an unnecessary 'fromFinanicalYearEnding' property that it being fetched on one of our fetch services. The property isn't used once it's been fetched so it makes sense to remove it. --- .../two-part-tariff/fetch-review-charge-reference.service.js | 1 - app/views/bill-runs/amend-adjustment-factor.njk | 2 +- app/views/bill-runs/amend-billable-returns.njk | 2 +- app/views/bill-runs/match-details.njk | 3 ++- .../two-part-tariff/amend-adjustment-factor.service.test.js | 1 - .../two-part-tariff/charge-reference-details.service.test.js | 1 - .../fetch-review-charge-reference.service.test.js | 1 - 7 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.js b/app/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.js index b23f002745..c672c6c50d 100644 --- a/app/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.js +++ b/app/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.js @@ -30,7 +30,6 @@ async function _fetchBillRun (billRunId) { .findById(billRunId) .select( 'id', - 'fromFinancialYearEnding', 'toFinancialYearEnding') } diff --git a/app/views/bill-runs/amend-adjustment-factor.njk b/app/views/bill-runs/amend-adjustment-factor.njk index 57f6fc9dfe..e629d9a432 100644 --- a/app/views/bill-runs/amend-adjustment-factor.njk +++ b/app/views/bill-runs/amend-adjustment-factor.njk @@ -96,7 +96,7 @@ errorMessage: error.chargeAdjustmentElement }) }} - {{ govukButton({ text: 'Confirm' }) }} + {{ govukButton({ text: 'Confirm', preventDoubleClick: true }) }} diff --git a/app/views/bill-runs/amend-billable-returns.njk b/app/views/bill-runs/amend-billable-returns.njk index bac5b46a1a..d1f71293d1 100644 --- a/app/views/bill-runs/amend-billable-returns.njk +++ b/app/views/bill-runs/amend-billable-returns.njk @@ -98,7 +98,7 @@ {# Hidden input for authorised volume #} - {{ govukButton({ text: 'Confirm' }) }} + {{ govukButton({ text: 'Confirm', preventDoubleClick: true }) }} {% endblock %} diff --git a/app/views/bill-runs/match-details.njk b/app/views/bill-runs/match-details.njk index f5bf041af2..52b8e12c33 100644 --- a/app/views/bill-runs/match-details.njk +++ b/app/views/bill-runs/match-details.njk @@ -106,7 +106,8 @@ {{ govukButton({ text: "Edit the billable returns", href: "/system/bill-runs/" + billRunId + "/review/" + licenceId + "/match-details/" + chargeElement.chargeElementId + "/amend-billable-returns", - classes: "govuk-button--secondary" + classes: "govuk-button--secondary", + preventDoubleClick: true }) }} diff --git a/test/services/bill-runs/two-part-tariff/amend-adjustment-factor.service.test.js b/test/services/bill-runs/two-part-tariff/amend-adjustment-factor.service.test.js index 9b3cbc6584..2e8e7e7636 100644 --- a/test/services/bill-runs/two-part-tariff/amend-adjustment-factor.service.test.js +++ b/test/services/bill-runs/two-part-tariff/amend-adjustment-factor.service.test.js @@ -51,7 +51,6 @@ describe('Amend Adjustment Factor Service', () => { function _billRun () { return { id: 'cc4bbb18-0d6a-4254-ac2c-7409de814d7e', - fromFinancialYearEnding: 2023, toFinancialYearEnding: 2023 } } diff --git a/test/services/bill-runs/two-part-tariff/charge-reference-details.service.test.js b/test/services/bill-runs/two-part-tariff/charge-reference-details.service.test.js index 4ce9999c2d..73777fb4d8 100644 --- a/test/services/bill-runs/two-part-tariff/charge-reference-details.service.test.js +++ b/test/services/bill-runs/two-part-tariff/charge-reference-details.service.test.js @@ -54,7 +54,6 @@ describe('Charge Reference Details Service', () => { function _billRun () { return { id: 'cc4bbb18-0d6a-4254-ac2c-7409de814d7e', - fromFinancialYearEnding: 2023, toFinancialYearEnding: 2023 } } diff --git a/test/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.test.js b/test/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.test.js index eb62f5d710..b7aa7ca676 100644 --- a/test/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.test.js +++ b/test/services/bill-runs/two-part-tariff/fetch-review-charge-reference.service.test.js @@ -67,7 +67,6 @@ describe('Fetch Review Charge Reference service', () => { expect(result.billRun).to.equal({ id: billRun.id, - fromFinancialYearEnding: billRun.fromFinancialYearEnding, toFinancialYearEnding: billRun.toFinancialYearEnding }) })