logic to show reps button

This commit is contained in:
2024-05-29 16:23:35 +01:00
parent d2f1a7d8b7
commit 01f2d7d766
7 changed files with 81 additions and 44 deletions
+17 -6
View File
@@ -205,9 +205,19 @@ let MakeRepresentation = (props) => {
const capacityOptionsArr = [
t("myrepresentations:capacity-options-arr-appellant"),
t("myrepresentations:capacity-options-arr-agent"),
t("myrepresentations:capacity-options-arr-interested"),
];
props.props.currentView.caseReference.appealType != 846040017
? capacityOptionsArr.push(
t("myrepresentations:capacity-options-arr-interested")
)
: props.props.currentView.caseReference.specialistProcess !=
846040000 &&
capacityOptionsArr.push(
t("myrepresentations:capacity-options-arr-interested")
);
console.log(props.props.currentView);
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
@@ -290,7 +300,6 @@ let MakeRepresentation = (props) => {
isLPA &&
currentView.caseReference.appealType != 846040019 &&
currentView.caseReference.appealType != 846040011 &&
currentView.caseReference.appealType != 846040015 &&
todaysDate >= startDate &&
todaysDate <= questionnaireDate &&
buildArr.push("Questionnaire");
@@ -313,10 +322,12 @@ let MakeRepresentation = (props) => {
todaysDate <= statementDueDate &&
buildArr.push("Statement");
currentView.caseReference.appealType != 846040004 &&
todaysDate >= statementDueDate &&
todaysDate <= finalCommentsDate &&
buildArr.push("Final comments");
currentView.caseReference.appealType != 846040004 ||
(currentView.caseReference.appealType == 846040004 &&
currentView.caseReference.specialistProcess != 846040001 &&
todaysDate >= statementDueDate &&
todaysDate <= finalCommentsDate &&
buildArr.push("Final comments"));
return buildArr;
};
+45 -34
View File
@@ -436,41 +436,52 @@ const CaseSummary = (props) => {
.caseReference
.appealType
) ? (
<>
<Link
href={{
pathname:
"/myportal/representation",
query: {
case:
currentType ==
"searchResultsObj"
? detailsObj.pinswg_name
: currentType ==
"watchedCases"
? casesObj.pinswg_title
: casesObj.reference,
},
}}
className="govuk-button"
>
{t(
"case:summary-make-representation-label"
)}
</Link>
props.currentView
.caseReference
.appealType ==
846040018 &&
props.currentView
.caseReference
.specialistProcess ==
846040000 ? (
""
) : (
<>
<Link
href={{
pathname:
"/myportal/representation",
query: {
case:
currentType ==
"searchResultsObj"
? detailsObj.pinswg_name
: currentType ==
"watchedCases"
? casesObj.pinswg_title
: casesObj.reference,
},
}}
className="govuk-button"
>
{t(
"case:summary-make-representation-label"
)}
</Link>
<a
onClick={() => {
//spinnerState();
router.back();
}}
className="govuk-button govuk-button--secondary"
>
{t(
"case:summary-back-button-label"
)}
</a>
</>
<a
onClick={() => {
//spinnerState();
router.back();
}}
className="govuk-button govuk-button--secondary"
>
{t(
"case:summary-back-button-label"
)}
</a>
</>
)
) : !isLPA &&
props.currentView
.caseReference
+8
View File
@@ -312,6 +312,14 @@ const SearchResults = (props) => {
item.pinswg_appealcasetype,
"showLoginCheck":
props.showLoginCheck,
"specialistProcess":
detailsObj.pinswg_speacialistcaseprocess !=
null ||
detailsObj.pinswg_specialistcaseprocess !=
null
? detailsObj.pinswg_speacialistcaseprocess ||
detailsObj.pinswg_specialistcaseprocess
: "",
});
}}
>