diff --git a/actions/azurestorage.js b/actions/azurestorage.js index f9bc1001..2e1ff561 100644 --- a/actions/azurestorage.js +++ b/actions/azurestorage.js @@ -263,7 +263,7 @@ export const createBlob = async (formContent, containerName, caseref) => { blobType: "Appeal", }; - console.log("the tags:", tags); + //console.log("the tags:", tags); const withTags = await blockBlobClient.setTags(tags); const withMeta = await blockBlobClient.setMetadata(tags); @@ -296,7 +296,7 @@ export const createRepBlob = async (formContent, containerName, caseref) => { blobType: "Representation", }; - console.log("the tags:", tags); + //console.log("the tags:", tags); const withTags = await blockBlobClient.setTags(tags); const withMeta = await blockBlobClient.setMetadata(tags); @@ -464,7 +464,7 @@ export const uploadPDFRepFiles = async ( blobType: "RepresentationPDF", }; - console.log("the tags:", tags); + //console.log("the tags:", tags); const withTags = await blockBlobClient.setTags(tags); const withMeta = await blockBlobClient.setMetadata(tags); @@ -486,21 +486,21 @@ export const uploadPDFAppealFiles = async ( const files = formContent; - console.log( - "///////////////////////////// \n", - formContent, - containerName, - foldername, - "\n///////////////////////////// \n" - ); - console.log( - "///////////////////////////// \n", - "appeal pdf files...", - files, - Object.keys(files).length, - foldername, - "\n///////////////////////////// \n" - ); + // console.log( + // "///////////////////////////// \n", + // formContent, + // containerName, + // foldername, + // "\n///////////////////////////// \n" + // ); + // console.log( + // "///////////////////////////// \n", + // "appeal pdf files...", + // files, + // Object.keys(files).length, + // foldername, + // "\n///////////////////////////// \n" + // ); // console.log(`files[${prop}] = ${files[prop][0].size}`); console.log(foldername + "/files/" + formContent.split("tmp/")[1]); @@ -517,7 +517,7 @@ export const uploadPDFAppealFiles = async ( blobType: "AppealPDF", }; - console.log("the tags:", tags); + //console.log("the tags:", tags); const withTags = await blockBlobClient.setTags(tags); const withMeta = await blockBlobClient.setMetadata(tags); @@ -556,7 +556,7 @@ export const uploadPDFCaseFiles = async ( blobType: "AppealPDF", }; - console.log("the tags:", tags); + //console.log("the tags:", tags); const withTags = await blockBlobClient.setTags(tags); const withMeta = await blockBlobClient.setMetadata(tags); @@ -775,7 +775,7 @@ export const getCaseBlob = async ( blobType: "Case", }; - console.log("the tags:", tags); + //console.log("the tags:", tags); const withTags = await blockBlobClient.setTags(tags); const withMeta = await blockBlobClient.setMetadata(tags); @@ -893,7 +893,12 @@ export const getAllProgressBlobs = async (containerName) => { }); } - console.log("blobObj:", blobObj); + console.log( + "\n////////////////////////////\n", + "blobObj:", + blobObj, + "\n////////////////////////////" + ); return blobObj; }; @@ -932,7 +937,7 @@ export const getRepsBlobs = async (containerName) => { listOptions )) { const blobClient = await containerClient.getBlobClient(blob.name); - console.log("getreps blob blob", blob); + console.log("getreps blob:", blob); blob.name.split("/")[2].indexOf("_rep.json") > 0 && blob.name.split("/")[2].indexOf("undefined") < 0 && blobObj.push({ diff --git a/components/case/representation/index.js b/components/case/representation/index.js index f8b1b2d5..6f1e72e5 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -165,12 +165,6 @@ let MakeRepresentation = (props) => { }; const whichControl = () => { - // console.log(isLPA); - // console.log( - // currentView.representationCapacity, - // _.isEmpty(currentView.representationCapacity) - // ); - if (isLPA && _.isEmpty(currentView.representationCapacity)) { return ( { const whichProgress = () => { { - console.log("curr"); switch (currentView.caseReference.appealType) { case 846040000: case 846040001: @@ -456,10 +449,6 @@ let MakeRepresentation = (props) => { } }); - //console.log(updateBody); - - //window.alert(`form is :\n\n${JSON.stringify(updateBody, null, 2)}`); - const reference = "PEDW-PARTIAL-REP"; const templateId = "021b0a7b-df00-41f1-b94e-c269bee98c75"; const emailAddress = props.props.accountDetails.loggedinUserEmail; @@ -568,7 +557,6 @@ let MakeRepresentation = (props) => { : values.representationCapacity, "locale": locale, })); - console.log(values); currentView.representationSubmit != true ? _.isEmpty(currentView.representationCapacity) ? isLPA @@ -610,11 +598,12 @@ let MakeRepresentation = (props) => { return _.includes(key, "representationDocuments"); }); - console.log(fileListObj); - console.log( "\n////////////////////////\n upload files:", - values.containerID + values.containerID, + "\n////////////////////////\n fileListObj:", + fileListObj, + "\n////////////////////////\n" ); var dataObj = values; @@ -630,8 +619,6 @@ let MakeRepresentation = (props) => { values.containerID, props.caseReference + "/" + dataObj.repfile_name ).then((data) => { - //console.log("hello", data); - return data; }); }; @@ -640,7 +627,6 @@ let MakeRepresentation = (props) => { try { let value = props.initialValues; - //console.log("has props"), value; setRepresentationCapacity( props.initialValues.representationCapacity.toLowerCase() ); @@ -1192,8 +1178,6 @@ let MakeRepresentation = (props) => { }; const mapStateToProps = (state) => { - //console.log("\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \n in map state", state); - return { search: state.search, searchResultsObj: state.searchResultsObj, diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js index ce788c73..59629894 100644 --- a/components/case/representation/representationAppellant.js +++ b/components/case/representation/representationAppellant.js @@ -41,8 +41,6 @@ const RepAppellant = (props) => { } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); - // console.log(props); - return ( <>
diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js index e0e06560..e1b95610 100644 --- a/components/case/representation/representationCompleteSubmit.js +++ b/components/case/representation/representationCompleteSubmit.js @@ -41,7 +41,6 @@ const RepCompleteSubmit = (props) => { const whichQuestionnaireCheck = () => { { - console.log("curr"); switch (currentView.caseReference.appealType) { case 846040000: return ( diff --git a/components/case/representation/representationDetails.js b/components/case/representation/representationDetails.js index 26b42572..3cd8518f 100644 --- a/components/case/representation/representationDetails.js +++ b/components/case/representation/representationDetails.js @@ -36,8 +36,6 @@ const RepDetails = (props) => { detailsObj = detailsObj[0]; - console.log("-----detailsObj:", detailsObj); - return ( <> {" "} diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js index 08d57456..a9f94619 100644 --- a/components/case/representation/representationElements.js +++ b/components/case/representation/representationElements.js @@ -980,7 +980,6 @@ export const RenderFileUpload = (field) => { getblobshash, casefolderID ) => { - //console.log(containerName, blobName, deleteblobhash); deleteBlob(containerName, blobName, deleteblobhash, casefolderID) .then((data) => data) .then(() => { diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index 05346adb..2f1ec009 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -55,7 +55,6 @@ let RepLPA = (props) => { const whichQuestionnaire = () => { { - console.log("curr"); switch (currentView.caseReference.appealType) { case 846040000: case 846040001: @@ -107,7 +106,6 @@ let RepLPA = (props) => { const whichProgress = () => { { - console.log("curr"); switch (currentView.caseReference.appealType) { case 846040000: case 846040001: @@ -190,8 +188,6 @@ let RepLPA = (props) => { ); resultsObj = resultsObj[0]; - //console.log(resultsObj, detailsObj); - return ( <>
diff --git a/components/case/representation/representationLPAComments.js b/components/case/representation/representationLPAComments.js index 8c0c7170..54d7a609 100644 --- a/components/case/representation/representationLPAComments.js +++ b/components/case/representation/representationLPAComments.js @@ -57,7 +57,6 @@ RepLPAQuestionnaire = connect((state) => { })(RepLPAQuestionnaire); const mapStateToProps = (state, props) => { - console.log(); return { search: state.search, searchResultsObj: state.searchResultsObj, diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js index b750d1b0..646b1a3e 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js @@ -1192,7 +1192,6 @@ Enforcement_Questionnaire = connect((state) => { })(Enforcement_Questionnaire); const mapStateToProps = (state, props) => { - console.log(); return { search: state.search, searchResultsObj: state.searchResultsObj, diff --git a/components/pdftemplates/appealRow_pdf.js b/components/pdftemplates/appealRow_pdf.js index 8cff2b60..68e134c8 100644 --- a/components/pdftemplates/appealRow_pdf.js +++ b/components/pdftemplates/appealRow_pdf.js @@ -30,10 +30,6 @@ import { DOMParser, XMLSerializer } from "@xmldom/xmldom"; export const AppealRow_pdf = (props) => { let { t } = useTranslation(); - // const router = useRouter(); - // console.log(router); - // const { locale } = router; - const { formXML, whichSection, @@ -131,8 +127,6 @@ export const AppealRow_pdf = (props) => { doc ); - //console.log(rowXML); - function formatDate(dateObj) { var m = new Date(dateObj); var dateString; @@ -149,20 +143,10 @@ export const AppealRow_pdf = (props) => { } const FieldsTranslations = (label) => { - // const router = useRouter(); - // const { locale } = router; const { appealtypes } = router.query; let formObj = jsonpath.query(fieldLookup, "$['" + appealtypes + "']"); - // let labelTrans = - // router.locale == "cy" - // ? jsonpath.query( - // formObj, - // "$..[?(@.value=='" + label + "')].value_cy" - // ) - // : label; - let labelTrans = label; return labelTrans; }; @@ -173,9 +157,7 @@ export const AppealRow_pdf = (props) => { var newRowXML = new XMLSerializer().serializeToString( rowXML[key] ); - //console.log(newRowXML); var doc = parser.parseFromString(newRowXML, "text/xml"); - var rows = xpath.select("//label/@description", doc); var fieldtype = xpath.select("//@classid", doc); var datafieldname = xpath.select("//@datafieldname", doc); @@ -190,7 +172,6 @@ export const AppealRow_pdf = (props) => { "//@ishareDocumentCode", doc ); - console.log(datafieldname[0].value); return ( <> @@ -460,32 +441,6 @@ export const AppealRow_pdf = (props) => { break; } })()} - - {/* - {fieldtype[0].value == - "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" - ? formatDate( - props.props.values[datafieldname[0].value] - ) - : fieldtype[0].value == - "{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}" - ? getPickListLabel( - props.props.formData.pickListData, - datafieldname[0].value, - props.props.values[datafieldname[0].value] - ) - : fieldtype[0].value == - "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" - ? getRadioLabel( - props.props.formData.pickListData, - datafieldname[0].value, - props.props.values[datafieldname[0].value] - ) - : fieldtype[0].value == - "{16D63FD6-119B-4353-BDCA-18358721C3FE}" - ? "ssss" - : props.props.values[datafieldname[0].value]} - */} ); })} diff --git a/components/pdftemplates/planningappeals78_pdf.js b/components/pdftemplates/planningappeals78_pdf.js index 5c926aad..db90de44 100644 --- a/components/pdftemplates/planningappeals78_pdf.js +++ b/components/pdftemplates/planningappeals78_pdf.js @@ -143,7 +143,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => { doc ); - console.log("\n//////////\n The Case:\n", docProps.caseObj); + //console.log("\n//////////\n The Case:\n", docProps.caseObj); return ( @@ -514,7 +514,6 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => { { ))} - - {/* - - - Supporting documents - - - - - - - List of attached files - - - - {values.hasOwnProperty("filesList") && - values.filesList.map((key) => ( - - {key.name} -{" "} - {bytesToSize(key.contentLength)} - - ))} - - - - */} { - console.log("Progress blob path:", data); + //console.log("Progress blob path:", data); return downloadProgressFile(containerID, data.path, casefolderID); } ); @@ -187,14 +165,6 @@ export default async function handler(req, res) { "caseObj": tempCaseBlob, }); - //console.log(blobProgress); - //if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) { - // //createContainer(containerID).then((containerName) => { - - // console.log("does this get folder name:", containerID, casefolderID); - - // createRepBlob(req.body, containerID, caseRef); - const pickListData = await getPickLists(appealType); ReactPDF.render( @@ -203,30 +173,17 @@ export default async function handler(req, res) { ); console.log( - "///////////////////////////////////\n file created: \n" + + "///////////////////////////////////\nfile created: " + `tmp/${blobProgress.pinswg_name}.pdf` + "\n/////////////////////////" ); - console.log( - "///////////////////////////////////\n uploadPDFAppealFiles: \n" + - `tmp/${appealBodyObj.pinswg_name}.pdf` + - "\n" + - containerID + - "\n" + - appealBodyObj.pinswg_name + - "\n" + - "\n/////////////////////////" - ); - uploadPDFAppealFiles( `tmp/${appealBodyObj.pinswg_name}.pdf`, containerID, appealBodyObj.pinswg_name ); - // to do upload file to storage account - // then remove from local folder // fs.unlinkSync( `tmp/${appealBodyObj.repfile_name}.pdf`,); diff --git a/pages/api/file/getrepsblob.js b/pages/api/file/getrepsblob.js index 730220ac..4a660e0c 100644 --- a/pages/api/file/getrepsblob.js +++ b/pages/api/file/getrepsblob.js @@ -58,7 +58,10 @@ ApiProxy.get(async (req, res) => { if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) { const blobObj = await getRepsBlobs(containerName, casefolderID) .then(async (data) => { - console.log("----------xxxxxx------", data); + console.log( + "\n////////////////////////////\n getRepsBlobs:", + data + ); let result = await downloadAllRepsFiles(containerName, data); return res.status(200).json(result); }) diff --git a/pages/auth/signin.js b/pages/auth/signin.js index 305af5f3..5679896d 100644 --- a/pages/auth/signin.js +++ b/pages/auth/signin.js @@ -90,40 +90,16 @@ const SignIn = (props) => { ); }; -// export async function getServerSideProps(context) { -// //console.log("-1-1-1-1-", context.query.callbackUrl, context.locale); -// //console.log("------ " + context.query.callbackUrl); -// // setCookie(context, "next-auth.callback-url", context.query.callbackUrl, { -// // path: "/", -// // }); - -// const csrfToken = await getCsrfToken(context); -// let callback = -// context.locale != "cy" -// ? process.env.NEXTAUTH_URL -// : "https://" + process.env.I18N_DOMAIN + ":3000"; - -// context.query.callbackUrl = callback; - -// let formURL = -// new URL(callback).protocol + -// "//" + -// new URL(callback).hostname + -// ":" + -// new URL(callback).port; // + -// // "/api/auth/signin/email"; - -// //console.log("******", formURL, callback, csrfToken); -// return { -// props: { csrfToken: csrfToken, callbackUrl: formURL, redirect: true }, -// }; -// } - export async function getServerSideProps(context) { const csrfToken = await getCsrfToken(context); - console.log("-1-1-1-1-", context.query.callbackUrl, context.locale); + console.log( + "\n//////////////////////\n", + "Sign in callbackurl: " + context.query.callbackUrl, + context.locale, + "\n//////////////////////\n" + ); let formURL = context.query.callbackUrl; - console.log("formUrl:", formURL); + //console.log("formUrl:", formURL); formURL = typeof formURL == "undefined" ? null : formURL; return { diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js index b736cbc4..32998f76 100644 --- a/pages/newappeal/index.js +++ b/pages/newappeal/index.js @@ -137,7 +137,12 @@ export const getServerSideProps = wrapper.getServerSideProps( const { req, res } = ctx; const { cookies } = req; - console.log("/newappeal - cookies ", cookies); + console.log( + "\n////////////////////////////\n", + "/newappeal - cookies ", + cookies, + "\n////////////////////////////\n" + ); let thisSession = await getSession(ctx); //console.log("nextAuth Session:", thisSession); @@ -172,7 +177,11 @@ export const getServerSideProps = wrapper.getServerSideProps( ] ); - console.log("wewerwe s s", accountDetails); + console.log( + "\n////////////////////////////\n Acccount Details:", + accountDetails, + "\n////////////////////////////\n" + ); // const lpaData = require("../../data/lpa.json"); // const appealTypeData = require("../../data/appealtypes.json");