diff --git a/editor.planx.uk/src/@planx/components/Feedback/Public/Public.tsx b/editor.planx.uk/src/@planx/components/Feedback/Public/Public.tsx index 156ce4d5ba..897d0df543 100644 --- a/editor.planx.uk/src/@planx/components/Feedback/Public/Public.tsx +++ b/editor.planx.uk/src/@planx/components/Feedback/Public/Public.tsx @@ -1,12 +1,11 @@ import Box from "@mui/material/Box"; import Grid from "@mui/material/Grid"; -import Typography from "@mui/material/Typography"; import { Disclaimer } from "@planx/components/shared/Disclaimer"; import Card from "@planx/components/shared/Preview/Card"; import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader"; import type { PublicProps } from "@planx/components/shared/types"; import { FeedbackView } from "components/Feedback/types"; -import { FormikHelpers, useFormik } from "formik"; +import { useFormik } from "formik"; import { getInternalFeedbackMetadata, insertFeedbackMutation, @@ -26,11 +25,10 @@ import { FaceBox } from "../components/FaceBox"; import { Feedback, FormProps } from "../model"; import { StyledToggleButtonGroup } from "../styled"; +export const PASSPORT_FEEDBACK_KEY = "_feedback"; + const FeedbackComponent = (props: PublicProps): FCReturn => { - const handleSubmitFeedback = async ( - values: FormProps, - { resetForm }: FormikHelpers, - ) => { + const handleSubmitFeedback = async (values: FormProps) => { const metadata = await getInternalFeedbackMetadata(); const feedback = { userComment: values.feedback, @@ -46,12 +44,10 @@ const FeedbackComponent = (props: PublicProps): FCReturn => { console.error(err); }, ); - props.handleSubmit?.(makeData(props, values, "_feedback")); + props.handleSubmit?.(makeData(props, values, PASSPORT_FEEDBACK_KEY)); if (!submitFeedbackResult) { return; } - - resetForm({ values }); }; const formik = useFormik({ diff --git a/editor.planx.uk/src/@planx/components/Feedback/model.ts b/editor.planx.uk/src/@planx/components/Feedback/model.ts index 1cc4ab37df..11ebaaa4b3 100644 --- a/editor.planx.uk/src/@planx/components/Feedback/model.ts +++ b/editor.planx.uk/src/@planx/components/Feedback/model.ts @@ -1,5 +1,3 @@ -// import { object, string } from "yup"; - import { BaseNodeData, parseBaseNodeData } from "../shared"; import { defaultContent } from "./components/defaultContent"; export interface Feedback extends BaseNodeData { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74e972cdf1..8c5e49c250 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,24 +1,18 @@ -lockfileVersion: '9.0' +lockfileVersion: '6.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false -importers: - - .: - devDependencies: - typescript: - specifier: 5.6.2 - version: 5.6.2 +devDependencies: + typescript: + specifier: 5.6.2 + version: 5.6.2 packages: - typescript@5.6.2: + /typescript@5.6.2: resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} engines: {node: '>=14.17'} hasBin: true - -snapshots: - - typescript@5.6.2: {} + dev: true