From 9e87586fd8c6ac5fba5bd3709acbfe230a9c21bf Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 19 May 2022 12:09:03 +0100 Subject: [PATCH] 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.accountDetails.accountDetails.firstname}{" "} - {props.accountDetails.accountDetails.lastname} + + + { + props.accountDetails.accountDetails + .firstname + }{" "} + { + props.accountDetails.accountDetails + .lastname + } + +
{
- - - - + {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/components/myportal/myrepresentations.js b/components/myportal/myrepresentations.js index a4db29a8..139c7dd4 100644 --- a/components/myportal/myrepresentations.js +++ b/components/myportal/myrepresentations.js @@ -21,12 +21,15 @@ const MyRepresentations = (props) => {
- {props.myRepresentations.myRepresentations["@odata.count"] != - 0 && ( + {props.myRepresentations.myRepresentations["@odata.count"] > + 3 && (
{ }
)} - {topThreeType != "awaitingSubmission" ? ( -
- {t("myportal:case-address")}:{" "} - {_.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} -
- ) : ( - "" - )} + {/* {topThreeType != "awaitingSubmission" ? ( */} +
+ {t("myportal:case-address")}:{" "} + {_.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 + : "")} +
+ {router.locale == "cy" ? jsonpath.query( transLookup, diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index 617ba86f..1d871c80 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -21,11 +21,12 @@ const WatchedCases = (props) => {
- {props.watchedCases.watchedCases["@odata.count"] != 0 && ( + {props.watchedCases.watchedCases["@odata.count"] > 3 && (