Merged PR 854: My portal amends

Related work items: #7636, #7637, #7638
This commit is contained in:
Robert Bond
2022-05-19 11:10:31 +00:00
11 changed files with 201 additions and 57 deletions
+16
View File
@@ -491,6 +491,22 @@ export const getAppealsTypes = () => {
});
};
export const getAppealsTypesForNewAppeal = () => {
return axios
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
.then((res) => res.data)
.catch((error) => {
console.log(error);
let ErrResponse = {
value: [],
errorCode: error.response.status,
errorMsg: error.response.statusText,
};
return ErrResponse;
});
};
export const getLPA = () => {
return axios
.get(BASE_URL + "/api/endpoint/getlpa_api")
-1
View File
@@ -165,7 +165,6 @@ let Login = (props) => {
router.replace({
pathname:
router.locale == "cy" ? "/fymhorth" : "/myportal",
shallow: true,
}))
: //setShowSpinnerState(false),
setValidLoginID(false);
+38 -11
View File
@@ -89,8 +89,18 @@ const MyPortal = (props) => {
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
/>{" "}
<div className="serviceBanner_userDetails_name">
{props.accountDetails.accountDetails.firstname}{" "}
{props.accountDetails.accountDetails.lastname}
<Link href="/account/personaldetails">
<a className="govuk-button-secondary">
{
props.accountDetails.accountDetails
.firstname
}{" "}
{
props.accountDetails.accountDetails
.lastname
}
</a>
</Link>
</div>
<div>
<Link
@@ -117,16 +127,33 @@ const MyPortal = (props) => {
<div className="flex-container grid-row govuk-body ">
<MakeNewAppeal />
<SearchCases />
<AwaitingSubmission
awaitingSubmission={props.awaitingSubmission}
/>
<MyCases myCases={props.myCases} />
<WatchedCases watchedCases={props.watchedCases} />
<MyRepresentations
myRepresentations={props.myRepresentations}
/>
{props.awaitingSubmission.awaitingSubmission[
"@odata.count"
] > 0 && (
<AwaitingSubmission
awaitingSubmission={
props.awaitingSubmission
}
/>
)}
{props.myCases.myCases["@odata.count"] > 0 && (
<MyCases myCases={props.myCases} />
)}
{props.watchedCases.watchedCases["@odata.count"] >
0 && (
<WatchedCases
watchedCases={props.watchedCases}
/>
)}
{props.myRepresentations.myRepresentations[
"@odata.count"
] > 0 && (
<MyRepresentations
myRepresentations={props.myRepresentations}
/>
)}
<Dns />
<YourAccount />
{/* <YourAccount /> */}
{showFileUpload == "true" && <UploadFile />}
</div>
</div>
+21 -15
View File
@@ -23,24 +23,30 @@ const AwaitingSubmission = (props) => {
showTopThree={
props.awaitingSubmission.awaitingSubmission
}
showDetails={
props.awaitingSubmission.awaitingSubmissionDetails
}
topThreeType={"awaitingSubmission"}
/>
</div>
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentView({
"viewName": "Awaiting Submission",
"viewKey": "awaitingSubmission",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
{props.awaitingSubmission.awaitingSubmission["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
setCurrentView({
"viewName": "Awaiting Submission",
"viewKey": "awaitingSubmission",
});
}}
>
{t("myportal:viewall-link")}
</a>
</Link>
</div>
)}
</div>
</div>
);
+2 -2
View File
@@ -24,9 +24,9 @@ const MyCases = (props) => {
topThreeType={"myCases"}
/>
</div>
{props.myCases.myCases["@odata.count"] != 0 && (
{props.myCases.myCases["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<Link href="/myportal/viewall">
<a
className="govuk-link--no-underline"
onClick={() => {
+5 -2
View File
@@ -21,12 +21,15 @@ const MyRepresentations = (props) => {
<div className="cardModuleContainer">
<TopThree
showTopThree={props.myRepresentations.myRepresentations}
showDetails={
props.myRepresentations.myRepresentationsDetails
}
topThreeType={"myRepresentations"}
/>
</div>
{props.myRepresentations.myRepresentations["@odata.count"] !=
0 && (
{props.myRepresentations.myRepresentations["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
+34 -20
View File
@@ -228,26 +228,40 @@ const TopThree = (props) => {
}
</div>
)}
{topThreeType != "awaitingSubmission" ? (
<div className="carModuleAddress">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showDetails)
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index])
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index].value[0])
? t("myportal:case-address-not-entered")
: _.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddressline1
)
? t("myportal:case-address-not-entered")
: showDetails[index].value[0]
.pinswg_siteaddressline1}
</div>
) : (
""
)}
{/* {topThreeType != "awaitingSubmission" ? ( */}
<div className="carModuleAddress">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showDetails)
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index])
? t("myportal:case-address-not-entered")
: _.isEmpty(showDetails[index].value[0])
? t("myportal:case-address-not-entered")
: _.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddressline1
)
? t("myportal:case-address-not-entered")
: showDetails[index].value[0]
.pinswg_siteaddressline1 +
(!_.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddressline2
)
? ", " +
showDetails[index].value[0]
.pinswg_siteaddressline2
: "") +
(!_.isEmpty(
showDetails[index].value[0]
.pinswg_siteaddresstown
)
? ", " +
showDetails[index].value[0]
.pinswg_siteaddresstown
: "")}
</div>
{router.locale == "cy"
? jsonpath.query(
transLookup,
+2 -1
View File
@@ -21,11 +21,12 @@ const WatchedCases = (props) => {
<div className="cardModuleContainer">
<TopThree
showTopThree={props.watchedCases.watchedCases}
showDetails={props.watchedCases.watchedCasesDetails}
topThreeType={"watchedCases"}
/>
</div>
{props.watchedCases.watchedCases["@odata.count"] != 0 && (
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<a
+15 -3
View File
@@ -4,6 +4,8 @@ import Link from "next/link";
import CookieBanner from "../components/cookieBanner";
import Footer from "../components/footer";
import Header from "../components/header";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { useSession, signIn, signOut } from "next-auth/react";
function Error({ statusCode }, props) {
let { t, lang } = useTranslation();
@@ -29,9 +31,19 @@ function Error({ statusCode }, props) {
? `An error ${statusCode} occurred on server`
: t("common:error-page-message")}
</p>
<Link href="/">
<a>Go back home</a>
</Link>
<a
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
signOut({
callbackUrl: "/",
});
}}
>
{" "}
Go back home
</a>
</div>
</div>
</main>
@@ -0,0 +1,66 @@
const ApiResponse = (req, res) => {
res.statusCode = 200;
res.json({
"value": [
{
"value": "Planning Appeal - S78",
"stringmapid": "cb4aa9f2-e275-eb11-aabd-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,000",
"attributevalue": 846040000,
},
{
"value": "Listed Building and Conservation Area Consent",
"stringmapid": "d3b500b5-1228-ec11-aaca-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,025",
"attributevalue": 846040025,
},
{
"value": "Householder and Minor Commercial Appeals - HAS/CAS",
"stringmapid": "585d46a7-9138-ec11-aacb-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,004",
"attributevalue": 846040004,
},
{
"value": "Adverts",
"stringmapid": "c356f05c-7f90-eb11-aac2-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,018",
"attributevalue": 846040018,
},
{
"value": "Non-Validation",
"stringmapid": "c956f05c-7f90-eb11-aac2-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,024",
"attributevalue": 846040024,
},
{
"value": "Enforcement Notice Appeal - S174",
"stringmapid": "b656f05c-7f90-eb11-aac2-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,005",
"attributevalue": 846040005,
},
{
"value":
"High Hedges, Tree Preservation orders, Hedgerows, Tree Replacement Notice.",
"stringmapid": "c256f05c-7f90-eb11-aac2-00224800be9c",
"organizationid": "01191a4d-105f-eb11-aaba-00224800be9c",
"attributevalue@OData.Community.Display.V1.FormattedValue":
"846,040,017",
"attributevalue": 846040017,
},
],
});
};
export default ApiResponse;
+2 -2
View File
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { getAppealsTypes, getLPA } from "../../actions";
import { getAppealsTypesForNewAppeal, getLPA } from "../../actions";
import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner";
import Footer from "../../components/footer";
@@ -130,7 +130,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
let loggedInUser = cookies.pinsUser;
const [appealTypeData, lpaData, caseData] = await Promise.all([
await getAppealsTypes(),
await getAppealsTypesForNewAppeal(),
await getLPA(),
]);