From f8a2d444437d5a3fd485bb518bcfbf35dabffc09 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 10 Jun 2024 10:36:27 +0100 Subject: [PATCH 1/2] welsh lang updates --- .../representation/representationAgent.js | 21 +++-- .../representation/representationAppellant.js | 21 +++-- .../representationCompleteSubmit.js | 13 ++- .../representation/representationElements.js | 15 +++- .../representationInterestedPartyPerson.js | 21 +++-- .../case/representation/representationLPA.js | 79 ++++--------------- components/case/summary.js | 36 +++++++-- components/myportal/watchedcases.js | 2 +- locales/cy/case.json | 5 +- locales/cy/myportal.json | 1 + locales/cy/myrepresentations.json | 3 +- locales/en/case.json | 5 +- locales/en/myportal.json | 1 + locales/en/myrepresentations.json | 3 +- 14 files changed, 132 insertions(+), 94 deletions(-) diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js index 9213c10c..93e66406 100644 --- a/components/case/representation/representationAgent.js +++ b/components/case/representation/representationAgent.js @@ -73,11 +73,22 @@ const RepAgent = (props) => { ) : ( )} diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js index d2db43da..f52b385c 100644 --- a/components/case/representation/representationAppellant.js +++ b/components/case/representation/representationAppellant.js @@ -73,11 +73,22 @@ const RepAppellant = (props) => { ) : ( )} diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js index f493477f..1c67af78 100644 --- a/components/case/representation/representationCompleteSubmit.js +++ b/components/case/representation/representationCompleteSubmit.js @@ -210,7 +210,18 @@ const RepCompleteSubmit = (props) => {
- {repFormData.representationType} + {router.locale == "cy" + ? repFormData.representationType == + "Questionnaire" + ? "Holiadur" + : repFormData.representationType == + "Statement" + ? "Datganiad" + : repFormData.representationType == + "Final comments" + ? "Sylwadau terfynol" + : repFormData.representationType + : repFormData.representationType}
diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js index cf53217c..6841f7d5 100644 --- a/components/case/representation/representationElements.js +++ b/components/case/representation/representationElements.js @@ -475,6 +475,8 @@ export const RenderPickList = ({ ...custom }) => { console.log(custom.disabled); + let { t } = useTranslation(); + return ( <>
- + {Object.keys(optionsArr).map((key, index) => { return ( ); })} diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js index 101662f2..067d6e3e 100644 --- a/components/case/representation/representationInterestedPartyPerson.js +++ b/components/case/representation/representationInterestedPartyPerson.js @@ -73,11 +73,22 @@ const RepInterestedPartyPerson = (props) => { ) : ( )}
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index 16764349..225583eb 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -266,71 +266,24 @@ let RepLPA = (props) => { ) : ( )} - {/* {!formObj["representationForm"].hasOwnProperty("values") || - typeof formObj.representationForm.values - .representationType == "undefined" ? ( - <> -

- {typeof props.representationType != - "undefined" || - typeof formObj.representationForm.values - .representationType != "undefined" - ? props.representationType == - "Questionnaire" - ? locale == "cy" - ? "Holiadur" - : props.representationType - : props.representationType - : locale == "cy" - ? "Cynrychioliadau" - : "Representation"}{" "} - {locale == "cy" - ? "o ACLI am a" - : "from an LPA for a"}{" "} - {locale == "cy" - ? jsonpath( - '$..[?(@.attributevalue=="' + - currentView.caseReference - .appealType + - '")].value_cy', - transLookup - ) - : getFormCollectionByID( - currentView.caseReference.appealType - ).value} -

- - - - ) : ( - - )} */}
diff --git a/components/case/summary.js b/components/case/summary.js index 5b30dfd4..717c6dc1 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -409,7 +409,7 @@ const CaseSummary = (props) => { )}
- Last modified + {t("case:summary-last-modified-label")}
{detailsObj.modifiedon > casesObj.modifiedon @@ -492,7 +492,28 @@ const CaseSummary = (props) => {

- The + {t( + "case:representation-date-passed-label", + { + startDate: + formatDates( + detailsObj.pinswg_startdate + ), + endDate: + props + .currentView + .caseReference + .appealType == + 846040019 + ? formatDates( + detailsObj.pinswg_statementduedate + ) + : formatDates( + detailsObj.pinswg_finalcommentsduedate + ), + } + )} + {/* The representation period for this appeal @@ -511,12 +532,11 @@ const CaseSummary = (props) => { ) : formatDates( detailsObj.pinswg_finalcommentsduedate - )} -
- You can make - a - representation - by emailing{" "} + )} */} +
{" "} + {t( + "case:representation-date-passed-additional-label" + )}{" "} pedw.casework@gov.wales diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index a1f79f14..9a6e367f 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -21,7 +21,7 @@ const WatchedCases = (props) => {

{props.myReps - ? "Submitted representations" + ? t("myportal:submitted-reps-card-title") : t("myportal:watchedcases-card-title")}

diff --git a/locales/cy/case.json b/locales/cy/case.json index 86e73c17..7911fe22 100644 --- a/locales/cy/case.json +++ b/locales/cy/case.json @@ -9,6 +9,7 @@ "summary-site-address-label": "Cyfeiriad y Safle", "summary-description-label": "Disgrifiad", "summary-case-stage-label": "Cyfnod Achos", + "summary-last-modified-label": "Addaswyd ddiwethaf", "summary-make-representation-label": "Cyflwyno cynrychiolaeth", "summary-back-button-label": "Ewch yn ôl", "summary-case-details-label": "Manylion yr Achos", @@ -93,5 +94,7 @@ "trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi", "you-have-stopped-watching-label": "Ydych chi am roi'r gorau i wylio achos ", "do-you-want-to-delete-case-label": "Ydych chi am ddileu achos", - "do-you-want-to-delete-case-disclaimer-label": "Unwaith y caiff ei dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli." + "do-you-want-to-delete-case-disclaimer-label": "Unwaith y caiff ei dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli.", + "representation-date-passed-label": "Y cyfnod cynrychioli ar gyfer yr apêl hon yw rhwng {{startDate}} a {{endDate}}", + "representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio," } \ No newline at end of file diff --git a/locales/cy/myportal.json b/locales/cy/myportal.json index bb124cf6..e22c2c6e 100644 --- a/locales/cy/myportal.json +++ b/locales/cy/myportal.json @@ -22,6 +22,7 @@ "awatitingsubmission-card-title": "Eto i’w gyflwyno", "myrepresentations-card-title": "Cyflwyniadau'r achos", "watchedcases-card-title": "Achosion a gwylio", + "submitted-reps-card-title": "Sylwadau a gyflwynwyd", "case-reference": "Cyfeirnod achos", "temp-reference": "Cyfeirnod Dros Dro", "case-address": "Cyfeiriad", diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json index 2b181f54..7cccf5cb 100644 --- a/locales/cy/myrepresentations.json +++ b/locales/cy/myrepresentations.json @@ -211,5 +211,6 @@ "statement-signed-label": "Llofnodwyd", "statement-date-label": "Dyddiad", "statement-onbehalf-label": "Ar ran", - "final-comments-label": "Sylwadau terfynol" + "final-comments-label": "Sylwadau terfynol", + "representation-type": "Math o gynrychiolaeth" } \ No newline at end of file diff --git a/locales/en/case.json b/locales/en/case.json index 87eedc85..c8ae5e5a 100644 --- a/locales/en/case.json +++ b/locales/en/case.json @@ -9,6 +9,7 @@ "summary-site-address-label": "Site Address", "summary-description-label": "Description", "summary-case-stage-label": "Case Stage", + "summary-last-modified-label": "Last modified", "summary-make-representation-label": "Make representation", "summary-back-button-label": "Go back", "summary-case-details-label": "Case Details", @@ -93,5 +94,7 @@ "trying-to-watch-case-redirect-label": "You will now be prompted to sign in", "you-have-stopped-watching-label": "Do you want to stop watching case ", "do-you-want-to-delete-case-label": "Do you want to delete case ", - "do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost." + "do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost.", + "representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}", + "representation-date-passed-additional-label": "You can make a representation by emailing," } \ No newline at end of file diff --git a/locales/en/myportal.json b/locales/en/myportal.json index 4546acd1..963e1372 100644 --- a/locales/en/myportal.json +++ b/locales/en/myportal.json @@ -22,6 +22,7 @@ "awatitingsubmission-card-title": "Awaiting submission", "myrepresentations-card-title": "My representations", "watchedcases-card-title": "Watched cases", + "submitted-reps-card-title": "Submitted representations", "case-reference": "Case reference", "temp-reference": "Temporary reference", "case-address": "Address", diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json index db8423e8..d11f4189 100644 --- a/locales/en/myrepresentations.json +++ b/locales/en/myrepresentations.json @@ -212,5 +212,6 @@ "statement-signed-label": "Signed", "statement-date-label": "Date", "statement-onbehalf-label": "On behalf of", - "final-comments-label": "Final comments" + "final-comments-label": "Final comments", + "representation-type": "Representation type" } \ No newline at end of file From da05499a124fd3ff7f1be3c595dd2dc8de45324a Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 10 Jun 2024 11:08:01 +0100 Subject: [PATCH 2/2] mail regex removed --- .../myportal/myrepresentationsfromblob.js | 2 +- components/myportal/topthree_reps.js | 9 +++-- next.config.js | 8 ++++ pages/auth/signin.js | 39 ++----------------- pages/myportal/searchresults.js | 2 +- 5 files changed, 19 insertions(+), 41 deletions(-) diff --git a/components/myportal/myrepresentationsfromblob.js b/components/myportal/myrepresentationsfromblob.js index fce1bf3c..5598b6fe 100644 --- a/components/myportal/myrepresentationsfromblob.js +++ b/components/myportal/myrepresentationsfromblob.js @@ -16,7 +16,7 @@ const MyRepresentations = (props) => {

- {t("myportal:myrepresentations-card-title")}dd + {t("myportal:myrepresentations-card-title")}

{ const deleteRepItem = (containerID, caseID, repfile) => { let cookies = parseCookies(); - console.log("sssss", containerID, caseID, repfile); + //console.log("sssss", containerID, caseID, repfile); deleteMyRepresentationsFromBlob(containerID, caseID, repfile) .then((data) => { @@ -209,11 +209,14 @@ const TopThree = (props) => {
- {t("myportal:case-reference")}:{" "} + {t("myportal:case-reference")}: { "/api/auth/signin/email"; const [buttonDisabled, setButtonDisabled] = useState(false); - const [hasError, setHasError] = useState(false); - 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; const handleSubmit = async (event) => { event.preventDefault(); - - //!emailRegex.test(event.currentTarget[2].value) && setHasError(true); - - !emailRegex.test(event.currentTarget[2].value) - ? (setHasError(true), setButtonDisabled(true)) - : (setButtonDisabled(true), event.target.submit()); + setButtonDisabled(true); + event.target.submit(); }; return ( @@ -67,13 +60,7 @@ const SignIn = (props) => { action="/api/auth/signin/email" onSubmit={handleSubmit} > -
+
{ > {t("auth:auth-email-label")} - {hasError && ( - - - Error: - {" "} - Enter a valid email address - - )} { - !emailRegex.test( - e.currentTarget.value - ) - ? (setHasError(true), - setButtonDisabled(true)) - : (setHasError(false), - setButtonDisabled(false)); - }} />
diff --git a/pages/myportal/searchresults.js b/pages/myportal/searchresults.js index 84486a37..0bcdd151 100644 --- a/pages/myportal/searchresults.js +++ b/pages/myportal/searchresults.js @@ -119,7 +119,7 @@ export const getServerSideProps = wrapper.getServerSideProps( const watchedCases = await getWatchedCases(loggedInUser); - console.log("sssss", loggedInUser); + //console.log("sssss", loggedInUser); const [accountDetails, searchDetailsObj, watchedCasesDetails] = await Promise.all([