From 06f7d44e816200c456db2455f6dafe33122de6eb Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 19 May 2022 12:07:56 +0100
Subject: [PATCH 1/3] specific appeal types for new appeals
---
actions/index.js | 16 +++++
.../getappealtypesfornewappeal_api.js | 66 +++++++++++++++++++
pages/newappeal/index.js | 4 +-
3 files changed, 84 insertions(+), 2 deletions(-)
create mode 100644 pages/api/endpoint/getappealtypesfornewappeal_api.js
diff --git a/actions/index.js b/actions/index.js
index cba68508..fe665760 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -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")
diff --git a/pages/api/endpoint/getappealtypesfornewappeal_api.js b/pages/api/endpoint/getappealtypesfornewappeal_api.js
new file mode 100644
index 00000000..2b561553
--- /dev/null
+++ b/pages/api/endpoint/getappealtypesfornewappeal_api.js
@@ -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;
diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js
index 6a98c57e..d28b6588 100644
--- a/pages/newappeal/index.js
+++ b/pages/newappeal/index.js
@@ -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(),
]);
From 9e87586fd8c6ac5fba5bd3709acbfe230a9c21bf Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 19 May 2022 12:09:03 +0100
Subject: [PATCH 2/3] condtional display of blocks
---
components/homepage/login.js | 1 -
components/myportal.js | 49 ++++++++++++++++-----
components/myportal/mycases.js | 4 +-
components/myportal/myrepresentations.js | 7 ++-
components/myportal/topthree.js | 54 +++++++++++++++---------
components/myportal/watchedcases.js | 3 +-
6 files changed, 81 insertions(+), 37 deletions(-)
diff --git a/components/homepage/login.js b/components/homepage/login.js
index 72ffeac0..ed565c0c 100644
--- a/components/homepage/login.js
+++ b/components/homepage/login.js
@@ -165,7 +165,6 @@ let Login = (props) => {
router.replace({
pathname:
router.locale == "cy" ? "/fymhorth" : "/myportal",
- shallow: true,
}))
: //setShowSpinnerState(false),
setValidLoginID(false);
diff --git a/components/myportal.js b/components/myportal.js
index 79fe02cf..5912aaa7 100644
--- a/components/myportal.js
+++ b/components/myportal.js
@@ -89,8 +89,18 @@ const MyPortal = (props) => {
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
/>{" "}
{
-
-
-
-
+ {props.awaitingSubmission.awaitingSubmission[
+ "@odata.count"
+ ] > 0 && (
+
+ )}
+ {props.myCases.myCases["@odata.count"] > 0 && (
+
+ )}
+ {props.watchedCases.watchedCases["@odata.count"] >
+ 0 && (
+
+ )}
+ {props.myRepresentations.myRepresentations[
+ "@odata.count"
+ ] > 0 && (
+
+ )}
-
+ {/*
*/}
{showFileUpload == "true" &&
}
diff --git a/components/myportal/mycases.js b/components/myportal/mycases.js
index 1b1ab822..73321722 100644
--- a/components/myportal/mycases.js
+++ b/components/myportal/mycases.js
@@ -24,9 +24,9 @@ const MyCases = (props) => {
topThreeType={"myCases"}
/>
- {props.myCases.myCases["@odata.count"] != 0 && (
+ {props.myCases.myCases["@odata.count"] > 3 && (
);
diff --git a/pages/_error.js b/pages/_error.js
index a478361e..03c19e07 100644
--- a/pages/_error.js
+++ b/pages/_error.js
@@ -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")}
-
- Go back home
-
+
+ {
+ destroyCookie({}, "pinsUser"),
+ window.localStorage.clear(),
+ signOut({
+ callbackUrl: "/",
+ });
+ }}
+ >
+ {" "}
+ Go back home
+