@@ -97,6 +104,20 @@ const MyPortal = (props) => { + {isLPA == true ? ( +
+

+ { + props.accountDetails.accountDetails[ + "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" + ] + }{" "} + LPA Portal +

+
+ ) : ( + "" + )}
@@ -138,7 +159,8 @@ const MyPortal = (props) => { myRepresentations={props.myRepresentations} /> )} - + {isLPA ? "" : } + {/* */} {showFileUpload == "true" && }
diff --git a/i18n.js b/i18n.js index 3d40e7c4..f3d74ff0 100644 --- a/i18n.js +++ b/i18n.js @@ -27,7 +27,7 @@ module.exports = { ], "/advancedsearch": ["search", "myportal"], "/advancedsearchresults": ["search"], - "/searchresults": ["search"], + "/searchresults": ["search", "case"], "/viewall": ["search"], "/case": ["case"], "/myportal/representation": ["case"], diff --git a/package.json b/package.json index 6c03b880..bba3ab8c 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/pages/api/endpoint/getpersonalaccount_api.js b/pages/api/endpoint/getpersonalaccount_api.js index 493132b5..99790163 100644 --- a/pages/api/endpoint/getpersonalaccount_api.js +++ b/pages/api/endpoint/getpersonalaccount_api.js @@ -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)); diff --git a/pages/myportal/index.js b/pages/myportal/index.js index 08bcfe3e..e6d32113 100644 --- a/pages/myportal/index.js +++ b/pages/myportal/index.js @@ -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) => {