clean up debug info, reduce page weight

This commit is contained in:
2024-09-26 10:07:27 +01:00
parent 00359e2f7d
commit a362a2c00f
11 changed files with 49 additions and 36 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ NEXTAUTH_URL_INTERNAL = $API_ROOT
NEXTAUTH_SECRET = SuperSecret NEXTAUTH_SECRET = SuperSecret
// CNR sql server // CNR sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server // dev test sql server
+5
View File
@@ -27,3 +27,8 @@ dockerfile*
.dockerignore .dockerignore
Makefile Makefile
docker*.yml docker*.yml
# Polling
pages/api/poll-queue.js
pages/polling.js
+20 -20
View File
@@ -70,11 +70,11 @@ export const createContainerSas = async (containerName) => {
expiresOn: TEN_MINUTES_AFTER_NOW, expiresOn: TEN_MINUTES_AFTER_NOW,
}; };
console.log( // console.log(
"\n////////////////////////\nsasOptions :", // "\n////////////////////////\nsasOptions :",
JSON.stringify(sasOptions), // JSON.stringify(sasOptions),
"\n////////////////////////" // "\n////////////////////////"
); // );
const sasToken = generateBlobSASQueryParameters( const sasToken = generateBlobSASQueryParameters(
sasOptions, sasOptions,
@@ -82,11 +82,11 @@ export const createContainerSas = async (containerName) => {
accountName accountName
).toString(); ).toString();
console.log( // console.log(
"\n////////////////////////\nsasToken :", // "\n////////////////////////\nsasToken :",
sasToken, // sasToken,
"\n////////////////////////" // "\n////////////////////////"
); // );
return sasToken; return sasToken;
}; };
@@ -140,7 +140,7 @@ export const createBlobSas = async (containerName, blobName) => {
export const createContainer = async (containerName) => { export const createContainer = async (containerName) => {
const creds = new DefaultAzureCredential(); const creds = new DefaultAzureCredential();
console.log(JSON.stringify(creds)); //console.log(JSON.stringify(creds));
//containerName = containerName.toLowerCase(); //containerName = containerName.toLowerCase();
//console.log( //console.log(
@@ -159,7 +159,7 @@ export const createContainer = async (containerName) => {
const createContainerResponse = await containerClient const createContainerResponse = await containerClient
.createIfNotExists() .createIfNotExists()
.then((data) => { .then((data) => {
console.log(data); //console.log(data);
return data; return data;
}) })
.catch((error) => { .catch((error) => {
@@ -933,7 +933,7 @@ export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
Array.isArray(repsBlobObj) && Array.isArray(repsBlobObj) &&
!repsBlobObj.length && !repsBlobObj.length &&
console.log("is empt and an array"); console.log("No partial reps for this container:" + containerName);
for (const prop in repsBlobObj) { for (const prop in repsBlobObj) {
//console.log(`Progress - ${prop}: ${repsBlobObj[prop].path}`); //console.log(`Progress - ${prop}: ${repsBlobObj[prop].path}`);
@@ -1128,13 +1128,13 @@ export const getAllProgressBlobs = async (containerName) => {
}); });
} }
console.log( // console.log(
"\n////////////////////////////\n", // "\n////////////////////////////\n",
sasUrl, // sasUrl,
"blobObj:", // "blobObj:",
blobObj, // blobObj,
"\n////////////////////////////" // "\n////////////////////////////"
); // );
return blobObj; return blobObj;
}; };
+5 -5
View File
@@ -47,8 +47,8 @@ const DocumentDetails = (props) => {
var startTime = docsOffline.split(",")[0]; var startTime = docsOffline.split(",")[0];
var endTime = docsOffline.split(",")[1]; var endTime = docsOffline.split(",")[1];
console.log(startTime); // console.log(startTime);
console.log(endTime); // console.log(endTime);
var currentDate = new Date(); var currentDate = new Date();
@@ -62,9 +62,9 @@ const DocumentDetails = (props) => {
endDate.setMinutes(endTime.split(":")[1]); endDate.setMinutes(endTime.split(":")[1]);
endDate.setSeconds(endTime.split(":")[2]); endDate.setSeconds(endTime.split(":")[2]);
console.log(startDate); // console.log(startDate);
console.log(endDate); // console.log(endDate);
console.log(currentDate); // console.log(currentDate);
var valid = startDate < currentDate && endDate > currentDate; var valid = startDate < currentDate && endDate > currentDate;
ShowDocLinks = valid; ShowDocLinks = valid;
+1 -1
View File
@@ -71,7 +71,7 @@ const ServiceBanner = (props) => {
<div className="serviceBanner_userDetails_name"> <div className="serviceBanner_userDetails_name">
<Link <Link
href="/account/personaldetails" href="/account/personaldetails"
className="govuk-button-secondary" className="govuk-button-secondary govuk-link"
> >
{props.accountDetails.accountDetails.firstname}{" "} {props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname} {props.accountDetails.accountDetails.lastname}
+3 -1
View File
@@ -9,7 +9,7 @@ module.exports = {
}, },
], ],
"pages": { "pages": {
"*": ["common", "newappeal", "search"], "*": ["common", "search"],
"/": ["common", "home", "case"], "/": ["common", "home", "case"],
"/error": ["common", "home", "myportal"], "/error": ["common", "home", "myportal"],
"/furtherdetails": ["common", "home", "myportal"], "/furtherdetails": ["common", "home", "myportal"],
@@ -42,8 +42,10 @@ module.exports = {
"/myportal/case/id/[incident]": ["case", "home"], "/myportal/case/id/[incident]": ["case", "home"],
"/myportal/addresssearch": ["search", "case", "myportal"], "/myportal/addresssearch": ["search", "case", "myportal"],
"/myportal/addresssearchresults": ["search", "case", "myportal"], "/myportal/addresssearchresults": ["search", "case", "myportal"],
"/myportal/[appealtypes]": ["newappeal", "home"],
"/newappeal": ["newappeal", "home"], "/newappeal": ["newappeal", "home"],
"/newappeal/*": ["newappeal", "home"], "/newappeal/*": ["newappeal", "home"],
"/newappeal/[appealtypes]": ["newappeal", "home"],
"/newappeal/selectappeal": ["newappeal", "home"], "/newappeal/selectappeal": ["newappeal", "home"],
"/dns/*": ["dnsCommon", "case", "common"], "/dns/*": ["dnsCommon", "case", "common"],
"/dns/[developmentName]": ["dnsCommon", "case", "common"], "/dns/[developmentName]": ["dnsCommon", "case", "common"],
+4 -1
View File
@@ -38,6 +38,7 @@
"fs": "0.0.2", "fs": "0.0.2",
"google-map-react": "^2.2.1", "google-map-react": "^2.2.1",
"govuk-frontend": "^5.0.0", "govuk-frontend": "^5.0.0",
"history": "^5.3.0",
"jsonpath": "^1.1.1", "jsonpath": "^1.1.1",
"jsonpath-plus": "^4.0.0", "jsonpath-plus": "^4.0.0",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
@@ -58,6 +59,7 @@
"nodemailer": "^6.9.7", "nodemailer": "^6.9.7",
"nookies": "^2.5.2", "nookies": "^2.5.2",
"notifications-node-client": "^7.0.6", "notifications-node-client": "^7.0.6",
"openapi-types": "^12.1.3",
"ospoint": "^0.2.1", "ospoint": "^0.2.1",
"path": "^0.12.7", "path": "^0.12.7",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
@@ -83,13 +85,14 @@
"sass-loader": "13.3.2", "sass-loader": "13.3.2",
"swagger-ui": "^5.10.3", "swagger-ui": "^5.10.3",
"swagger-ui-react": "^5.10.3", "swagger-ui-react": "^5.10.3",
"tslib": "^2.7.0",
"typescript": "^5.3.2", "typescript": "^5.3.2",
"uuid": "9.0.0", "uuid": "9.0.0",
"webpack": "^5.66.0", "webpack": "^5.66.0",
"xpath": "^0.0.32" "xpath": "^0.0.32"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.6.0", "eslint": "^9.11.1",
"eslint-config-next": "^14.0.1", "eslint-config-next": "^14.0.1",
"eslint-plugin-jsdoc": "^48.2.3", "eslint-plugin-jsdoc": "^48.2.3",
"prisma": "^5.0.0" "prisma": "^5.0.0"
+1 -1
View File
@@ -45,7 +45,7 @@ class MyDocument extends Document {
csp += `connect-src 'self' https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com;`; csp += `connect-src 'self' https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com;`;
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/;`; 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/;`;
csp += `style-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://www.google-analytics.com https://tagmanager.google.com/ https://www.googletagmanager.com/ https://fonts.googleapis.com/;`; csp += `style-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://www.google-analytics.com https://tagmanager.google.com/ https://www.googletagmanager.com/ https://fonts.googleapis.com/;`;
csp += `img-src 'self' 'unsafe-inline' https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com https://www.google-analytics.com https://ssl.gstatic.com/ data:;`; csp += `img-src 'self' 'unsafe-inline' https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com https://www.google-analytics.com https://ssl.gstatic.com/ blob: data:;`;
csp += `font-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://fonts.gstatic.com/ data:;`; csp += `font-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://fonts.gstatic.com/ data:;`;
return ( return (
+1 -1
View File
@@ -123,7 +123,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
console.log(cookies); console.log(cookies);
console.log("the query :", query.ticketnumber); console.log("the query :", query.ticketnumber);
console.log("viewkey:" + query.hasOwnProperty("key") ? "yes" : "no"); console.log("viewkey: " + (query.hasOwnProperty("key") ? "yes" : "no"));
const showLoginCheck = process.env.SHOWLOGIN || false; const showLoginCheck = process.env.SHOWLOGIN || false;
let thisSession = await getSession(ctx); let thisSession = await getSession(ctx);
+3 -3
View File
@@ -227,7 +227,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
myCases, myCases,
myRepresentations, myRepresentations,
watchedCases, watchedCases,
awaitingSubmission, //awaitingSubmission,
awaitingSubmissionFromBlob, awaitingSubmissionFromBlob,
] = await Promise.all([ ] = await Promise.all([
accountDetails.pinswg_typeofinvolvement == 846040012 accountDetails.pinswg_typeofinvolvement == 846040012
@@ -236,7 +236,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
await getRepsFromBlob(thisSession.user.id), await getRepsFromBlob(thisSession.user.id),
await getWatchedCases(loggedInUser), await getWatchedCases(loggedInUser),
await getAwaitingSubmission(loggedInUser), //await getAwaitingSubmission(loggedInUser),
await getAwaitingSubmissionFromBlob(thisSession.user.id), await getAwaitingSubmissionFromBlob(thisSession.user.id),
]); ]);
@@ -337,7 +337,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setWatchedCasesDetails(watchedCasesDetails)); store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
store.dispatch(setMySubmittedReps(mySubmittedReps)); store.dispatch(setMySubmittedReps(mySubmittedReps));
store.dispatch(setMySubmittedRepsDetails(mySubmittedRepsDetails)); store.dispatch(setMySubmittedRepsDetails(mySubmittedRepsDetails));
store.dispatch(setAwaitingSubmission(awaitingSubmission)); //store.dispatch(setAwaitingSubmission(awaitingSubmission));
store.dispatch( store.dispatch(
setAwaitingSubmissionFromBlob(awaitingSubmissionFromBlob) setAwaitingSubmissionFromBlob(awaitingSubmissionFromBlob)
); );
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
plugins: {},
};