From 3b0dfa675f91ebece73ffd157b8eeaf77a917e09 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Fri, 5 Jul 2024 09:30:03 +0100 Subject: [PATCH] add error messaging to boundary form and update error messaging --- .../components/Settings/GeneralSettings/BoundaryForm.tsx | 5 ++++- .../components/Settings/GeneralSettings/ContactForm.tsx | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/BoundaryForm.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/BoundaryForm.tsx index 4e7b528f66..f59e2bee97 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/BoundaryForm.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/BoundaryForm.tsx @@ -11,7 +11,9 @@ import { FormProps } from "."; export default function BoundaryForm({ formikConfig, onSuccess }: FormProps) { const formSchema = Yup.object().shape({ boundaryUrl: Yup.string() - .url("The URL should be in the form shown above") + .url( + "Enter a boundary URL in the correct format, https://www.planning.data.gov.uk/", + ) .required("Enter a boundary URL"), }); @@ -57,6 +59,7 @@ export default function BoundaryForm({ formikConfig, onSuccess }: FormProps) { ) => { formik.setFieldValue("boundaryUrl", ev.target.value); }} diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/ContactForm.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/ContactForm.tsx index 782b2e9b2a..7924634a00 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/ContactForm.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/ContactForm.tsx @@ -11,12 +11,16 @@ import { FormProps } from "."; export default function ContactForm({ formikConfig, onSuccess }: FormProps) { const formSchema = Yup.object().shape({ helpEmail: Yup.string() - .email("Enter a valid email address") + .email( + "Enter an email address in the correct format, like example@email.com", + ) .required("Enter a help email address"), helpPhone: Yup.string().required("Enter a help phone number"), helpOpeningHours: Yup.string().required("Enter your opening hours"), homepage: Yup.string() - .url("Enter a valid URL") + .url( + "Enter a homepage URL in the correct format, like https://www.localauthority.gov.uk/", + ) .required("Enter a homepage"), });