diff --git a/.eslintrc b/.eslintrc index 37638623..3d3f9308 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,30 +3,31 @@ "rules": { "@next/next/no-img-element": "off", "react/no-unknown-property": "error" - }, + + }//, //...your configuration - "overrides": [ - //...your overrides - { - // Force the setting of a swagger description on each api endpoint - "files": ["pages/api/**/*.js"], - "plugins": ["jsdoc"], - "rules": { - "jsdoc/no-missing-syntax": [ - "error", - { - "contexts": [ - { - "comment": "JsdocBlock:has(JsdocTag[tag=swagger])", - "context": "any", - "message": "@swagger documentation is required on each API. Check this out for syntax info: https://github.com/jellydn/next-swagger-doc" - } - ] - } - ] - } - } - ] + // "overrides": [ + // //...your overrides + // { + // // Force the setting of a swagger description on each api endpoint + // "files": ["pages/api/**/*.js"], + // "plugins": ["jsdoc"], + // "rules": { + // "jsdoc/no-missing-syntax": [ + // "error", + // { + // "contexts": [ + // { + // "comment": "JsdocBlock:has(JsdocTag[tag=swagger])", + // "context": "any", + // "message": "@swagger documentation is required on each API. Check this out for syntax info: https://github.com/jellydn/next-swagger-doc" + // } + // ] + // } + // ] + // } + // } + // ] } diff --git a/actions/index.js b/actions/index.js index b363b70c..e538fca0 100644 --- a/actions/index.js +++ b/actions/index.js @@ -12,6 +12,8 @@ if (process.browser) { } else { BASE_URL = process.env.API_ROOT || `http://localhost:${port}`; } +BASE_URL = process.env.API_ROOT; + const WORDKEY = process.env.HASHKEY; const cache = {}; diff --git a/components/account/changepassword.js b/components/account/changepassword.js index 5e32af17..638c1836 100644 --- a/components/account/changepassword.js +++ b/components/account/changepassword.js @@ -95,65 +95,63 @@ const ChangePassword = (props) => { const [hasErrors, setHasErrors] = useState(""); - return ( - <> - {passwordUpdated != true ? ( -
-
- - -
+ return <> + {passwordUpdated != true ? ( + +
+ + +
-
- - Cancel - -
-
- ) : ( - <> -

- Go to My Portal - -

- - )} - - ); +
+ + + Cancel + +
+ + ) : ( + <> +

+ + Go to My Portal + +

+ + )} + ; }; const mapStateToProps = (state) => { diff --git a/components/account/personaldetails.js b/components/account/personaldetails.js index 8f2fb98f..58043e5f 100644 --- a/components/account/personaldetails.js +++ b/components/account/personaldetails.js @@ -237,191 +237,189 @@ let PersonalDetails = (props) => { setPersonalDetailsComplete(true); }; - return ( - <> - {props.accountUpdatedComplete == false ? ( - props.personalDetailsComplete == false ? ( -
-
- -

- {t("account:account-about-you-label")} -

-
-
- - {t("account:account-role-label")}:{" "} - { - props.props.accountDetails - .accountDetails[ - "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" - ] - } - -
- - - - - - - - - -
-
- -

- {t("account:account-your-address-label")} -

-
- - - - - - -
-
- - + +

+ {t("account:account-about-you-label")} +

+
+
+ + {t("account:account-role-label")}:{" "} + { + props.props.accountDetails + .accountDetails[ + "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" + ] } - > - - {t("common:cancel-link")} - - +
- - ) : ( - <> - - - ) + + + + + + + + +
+ +

+ {t("account:account-your-address-label")} +

+
+ + + + + + +
+
+ + + + {t("common:cancel-link")} + + +
+ ) : ( - - )} - - ); + <> + + + ) + ) : ( + + )} + ; }; const mapStateToProps = (state) => { diff --git a/components/account/personaldetailsCheck.js b/components/account/personaldetailsCheck.js index 1818a6b7..aad11ee0 100644 --- a/components/account/personaldetailsCheck.js +++ b/components/account/personaldetailsCheck.js @@ -31,327 +31,325 @@ const BuildCheckPersonalDetails = (props) => { : t("account:account-preferred-language-welsh"); }; - return ( - <> -

- {t("account:account-about-you-label")} -

-
-
-
- {t("account:account-first-name-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .firstname - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {t("account:account-first-name-label")}{" "} - - -
-
-
-
- {" "} - {t("account:account-last-name-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .lastname - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-last-name-label")} - - -
-
-
-
- {" "} - {t("account:account-email-address-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .emailaddress1 - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-email-address-label")} - - -
-
-
-
- {t("account:account-telephone-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .telephone1 - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {t("account:account-telephone-label")} - - -
-
-
-
- {" "} - {t("account:account-company-group-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .company - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-company-group-label")} - - -
-
-
-
- {t("account:account-preferred-language-label")} -
-
- {getPreferredLanguageLabel( - props.props.props.form.personalDetailsForm.values - .pinswg_preferredlanguage - )} -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-preferred-language-label")} - - -
-
-
-

- {" "} - {t("account:account-your-address-label")} -

-
-
-
- {t("account:account-address-line-1-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .address1_line1 - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-address-line-1-label")} - - -
-
-
-
- {t("account:account-address-line-2-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .address1_line2 - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-address-line-2-label")} - - -
-
-
-
- {t("account:account-town-city-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .address1_city - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-town-city-label")} - - -
-
-
-
- {" "} - {t("account:account-county-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .address1_county - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-county-label")} - - -
-
-
-
- {" "} - {t("account:account-postcode-label")} -
-
- { - props.props.props.form.personalDetailsForm.values - .address1_postalcode - } -
-
- { - setPersonalDetailsComplete(false); - }} - > - {t("common:change-link-label")} - - {" "} - {t("account:account-postcode-label")} - - -
-
-
-
- - - {t("common:back-link")} - + return <> +

+ {t("account:account-about-you-label")} +

+
+
+
+ {t("account:account-first-name-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .firstname + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {t("account:account-first-name-label")}{" "} + + +
- - ); +
+
+ {" "} + {t("account:account-last-name-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .lastname + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-last-name-label")} + + +
+
+
+
+ {" "} + {t("account:account-email-address-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .emailaddress1 + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-email-address-label")} + + +
+
+
+
+ {t("account:account-telephone-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .telephone1 + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {t("account:account-telephone-label")} + + +
+
+
+
+ {" "} + {t("account:account-company-group-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .company + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-company-group-label")} + + +
+
+
+
+ {t("account:account-preferred-language-label")} +
+
+ {getPreferredLanguageLabel( + props.props.props.form.personalDetailsForm.values + .pinswg_preferredlanguage + )} +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-preferred-language-label")} + + +
+
+
+

+ {" "} + {t("account:account-your-address-label")} +

+
+
+
+ {t("account:account-address-line-1-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .address1_line1 + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-address-line-1-label")} + + +
+
+
+
+ {t("account:account-address-line-2-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .address1_line2 + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-address-line-2-label")} + + +
+
+
+
+ {t("account:account-town-city-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .address1_city + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-town-city-label")} + + +
+
+
+
+ {" "} + {t("account:account-county-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .address1_county + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-county-label")} + + +
+
+
+
+ {" "} + {t("account:account-postcode-label")} +
+
+ { + props.props.props.form.personalDetailsForm.values + .address1_postalcode + } +
+
+ { + setPersonalDetailsComplete(false); + }} + > + {t("common:change-link-label")} + + {" "} + {t("account:account-postcode-label")} + + +
+
+
+
+ + + {t("common:back-link")} + +
+ ; }; const mapStateToProps = (state) => { diff --git a/components/account/personaldetailsComplete.js b/components/account/personaldetailsComplete.js index 1819ef94..1e202af3 100644 --- a/components/account/personaldetailsComplete.js +++ b/components/account/personaldetailsComplete.js @@ -40,24 +40,22 @@ const PersonalDetailsComplete = (props) => { props.props.props.form.personalDetailsForm.values, ]); - return ( - <> -

{t("account:account-complete-para-1")}

+ return <> +

{t("account:account-complete-para-1")}

-

{t("account:account-complete-para-2")}

+

{t("account:account-complete-para-2")}

-

- - - {" "} - {t("account:account-complete-return-to-portal-link")} - - -

- - ); +

+ + + {" "} + {t("account:account-complete-return-to-portal-link")} + + +

+ ; }; const mapStateToProps = (state) => { diff --git a/components/account/registerComplete.js b/components/account/registerComplete.js index cac7970c..fb82290e 100644 --- a/components/account/registerComplete.js +++ b/components/account/registerComplete.js @@ -78,7 +78,7 @@ const RegisterComplete = (props) => { var registerBody = ""; switch (props.accountDetails.accCr) { case "created": - return (registerBody = ( + return registerBody = ( <>

{t("account:register-new-account-confirmation-email")} @@ -95,33 +95,33 @@ const RegisterComplete = (props) => {

- - { - setLogout(), - window.localStorage.clear(), - destroyCookie( - null, - "next-auth.csrf-token" - ), - destroyCookie( - null, - "next-auth.callback-url" - ), - destroyCookie(null, "pedw_locale"), - destroyCookie(null, "pinsUser"), - signOut({ callbackUrl: "/logout" }); - }} - > - {t( - "account:register-new-account-my-portal-link" - )} - + { + setLogout(), + window.localStorage.clear(), + destroyCookie( + null, + "next-auth.csrf-token" + ), + destroyCookie( + null, + "next-auth.callback-url" + ), + destroyCookie(null, "pedw_locale"), + destroyCookie(null, "pinsUser"), + signOut({ callbackUrl: "/logout" }); + }}> + + {t( + "account:register-new-account-my-portal-link" + )} +

- )); + ); break; diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 88bde13a..0d6af9d8 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -49,838 +49,834 @@ const Breadcrumbs = (props) => { const { data: session, status } = useSession(); - return ( - <> - + ; }; export default Breadcrumbs; diff --git a/components/case/documents.js b/components/case/documents.js index 99476370..38d72805 100644 --- a/components/case/documents.js +++ b/components/case/documents.js @@ -204,8 +204,8 @@ const DocumentDetails = (props) => { {/*
- {t("case:documents-size-label")} -
*/} + {t("case:documents-size-label")} + */}
{showSpinnerState == true ? (
@@ -240,41 +240,33 @@ const DocumentDetails = (props) => { {showDownloadingState === key && (
{/* { */} + className="data-loading-icon" + src="/assets/images/loading.gif" + alt={ + router.locale == + "cy" + ? "Nôl data" + : "Fetching data" + } + /> */}
)} { + toggleDownLoadLink(key); + }} > - { - toggleDownLoadLink(key); - }} - > - - {t( - "case:documents-name-label" - )} - : - - {_.has( - detailsObj, - "pinswg_name" - ) - ? detailsObj.pinswg_name - : ""} - + + {t("case:documents-name-label")} + : + + {_.has(detailsObj, "pinswg_name") + ? detailsObj.pinswg_name + : ""}
@@ -317,11 +309,11 @@ const DocumentDetails = (props) => { : ""}
{/*
- - {t("case:documents-size-label")}: - - 92 -
*/} + + {t("case:documents-size-label")}: + + 92 + */}
); }) @@ -340,49 +332,6 @@ const DocumentDetails = (props) => { ); }; - useEffect(() => { - getDocumentTypes(); - if (selectedOption) { - setShowSpinnerState(true); - getDocumentResults(1, orderByState, fieldSortState); - } - - if (selectedDocumentType) { - setShowSpinnerState(true); - getDocumentResults( - 1, - orderByState, - fieldSortState, - selectedDocumentType - ); - } - - const docDetailsObj = async () => { - let docObj = await getSearchDocumentDetails(incidentid).then( - (data) => { - //console.log(data); - setDocumentDetails(data); - setDocumentSearchState(true); - - return data; - } - ); - - return docObj; - }; - - const searchDocumentResultsObj = docDetailsObj(); - }, [ - incidentid, - setDocumentDetails, - selectedOption, - selectedDocumentType, - fieldSortState, - orderByState, - getDocumentTypes, - getDocumentResults, - ]); - const getDocumentTypes = useCallback(() => { getSearchDocumentTypes(props.incidentid).then((data) => { setDocumentTypes(data); @@ -495,6 +444,48 @@ const DocumentDetails = (props) => { setShowSpinnerState(true); }; + useEffect(() => { + getDocumentTypes(); + if (selectedOption) { + setShowSpinnerState(true); + getDocumentResults(1, orderByState, fieldSortState); + } + + if (selectedDocumentType) { + setShowSpinnerState(true); + getDocumentResults( + 1, + orderByState, + fieldSortState, + selectedDocumentType + ); + } + + const docDetailsObj = async () => { + let docObj = await getSearchDocumentDetails(incidentid).then( + (data) => { + //console.log(data); + setDocumentDetails(data); + setDocumentSearchState(true); + + return data; + } + ); + + return docObj; + }; + + const searchDocumentResultsObj = docDetailsObj(); + }, [ + incidentid, + setDocumentDetails, + selectedOption, + selectedDocumentType, + fieldSortState, + orderByState, + getDocumentTypes, + getDocumentResults, + ]); return ( <>
diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 8d85a1e0..15eff4aa 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -394,7 +394,7 @@ let MakeRepresentation = (props) => { let year = repDate.getFullYear(); let time = repDate.getTime(); - const repType = ""; + let repType = ""; switch (values.representationCapacity) { case t("myrepresentations:capacity-options-arr-appellant"): repType = "APPELLANT"; diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js index 4348922c..d2265706 100644 --- a/components/case/representation/representationComplete.js +++ b/components/case/representation/representationComplete.js @@ -66,13 +66,13 @@ const RepComplete = (props) => {
- - setRepresentationReset()} - className="govuk-button" - > - {t("common:continue-button")} - + setRepresentationReset()} + className="govuk-button"> + + {t("common:continue-button")} +
diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js index ea7fc8e1..55e08345 100644 --- a/components/case/representation/representationElements.js +++ b/components/case/representation/representationElements.js @@ -871,119 +871,116 @@ export const RenderFileUpload = (field) => { }); }; - return ( - <> - { - const renamedAcceptedFiles = filesToUpload.map( - (file) => - new File([file], `${file.name}`, { - type: file.type, - }) - ); - field.input.onChange(renamedAcceptedFiles); - }} - > - {({ getRootProps, getInputProps }) => ( - <> - {/* {field.hint != false && ( -
ss{t(field.hint)}
- )} -
*/} -
-
- {" "} - -
- {t( - "newappeal:new-appeal-fileupload-drop-label" - )} -
- - ( - {t( - "newappeal:new-appeal-fileupload-file-list-label" - )} - ) - + return <> + { + const renamedAcceptedFiles = filesToUpload.map( + (file) => + new File([file], `${file.name}`, { + type: file.type, + }) + ); + field.input.onChange(renamedAcceptedFiles); + }} + > + {({ getRootProps, getInputProps }) => ( + <> + {/* {field.hint != false && ( +
ss{t(field.hint)}
+ )} +
*/} +
+
+ {" "} + +
+ {t( + "newappeal:new-appeal-fileupload-drop-label" + )}
- -
- - )} -
- {field.meta.touched && field.meta.error && ( - {field.meta.error} - )} - {files && Array.isArray(files) && ( -
    - {files.map((file, i) => ( -
    - {file.name} - - {file.name} ({bytesToSize(file.size)}) - + + ( + {t( + "newappeal:new-appeal-fileupload-file-list-label" + )} + ) +
    - ))} -
+ +
+ )} - {blobList.map((blob, i) => ( -
-
- { - deleteThisBlob( - field.containerID, - blob.name, - blob.hasheddeletepath, - blob.hashgetblobs, - field.ticketnumber - ); - }} - title="Remove this file" - > - − + + {field.meta.touched && field.meta.error && ( + {field.meta.error} + )} + {files && Array.isArray(files) && ( +
    + {files.map((file, i) => ( +
    + {file.name} + + {file.name} ({bytesToSize(file.size)})
    - {blob.name} - - +
    + { + deleteThisBlob( + field.containerID, + blob.name, + blob.hasheddeletepath, + blob.hashgetblobs, + field.ticketnumber + ); + }} + title="Remove this file" > - - {blob.name} ({bytesToSize(blob.contentLength)}) - - + − +
    - ))}{" "} - - ); + {blob.name} + + + + {blob.name}({bytesToSize(blob.contentLength)}) + +
+ ))}{" "} + ; }; export function FileUploadField(props) { diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index 9f4d808f..05346adb 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -25,8 +25,8 @@ import jsonpath from "jsonpath"; import { useState } from "react"; import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement"; import S78_Qquestionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78"; -import { RepresentationProgress_s78 } from "./representationProgress/representationProgress_s78"; -import { RepresentationProgress_enforcement } from "./representationProgress/representationProgress_enforcement"; +import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78"; +import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement"; import transLookup from "../../../data/lookuptranslations.json"; let RepLPA = (props) => { diff --git a/components/case/summary.js b/components/case/summary.js index f91e7709..263bf2f8 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -432,12 +432,11 @@ const CaseSummary = (props) => { : casesObj.reference, }, }} + className="govuk-button" > - - {t( - "case:summary-make-representation-label" - )} - + {t( + "case:summary-make-representation-label" + )} { }} title={t("case:watch-this-case-link")} > - {t("case:watch-this-case-link")} dd + {t("case:watch-this-case-link")} )}
@@ -624,12 +623,13 @@ const CaseSummary = (props) => { true ? ( "" ) : ( - - - {t( - "case:summary-make-representation-label" - )} - + + {t( + "case:summary-make-representation-label" + )} )} @@ -996,8 +996,9 @@ const CaseSummary = (props) => { item.title + "&lk=1" } + className="" > - {item.title} + {item.title} ); @@ -1009,7 +1010,7 @@ const CaseSummary = (props) => { } function showReps(startDate, endDate) { - const date = new Date(); + let date = new Date(); date = new Date(date.toDateString()); const start = new Date(startDate); const end = new Date(endDate); @@ -1018,7 +1019,7 @@ const CaseSummary = (props) => { } function showRepsEnded(startDate, endDate) { - const date = new Date(); + let date = new Date(); date = new Date(date.toDateString()); const start = new Date(startDate); const end = new Date(endDate); diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js index e3ec3f27..1e7a5d38 100644 --- a/components/case/summaryTypes/pinswg_dnsid.js +++ b/components/case/summaryTypes/pinswg_dnsid.js @@ -18,8 +18,8 @@ const Pinswg_dnsid = (props) => { const router = useRouter(); const { locale } = router; - const point = {}; - const siteCoords = {}; + let point = {}; + let siteCoords = {}; let center = {}; point = new OSPoint( diff --git a/components/caseresults.js b/components/caseresults.js index b7c0223e..da23c9e1 100644 --- a/components/caseresults.js +++ b/components/caseresults.js @@ -25,17 +25,17 @@ export default function Search({ children, pages }) {
- - - {t("search:searchresults-search-button-label")} - + + + {t("search:searchresults-search-button-label")} + - - - {t( - "search:searchresults-new-search-button-label" - )} - + + + {t( + "search:searchresults-new-search-button-label" + )} +
diff --git a/components/cookieBanner.js b/components/cookieBanner.js index fdd30e14..7c82c71f 100644 --- a/components/cookieBanner.js +++ b/components/cookieBanner.js @@ -36,104 +36,102 @@ const CookieBanner = () => { setBannerVisible(false); }; - return ( - <> - {bannerVisible ? ( - -
- diff --git a/components/myportal/makenewappeal.js b/components/myportal/makenewappeal.js index ad42d108..b300ccf3 100644 --- a/components/myportal/makenewappeal.js +++ b/components/myportal/makenewappeal.js @@ -20,10 +20,10 @@ export default function MakeNewAppeal() { {t("myportal:makenewappeal-card-paragraph-two")}

- - - {t("myportal:makenewappeal-card-button-label")} - + + + {t("myportal:makenewappeal-card-button-label")} +
diff --git a/components/myportal/mycases.js b/components/myportal/mycases.js index ed428b21..f080c25e 100644 --- a/components/myportal/mycases.js +++ b/components/myportal/mycases.js @@ -34,21 +34,19 @@ const MyCases = (props) => { "/fymhorth/gweldpopeth" : "/myportal/viewall" } - > - { - setCurrentView({ - "viewName": "My Cases", - "viewKey": "myCases", - }); - }} - > - {t("myportal:viewall-link")}{" "} - {props.isLPA && - props.myCases.myCases["@odata.count"] + - " appeals"} - + className="govuk-link--no-underline" + onClick={() => { + setCurrentView({ + "viewName": "My Cases", + "viewKey": "myCases", + }); + }}> + + {t("myportal:viewall-link")}{" "} + {props.isLPA && + props.myCases.myCases["@odata.count"] + + " appeals"} +
)} diff --git a/components/myportal/myrepresentations.js b/components/myportal/myrepresentations.js index 7bbe0bd8..dcd1b6cb 100644 --- a/components/myportal/myrepresentations.js +++ b/components/myportal/myrepresentations.js @@ -40,18 +40,16 @@ const MyRepresentations = (props) => { : "/myportal/viewall" } shallow - > - { - setCurrentView({ - "viewName": "My Representations", - "viewKey": "myRepresentations", - }); - }} - > - {t("myportal:viewall-link")} - + className="govuk-link--no-underline" + onClick={() => { + setCurrentView({ + "viewName": "My Representations", + "viewKey": "myRepresentations", + }); + }}> + + {t("myportal:viewall-link")} +
)} diff --git a/components/myportal/myrepresentationsfromblob.js b/components/myportal/myrepresentationsfromblob.js index 63a47c1b..4c9492e5 100644 --- a/components/myportal/myrepresentationsfromblob.js +++ b/components/myportal/myrepresentationsfromblob.js @@ -40,18 +40,16 @@ const MyRepresentations = (props) => { : "/myportal/viewall" } shallow - > - { - setCurrentView({ - "viewName": "My Representations", - "viewKey": "myRepresentations", - }); - }} - > - {t("myportal:viewall-link")} - + className="govuk-link--no-underline" + onClick={() => { + setCurrentView({ + "viewName": "My Representations", + "viewKey": "myRepresentations", + }); + }}> + + {t("myportal:viewall-link")} + )} diff --git a/components/myportal/searchcases.js b/components/myportal/searchcases.js index d06c69c6..cd556f0b 100644 --- a/components/myportal/searchcases.js +++ b/components/myportal/searchcases.js @@ -95,64 +95,62 @@ let CaseSearch = (props) => { }); }; - return ( - <> -
-
-
-

- {t("myportal:searchcases-card-title")} -

+ return <> +
+ +
+

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

- + -
- -
- - - {t("myportal:searchcases-card-advanced-link")} - - +
+
- -
- - ); + + + {t("myportal:searchcases-card-advanced-link")} + + +
+ +
+ ; }; const mapStateToProps = (state) => { diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index 7a103719..d677ac60 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -167,47 +167,45 @@ const TopThree = (props) => { ? "/fymhorth/achos" : "/myportal/case" } - > - { - setCurrentReference({ - "currentReference": - topThreeType != "watchedCases" - ? topThreeType != - "myRepresentations" - ? showTopThreeArr[key] - .ticketnumber - : showTopThreeArr[key][ - "_pinswg_case_value@OData.Community.Display.V1.FormattedValue" - ] + className="govuk-link--no-underline" + data-id={index} + onClick={() => { + setCurrentReference({ + "currentReference": + topThreeType != "watchedCases" + ? topThreeType != + "myRepresentations" + ? showTopThreeArr[key] + .ticketnumber : showTopThreeArr[key][ - "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" - ], - "currentType": topThreeType, + "_pinswg_case_value@OData.Community.Display.V1.FormattedValue" + ] + : showTopThreeArr[key][ + "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" + ], + "currentType": topThreeType, - "incidentid": getIncidentId( - topThreeType, - showTopThreeArr[key] - ), + "incidentid": getIncidentId( + topThreeType, + showTopThreeArr[key] + ), - "appealType": - showTopThreeArr[key] - .pinswg_appealcasetype, - }); - }} - > - {topThreeType != "watchedCases" - ? topThreeType != "myRepresentations" - ? showTopThreeArr[key].ticketnumber - : showTopThreeArr[key][ - "_pinswg_case_value@OData.Community.Display.V1.FormattedValue" - ] + "appealType": + showTopThreeArr[key] + .pinswg_appealcasetype, + }); + }}> + + {topThreeType != "watchedCases" + ? topThreeType != "myRepresentations" + ? showTopThreeArr[key].ticketnumber : showTopThreeArr[key][ - "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" - ]}{" "} - + "_pinswg_case_value@OData.Community.Display.V1.FormattedValue" + ] + : showTopThreeArr[key][ + "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" + ]}{" "} +
{/* {(topThreeType == "awaitingSubmission" || diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index dad94159..ab8d610c 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -156,6 +156,7 @@ const TopThree = (props) => {
{t("myportal:case-reference")}:{" "} { state: "edit", }, }} - // href="#" - > - { - setCurrentReference({ - "currentReference": - showTopThreeArr[key].caseRef, - "currentType": topThreeType, - "incidentid": - showTopThreeArr[key].incidentID, - "appealType": - showTopThreeArr[key].appealType, - "repDetails": showTopThreeArr[key], - }); - }} - > - {showTopThreeArr[key].pinswg_name} - + className="govuk-link--no-underline" + data-id={index} + onClick={() => { + setCurrentReference({ + "currentReference": + showTopThreeArr[key].caseRef, + "currentType": topThreeType, + "incidentid": + showTopThreeArr[key].incidentID, + "appealType": + showTopThreeArr[key].appealType, + "repDetails": showTopThreeArr[key], + }); + }}> + + {showTopThreeArr[key].pinswg_name} +
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index 33fd4201..925cd75f 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -100,49 +100,47 @@ const ViewAllResults = (props) => { ? "/myportal/case" : "/case" } - > - { - setCurrentReference({ - "currentReference": - currentView.viewKey != "watchedCases" - ? currentView.viewKey == - "myRepresentations" - ? resultsArr[key].caseRef - : resultsArr[key].ticketnumber - : resultsArr[key][ - "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" - ], + onClick={() => { + setCurrentReference({ + "currentReference": + currentView.viewKey != "watchedCases" + ? currentView.viewKey == + "myRepresentations" + ? resultsArr[key].caseRef + : resultsArr[key].ticketnumber + : resultsArr[key][ + "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" + ], - "currentType": currentView.viewKey, - "incidentid": - currentView.viewKey != "watchedCases" - ? resultsArr[key].incidentid - : resultsArr[key][ - "_pinswg_watchedcase_value" - ], + "currentType": currentView.viewKey, + "incidentid": + currentView.viewKey != "watchedCases" + ? resultsArr[key].incidentid + : resultsArr[key][ + "_pinswg_watchedcase_value" + ], + + "appealType": + resultsArr[key].pinswg_appealcasetype, + "repDetails": + currentView.viewKey == + "myRepresentations" && + resultsArr[key], + }); + }}> + + + {t("search:searchresults-case-reference-label")} + : + + {currentView.viewKey != "watchedCases" + ? currentView.viewKey == "myRepresentations" + ? resultsArr[key].caseRef + : resultsArr[key].ticketnumber + : resultsArr[key][ + "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" + ]} - "appealType": - resultsArr[key].pinswg_appealcasetype, - "repDetails": - currentView.viewKey == - "myRepresentations" && - resultsArr[key], - }); - }} - > - - {t("search:searchresults-case-reference-label")} - : - - {currentView.viewKey != "watchedCases" - ? currentView.viewKey == "myRepresentations" - ? resultsArr[key].caseRef - : resultsArr[key].ticketnumber - : resultsArr[key][ - "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" - ]} -
diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index a279ed3d..e5ff6c13 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -37,18 +37,16 @@ const WatchedCases = (props) => { : "/myportal/viewall" } shallow - > - { - setCurrentView({ - "viewName": "Watched Cases", - "viewKey": "watchedCases", - }); - }} - > - {t("myportal:viewall-link")} - + className="govuk-link--no-underline" + onClick={() => { + setCurrentView({ + "viewName": "Watched Cases", + "viewKey": "watchedCases", + }); + }}> + + {t("myportal:viewall-link")} +
)} diff --git a/components/myportal/youraccount.js b/components/myportal/youraccount.js index 439d5734..126a7d17 100644 --- a/components/myportal/youraccount.js +++ b/components/myportal/youraccount.js @@ -7,44 +7,42 @@ export default function YourAccount() { const router = useRouter(); const { locale } = router; - return ( - <> -
-
-

- {t("myportal:yourdetails-card-title")} -

-

- {t("myportal:yourdetails-card-paragraph-one")} -

+ return <> +
+
+

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

+

+ {t("myportal:yourdetails-card-paragraph-one")} +

-
- - - {t("myportal:yourdetails-card-link")} - - -
+
+ + + {t("myportal:yourdetails-card-link")} + +
- - {/*
-

- {t("myportal:changepassword-card-title")} -

-

- {" "} - {t("myportal:changepassword-card-paragraph-one")} -

- - -
*/}
- - ); + + {/*
+

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

+

+ {" "} + {t("myportal:changepassword-card-paragraph-one")} +

+ +
+ + + {t("myportal:changepassword-card-link")} + + +
+
*/} +
+ ; } diff --git a/components/newappeal/buildsection.js b/components/newappeal/buildsection.js index b4e7333d..05302282 100644 --- a/components/newappeal/buildsection.js +++ b/components/newappeal/buildsection.js @@ -79,7 +79,7 @@ let BuildSection = (props) => { ); const isProgressComplete = (progObj) => { - const progressCount = 0; + let progressCount = 0; for (let key in progObj) { progObj[key].allFieldsComplete === true && progressCount++; diff --git a/components/newappeal/complete.js b/components/newappeal/complete.js index 25e2aaba..a559c675 100644 --- a/components/newappeal/complete.js +++ b/components/newappeal/complete.js @@ -138,8 +138,8 @@ let CompleteAppeal = (props) => {

- - Back to My Portal + + Back to My Portal

diff --git a/components/nosession.js b/components/nosession.js index 9b8ba73f..5f717195 100644 --- a/components/nosession.js +++ b/components/nosession.js @@ -7,7 +7,7 @@ import Footer from "../components/footer"; import useTranslation from "next-translate/useTranslation"; const NoSessionWarning = (props) => { - const { footerLinks, loading } = props; + let { footerLinks, loading } = props; let { t, lang } = useTranslation(); diff --git a/components/pdftemplates/enforcement_pdf.js b/components/pdftemplates/enforcement_pdf.js index 955f2a66..ed49d754 100644 --- a/components/pdftemplates/enforcement_pdf.js +++ b/components/pdftemplates/enforcement_pdf.js @@ -131,6 +131,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => { PEDW Logo @@ -1540,6 +1541,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { PEDW Logo @@ -278,6 +279,7 @@ export const finalComments_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { PEDW Logo @@ -1424,6 +1425,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { PEDW Logo @@ -285,6 +286,7 @@ export const other_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { PEDW Logo @@ -317,6 +318,7 @@ export const planningappeals78_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { PEDW Logo @@ -278,6 +279,7 @@ export const statement_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { PEDW Logo @@ -278,6 +279,7 @@ export const writtenStatement_pdf = ({ docProps }) => { values.filesList.map(function (p) { return ( { label, errormsg, }) => { - return ( - <> -
- - {touched && error && ( - - - Error: - {" "} - {errormsg} - - )} -
- props.onChangeSelectAppealType(e)} + > + + {_.isEmpty(optionsObj) + ? "" + : Object.keys(optionsObj).map((key, index) => { + return ( +
+ ? "" + : optionsObj[key] + .attributevalue + + "," + + optionsObj[key].value + .replace( + /(\band|[\s\-\+\(\)\,\&])/g, + "" + ) + .toLowerCase() + } + > + {_.isEmpty(optionsObj[key]) + ? "" + : _.isEmpty(optionsObj[key]) + ? "" + : _.isEmpty( + optionsObj[key].value + ) + ? "" + : router.locale == "cy" + ? jsonpath.query( + transLookup, + '$..[?(@.value=="' + + optionsObj[key] + .value + + '")].value_cy' + ) + : optionsObj[key].value || + t( + "case:summary-no-date-entered-label" + )} + + ); + })} +
- - ); +
+ ; }; // const [showSpinnerState, setShowSpinnerState] = useState(false); diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 17ec32aa..637af5f3 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -356,31 +356,29 @@ const DNSSearchResults = (props) => { : "") + "/dnsdetails" } - > - { - setCurrentReference({ - "currentReference": - item.title, - "currentType": - "searchResultsObj", - "incidentid": - item.incidentid, - "appealType": - item.pinswg_appealcasetype, - "showMap": showMap, - }); - }} - > - - {t( - "search:searchresults-case-reference-label" - )} - : - - {item.title} - + className="govuk-link--no-underline" + onClick={() => { + setCurrentReference({ + "currentReference": + item.title, + "currentType": + "searchResultsObj", + "incidentid": + item.incidentid, + "appealType": + item.pinswg_appealcasetype, + "showMap": showMap, + }); + }}> + + + {t( + "search:searchresults-case-reference-label" + )} + : + + {item.title} +
diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 9cb97dc5..1724e00f 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -86,27 +86,6 @@ const SearchResults = (props) => { const cookies = parseCookies(); - const selectWatchedCase = (loggedInUser, incidentID, appealType) => { - let updateBody = { - "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", - "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", - "pinswg_appealcasetype": +appealType, - }; - - createWatchedCases(updateBody) - .then((data) => data) - .then(() => { - getWatchedCasesProxy(props.accountDetails.loggedinUserId).then( - (data) => { - setWatchedCases(data), - getDetails(data, "myWatchedCases").then((data) => { - setWatchedCasesDetails(data); - }); - } - ); - }); - }; - const isWatchedCase = (whichIncident) => { let isWatched = jsonpath.query( watchedCases, @@ -298,30 +277,27 @@ const SearchResults = (props) => { ? "/myportal/case" : "/case" } + className="govuk-link--no-underline" + onClick={() => { + setCurrentReference({ + "currentReference": + item.title, + "currentType": + "searchResultsObj", + "incidentid": + item.incidentid, + "appealType": + item.pinswg_appealcasetype, + }); + }} > - { - setCurrentReference({ - "currentReference": - item.title, - "currentType": - "searchResultsObj", - "incidentid": - item.incidentid, - "appealType": - item.pinswg_appealcasetype, - }); - }} - > - - {t( - "search:searchresults-case-reference-label" - )} - : - - {item.title} - + + {t( + "search:searchresults-case-reference-label" + )} + : + + {item.title}
@@ -358,7 +334,7 @@ const SearchResults = (props) => { : ""} {/* {detailsObj.pinswg_siteaddressline1 != - null &&
} */} + null &&
} */} {_.has( detailsObj, @@ -687,6 +663,28 @@ const SearchResults = (props) => { }; useEffect(() => { + const selectWatchedCase = (loggedInUser, incidentID, appealType) => { + let updateBody = { + "pinswg_WatchedCase@odata.bind": + "/incidents(" + incidentID + ")", + "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", + "pinswg_appealcasetype": +appealType, + }; + + createWatchedCases(updateBody) + .then((data) => data) + .then(() => { + getWatchedCasesProxy( + props.accountDetails.loggedinUserId + ).then((data) => { + setWatchedCases(data), + getDetails(data, "myWatchedCases").then((data) => { + setWatchedCasesDetails(data); + }); + }); + }); + }; + if (searchLoaded) { if (selectedOption) { setShowSpinnerState(true); @@ -724,7 +722,12 @@ const SearchResults = (props) => { fieldSortState, orderByState, searchLoaded, + loginToWatch, + setWatchedCases, getSearchPageResults, + setWatchedCasesDetails, + props.accountDetails.loggedinUserId, + router.query, ]); // console.log( // "page is here ", diff --git a/components/search/viewall.js b/components/search/viewall.js index ec4e33f9..26fc2264 100644 --- a/components/search/viewall.js +++ b/components/search/viewall.js @@ -14,12 +14,12 @@ export default function ViewAllResults(props) {
- - - Case Reference: - - {resultsArr[key].title} - + + + Case Reference: + + {resultsArr[key].title} +
@@ -90,12 +90,12 @@ export default function ViewAllResults(props) { : "/case" } > - - - Case Reference: - - {item.title} - + + + Case Reference: + + {item.title} +
diff --git a/components/searchresults.js b/components/searchresults.js index ec39b08b..50dc5df1 100644 --- a/components/searchresults.js +++ b/components/searchresults.js @@ -58,12 +58,12 @@ export default function Search(props) {
- - - {t( - "search:searchresults-search-button-label" - )} - + + + {t( + "search:searchresults-search-button-label" + )} + {/* router.back()} diff --git a/components/viewall.js b/components/viewall.js index 1452b9c7..e8798d5b 100644 --- a/components/viewall.js +++ b/components/viewall.js @@ -29,8 +29,8 @@ export default function ViewAll(props) {
- - Back + + Back
diff --git a/package.json b/package.json index 3f5f261e..b13fc262 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "multiparty": "^4.2.3", "mysql": "^2.18.1", "nanoid": "^3.2.0", - "next": "^12.0.8", + "next": "13.4", "next-auth": "^4.22.1", "next-connect": "^0.12.2", "next-redux-wrapper": "^7.0.5", @@ -55,12 +55,12 @@ "path": "^0.12.7", "prop-types": "^15.8.1", "raw-loader": "^4.0.2", - "react": "17.0.2", + "react": "^18.2.0", "react-accessible-accordion": "^4.0.0", "react-autosuggest": "^10.1.0", "react-cookie-consent": "^7.2.1", "react-datepicker": "4.10.0", - "react-dom": "17.0.2", + "react-dom": "^18.2.0", "react-dropzone": "^11.5.1", "react-idle-timer": "4.6.4", "react-leaflet": "^3.2.5", @@ -83,7 +83,7 @@ }, "devDependencies": { "eslint": "^8.6.0", - "eslint-config-next": "^13.1.6", + "eslint-config-next": "^14.0.1", "eslint-plugin-jsdoc": "^40.0.1", "prisma": "^5.0.0" } diff --git a/pages/404.js b/pages/404.js index f9d320e8..03bd1aeb 100644 --- a/pages/404.js +++ b/pages/404.js @@ -27,7 +27,7 @@ const FourOhFour = (props) => {

{t("common:404-not-found-title")}

- {t("common:404-not-found-link")} + {t("common:404-not-found-link")}
diff --git a/pages/_document.js b/pages/_document.js index e2782d41..324db990 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -3,6 +3,7 @@ import SkipLink from "../components/skiplink"; import { Tracking, TrackingNoScript } from "../components/tracking"; import { nanoid } from "nanoid"; import { setCookie } from "nookies"; +import Script from "next/script"; class MyDocument extends Document { static async getInitialProps(ctx) { @@ -64,11 +65,19 @@ class MyDocument extends Document { {!process.browser && ( <> + + )} + + {typeof window !== "undefined" && ( + <> +
hello
+ )} diff --git a/pages/api/email/index.js b/pages/api/email/index.js deleted file mode 100644 index 8576acbc..00000000 --- a/pages/api/email/index.js +++ /dev/null @@ -1,81 +0,0 @@ -import nodemailer from "nodemailer"; - -export default function handler(req, res) { - const { email, subject, emailcontenttitle, emailcontent } = req.body; - console.log(email); - //console.log(process.env); - - const client = nodemailer.createTransport({ - auth: { - user: process.env.EMAIL_SERVER_USER, - pass: process.env.EMAIL_SERVER_PASSWORD, - }, - host: process.env.EMAIL_SERVER_HOST, - port: process.env.EMAIL_SERVER_PORT, - secure: true, - }); - - //console.log(client); - - // Some simple styling options - const backgroundColor = "#ffffff"; - const textColor = "#444444"; - const mainBackgroundColor = "#ffffff"; - const buttonBackgroundColor = "#aa1111"; - const buttonBorderColor = "#aa1111"; - const buttonTextColor = "#ffffff"; - const headerBackgroundColor = "#000000"; - const url = process.env.API_ROOT; - - let emailBodyContent = ` - - - - - - - - - - - - - - - -
-
- ${emailcontenttitle} -
- ${emailcontent} -
- -
- If you did not request this email you can safely ignore it. -
-`; - - const mailData = { - from: "no-reply@rdbdigital.com", - to: email, - subject: subject, - text: emailBodyContent, - html: emailBodyContent, - }; - - client.sendMail(mailData, (err, data) => { - if (err) { - console.log(err); - res.status(400); - } else { - console.log("mail sent"); - res.status(200).json(data); - } - }); -} diff --git a/pages/auth/error.js b/pages/auth/error.js index b8142769..cdcbc568 100644 --- a/pages/auth/error.js +++ b/pages/auth/error.js @@ -58,7 +58,7 @@ const Error = (props) => {
- + {t("auth:auth-return-home-link-label")}
diff --git a/pages/auth/verify-request.js b/pages/auth/verify-request.js index 17568c99..93ffbd68 100644 --- a/pages/auth/verify-request.js +++ b/pages/auth/verify-request.js @@ -40,7 +40,7 @@ const SignIn = (props) => {
{" "} - + {t("auth:auth-return-home-link-label")}
diff --git a/pages/dns-not-found.js b/pages/dns-not-found.js index 678bfdfa..b2ed98c3 100644 --- a/pages/dns-not-found.js +++ b/pages/dns-not-found.js @@ -30,7 +30,7 @@ const FourOhFour = (props) => { found - {t("common:404-not-found-link")} + {t("common:404-not-found-link")}
diff --git a/pages/dns/help.js b/pages/dns/help.js index 90f4940b..85bd980d 100644 --- a/pages/dns/help.js +++ b/pages/dns/help.js @@ -42,8 +42,8 @@ const Home = (props) => { contains the following:

- - Accessibility + + Accessibility

@@ -51,10 +51,10 @@ const Home = (props) => { help using the site.

- - + + Terms and conditions - +

@@ -62,8 +62,8 @@ const Home = (props) => { site.

- - Cookies + + Cookies

@@ -71,14 +71,14 @@ const Home = (props) => { website uses them.

- - Privacy + + Privacy

View our Privacy Notice on GOV.UK.

- - Welsh language + + Welsh language

@@ -87,8 +87,8 @@ const Home = (props) => { Scheme.

- - Sitemap + + Sitemap

@@ -96,16 +96,16 @@ const Home = (props) => { heirarchy of the site.

- - Useful links + + Useful links

Links to other related websites and documents.

- - Contact + + Contact

diff --git a/pages/logout.js b/pages/logout.js index 98334bc2..b1ecb71a 100644 --- a/pages/logout.js +++ b/pages/logout.js @@ -91,7 +91,7 @@ const LogOut = (props) => {

{t("common:logged-out-title")}

- + {t("common:logged-out-link")}
diff --git a/pages/myportal/error.js b/pages/myportal/error.js index a969f55d..a257f532 100644 --- a/pages/myportal/error.js +++ b/pages/myportal/error.js @@ -28,7 +28,7 @@ function Error({ statusCode }, props) { A problem occured when trying to login

- {t("common:404-not-found-link")} + {t("common:404-not-found-link")}
diff --git a/pages/myportal/representation.js b/pages/myportal/representation.js index 08d19508..f1a7aeb4 100644 --- a/pages/myportal/representation.js +++ b/pages/myportal/representation.js @@ -40,29 +40,26 @@ const Home = (props) => { const dispatch = useDispatch(); - useEffect(() => { - const updateAccountStore = async () => { - const thisSession = await getSession(); + // useEffect(() => { + // const updateAccountStore = async () => { + // const thisSession = await getSession(); - if (thisSession) { - let [loggedInUser] = await Promise.all([ - await getPortalLogin(thisSession.user.email), - ]); + // if (thisSession) { + // let loggedInUser = await getPortalLogin(thisSession.user.email); + // dispatch( + // setAccountDetails( + // await getPersonalAccount( + // loggedInUser.value[0].contactid + // ) + // ) + // ); + // dispatch(setContainerID(thisSession.user.id)); - dispatch( - setAccountDetails( - await getPersonalAccount( - loggedInUser.value[0].contactid - ) - ) - ); - dispatch(setContainerID(thisSession.user.id)); - - //dispatch(setRepresentationSubmit(true)); - } - }; - updateAccountStore(); - }, [dispatch]); + // //dispatch(setRepresentationSubmit(true)); + // } + // }; + // updateAccountStore(); + // }, [dispatch]); const { data: session, status } = useSession(); diff --git a/public/assets/javascript/govuk-frontend-3.13.0.min.js b/public/assets/javascript/govuk-frontend-3.13.0.min.js index e9366b04..78979b67 100644 --- a/public/assets/javascript/govuk-frontend-3.13.0.min.js +++ b/public/assets/javascript/govuk-frontend-3.13.0.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define("GOVUKFrontend",["exports"],e):e(t.GOVUKFrontend={})}(this,function(t){"use strict";function r(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n>>0,"object"==typeof i[r]?i[r].baseVal=a.join(" "):i[r]=a.join(" "),u())},s.remove=function(){d.apply(s,t=arguments);for(var t,e={},n=0,o=[];n>>0,"object"==typeof i[r]?i[r].baseVal=a.join(" "):i[r]=a.join(" "),u()},s.toggle=function(t,e){return d.apply(s,[t]),o!==e?e?(s.add(t),!0):(s.remove(t),!1):c[t]?(s.remove(t),!1):(s.add(t),!0)},s}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(t){var e=arguments[1];if(e!==o)return this[(e=!!e)?"add":"remove"](t),e;var n=!this.contains(t);return this[n?"add":"remove"](t),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var o=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,e=arguments.length,n=0;nsections',this.$openAllButton.setAttribute("class",this.openAllClass),this.$openAllButton.setAttribute("aria-expanded","false"),this.$openAllButton.setAttribute("type","button");var t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$openAllButton),this.$module.insertBefore(t,this.$module.firstChild),this.$openAllButton.addEventListener("click",this.onOpenOrCloseAllToggle.bind(this))},n.prototype.initSectionHeaders=function(){r(this.$sections,function(t,e){var n=t.querySelector("."+this.sectionHeaderClass);this.initHeaderAttributes(n,e),this.setExpanded(this.isExpanded(t),t),n.addEventListener("click",this.onSectionToggle.bind(this,t)),this.setInitialState(t)}.bind(this))},n.prototype.initHeaderAttributes=function(e,t){var n=this,o=e.querySelector("."+this.sectionButtonClass),i=e.querySelector("."+this.sectionHeadingClass),r=e.querySelector("."+this.sectionSummaryClass),s=document.createElement("button");s.setAttribute("type","button"),s.setAttribute("id",this.moduleId+"-heading-"+(t+1)),s.setAttribute("aria-controls",this.moduleId+"-content-"+(t+1));for(var a=0;a>>0,"object"==typeof i[r]?i[r].baseVal=a.join(" "):i[r]=a.join(" "),u())},s.remove=function(){d.apply(s,t=arguments);for(var t,e={},n=0,o=[];n>>0,"object"==typeof i[r]?i[r].baseVal=a.join(" "):i[r]=a.join(" "),u()},s.toggle=function(t,e){return d.apply(s,[t]),o!==e?e?(s.add(t),!0):(s.remove(t),!1):c[t]?(s.remove(t),!1):(s.add(t),!0)},s};}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(t){var e=arguments[1];if(e!==o)return this[(e=!!e)?"add":"remove"](t),e;var n=!this.contains(t);return this[n?"add":"remove"](t),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var o=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,e=arguments.length,n=0;nsections',this.$openAllButton.setAttribute("class",this.openAllClass),this.$openAllButton.setAttribute("aria-expanded","false"),this.$openAllButton.setAttribute("type","button");var t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$openAllButton),this.$module.insertBefore(t,this.$module.firstChild),this.$openAllButton.addEventListener("click",this.onOpenOrCloseAllToggle.bind(this))},n.prototype.initSectionHeaders=function(){r(this.$sections,function(t,e){var n=t.querySelector("."+this.sectionHeaderClass);this.initHeaderAttributes(n,e),this.setExpanded(this.isExpanded(t),t),n.addEventListener("click",this.onSectionToggle.bind(this,t)),this.setInitialState(t)}.bind(this))},n.prototype.initHeaderAttributes=function(e,t){var n=this,o=e.querySelector("."+this.sectionButtonClass),i=e.querySelector("."+this.sectionHeadingClass),r=e.querySelector("."+this.sectionSummaryClass),s=document.createElement("button");s.setAttribute("type","button"),s.setAttribute("id",this.moduleId+"-heading-"+(t+1)),s.setAttribute("aria-controls",this.moduleId+"-content-"+(t+1));for(var a=0;a