From 86f15ba9495f70e07e539702f8129fc65cda089d Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 2 Apr 2024 17:45:02 +0100 Subject: [PATCH] added in guidance link and welsh trans --- components/elements/index.js | 91 ++++++++++--------- .../myportal/awaitingsubmissionfromblob.js | 10 +- components/myportal/makenewappeal.js | 2 +- data/crmfieldlookuptranslations.json | 4 + locales/cy/myportal.json | 7 +- locales/cy/newappeal.json | 1 + locales/en/myportal.json | 7 +- locales/en/newappeal.json | 1 + pages/api/auth/[...nextauth].js | 41 ++++++++- pages/auth/signin.js | 1 - 10 files changed, 110 insertions(+), 55 deletions(-) diff --git a/components/elements/index.js b/components/elements/index.js index f1bcdee7..956661d0 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -1774,51 +1774,54 @@ const renderField = ({ input, label, type, meta: { touched, error } }) => ( ); -const renderSubFields = ({ fields }) => ( - -); + ))} + + + + ); +}; export const FieldArrayForm = (props) => { const { diff --git a/components/myportal/awaitingsubmissionfromblob.js b/components/myportal/awaitingsubmissionfromblob.js index f8d577c3..904b81a5 100644 --- a/components/myportal/awaitingsubmissionfromblob.js +++ b/components/myportal/awaitingsubmissionfromblob.js @@ -130,7 +130,7 @@ const AwaitingSubmissionFromBlob = (props) => { )}
- LPA reference:{" "} + {t("myportal:lpa-reference-label")}:{" "} { showTopThreeArr[key] .pinswg_lpaapplicationreference @@ -239,7 +239,13 @@ const AwaitingSubmissionFromBlob = (props) => { "appealComplete" ) && (
- Submission processing..... + + {" "} + {t( + "myportal:submission-processing-label" + )} + ..... +
)}
diff --git a/components/myportal/makenewappeal.js b/components/myportal/makenewappeal.js index 9e38e86c..b17ef1df 100644 --- a/components/myportal/makenewappeal.js +++ b/components/myportal/makenewappeal.js @@ -28,7 +28,7 @@ export default function MakeNewAppeal() { {t("myportal:makenewappeal-card-paragraph-three")}

- + {t("myportal:makenewappeal-card-link-label")}

diff --git a/data/crmfieldlookuptranslations.json b/data/crmfieldlookuptranslations.json index 6d9de2c5..96b9ec14 100644 --- a/data/crmfieldlookuptranslations.json +++ b/data/crmfieldlookuptranslations.json @@ -2152,6 +2152,10 @@ "value": "Application form dated", "value_cy": "Dyddiad y ffurflen gais" }, + { + "value": "Reason for Appeal", + "value_cy": "Rheswm dros yr Apêl" + }, { "value": "Has your application been decided by the LPA?", "value_cy": "A yw'r ACLl wedi penderfynu ar eich cais?" diff --git a/locales/cy/myportal.json b/locales/cy/myportal.json index 75f0440c..b471a73f 100644 --- a/locales/cy/myportal.json +++ b/locales/cy/myportal.json @@ -6,7 +6,8 @@ "makenewappeal-card-link": "berthnasol i'r math o apêl sydd gennych.", "makenewappeal-card-paragraph-two": "Wedi i chi glicio'r botwm 'gwneud apêl newydd' isod, cewch eich arwain drwy broses i'ch helpu i ddewis y math cywir o apêl.", "makenewappeal-card-paragraph-three": "Dim ond yn erbyn Gwrthod Caniatâd Cynllunio neu Fethiant i Benderfynu o fewn amser i'r Porth Gwaith Achos hwn y gallwch chi Gyflwyno apêl. Rhaid cyflwyno pob apêl arall trwy e-bost neu'r post.", - "makenewappeal-card-link-label": "Link label", + "makenewappeal-card-link-label": "Arweiniad", + "makenewappeal-card-guidance-link": "https://www.llyw.cymru/arweiniad-ar-apeliadau-cheisiadau", "makenewappeal-card-button-label": "Gwneud apêl newydd", "mycases-card-title": "Fy achosion", "searchcases-card-title": "Chwilio apeliadau a Datblygiadau o Arwyddocâd Cenedlaethol", @@ -36,9 +37,11 @@ "norecords-awaiting-submissions": "Nid oes gennych unrhyw gyflwyniadau sy'n aros", "on-behalf-of-label": "Ar ran", "appeal-type-label": "Math o apêl", + "lpa-reference-label": "Cyfeirnod yr LPA", "raised-by-label": "Codwyd gan", "representation-id": "Id cynrychiolaeth", "representation-type": "Math o gynrychiolaeth", "capacity": "Gallu", - "date-raised": "Dyddiad codi" + "date-raised": "Dyddiad codi", + "submission-processing-label": "Prosesu cyflwyniad" } \ No newline at end of file diff --git a/locales/cy/newappeal.json b/locales/cy/newappeal.json index 54bb3fdb..731e6a91 100644 --- a/locales/cy/newappeal.json +++ b/locales/cy/newappeal.json @@ -62,6 +62,7 @@ "new-appeal-agricultural-holding-option-yes": "(a) Nid oes unrhyw ran o’r tir y mae’r apêl yn ymwneud ag ef yn ddaliad amaethyddol, neu’n rhan o ddaliad amaethyddol", "new-appeal-agricultural-holding-option-no": "(b) (i) Mae safle’r apêl yn ddaliad amaethyddol, neu’n rhan o ddaliad amaethyddol, a’r apelydd yw’r unig denant amaethyddol", "new-appeal-agricultural-holding-option-NA": "(b) (ii) Mae safle’r apêl yn ddaliad amaethyddol neu’n rhan o ddaliad amaethyddol ac mae’r apelydd (neu’r asiant) wedi rhoi’r hysbysiad gofynnol i bob person (ac eithrio’r apelydd) sydd, ar y diwrnod 21 diwrnod cyn y dyddiad o’r apêl, a oedd yn denant daliad amaethyddol ar y cyfan neu ran o’r tir y mae’r apêl yn ymwneud ag ef fel a restrir isod:", + "new-appeal-add-tenant-label": "Ychwanegu Tenant", "new-appeal-procedure-option-virtual": "Rhith", "new-appeal-procedure-option-inperson": "Yn bersonol", "new-appeal-procedure-option-hybrid": "Hybrid", diff --git a/locales/en/myportal.json b/locales/en/myportal.json index c0c405d3..4a4953be 100644 --- a/locales/en/myportal.json +++ b/locales/en/myportal.json @@ -6,7 +6,8 @@ "makenewappeal-card-link": "relevant to your appeal type.", "makenewappeal-card-paragraph-two": "Once you click the 'make a new appeal' button below you will be guided through a process to help you select the correct appeal type", "makenewappeal-card-paragraph-three": "You can only Submit an appeal against a Refusal of planning Permission or Failure to determine within time vai this Casework Portal. All other appeals must be submitted via Email or post.", - "makenewappeal-card-link-label": "Link label", + "makenewappeal-card-link-label": "Guidance", + "makenewappeal-card-guidance-link": "https://www.gov.wales/planning-appeals-guidance", "makenewappeal-card-button-label": "Make a new appeal", "mycases-card-title": "My cases", "searchcases-card-title": "Search appeals and Developments of National Significance", @@ -36,9 +37,11 @@ "norecords-awaiting-submissions": "You have no awaiting submissions", "on-behalf-of-label": "On behalf of", "appeal-type-label": "Appeal type", + "lpa-reference-label": "LPA reference number", "raised-by-label": "Raised by", "representation-id": "Representation ID", "representation-type": "Representation type", "capacity": "Capacity", - "date-raised": "Date raised" + "date-raised": "Date raised", + "submission-processing-label": "Submission processing" } \ No newline at end of file diff --git a/locales/en/newappeal.json b/locales/en/newappeal.json index 04f331d4..95e8e939 100644 --- a/locales/en/newappeal.json +++ b/locales/en/newappeal.json @@ -62,6 +62,7 @@ "new-appeal-agricultural-holding-option-yes": "(a) None of the land to which the appeal relates is, or is part of, an agricultural holding", "new-appeal-agricultural-holding-option-no": "(b) (i) The appeal site is, or is part of an agricultural holding, and the appellant is the sole agricultural tenant", "new-appeal-agricultural-holding-option-NA": "(b) (ii) The appeal site is, or is part of, an agricultural holding and the appellant (or the agent) has given the requisite notice to every person (other than the appellant) who, on the day 21 days before the date of the appeal, was a tenant of anagricultural holding on all or part of the land to which the appeal relates as listed below:", + "new-appeal-add-tenant-label": "Add Tenant", "new-appeal-procedure-option-virtual": "Virtual", "new-appeal-procedure-option-inperson": "In person", "new-appeal-procedure-option-hybrid": "Hybrid", diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index 0ab7ee64..c0b92778 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -165,13 +165,48 @@ const authOptions = (locale, req, res) => { ); let newURL = locale == "cy" - ? process.env.CY_API_ROOT + ? process.env.CY_API_ROOT + + "/api/auth/callback/email?callbackUrl=" + + encodeURIComponent(process.env.CY_API_ROOT) + + "&token=" + + searchParams.get("token") + + "&email=" + + encodeURIComponent(email) : process.env.NEXTAUTH_URL; - //console.log(newURL, searchParams.get("token")); + // console.log( + // "============================================================\n", + // locale + "\n", + // "============================================================\n", + // newURL + "\n", + // encodeURIComponent(newURL) + "\n", + // "============================================================\n", + // url + "\n", + // "============================================================\n", + // newURL + "\n", + // "============================================================\n", + // searchParams.get("token") + "\n", + // "============================================================\n" + // ); + + console.log( + "============================================================\n", + locale == "cy" + ? url.split("/api")[0] + + "/cy/api" + + url.split("/api")[1] + : url, + "============================================================\n" + ); + const personalisation = { "emailAddress": email, - "signInLink": url, + "signInLink": + locale == "cy" + ? url.split("&token")[0] + + "/cy&token" + + url.split("&token")[1] + : url, "linkExpiry": 2 * 60 * 60, }; diff --git a/pages/auth/signin.js b/pages/auth/signin.js index 13ef525b..9b2cb562 100644 --- a/pages/auth/signin.js +++ b/pages/auth/signin.js @@ -7,7 +7,6 @@ import Header from "../../components/header"; import Breadcrumbs from "../../components/breadcrumbs"; import { getCsrfToken } from "next-auth/react"; import { parseCookies, setCookie, destroyCookie } from "nookies"; -import { ca } from "date-fns/locale"; const SignIn = (props) => { let { t, lang } = useTranslation();