lpa dashboard tweaks

This commit is contained in:
2023-10-24 10:41:24 +01:00
parent c4fcb6fa56
commit fdf5be3415
4 changed files with 22 additions and 12 deletions
+9 -7
View File
@@ -104,7 +104,7 @@ const MyPortal = (props) => {
</div> </div>
</div> </div>
</div> </div>
{isLPA == true ? ( {isLPA && (
<div> <div>
<h2 className="heading-small card-heading"> <h2 className="heading-small card-heading">
{ {
@@ -115,13 +115,11 @@ const MyPortal = (props) => {
LPA Portal LPA Portal
</h2> </h2>
</div> </div>
) : (
""
)} )}
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<div className="flex-container grid-row govuk-body "> <div className="flex-container grid-row govuk-body ">
{isLPA ? "" : <MakeNewAppeal />} {!isLPA && <MakeNewAppeal />}
<SearchCases /> <SearchCases />
{/* {props.awaitingSubmission.awaitingSubmission[ {/* {props.awaitingSubmission.awaitingSubmission[
"@odata.count" "@odata.count"
@@ -147,12 +145,16 @@ const MyPortal = (props) => {
/> />
)} )}
{props.myCases.myCases["@odata.count"] > 0 && ( {props.myCases.myCases["@odata.count"] > 0 && (
<MyCases myCases={props.myCases} /> <MyCases
myCases={props.myCases}
isLPA={isLPA}
/>
)} )}
{props.watchedCases.watchedCases["@odata.count"] > {props.watchedCases.watchedCases["@odata.count"] >
0 && ( 0 && (
<WatchedCases <WatchedCases
watchedCases={props.watchedCases} watchedCases={props.watchedCases}
isLPA={isLPA}
/> />
)} )}
{props.myRepresentations.myRepresentations[ {props.myRepresentations.myRepresentations[
@@ -160,12 +162,12 @@ const MyPortal = (props) => {
] > 0 && ( ] > 0 && (
<MyRepresentations <MyRepresentations
myRepresentations={props.myRepresentations} myRepresentations={props.myRepresentations}
isLPA={isLPA}
/> />
)} )}
{isLPA ? "" : <Dns />} {!isLPA && <Dns />}
{/* <YourAccount /> */} {/* <YourAccount /> */}
{showFileUpload == "true" && <UploadFile />}
</div> </div>
</div> </div>
</div> </div>
+4 -1
View File
@@ -44,7 +44,10 @@ const MyCases = (props) => {
}); });
}} }}
> >
{t("myportal:viewall-link")} {t("myportal:viewall-link")}{" "}
{props.isLPA &&
props.myCases.myCases["@odata.count"] +
" appeals"}
</a> </a>
</Link> </Link>
</div> </div>
+7 -2
View File
@@ -19,7 +19,12 @@
import axios from "axios"; import axios from "axios";
import CryptoJS from "crypto-js"; import CryptoJS from "crypto-js";
import { getToken, azureHeaders, consoleLogger } from "../../../actions"; import {
getToken,
azureHeaders,
consoleLogger,
getLPA,
} from "../../../actions";
import jsonpath from "jsonpath"; import jsonpath from "jsonpath";
const WORDKEY = process.env.HASHKEY; const WORDKEY = process.env.HASHKEY;
@@ -43,7 +48,7 @@ export default async function ApiProxy(req, res) {
const lpaList = await getLPA(); const lpaList = await getLPA();
const lpaGUID = jsonpath.query(lpaList, '$..[?(@.name="' + lpaid + '")]'); const lpaGUID = jsonpath.query(lpaList, '$..[?(@.name=="' + lpaid + '")]');
console.log( console.log(
'$..[?(@.name="' + lpaid + '")]', '$..[?(@.name="' + lpaid + '")]',
+2 -2
View File
@@ -192,7 +192,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const lpaid = const lpaid =
accountDetails[ accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" "pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
]; ];
const [ const [
@@ -202,7 +202,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
awaitingSubmission, awaitingSubmission,
awaitingSubmissionFromBlob, awaitingSubmissionFromBlob,
] = await Promise.all([ ] = await Promise.all([
accountDetails.pinswg_typeofinvolvment == 846040012 accountDetails.pinswg_typeofinvolvement == 846040012
? await getMyLPACases(lpaid) ? await getMyLPACases(lpaid)
: await getMyCases(loggedInUser), : await getMyCases(loggedInUser),