From 6fd810af4c99ba65a491e1d3b272e559d94c2f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 21 Mar 2024 15:46:02 +0100 Subject: [PATCH] chore: Drop `GOVPAY_METADATA` feature flag --- .../src/@planx/components/Pay/Editor.test.tsx | 3 - .../src/@planx/components/Pay/Editor.tsx | 140 +++++++++--------- editor.planx.uk/src/lib/featureFlags.ts | 2 +- 3 files changed, 69 insertions(+), 76 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/Pay/Editor.test.tsx b/editor.planx.uk/src/@planx/components/Pay/Editor.test.tsx index 7824c32e27..ab5d70006c 100644 --- a/editor.planx.uk/src/@planx/components/Pay/Editor.test.tsx +++ b/editor.planx.uk/src/@planx/components/Pay/Editor.test.tsx @@ -34,9 +34,6 @@ describe("Pay component - Editor Modal", () => { describe("GOV.UK Pay Metadata section", () => { jest.setTimeout(20000); - beforeAll(() => toggleFeatureFlag("GOVPAY_METADATA")); - afterAll(() => toggleFeatureFlag("GOVPAY_METADATA")); - // Set up mock state with platformAdmin user so all Editor features are enabled const { getState, setState } = vanillaStore; const mockUser: User = { diff --git a/editor.planx.uk/src/@planx/components/Pay/Editor.tsx b/editor.planx.uk/src/@planx/components/Pay/Editor.tsx index afb17f929a..0cef28938e 100644 --- a/editor.planx.uk/src/@planx/components/Pay/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Pay/Editor.tsx @@ -17,7 +17,6 @@ import { MoreInformation, } from "@planx/components/ui"; import { Form, Formik, useFormikContext } from "formik"; -import { hasFeatureFlag } from "lib/featureFlags"; import { useStore } from "pages/FlowEditor/lib/store"; import React from "react"; import ListManager, { @@ -132,7 +131,6 @@ export type Props = EditorProps; const Component: React.FC = (props: Props) => { const [flowName] = useStore((store) => [store.flowName]); - const displayGovPayMetadataSection = hasFeatureFlag("GOVPAY_METADATA"); const initialValues: Pay = { title: props.node?.data?.title || "Pay for your application", @@ -269,79 +267,77 @@ const Component: React.FC = (props: Props) => { Hide the pay buttons and show fee for information only - {displayGovPayMetadataSection && ( - - + + + Include metadata alongside payments, such as VAT codes, cost + centers, or ledger codes. See{" "} + + GOV.UK Pay documentation + {" "} + for more details. + + - - Include metadata alongside payments, such as VAT codes, cost - centers, or ledger codes. See{" "} - + - GOV.UK Pay documentation - {" "} - for more details. - - - <> - - - Key - - - Value - - - { - setFieldValue("govPayMetadata", metadata); - }} - Editor={GovPayMetadataEditor} - newValue={() => { - setTouched({}); - return { key: "", value: "" }; - }} - isFieldDisabled={({ key }, index) => - isFieldDisabled(key, index) - } - /> - - - - - )} + Key + + + Value + + + { + setFieldValue("govPayMetadata", metadata); + }} + Editor={GovPayMetadataEditor} + newValue={() => { + setTouched({}); + return { key: "", value: "" }; + }} + isFieldDisabled={({ key }, index) => + isFieldDisabled(key, index) + } + /> + + + +