(value ? undefined : "Required");
+ const required = (value) => {
+ let errors = {};
+
+ // Check for the required field
+ if (!value) {
+ errors = "This field is required";
+ }
+
+ // Check for emojis using a regular expression
+ const emojiRegex =
+ /[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
+
+ if (emojiRegex.test(value)) {
+ errors = "Emojis are not allowed";
+ }
+
+ return errors;
+ };
//console.log(props.options);
const fieldOptions = props.options
@@ -385,7 +417,24 @@ const RenderCheckBox = ({
...custom
}) => {
let { t } = useTranslation();
- const required = (value) => (value ? undefined : "Required");
+ const required = (value) => {
+ let errors = {};
+
+ // Check for the required field
+ if (!value) {
+ errors = "This field is required";
+ }
+
+ // Check for emojis using a regular expression
+ const emojiRegex =
+ /[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
+
+ if (emojiRegex.test(value)) {
+ errors = "Emojis are not allowed";
+ }
+
+ return errors;
+ };
return (
<>
@@ -455,7 +504,24 @@ let AboutYou = (props) => {
const contactPref =
router.locale == "cy" ? ["Ebost", "Post"] : ["Email", "Post"];
- const required = (value) => (value ? undefined : "Is required");
+ const required = (value) => {
+ let errors = {};
+
+ // Check for the required field
+ if (!value) {
+ errors = "This field is required";
+ }
+
+ // Check for emojis using a regular expression
+ const emojiRegex =
+ /[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
+
+ if (emojiRegex.test(value)) {
+ errors = "Emojis are not allowed";
+ }
+
+ return errors;
+ };
const emailRegex =
/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi;
diff --git a/data/formsxml/planningappeals78.xml b/data/formsxml/planningappeals78.xml
index 4dc15fbc..c9b3732b 100644
--- a/data/formsxml/planningappeals78.xml
+++ b/data/formsxml/planningappeals78.xml
@@ -68,7 +68,7 @@
-
+
diff --git a/locales/cy/newappeal.json b/locales/cy/newappeal.json
index 261c4178..77534468 100644
--- a/locales/cy/newappeal.json
+++ b/locales/cy/newappeal.json
@@ -60,7 +60,8 @@
"new-appeal-introduction-warning-bullet-one": "gyflwyno eich apêl o fewn 6 mis o ddyddiad hysbysiad o benderfyniad yr Awdurdod Cynllunio Lleol",
"new-appeal-introduction-warning-bullet-two": "darparu'r holl ddogfennau ategol hanfodol o fewn y cyfnod apelio",
"new-appeal-development-description-hint": "Nodwch fanylion y datblygiad arfaethedig o'r ffurflen gais cynllunio. Os cafodd y cais ei ddiwygio tra oedd gyda’r ACLl, nodwch fanylion y cynllun diwygiedig ac amgaewch gopi o gytundeb yr ACLl i’r newid.",
- "new-appeal-dateofapplication-hint": "Dyma ddyddiad y ffurflen gais wreiddiol ",
+ "new-appeal-dateofapplication-hint": "Dyma’r dyddiad y gwnaethoch gyflwyno’r cais gwreiddiol i’r awdurdod cynllunio lleol. Nid yw'r ffurflen hon yn gallu prosesu apeliadau gyda dyddiadau ymgeisio sy'n hŷn na phum mlynedd. Os gwnaed eich cais fwy na phum mlynedd yn ôl yna cysylltwch â'r swyddfa am gymorth.",
+ "new-appeal-dateoflpadecision-hint": "Dyma’r dyddiad y cyhoeddodd yr ACLl ei benderfyniad ar eich cais. Sylwch, nid dyma'r dyddiad y cawsoch y penderfyniad, yn hytrach y dyddiad a ysgrifennwyd ar y penderfyniad. Ni all y ffurflen hon brosesu apeliadau sydd â dyddiad penderfynu sy'n hŷn na 6 mis. Os cyhoeddwyd eich penderfyniad fwy na 6 mis yn ôl yna efallai eich bod wedi rhedeg allan o amser i apelio. Cysylltwch â'r swyddfa am gymorth.",
"new-appeal-ownership-hint": "Mae angen i ni wybod pwy sy'n berchen ar safle'r apêl neu ran ohono, a bod pob perchennog yn gwybod eich bod wedi gwneud apêl. Defnyddiwch y nodiadau canllaw i gwblhau'r adran hon.",
"new-appeal-ownership-option-NA": "Amherthnasol",
"new-appeal-ownership-option-A": "Tystysgrif A - (ar gyfer unig berchnogion safle'r apêl). Tystiaf, ar y diwrnod 21 diwrnod cyn dyddiad yr apêl hon, nad oedd neb heblaw’r apelydd yn berchennog (gweler y daflen arweiniad am ddiffiniad) unrhyw ran o’r tir y mae’r apêl yn ymwneud ag ef.",
diff --git a/locales/en/newappeal.json b/locales/en/newappeal.json
index 97236df5..59b6724a 100644
--- a/locales/en/newappeal.json
+++ b/locales/en/newappeal.json
@@ -59,7 +59,8 @@
"new-appeal-introduction-warning-bullet-one": "submit your appeal within 6 months of the date of the Local Planning Authority's decision notice",
"new-appeal-introduction-warning-bullet-two": "provide all essential supporting documents within the appeal period",
"new-appeal-development-description-hint": "Enter details of the proposed development from the planning application form. If the application was revised while it was with the LPA enter details of the revised scheme and enclose a copy of the LPA’s agreement to the change.",
- "new-appeal-dateofapplication-hint": "This is the date of the original application form",
+ "new-appeal-dateofapplication-hint": "This is the date that you submitted the original application to the local planning authority. This form is not able to process appeals with application dates older than five years. If your application was made more than five years ago then please contact the office for help.",
+ "new-appeal-dateoflpadecision-hint": "This is the date that the LPA issued their decision on your application. Please note, this is not the date you received the decision, rather the date written on the decision. This form in not able to process appeals with a decision date older than 6 months. If your decision was issued more than 6 months ago then you may have run out of time to appeal. Please contact the office for help.",
"new-appeal-ownership-hint": "We need to know who owns the appeal site or part of it, and that all owners know you have made an appeal. Use the guidance notes to complete this section.",
"new-appeal-ownership-option-NA": "Not applicable",
"new-appeal-ownership-option-A": "Certificate A - (for sole owners of the appeal site). I certify that, on the day 21 days before the date of this appeal, nobody except the appellant, was the owner (see the guidance leaflet for a definition) of any part of the land to which the appeal relates",