From 0df0ad5faae830627884a7bc70cbaeedff640c70 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Wed, 18 Jun 2025 09:01:41 +0100 Subject: [PATCH 1/3] 17169 added consultation response location id --- actions/azurestorage.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/actions/azurestorage.js b/actions/azurestorage.js index 3d9763d2..abdbc590 100644 --- a/actions/azurestorage.js +++ b/actions/azurestorage.js @@ -423,8 +423,8 @@ export const createRepPDFBlob = async ( ? "846040003" : repName.indexOf("_Impact") > 0 ? "846040029" - : repName.indexOf("_Consultation_Response") > 0 - ? "846040005" + : repName.indexOf("_Consultation_Response_") > 0 + ? "846040036" : "846040002"; const tags = { @@ -611,6 +611,10 @@ export const uploadFile = async (formContent, containerName, foldername) => { ? "846040003" : files[prop][0].fieldName.indexOf("_Impact_") > 0 ? "846040001" + : files[prop][0].fieldName.indexOf( + "_Consultation_Response_" + ) > 0 + ? "846040036" : "846040000"; const tags = { @@ -737,6 +741,7 @@ export const uploadSingleFile = async ( { pattern: /_Questionnaire_/, value: "846040001" }, { pattern: /_Comments_/, value: "846040003" }, { pattern: /_Impact_/, value: "846040001" }, + { pattern: /_Consultation_Response_/, value: "846040036" }, ]; // Find a matching pattern or fallback to default From 4b92f40018bde768a7fdf702b28059e9c13de592 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Wed, 18 Jun 2025 09:09:06 +0100 Subject: [PATCH 2/3] test language switcher --- pages/myportal/index.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pages/myportal/index.js b/pages/myportal/index.js index a6a3f242..78189a31 100644 --- a/pages/myportal/index.js +++ b/pages/myportal/index.js @@ -227,14 +227,15 @@ export const getServerSideProps = wrapper.getServerSideProps( preferredLocale = cookies.pedw_locale; } - if (preferredLocale !== locale) { - return { - redirect: { - destination: `/${preferredLocale}`, - permanent: false, - }, - }; - } + // if (preferredLocale !== locale) { + // return { + // redirect: { + // destination: `/${preferredLocale}/myportal`, + // permanent: false, + // locale: preferredLocale, + // }, + // }; + // } const showLoginCheck = Boolean(process.env.SHOWLOGIN); const showReps = Boolean(process.env.SHOWREPRESENTATIONS); From 6900d02f8c94725992d4d3cc74189fc0426e0ee6 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Wed, 18 Jun 2025 09:09:45 +0100 Subject: [PATCH 3/3] csp update --- middleware.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/middleware.js b/middleware.js index d8a952ed..de7a6db7 100644 --- a/middleware.js +++ b/middleware.js @@ -4,23 +4,25 @@ export function middleware(request) { const nonce = Buffer.from(crypto.randomUUID()).toString("base64"); const cspHeader = ` - default-src 'self'; - script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: http: ${ + default-src 'self'; + script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: http: ${ process.env.NODE_ENV === "production" ? "" : `'unsafe-eval'` }; - style-src 'self' 'unsafe-eval' 'unsafe-inline'; - img-src 'self' 'unsafe-inline' https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com blob: data:; - connect-src 'self' http://127.0.0.1 https://uksouth-1.in.applicationinsights.azure.com https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com; - font-src 'self' https://pro.fontawesome.com/ https://fonts.gstatic.com/ ; - object-src 'none'; - base-uri 'self'; - frame-src https://datamap.gov.wales/; - form-action 'self' ` + + style-src 'self' 'unsafe-eval' 'unsafe-inline'; + img-src 'self' 'unsafe-inline' https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com blob: data:; + connect-src 'self' http://127.0.0.1 https://uksouth-1.in.applicationinsights.azure.com https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com; + font-src 'self' https://pro.fontawesome.com/ https://fonts.gstatic.com/ ; + object-src 'none'; + base-uri 'self'; + frame-src https://datamap.gov.wales/; + form-action 'self' ` + process.env.NEXTAUTH_URL + - `; - frame-ancestors 'none'; - upgrade-insecure-requests; -`; + `; + frame-ancestors 'none'; + upgrade-insecure-requests; + `; + + //const cspHeader = ""; // csp += `base-uri 'self';`; // csp += `script-src 'self' 'unsafe-eval' 'unsafe-inline' https://ukwest-0.in.applicationinsights.azure.com https://region1.google-analytics.com https://www.google-analytics.com/ https://tagmanager.google.com/ https://www.googletagmanager.com/;`;