lpa portal view
This commit is contained in:
+20
-7
@@ -28,13 +28,15 @@ export const consoleLogger = (err) => {
|
||||
var errStr =
|
||||
"\n\n/////////////////////////////////////////////////\nServer Error " +
|
||||
"\n" +
|
||||
err.response.status +
|
||||
" : " +
|
||||
err.response.statusText +
|
||||
"\nRequest URL: " +
|
||||
err.response.config.url +
|
||||
"\nRequest Time: " +
|
||||
err.response.headers.date +
|
||||
(err.hasOwnProperty("response")
|
||||
? err.response.status +
|
||||
" : " +
|
||||
err.response.statusText +
|
||||
"\nRequest URL: " +
|
||||
err.response.config.url +
|
||||
"\nRequest Time: " +
|
||||
err.response.headers.date
|
||||
: err) +
|
||||
"\n/////////////////////////////////////////////////\n\n";
|
||||
return errStr;
|
||||
};
|
||||
@@ -666,6 +668,17 @@ export const getMyCases = (loggedInUserId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMyLPACases = (lpaid) => {
|
||||
return axios
|
||||
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
//console.log("API call error", error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getMyRepresentations = (loggedInUserId) => {
|
||||
return axios
|
||||
.get(
|
||||
|
||||
@@ -48,7 +48,13 @@ export const getSelectQuery = (appealTypeName) => {
|
||||
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
|
||||
break;
|
||||
case "pinswg_planningappeals78s":
|
||||
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent";
|
||||
console.log(
|
||||
"///////////////\n path:",
|
||||
process.env.RELAYPATH == "test-pedw-hc"
|
||||
);
|
||||
return process.env.RELAYPATH == "dev-pedw-hc"
|
||||
? "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent"
|
||||
: "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_typeofevent";
|
||||
break;
|
||||
case "pinswg_planningconditionss73s79s":
|
||||
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
||||
|
||||
@@ -204,9 +204,11 @@ const CaseSummary = (props) => {
|
||||
|
||||
let showDetails = typeof detailsObj != "undefined" ? true : false;
|
||||
|
||||
var timestamp = Date.parse(
|
||||
detailsObj.pinswg_representation_period_end_date
|
||||
);
|
||||
var timestamp = showDetails
|
||||
? detailsObj.hasOwnProperty("pinswg_representation_period_end_date")
|
||||
? Date.parse(detailsObj.pinswg_representation_period_end_date)
|
||||
: "n/a"
|
||||
: "n/a";
|
||||
|
||||
if (isNaN(timestamp) == false) {
|
||||
var d = new Date(timestamp);
|
||||
|
||||
+23
-1
@@ -32,6 +32,13 @@ const MyPortal = (props) => {
|
||||
signOut({ callbackUrl: "/logout" });
|
||||
};
|
||||
|
||||
const isLPA =
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
] == "LPA"
|
||||
? true
|
||||
: false;
|
||||
|
||||
return (
|
||||
<>
|
||||
<main className="" id="main-content" role="main">
|
||||
@@ -97,6 +104,20 @@ const MyPortal = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{isLPA == true ? (
|
||||
<div>
|
||||
<h2 className="heading-small card-heading">
|
||||
{
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
}{" "}
|
||||
LPA Portal
|
||||
</h2>
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="flex-container grid-row govuk-body ">
|
||||
@@ -138,7 +159,8 @@ const MyPortal = (props) => {
|
||||
myRepresentations={props.myRepresentations}
|
||||
/>
|
||||
)}
|
||||
<Dns />
|
||||
{isLPA ? "" : <Dns />}
|
||||
|
||||
{/* <YourAccount /> */}
|
||||
{showFileUpload == "true" && <UploadFile />}
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = {
|
||||
],
|
||||
"/advancedsearch": ["search", "myportal"],
|
||||
"/advancedsearchresults": ["search"],
|
||||
"/searchresults": ["search"],
|
||||
"/searchresults": ["search", "case"],
|
||||
"/viewall": ["search"],
|
||||
"/case": ["case"],
|
||||
"/myportal/representation": ["case"],
|
||||
|
||||
+3
-2
@@ -10,11 +10,12 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@auth/prisma-adapter": "^1.0.1",
|
||||
"@azure/identity": "^3.1.3",
|
||||
"@azure/storage-blob": "^12.12.0",
|
||||
"@azure/storage-queue": "^12.11.0",
|
||||
"@next-auth/prisma-adapter": "^1.0.4",
|
||||
"@prisma/client": "^3.12.0",
|
||||
"@prisma/client": "^5.0.0",
|
||||
"@redux-devtools/extension": "^3.2.5",
|
||||
"applicationinsights": "^2.2.0",
|
||||
"axios": "^0.24.0",
|
||||
@@ -75,6 +76,6 @@
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-config-next": "^13.1.6",
|
||||
"eslint-plugin-jsdoc": "^40.0.1",
|
||||
"prisma": "^3.12.0"
|
||||
"prisma": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export default async function ApiProxy(req, res) {
|
||||
var queryUrl =
|
||||
"contacts(" +
|
||||
contactid +
|
||||
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode,pinswg_typeofinvolvement,pinswg_preferredlanguage&$count=true";
|
||||
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode,pinswg_typeofinvolvement,pinswg_contact_associatedlpa,pinswg_preferredlanguage&$count=true";
|
||||
|
||||
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
||||
|
||||
|
||||
+14
-3
@@ -9,6 +9,7 @@ import {
|
||||
getAwaitingSubmissionFromBlob,
|
||||
getAwaitingSubmission,
|
||||
getMyCases,
|
||||
getLPACases,
|
||||
getMyRepresentations,
|
||||
getPersonalAccount,
|
||||
getPortalModuleDetails,
|
||||
@@ -185,15 +186,22 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
//Create Storage container for logged in user
|
||||
await createContainerProxy(thisSession.user.id);
|
||||
|
||||
const accountDetails = await getPersonalAccount(loggedInUser);
|
||||
|
||||
const lpaid = accountDetails(
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
);
|
||||
|
||||
const [
|
||||
accountDetails,
|
||||
myCases,
|
||||
myRepresentations,
|
||||
watchedCases,
|
||||
awaitingSubmission,
|
||||
awaitingSubmissionFromBlob,
|
||||
] = await Promise.all([
|
||||
await getPersonalAccount(loggedInUser),
|
||||
accountDetails.pinswg_typeofinvolvment == 846040012
|
||||
? await getMyLPACases(lpaid)
|
||||
: await getMyCases(loggedinUser),
|
||||
await getMyCases(loggedInUser),
|
||||
await getRepsFromBlob(thisSession.user.id),
|
||||
await getWatchedCases(loggedInUser),
|
||||
@@ -375,7 +383,10 @@ const getDetails = (resultsObj, detailsType) => {
|
||||
);
|
||||
}
|
||||
});
|
||||
return Promise.all(detailsArr);
|
||||
|
||||
let detArr = Promise.all(detailsArr);
|
||||
console.log(detArr);
|
||||
return detArr;
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
|
||||
Reference in New Issue
Block a user