diff --git a/.env.local b/.env.local index 2748700e..f4494e11 100644 --- a/.env.local +++ b/.env.local @@ -39,11 +39,11 @@ RELAYPATH = "dev-pedw-hc" GOOGLE_TAG_MANAGER = GTM-T78CBC3 SHOWLOGIN = true -//SHOWREPRESENTATIONS = true +SHOWREPRESENTATIONS = true SHOWFILEUPLOAD = "false" SHOWMAPS = "false" API_ROOT = "http://localhost:3000" - +CY_API_ROOT ="http://cymru.local:3000" I18N_DOMAIN = "cymru.local" diff --git a/.vscode/launch.json b/.vscode/launch.json index 562cc640..39c6d864 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,12 +4,18 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { + { + "name": "Next.js: debug server-side", + "type": "node-terminal", + "request": "launch", + "command": "yarn run dev" + }, + {"name": "Launch Chrome against localhost", "type": "pwa-chrome", "request": "launch", - "name": "Launch Chrome against localhost", "url": "http://localhost:3000", "webRoot": "${workspaceFolder}" } + ] } \ No newline at end of file diff --git a/actions/azurestorage.js b/actions/azurestorage.js index 11222605..e014febb 100644 --- a/actions/azurestorage.js +++ b/actions/azurestorage.js @@ -422,7 +422,7 @@ export const downloadProgressFile = async ( const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody); - console.log("Downloaded blob content:", downloaded.toString()); + //console.log("Downloaded blob content:", downloaded.toString()); return JSON.parse(downloaded.toString()); }; @@ -578,17 +578,17 @@ export const getProgressBlobs = async (containerName, caseReference) => { blobCount++; } - console.log( - "this is the casefolder and blobcount:", - caseReference, - blobCount - ); + // console.log( + // "this is the casefolder and blobcount:", + // caseReference, + // blobCount + // ); let blobObj = []; for await (const blob of containerClient.listBlobsFlat({ prefix: caseReference + "/" + caseReference + "_appeal.json", })) { - console.log("getProgressBlobs in here"); + //console.log("getProgressBlobs in here"); blobObj.push({ "name": blob.name.split("/")[1], "path": blob.name, @@ -680,11 +680,11 @@ export const getRepslobs = async (containerName, caseReference) => { blobCount++; } - console.log( - "this is the casefolder and blobcount:", - caseReference, - blobCount - ); + // console.log( + // "this is the casefolder and blobcount:", + // caseReference, + // blobCount + // ); let blobObj = []; for await (const blob of containerClient.findBlobsByTags( diff --git a/actions/index.js b/actions/index.js index a660af8c..cbdab79d 100644 --- a/actions/index.js +++ b/actions/index.js @@ -1264,7 +1264,7 @@ export const uploadFiles = async ( for (let i = 0; i < files.length; i++) { for (let j = 0; j < files[i].length; j++) { - console.log(files[i][j].name); + console.log("upload files:", files[i][j].name); formData.append(files[i][j].name, files[i][j]); } } @@ -1308,7 +1308,7 @@ export const uploadRepFiles = async ( for (let i = 0; i < files.length; i++) { for (let j = 0; j < files[i].length; j++) { - console.log(files[i][j].name); + console.log("upload rep files:", files[i][j].name); formData.append(files[i][j].name, files[i][j]); } } @@ -1335,6 +1335,7 @@ export const uploadRepFiles = async ( export const getFilesFromBlob = (containerName, casefolderID) => { console.log( + " get files from blob", BASE_URL + "/api/file/getbloblist?container=" + containerName + diff --git a/components/account/registerComplete.js b/components/account/registerComplete.js index 66607e12..cac7970c 100644 --- a/components/account/registerComplete.js +++ b/components/account/registerComplete.js @@ -101,7 +101,16 @@ const RegisterComplete = (props) => { onClick={() => { setLogout(), window.localStorage.clear(), - destroyCookie({}, "pinsUser"), + destroyCookie( + null, + "next-auth.csrf-token" + ), + destroyCookie( + null, + "next-auth.callback-url" + ), + destroyCookie(null, "pedw_locale"), + destroyCookie(null, "pinsUser"), signOut({ callbackUrl: "/logout" }); }} > diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 4a480c38..ea7d02f5 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -87,7 +87,9 @@ const Breadcrumbs = (props) => { { {router.pathname == "/myportal/advancedsearch" ? ( <>
  • + www @@ -177,7 +182,9 @@ const Breadcrumbs = (props) => { @@ -217,7 +224,9 @@ const Breadcrumbs = (props) => { @@ -239,7 +248,9 @@ const Breadcrumbs = (props) => { @@ -261,7 +272,9 @@ const Breadcrumbs = (props) => { @@ -286,7 +299,9 @@ const Breadcrumbs = (props) => { @@ -299,7 +314,9 @@ const Breadcrumbs = (props) => { @@ -321,7 +338,9 @@ const Breadcrumbs = (props) => { @@ -331,7 +350,7 @@ const Breadcrumbs = (props) => {
  • - Your cases + {t("common:breadcrumb-your-cases")}
  • ) : ( @@ -345,7 +364,7 @@ const Breadcrumbs = (props) => { router.locale != "en" ? "/" + router.locale + - "/myportal" + "/fymhorth" : "/myportal" } > @@ -380,7 +399,9 @@ const Breadcrumbs = (props) => { @@ -393,12 +414,14 @@ const Breadcrumbs = (props) => {
    - Your cases{" "} + {t("common:breadcrumb-your-cases")} @@ -421,7 +444,9 @@ const Breadcrumbs = (props) => { @@ -443,7 +468,9 @@ const Breadcrumbs = (props) => { @@ -564,7 +591,9 @@ const Breadcrumbs = (props) => { @@ -595,7 +624,9 @@ const Breadcrumbs = (props) => { @@ -814,7 +845,7 @@ const Breadcrumbs = (props) => { diff --git a/components/case/summary.js b/components/case/summary.js index 6b163182..9f880456 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -447,15 +447,19 @@ const CaseSummary = (props) => { "watchedCases" ); alert( - "You have stopped watching case " + + t( + "case:you-have-stopped-watching-label" + ) + props.currentView .caseReference .currentReference ); }} - title="Stop watching this case" + title={t( + "case:stop-watching-case-link" + )} > - Stop watching this case{" "} + {t("case:stop-watching-case-link")}{" "} ) : ( { .appealType ); alert( - "You are watching case " + + t( + "case:you-are-watching-label" + ) + + " " + props.currentView .caseReference .currentReference ); }} > - Watch this case + {t("case:watch-this-case-link")} ))} @@ -505,9 +512,9 @@ const CaseSummary = (props) => { // item.title // ); }} - title="Watch this case" + title={t("case:watch-this-case-link")} > - Watch this case + {t("case:watch-this-case-link")} )} @@ -524,7 +531,10 @@ const CaseSummary = (props) => { detailsObj.pinswg_representation_period_end_date ) && (
    - Representation Period ended on{" "} + {t( + "case:representation-period-ended-on-label" + )} + {formatDates( detailsObj.pinswg_representation_period_end_date )} diff --git a/components/elements/index.js b/components/elements/index.js index e8c8e199..379dc12a 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -1,7 +1,6 @@ import { Field, reduxForm } from "redux-form"; import { useRouter } from "next/router"; import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker"; -import cy from "date-fns/locale/cy"; import React, { useCallback, useEffect, useMemo, useState } from "react"; import "react-datepicker/dist/react-datepicker.css"; import moment from "moment"; @@ -288,7 +287,6 @@ const RenderDatePicker = ({ ...custom }) => { const router = useRouter(); - registerLocale("cy", cy); var startDateArr = custom.dateStart != "0" ? custom.dateStart.split("") : custom.dateStart; diff --git a/components/header.js b/components/header.js index e3a10c4b..302bfe59 100644 --- a/components/header.js +++ b/components/header.js @@ -220,8 +220,22 @@ const Header = (props) => { { window.localStorage.clear(), - destroyCookie({}, "pinsUser"), - signOut({ callbackUrl: "/logout" }); + destroyCookie( + null, + "next-auth.csrf-token" + ), + destroyCookie( + null, + "next-auth.callback-url" + ), + destroyCookie(null, "pedw_locale"), + destroyCookie(null, "pinsUser"), + signOut({ + callbackUrl: + locale == "cy" + ? "/allgofnodi" + : "/logout", + }); }} className="govuk-header__link govuk-!-margin-right-3" > @@ -272,6 +286,16 @@ const Header = (props) => { ? "Dewiswch Cymraeg" : "Select English" } + onClick={() => { + setCookie( + null, + "pedw_locale", + locale == "en" ? "cy" : "en", + { + path: "/", + } + ); + }} > {" "} {t("common:available-in")} diff --git a/components/homepage/login.js b/components/homepage/login.js index ebc864af..c791c2b6 100644 --- a/components/homepage/login.js +++ b/components/homepage/login.js @@ -184,6 +184,16 @@ let Login = (props) => { ; } + + const signInButton = () => { + router.push( + `${ + router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin" + }?callbackUrl=${encodeURIComponent( + window.location.href + )}&error=EmailSignin` + ); + }; return ( <>
    @@ -197,14 +207,19 @@ let Login = (props) => { {session && "Signed in as " + session.user?.email}

    + {!session && (