diff --git a/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.test.ts b/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.test.ts index 7739adbd9c..6150f6b4a2 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.test.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.test.ts @@ -58,31 +58,13 @@ describe("sendAgentAndPayeeConfirmationEmail", () => { ], }, }); - queryMock.mockQuery({ - name: "LookupHumanReadableProjectType", - variables: { - rawList: [ - "alter.internal", - "alter.openings.add.doors.rear", - "alter.facades.paint", - ], - }, - data: { - projectTypes: [ - { description: "internal alterations" }, - { description: "addition of doorways to the rear of the building" }, - { description: "painting of facades" }, - ], - }, - }); const expectedConfig = { personalisation: { applicantName: "xyz", payeeName: "payeeName", address: "123 PLACE", - projectType: - "Internal alterations, addition of doorways to the rear of the building, and painting of facades", + projectType: "Paint the facade and changes to internal walls or layout", emailReplyToId: "123", helpEmail: "help@email.com", helpOpeningHours: "9-5", diff --git a/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.ts b/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.ts index 6ee3820fda..387980d8bd 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.ts @@ -1,13 +1,14 @@ -import { $public, $api } from "../../../../client"; -import { sendEmail } from "../../../../lib/notify"; +import { formatRawProjectTypes } from "@opensystemslab/planx-core"; import { gql } from "graphql-request"; +import { $api } from "../../../../client"; +import { sendEmail } from "../../../../lib/notify"; import type { AgentAndPayeeSubmissionNotifyConfig } from "../../../../types"; export async function sendAgentAndPayeeConfirmationEmail(sessionId: string) { const { personalisation, applicantEmail, payeeEmail, projectTypes } = await getDataForPayeeAndAgentEmails(sessionId); const projectType = projectTypes.length - ? await $public.formatRawProjectTypes(projectTypes) + ? formatRawProjectTypes(projectTypes) : "Project type not submitted"; const config: AgentAndPayeeSubmissionNotifyConfig = { personalisation: { diff --git a/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.test.ts b/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.test.ts index d836ff4c21..191dc6c522 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.test.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.test.ts @@ -6,11 +6,6 @@ import { validatePaymentRequestNotFoundQueryMock, validatePaymentRequestQueryMock, } from "../../../../tests/mocks/inviteToPayMocks"; -import { CoreDomainClient } from "@opensystemslab/planx-core"; - -jest - .spyOn(CoreDomainClient.prototype, "formatRawProjectTypes") - .mockResolvedValue("New office premises"); const TEST_PAYMENT_REQUEST_ID = "09655c28-3f34-4619-9385-cd57312acc44"; diff --git a/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.ts b/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.ts index ac2ca1d9f5..b281926d80 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/sendPaymentEmail.ts @@ -1,17 +1,16 @@ +import { formatRawProjectTypes } from "@opensystemslab/planx-core"; +import type { PaymentRequest } from "@opensystemslab/planx-core/types"; import { gql } from "graphql-request"; -import { - calculateExpiryDate, - getServiceLink, -} from "../../../saveAndReturn/service/utils"; import { Template, getClientForTemplate, sendEmail, } from "../../../../lib/notify"; -import { InviteToPayNotifyConfig } from "../../../../types"; -import { Team } from "../../../../types"; -import type { PaymentRequest } from "@opensystemslab/planx-core/types"; -import { $public } from "../../../../client"; +import { InviteToPayNotifyConfig, Team } from "../../../../types"; +import { + calculateExpiryDate, + getServiceLink, +} from "../../../saveAndReturn/service/utils"; interface SessionDetails { email: string; @@ -38,7 +37,7 @@ const sendSinglePaymentEmail = async ({ paymentRequestId, template, ); - const config = await getInviteToPayNotifyConfig(session, paymentRequest); + const config = getInviteToPayNotifyConfig(session, paymentRequest); const recipient = template.includes("-agent") ? session.email : paymentRequest.payeeEmail; @@ -105,10 +104,10 @@ const validatePaymentRequest = async ( } }; -const getInviteToPayNotifyConfig = async ( +const getInviteToPayNotifyConfig = ( session: SessionDetails, paymentRequest: PaymentRequest, -): Promise => ({ +): InviteToPayNotifyConfig => ({ personalisation: { ...session.flow.team.notifyPersonalisation, sessionId: paymentRequest.sessionId, @@ -121,9 +120,9 @@ const getInviteToPayNotifyConfig = async ( ).title, fee: getFee(paymentRequest), projectType: - (await $public.formatRawProjectTypes( + formatRawProjectTypes( paymentRequest.sessionPreviewData?.["proposal.projectType"] as string[], - )) || "Project type not submitted", + ) || "Project type not submitted", serviceName: session.flow.name, serviceLink: getServiceLink(session.flow.team, session.flow.slug), expiryDate: calculateExpiryDate(paymentRequest.createdAt), diff --git a/api.planx.uk/modules/saveAndReturn/service/resumeApplication.test.ts b/api.planx.uk/modules/saveAndReturn/service/resumeApplication.test.ts index b7cba296bf..62bc588b03 100644 --- a/api.planx.uk/modules/saveAndReturn/service/resumeApplication.test.ts +++ b/api.planx.uk/modules/saveAndReturn/service/resumeApplication.test.ts @@ -12,25 +12,6 @@ import { PartialDeep } from "type-fest"; const ENDPOINT = "/resume-application"; const TEST_EMAIL = "simulate-delivered@notifications.service.gov.uk"; -const mockFormatRawProjectTypes = jest - .fn() - .mockResolvedValue(["New office premises"]); - -jest.mock("@opensystemslab/planx-core", () => { - const actualCoreDomainClient = jest.requireActual( - "@opensystemslab/planx-core", - ).CoreDomainClient; - - return { - CoreDomainClient: class extends actualCoreDomainClient { - constructor() { - super(); - this.formatRawProjectTypes = () => mockFormatRawProjectTypes(); - } - }, - }; -}); - describe("buildContentFromSessions function", () => { it("should return correctly formatted content for a single session", async () => { const sessions: PartialDeep[] = [ @@ -56,7 +37,7 @@ describe("buildContentFromSessions function", () => { const result = `Service: Apply for a Lawful Development Certificate Address: 1 High Street - Project type: New office premises + Project type: New offices Expiry Date: 29 May 2026 Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123`; expect( @@ -126,15 +107,15 @@ describe("buildContentFromSessions function", () => { ]; const result = `Service: Apply for a Lawful Development Certificate Address: 1 High Street - Project type: New office premises + Project type: New offices Expiry Date: 29 May 2026 Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123\n\nService: Apply for a Lawful Development Certificate Address: 2 High Street - Project type: New office premises + Project type: New offices Expiry Date: 29 May 2026 Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=456\n\nService: Apply for a Lawful Development Certificate Address: 3 High Street - Project type: New office premises + Project type: New offices Expiry Date: 29 May 2026 Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=789`; expect( @@ -186,7 +167,7 @@ describe("buildContentFromSessions function", () => { ]; const result = `Service: Apply for a Lawful Development Certificate Address: 1 High Street - Project type: New office premises + Project type: New offices Expiry Date: 29 May 2026 Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123`; expect( @@ -219,7 +200,7 @@ describe("buildContentFromSessions function", () => { const result = `Service: Apply for a Lawful Development Certificate Address: Address not submitted - Project type: New office premises + Project type: New offices Expiry Date: 29 May 2026 Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123`; expect( @@ -231,7 +212,6 @@ describe("buildContentFromSessions function", () => { }); it("should handle an empty project type field", async () => { - mockFormatRawProjectTypes.mockResolvedValueOnce(""); const sessions: PartialDeep[] = [ { data: { diff --git a/api.planx.uk/modules/saveAndReturn/service/resumeApplication.ts b/api.planx.uk/modules/saveAndReturn/service/resumeApplication.ts index b229a7f1b0..52c093c435 100644 --- a/api.planx.uk/modules/saveAndReturn/service/resumeApplication.ts +++ b/api.planx.uk/modules/saveAndReturn/service/resumeApplication.ts @@ -1,7 +1,8 @@ +import { formatRawProjectTypes } from "@opensystemslab/planx-core"; import type { SiteAddress } from "@opensystemslab/planx-core/types"; import { differenceInDays } from "date-fns"; import { gql } from "graphql-request"; -import { $api, $public } from "../../../client"; +import { $api } from "../../../client"; import { sendEmail } from "../../../lib/notify"; import { LowCalSession, Team } from "../../../types"; import { DAYS_UNTIL_EXPIRY, calculateExpiryDate, getResumeLink } from "./utils"; @@ -109,9 +110,11 @@ const buildContentFromSessions = async ( const address: SiteAddress | undefined = session.data?.passport?.data?._address; const addressLine = address?.single_line_address || address?.title; - const projectType = await $public.formatRawProjectTypes( - session.data?.passport?.data?.["proposal.projectType"], - ); + const projectType = session.data?.passport?.data?.["proposal.projectType"] + ? formatRawProjectTypes( + session.data?.passport?.data?.["proposal.projectType"], + ) + : "Project type not submitted"; const resumeLink = getResumeLink(session, team, session.flow.slug); const expiryDate = calculateExpiryDate(session.created_at); diff --git a/api.planx.uk/modules/saveAndReturn/service/utils.ts b/api.planx.uk/modules/saveAndReturn/service/utils.ts index a7f54a9132..d1c61d58cb 100644 --- a/api.planx.uk/modules/saveAndReturn/service/utils.ts +++ b/api.planx.uk/modules/saveAndReturn/service/utils.ts @@ -1,9 +1,10 @@ +import { formatRawProjectTypes } from "@opensystemslab/planx-core"; import { SiteAddress } from "@opensystemslab/planx-core/types"; -import { format, addDays } from "date-fns"; +import { addDays, format } from "date-fns"; import { gql } from "graphql-request"; -import { LowCalSession, Team } from "../../../types"; +import { $api } from "../../../client"; import { Template, getClientForTemplate, sendEmail } from "../../../lib/notify"; -import { $api, $public } from "../../../client"; +import { LowCalSession, Team } from "../../../types"; const DAYS_UNTIL_EXPIRY = 28; const REMINDER_DAYS_FROM_EXPIRY = [7, 1]; @@ -120,7 +121,7 @@ const validateSingleSessionRequest = async ( flowSlug: session.flow.slug, flowName: session.flow.name, team: session.flow.team, - session: await getSessionDetails(session), + session: getSessionDetails(session), }; } catch (error) { throw Error(`Unable to validate request. ${(error as Error).message}`); @@ -139,14 +140,11 @@ interface SessionDetails { /** * Parse session details into an object which will be read by email template */ -export const getSessionDetails = async ( - session: LowCalSession, -): Promise => { +export const getSessionDetails = (session: LowCalSession): SessionDetails => { const passportProtectTypes = session.data.passport?.data?.["proposal.projectType"]; const projectTypes = - passportProtectTypes && - (await $public.formatRawProjectTypes(passportProtectTypes)); + passportProtectTypes && formatRawProjectTypes(passportProtectTypes); const address: SiteAddress | undefined = session.data?.passport?.data?._address; const addressLine = address?.single_line_address || address?.title; @@ -268,12 +266,12 @@ export const setupEmailEventTriggers = async (sessionId: string) => { }; export { - getSaveAndReturnPublicHeaders, - getResumeLink, - sendSingleApplicationEmail, - markSessionAsSubmitted, DAYS_UNTIL_EXPIRY, REMINDER_DAYS_FROM_EXPIRY, calculateExpiryDate, + getResumeLink, + getSaveAndReturnPublicHeaders, + markSessionAsSubmitted, + sendSingleApplicationEmail, softDeleteSession, }; diff --git a/api.planx.uk/modules/sendEmail/index.test.ts b/api.planx.uk/modules/sendEmail/index.test.ts index 8ae931321a..153f1632de 100644 --- a/api.planx.uk/modules/sendEmail/index.test.ts +++ b/api.planx.uk/modules/sendEmail/index.test.ts @@ -9,16 +9,11 @@ import { mockValidateSingleSessionRequest, mockValidateSingleSessionRequestMissingSession, } from "../../tests/mocks/saveAndReturnMocks"; -import { CoreDomainClient } from "@opensystemslab/planx-core"; // https://docs.notifications.service.gov.uk/node.html#email-addresses const TEST_EMAIL = "simulate-delivered@notifications.service.gov.uk"; const SAVE_ENDPOINT = "/send-email/save"; -jest - .spyOn(CoreDomainClient.prototype, "formatRawProjectTypes") - .mockResolvedValue("New office premises"); - describe("Send Email endpoint", () => { beforeEach(() => { queryMock.reset(); diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index 9e1d308b8a..969a53ec52 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -5,7 +5,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#b43b268", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#0c256f1", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index c1b21ac157..229a36c69c 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#b43b268 - version: github.com/theopensystemslab/planx-core/b43b268 + specifier: git+https://github.com/theopensystemslab/planx-core#0c256f1 + version: github.com/theopensystemslab/planx-core/0c256f1 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -8203,8 +8203,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/b43b268: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/b43b268} + github.com/theopensystemslab/planx-core/0c256f1: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/0c256f1} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index f59a16d87b..061accfde0 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -7,7 +7,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#b43b268", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#0c256f1", "axios": "^1.6.8", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", diff --git a/e2e/tests/api-driven/pnpm-lock.yaml b/e2e/tests/api-driven/pnpm-lock.yaml index 325902c9a3..c279fd4e5c 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#b43b268 - version: github.com/theopensystemslab/planx-core/b43b268 + specifier: git+https://github.com/theopensystemslab/planx-core#0c256f1 + version: github.com/theopensystemslab/planx-core/0c256f1 axios: specifier: ^1.6.8 version: 1.6.8 @@ -3053,8 +3053,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/b43b268: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/b43b268} + github.com/theopensystemslab/planx-core/0c256f1: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/0c256f1} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index 59e49915dd..416a040816 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,7 +8,7 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#b43b268", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#0c256f1", "axios": "^1.6.8", "dotenv": "^16.3.1", "eslint": "^8.56.0", diff --git a/e2e/tests/ui-driven/pnpm-lock.yaml b/e2e/tests/ui-driven/pnpm-lock.yaml index a8b7649791..d9423b574c 100644 --- a/e2e/tests/ui-driven/pnpm-lock.yaml +++ b/e2e/tests/ui-driven/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#b43b268 - version: github.com/theopensystemslab/planx-core/b43b268 + specifier: git+https://github.com/theopensystemslab/planx-core#0c256f1 + version: github.com/theopensystemslab/planx-core/0c256f1 axios: specifier: ^1.6.8 version: 1.6.8 @@ -2782,8 +2782,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/b43b268: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/b43b268} + github.com/theopensystemslab/planx-core/0c256f1: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/0c256f1} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 297c6d69d5..29b6f28e54 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -13,7 +13,7 @@ "@mui/material": "^5.15.2", "@mui/utils": "^5.15.2", "@opensystemslab/map": "^0.8.3", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#b43b268", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#0c256f1", "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.0.3", "@tiptap/extension-bubble-menu": "^2.1.13", diff --git a/editor.planx.uk/pnpm-lock.yaml b/editor.planx.uk/pnpm-lock.yaml index 7ea2dbb091..228984a6df 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -43,8 +43,8 @@ dependencies: specifier: ^0.8.3 version: 0.8.3 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#b43b268 - version: github.com/theopensystemslab/planx-core/b43b268(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#0c256f1 + version: github.com/theopensystemslab/planx-core/0c256f1(@types/react@18.2.45) '@tiptap/core': specifier: ^2.4.0 version: 2.4.0(@tiptap/pm@2.0.3) @@ -6819,11 +6819,11 @@ packages: - supports-color dev: true - /@storybook/builder-manager@8.1.10(prettier@3.0.0): + /@storybook/builder-manager@8.1.10(prettier@3.3.2): resolution: {integrity: sha512-dhg54zpaglR9XKNAiwMqm5/IONMCEG/hO/iTfNHJI1rAGeWhvM71cmhF+VlKUcjpTlIfHe7J19+TL+sWQJNgtg==} dependencies: '@fal-works/esbuild-plugin-global-externals': 2.1.2 - '@storybook/core-common': 8.1.10(prettier@3.0.0) + '@storybook/core-common': 8.1.10(prettier@3.3.2) '@storybook/manager': 8.1.10 '@storybook/node-logger': 8.1.10 '@types/ejs': 3.1.5 @@ -6927,12 +6927,12 @@ packages: '@babel/types': 7.24.7 '@ndelangen/get-tarball': 3.0.9 '@storybook/codemod': 8.1.10 - '@storybook/core-common': 8.1.10(prettier@3.0.0) + '@storybook/core-common': 8.1.10(prettier@3.3.2) '@storybook/core-events': 8.1.10 - '@storybook/core-server': 8.1.10(prettier@3.0.0)(react-dom@18.2.0)(react@18.2.0) + '@storybook/core-server': 8.1.10(prettier@3.3.2)(react-dom@18.2.0)(react@18.2.0) '@storybook/csf-tools': 8.1.10 '@storybook/node-logger': 8.1.10 - '@storybook/telemetry': 8.1.10(prettier@3.0.0) + '@storybook/telemetry': 8.1.10(prettier@3.3.2) '@storybook/types': 8.1.10 '@types/semver': 7.5.8 '@yarnpkg/fslib': 2.10.3 @@ -7071,7 +7071,7 @@ packages: - supports-color dev: true - /@storybook/core-common@8.1.10(prettier@3.0.0): + /@storybook/core-common@8.1.10(prettier@3.3.2): resolution: {integrity: sha512-+0GhgDRQwUlXu1lY77NdLnVBVycCEW0DG7eu7rvLYYkTyNRxbdl2RWsQpjr/j4sxqT6u82l9/b+RWpmsl4MgMQ==} peerDependencies: prettier: ^2 || ^3 @@ -7100,8 +7100,8 @@ packages: node-fetch: 2.7.0 picomatch: 2.3.1 pkg-dir: 5.0.0 - prettier: 3.0.0 - prettier-fallback: /prettier@3.0.0 + prettier: 3.3.2 + prettier-fallback: /prettier@3.3.2 pretty-hrtime: 1.0.3 resolve-from: 5.0.0 semver: 7.6.2 @@ -7133,16 +7133,16 @@ packages: ts-dedent: 2.2.0 dev: true - /@storybook/core-server@8.1.10(prettier@3.0.0)(react-dom@18.2.0)(react@18.2.0): + /@storybook/core-server@8.1.10(prettier@3.3.2)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-jNL5/daNyo7Rcu+y/bOmSB1P65pmcaLwvpr31EUEIISaAqvgruaneS3GKHg2TR0wcxEoHaM4abqhW6iwkI/XYQ==} dependencies: '@aw-web-design/x-default-browser': 1.4.126 '@babel/core': 7.24.7 '@babel/parser': 7.24.7 '@discoveryjs/json-ext': 0.5.7 - '@storybook/builder-manager': 8.1.10(prettier@3.0.0) + '@storybook/builder-manager': 8.1.10(prettier@3.3.2) '@storybook/channels': 8.1.10 - '@storybook/core-common': 8.1.10(prettier@3.0.0) + '@storybook/core-common': 8.1.10(prettier@3.3.2) '@storybook/core-events': 8.1.10 '@storybook/csf': 0.1.11 '@storybook/csf-tools': 8.1.10 @@ -7152,7 +7152,7 @@ packages: '@storybook/manager-api': 8.1.10(react-dom@18.2.0)(react@18.2.0) '@storybook/node-logger': 8.1.10 '@storybook/preview-api': 8.1.10 - '@storybook/telemetry': 8.1.10(prettier@3.0.0) + '@storybook/telemetry': 8.1.10(prettier@3.3.2) '@storybook/types': 8.1.10 '@types/detect-port': 1.3.5 '@types/diff': 5.2.1 @@ -7594,11 +7594,11 @@ packages: qs: 6.12.3 dev: true - /@storybook/telemetry@8.1.10(prettier@3.0.0): + /@storybook/telemetry@8.1.10(prettier@3.3.2): resolution: {integrity: sha512-pwiMWrq85D0AnaAgYNfB2w2BDgqnetQ+tXwsUAw4fUEFwA4oPU6r0uqekRbNNE6wmSSYjiiFP3JgknBFqjd2hg==} dependencies: '@storybook/client-logger': 8.1.10 - '@storybook/core-common': 8.1.10(prettier@3.0.0) + '@storybook/core-common': 8.1.10(prettier@3.3.2) '@storybook/csf-tools': 8.1.10 chalk: 4.1.2 detect-package-manager: 2.0.1 @@ -7912,20 +7912,6 @@ packages: pretty-format: 27.5.1 dev: true - /@testing-library/dom@8.20.1: - resolution: {integrity: sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==} - engines: {node: '>=12'} - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/runtime': 7.24.7 - '@types/aria-query': 5.0.4 - aria-query: 5.1.3 - chalk: 4.1.2 - dom-accessibility-api: 0.5.16 - lz-string: 1.5.0 - pretty-format: 27.5.1 - dev: true - /@testing-library/dom@9.3.4: resolution: {integrity: sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==} engines: {node: '>=14'} @@ -7963,7 +7949,7 @@ packages: react-dom: ^18.0.0 dependencies: '@babel/runtime': 7.24.7 - '@testing-library/dom': 8.20.1 + '@testing-library/dom': 9.3.4 '@types/react-dom': 18.2.18 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -21847,9 +21833,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/b43b268(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/b43b268} - id: github.com/theopensystemslab/planx-core/b43b268 + github.com/theopensystemslab/planx-core/0c256f1(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/0c256f1} + id: github.com/theopensystemslab/planx-core/0c256f1 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/src/pages/Pay/MakePayment.tsx b/editor.planx.uk/src/pages/Pay/MakePayment.tsx index 39afbf201f..09855bc305 100644 --- a/editor.planx.uk/src/pages/Pay/MakePayment.tsx +++ b/editor.planx.uk/src/pages/Pay/MakePayment.tsx @@ -2,6 +2,7 @@ import Check from "@mui/icons-material/Check"; import Container from "@mui/material/Container"; import { lighten, useTheme } from "@mui/material/styles"; import Typography from "@mui/material/Typography"; +import { formatRawProjectTypes } from "@opensystemslab/planx-core"; import { GovUKPayment, type PaymentRequest, @@ -170,14 +171,11 @@ export default function MakePayment({ ); const PaymentDetails = () => { - const $public = useStore((state) => state.$public); const [projectType, setProjectType] = useState(); useEffect(() => { const fetchProjectType = async () => { - const projectType = await $public().formatRawProjectTypes( - rawProjectTypes, - ); + const projectType = formatRawProjectTypes(rawProjectTypes); setProjectType(projectType); }; fetchProjectType();