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
-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>
+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