diff --git a/.trivyignore b/.trivyignore index e69de29bb..182cdd3c3 100644 --- a/.trivyignore +++ b/.trivyignore @@ -0,0 +1 @@ +CVE-2026-1615 # https://avd.aquasec.com/nvd/cve-2026-1615 - jsonpath - fixed version not available. This is a dev-dependecy brought in by pa11y. pa11y will be removed soon (TODO: CCM-13084) diff --git a/frontend/public/lib/nhs-frontend-js-check.js b/frontend/public/lib/nhs-frontend-js-check.js deleted file mode 100644 index 67b5fcad3..000000000 --- a/frontend/public/lib/nhs-frontend-js-check.js +++ /dev/null @@ -1 +0,0 @@ -document.body.className = ((document.body.className) ? `${document.body.className } js-enabled` : "js-enabled"); diff --git a/frontend/src/__tests__/app/edit-template-campaign/[templateId]/page.test.tsx b/frontend/src/__tests__/app/edit-template-campaign/[templateId]/page.test.tsx index 711d761f6..4c80a5222 100644 --- a/frontend/src/__tests__/app/edit-template-campaign/[templateId]/page.test.tsx +++ b/frontend/src/__tests__/app/edit-template-campaign/[templateId]/page.test.tsx @@ -23,11 +23,18 @@ const mockTemplate: TemplateDto = { lockNumber: 5, language: 'en', letterType: 'x0', - sidesCount: 2, createdAt: '2026-01-01T00:00:00.000Z', updatedAt: '2026-01-01T00:00:00.000Z', clientId: 'client-123', campaignId: 'Campaign 1', + files: { + initialRender: { + pageCount: 2, + currentVersion: 'version', + fileName: 'name.pdf', + status: 'RENDERED', + }, + }, }; beforeEach(() => { diff --git a/frontend/src/__tests__/app/edit-template-name/[templateId]/page.test.tsx b/frontend/src/__tests__/app/edit-template-name/[templateId]/page.test.tsx index f9ae37d8d..c017c7295 100644 --- a/frontend/src/__tests__/app/edit-template-name/[templateId]/page.test.tsx +++ b/frontend/src/__tests__/app/edit-template-name/[templateId]/page.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { redirect, RedirectType } from 'next/navigation'; -import { TemplateDto } from 'nhs-notify-backend-client'; +import type { AuthoringLetterTemplate } from 'nhs-notify-web-template-management-utils'; import { fetchClient } from '@utils/server-features'; import { getTemplate } from '@utils/form-actions'; import { verifyFormCsrfToken } from '@utils/csrf-utils'; @@ -14,7 +14,7 @@ jest.mock('@utils/form-actions'); jest.mock('@app/edit-template-name/[templateId]/server-action'); jest.mock('@utils/csrf-utils'); -const mockTemplate: TemplateDto = { +const mockTemplate: AuthoringLetterTemplate = { id: 'template-123', name: 'Original Template Name', templateType: 'LETTER', @@ -23,10 +23,18 @@ const mockTemplate: TemplateDto = { lockNumber: 5, language: 'en', letterType: 'x0', - sidesCount: 2, createdAt: '2026-01-01T00:00:00.000Z', updatedAt: '2026-01-01T00:00:00.000Z', clientId: 'client-123', + files: { + initialRender: { + fileName: 'render.pdf', + currentVersion: 'v1', + status: 'RENDERED', + pageCount: 2, + }, + }, + systemPersonalisation: [], }; beforeEach(() => { diff --git a/frontend/src/__tests__/app/message-plans/review-and-move-to-production/__snapshots__/page.test.tsx.snap b/frontend/src/__tests__/app/message-plans/review-and-move-to-production/__snapshots__/page.test.tsx.snap index 85a2cb231..3f686e44f 100644 --- a/frontend/src/__tests__/app/message-plans/review-and-move-to-production/__snapshots__/page.test.tsx.snap +++ b/frontend/src/__tests__/app/message-plans/review-and-move-to-production/__snapshots__/page.test.tsx.snap @@ -2,774 +2,778 @@ exports[`Review and move to production page matches snapshot for full cascade 1`] = ` -
-
- - Step 2 of 2 - -

- Review and move message plan to production -

-
-
-
- Name -
-
- Test config -
-
-
-

- -

-
    -
  • +
    -

    +

    +

    -
    +

    +
      +
    -
- -
  • -
  • - -
  • -
    - + +
    - + + Fallback conditions + +
    +
    - Fallback conditions - - +
      +
    • + + If first message read within 24 hours, no further messages sent. +
    • +
    • + + If first message not read within 24 hours, second message sent. +
    • +
    +
    +
    + +
  • - -
  • -
  • - -

    - Second message -

    -
    +

    + Second message +

    -

    - Email -

    -

    - email template name -

    -
    - + Email + +

    + email template name +

    +
    - - Preview - Email + Preview + + Email + + template - template - -
    -
    -
    -

    - message -

    - + +
    +
    +

    + message +

    + +
    -
    -
    + +
    - -
  • -
  • -
  • - - -
    - + +
    - + + Fallback conditions + +
    +
    - Fallback conditions - - +
      +
    • + + If second message delivered within 72 hours, no further messages sent. +
    • +
    • + + If second message not delivered within 72 hours, third message sent. +
    • +
    +
    +
    +
  • +
  • - -
  • -
  • - -

    - Third message -

    -
    +

    + Third message +

    -

    - Text message (SMS) -

    -

    - sms template name -

    -
    - + Text message (SMS) + +

    - +

    + - Preview - Text message (SMS) + Preview + + Text message (SMS) + + template - template - - -
    -
    -

    - message -

    - +
    +
    +
    +

    + message +

    + +
    -
    - + +
    - -
  • -
  • -
  • - - -
    - + +
    - + + Fallback conditions + +
    +
    - Fallback conditions - - +
      +
    • + + If third message delivered within 72 hours, no further messages sent. +
    • +
    • + + If third message not delivered within 72 hours, fourth message sent. +
    • +
    +
    +
    +
  • +
  • - -
  • -
  • - -

    - Fourth message -

    -
    +

    + Fourth message +

    - -
      -
    • - -
      - + +
      - - Conditions for accessible and language letters - -
      -
      -
        + Conditions for accessible and language letters + + +
        -
      • - - The relevant accessible or language letter will be sent instead of the standard English letter if, both: -
          -
        • - the recipient has requested an accessible or language letter in PDS -
        • -
        • - you've included the relevant template in this message plan -
        • -
        -
      • -
      -
      -
      -
    • -
    • -
      +
    • + + The relevant accessible or language letter will be sent instead of the standard English letter if, both: +
        +
      • + the recipient has requested an accessible or language letter in PDS +
      • +
      • + you've included the relevant template in this message plan +
      • +
      +
    • +
    + + +
  • +
  • -

    - Large print letter (optional) -

    -

    - - letter template name - -

    + Large print letter (optional) + +

    + + letter template name + +

    +
    - -
  • -
  • -
    +
  • - -
  • - - - -
    - - - - -
    + + + + - - + + + + - + + + Keep in draft + +
    + + - -
    + +
    `; diff --git a/frontend/src/__tests__/app/preview-letter-template/__snapshots__/page.test.tsx.snap b/frontend/src/__tests__/app/preview-letter-template/__snapshots__/page.test.tsx.snap new file mode 100644 index 000000000..fb78c9781 --- /dev/null +++ b/frontend/src/__tests__/app/preview-letter-template/__snapshots__/page.test.tsx.snap @@ -0,0 +1,1497 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`authoring letter with validation errors matches snapshot with error and no render 1`] = ` + +
    + +
    +
    + +
    +
    +
    + + Template + +

    + authoring letter template name +

    +
    +
    +
    +
    +
    + Template ID +
    +
    + authoring-letter-template-id +
    +
    +
    +
    +
    + Template type +
    +
    + Standard letter +
    +
    +
    +
    +
    + Status +
    +
    + + Checks failed + +
    +
    + + Learn more + + about status + + +
    +
    +
    +
    +
    +
    +
    +

    + + Back to all templates + +

    +
    +
    +
    +`; + +exports[`authoring letter with validation errors matches snapshot with error and render 1`] = ` + +
    + +
    +
    + +
    +
    +
    + + Template + +

    + authoring letter template name +

    +
    +
    +
    +
    +
    + Template ID +
    +
    + authoring-letter-template-id +
    +
    +
    +
    +
    + Template type +
    +
    + Standard letter +
    +
    +
    +
    +
    + Total pages +
    +
    + 2 +
    +
    +
    +
    +
    + Sheets +
    +
    + 1 +
    +
    + + Learn more + + about sheets + + +
    +
    +
    +
    + Status +
    +
    + + Checks failed + +
    +
    + + Learn more + + about status + + +
    +
    +
    +
    +
    +
    +
    +
    +

    + Letter preview +

    +

    + Check how your personalisation fields will appear in your letter. +

    +
    +

    + Example personalisation data +

    + +
    +
    +
    +
    + + +

    + PDS personalisation fields +

    +

    + The PDS fields will be pre-filled with example data when you choose a test recipient. +

    +
    + + +
    + +
    +
    +
    +