condtional display of blocks

This commit is contained in:
2022-05-19 12:09:03 +01:00
parent 06f7d44e81
commit 9e87586fd8
6 changed files with 81 additions and 37 deletions
+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