pass showlogin vars to pages and components
This commit is contained in:
@@ -41,6 +41,7 @@ const Case = (props) => {
|
|||||||
docsOffline={props.props.docsOffline}
|
docsOffline={props.props.docsOffline}
|
||||||
documentDetailsObj={props.documentDetailsObj}
|
documentDetailsObj={props.documentDetailsObj}
|
||||||
showFilteredDocs={props.showFilteredDocs}
|
showFilteredDocs={props.showFilteredDocs}
|
||||||
|
showLoginCheck={props.showLoginCheck}
|
||||||
/>
|
/>
|
||||||
{showRepresentations == true && (
|
{showRepresentations == true && (
|
||||||
<RepresentationList
|
<RepresentationList
|
||||||
|
|||||||
+133
-127
@@ -88,8 +88,10 @@ const CaseSummary = (props) => {
|
|||||||
ticketnumber,
|
ticketnumber,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const showLoginCheck =
|
// const showLoginCheck =
|
||||||
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
// currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
||||||
|
|
||||||
|
let showLoginCheck = props.showLoginCheck;
|
||||||
const { data: session, status } = useSession();
|
const { data: session, status } = useSession();
|
||||||
|
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
@@ -154,10 +156,10 @@ const CaseSummary = (props) => {
|
|||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(loggedInUser).then((data) => {
|
getWatchedCasesProxy(loggedInUser).then((data) => {
|
||||||
setWatchedCases(data),
|
(setWatchedCases(data),
|
||||||
getDetailsProxy(data, "myWatchedCases").then((data) => {
|
getDetailsProxy(data, "myWatchedCases").then((data) => {
|
||||||
setWatchedCasesDetails(data);
|
setWatchedCasesDetails(data);
|
||||||
});
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -184,12 +186,12 @@ const CaseSummary = (props) => {
|
|||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
setWatchedCases(data),
|
(setWatchedCases(data),
|
||||||
getDetailsProxy(data, "myWatchedCases").then(
|
getDetailsProxy(data, "myWatchedCases").then(
|
||||||
(data) => {
|
(data) => {
|
||||||
setWatchedCasesDetails(data);
|
setWatchedCasesDetails(data);
|
||||||
}
|
},
|
||||||
);
|
));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -214,28 +216,28 @@ const CaseSummary = (props) => {
|
|||||||
eval: true,
|
eval: true,
|
||||||
}))
|
}))
|
||||||
: currentType == "watchedCases"
|
: currentType == "watchedCases"
|
||||||
? (casesObj = jsonpath({
|
? (casesObj = jsonpath({
|
||||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||||
json: setCaseQueryObj,
|
json: setCaseQueryObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
}))
|
}))
|
||||||
: currentType == "myCases"
|
: currentType == "myCases"
|
||||||
? (casesObj = jsonpath({
|
? (casesObj = jsonpath({
|
||||||
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
|
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
|
||||||
json: setCaseQueryObj,
|
json: setCaseQueryObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
}))
|
}))
|
||||||
: currentType == "directResultsObj"
|
: currentType == "directResultsObj"
|
||||||
? (casesObj = jsonpath({
|
? (casesObj = jsonpath({
|
||||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||||
json: setCaseQueryObj,
|
json: setCaseQueryObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
}))
|
}))
|
||||||
: (casesObj = jsonpath({
|
: (casesObj = jsonpath({
|
||||||
path: '$..[?(@ && @.reference=="' + caseReference + '")]',
|
path: '$..[?(@ && @.reference=="' + caseReference + '")]',
|
||||||
json: setCaseQueryObj,
|
json: setCaseQueryObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
casesObj = Object.assign({}, ...casesObj);
|
casesObj = Object.assign({}, ...casesObj);
|
||||||
|
|
||||||
@@ -248,12 +250,12 @@ const CaseSummary = (props) => {
|
|||||||
eval: true,
|
eval: true,
|
||||||
}))
|
}))
|
||||||
: currentType == "directResultsObj"
|
: currentType == "directResultsObj"
|
||||||
? (detailsObj = setCaseDetailsObj[0].value[0])
|
? (detailsObj = setCaseDetailsObj[0].value[0])
|
||||||
: (detailsObj = jsonpath({
|
: (detailsObj = jsonpath({
|
||||||
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||||
jsopn: setCaseDetailsObj,
|
jsopn: setCaseDetailsObj,
|
||||||
eval: true,
|
eval: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0];
|
detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0];
|
||||||
|
|
||||||
@@ -281,10 +283,10 @@ const CaseSummary = (props) => {
|
|||||||
{currentType == "searchResultsObj"
|
{currentType == "searchResultsObj"
|
||||||
? detailsObj.pinswg_name
|
? detailsObj.pinswg_name
|
||||||
: currentType == "directResultsObj"
|
: currentType == "directResultsObj"
|
||||||
? casesObj.title
|
? casesObj.title
|
||||||
: currentType == "watchedCases"
|
: currentType == "watchedCases"
|
||||||
? casesObj.pinswg_title
|
? casesObj.pinswg_title
|
||||||
: casesObj.reference}
|
: casesObj.reference}
|
||||||
</h1>
|
</h1>
|
||||||
{props.messagesObj["@odata.count"] > 0 && (
|
{props.messagesObj["@odata.count"] > 0 && (
|
||||||
<CaseNoticeBanner messagesObj={props.messagesObj} />
|
<CaseNoticeBanner messagesObj={props.messagesObj} />
|
||||||
@@ -295,17 +297,19 @@ const CaseSummary = (props) => {
|
|||||||
{getFormCollectionByID(
|
{getFormCollectionByID(
|
||||||
appealTypeID ||
|
appealTypeID ||
|
||||||
setCaseQueryObj.value[0]
|
setCaseQueryObj.value[0]
|
||||||
.pinswg_appealcasetype
|
.pinswg_appealcasetype,
|
||||||
).PrimaryIdAttribute == "pinswg_dnsid"
|
).PrimaryIdAttribute == "pinswg_dnsid"
|
||||||
? t("case:summary-applicantonly-label")
|
? t("case:summary-applicantonly-label")
|
||||||
: getFormCollectionByID(
|
: getFormCollectionByID(
|
||||||
appealTypeID ||
|
appealTypeID ||
|
||||||
setCaseQueryObj.value[0]
|
setCaseQueryObj.value[0]
|
||||||
.pinswg_appealcasetype
|
.pinswg_appealcasetype,
|
||||||
).PrimaryIdAttribute ==
|
).PrimaryIdAttribute ==
|
||||||
"pinswg_nonvalidationid"
|
"pinswg_nonvalidationid"
|
||||||
? t("case:summary-appellantonly-label")
|
? t(
|
||||||
: t("case:summary-applicant-label")}
|
"case:summary-appellantonly-label",
|
||||||
|
)
|
||||||
|
: t("case:summary-applicant-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{casesObj.pinswg_appellantagent == 846040001
|
{casesObj.pinswg_appellantagent == 846040001
|
||||||
@@ -320,7 +324,7 @@ const CaseSummary = (props) => {
|
|||||||
{detailsObj.pinswg_agentcontactname != null &&
|
{detailsObj.pinswg_agentcontactname != null &&
|
||||||
(_.has(
|
(_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_agentcontactname"
|
"pinswg_agentcontactname",
|
||||||
) ? (
|
) ? (
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -329,7 +333,7 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_agentcontactname"
|
"pinswg_agentcontactname",
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_agentcontactname
|
? detailsObj.pinswg_agentcontactname
|
||||||
: ""}
|
: ""}
|
||||||
@@ -346,44 +350,44 @@ const CaseSummary = (props) => {
|
|||||||
{getFormCollectionByID(
|
{getFormCollectionByID(
|
||||||
appealTypeID ||
|
appealTypeID ||
|
||||||
setCaseQueryObj.value[0]
|
setCaseQueryObj.value[0]
|
||||||
.pinswg_appealcasetype
|
.pinswg_appealcasetype,
|
||||||
).PrimaryIdAttribute == "pinswg_dnsid"
|
).PrimaryIdAttribute == "pinswg_dnsid"
|
||||||
? detailsObj.pinswg_projectlocation !=
|
? detailsObj.pinswg_projectlocation !=
|
||||||
null
|
null
|
||||||
? detailsObj.pinswg_projectlocation.indexOf(
|
? detailsObj.pinswg_projectlocation.indexOf(
|
||||||
";"
|
";",
|
||||||
) < 0
|
) < 0
|
||||||
? detailsObj.pinswg_projectlocation
|
? detailsObj.pinswg_projectlocation
|
||||||
: router.locale == "cy"
|
: router.locale == "cy"
|
||||||
? detailsObj.pinswg_projectlocation.split(
|
? detailsObj.pinswg_projectlocation.split(
|
||||||
";"
|
";",
|
||||||
)[1]
|
)[1]
|
||||||
: detailsObj.pinswg_projectlocation.split(
|
: detailsObj.pinswg_projectlocation.split(
|
||||||
";"
|
";",
|
||||||
)[0]
|
)[0]
|
||||||
: ""
|
: ""
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1",
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline1"
|
"pinswg_siteaddressline1",
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline1 !=
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline2"
|
"pinswg_siteaddressline2",
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline2"
|
"pinswg_siteaddressline2",
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddressline2 !=
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
@@ -392,25 +396,25 @@ const CaseSummary = (props) => {
|
|||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresstown"
|
"pinswg_siteaddresstown",
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddresstown !=
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty",
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty",
|
||||||
) &&
|
) &&
|
||||||
detailsObj.pinswg_siteaddresscounty !=
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresspostcode"
|
"pinswg_siteaddresspostcode",
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddresspostcode
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
: ""}
|
: ""}
|
||||||
@@ -425,10 +429,12 @@ const CaseSummary = (props) => {
|
|||||||
{casesObj.description.indexOf(";") < 0
|
{casesObj.description.indexOf(";") < 0
|
||||||
? casesObj.description
|
? casesObj.description
|
||||||
: router.locale == "cy"
|
: router.locale == "cy"
|
||||||
? casesObj.description.split(";")[1]
|
? casesObj.description.split(
|
||||||
: casesObj.description.split(
|
";",
|
||||||
";"
|
)[1]
|
||||||
)[0]}
|
: casesObj.description.split(
|
||||||
|
";",
|
||||||
|
)[0]}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -453,7 +459,7 @@ const CaseSummary = (props) => {
|
|||||||
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
|
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
|
||||||
] ||
|
] ||
|
||||||
t(
|
t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label",
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
@@ -480,24 +486,24 @@ const CaseSummary = (props) => {
|
|||||||
{(_.has(detailsObj, "pinswg_startdate") ||
|
{(_.has(detailsObj, "pinswg_startdate") ||
|
||||||
_.has(
|
_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_applicationacceptedasvalid"
|
"pinswg_applicationacceptedasvalid",
|
||||||
) ||
|
) ||
|
||||||
_.has(
|
_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_startdates"
|
"pinswg_startdates",
|
||||||
)) &&
|
)) &&
|
||||||
showReps(
|
showReps(
|
||||||
detailsObj.pinswg_startdate ||
|
detailsObj.pinswg_startdate ||
|
||||||
detailsObj.pinswg_startdates ||
|
detailsObj.pinswg_startdates ||
|
||||||
detailsObj.pinswg_applicationacceptedasvalid,
|
detailsObj.pinswg_applicationacceptedasvalid,
|
||||||
detailsObj.pinswg_finalcommentsduedate ||
|
detailsObj.pinswg_finalcommentsduedate ||
|
||||||
detailsObj.pinswg_endofrepresentationperiod
|
detailsObj.pinswg_endofrepresentationperiod,
|
||||||
) && (
|
) && (
|
||||||
<>
|
<>
|
||||||
{showRepButton(
|
{showRepButton(
|
||||||
props.currentView
|
props.currentView
|
||||||
.caseReference
|
.caseReference
|
||||||
.appealType
|
.appealType,
|
||||||
) ? (
|
) ? (
|
||||||
<>
|
<>
|
||||||
{ShowDocLinks ? (
|
{ShowDocLinks ? (
|
||||||
@@ -513,7 +519,7 @@ const CaseSummary = (props) => {
|
|||||||
Notice
|
Notice
|
||||||
</span>
|
</span>
|
||||||
{t(
|
{t(
|
||||||
"case:docsoffline-reps-label"
|
"case:docsoffline-reps-label",
|
||||||
)}
|
)}
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
@@ -528,18 +534,18 @@ const CaseSummary = (props) => {
|
|||||||
"searchResultsObj"
|
"searchResultsObj"
|
||||||
? detailsObj.ticketnumber
|
? detailsObj.ticketnumber
|
||||||
: currentType ==
|
: currentType ==
|
||||||
"watchedCases"
|
"watchedCases"
|
||||||
? casesObj.pinswg_title
|
? casesObj.pinswg_title
|
||||||
: currentType ==
|
: currentType ==
|
||||||
"directResultsObj"
|
"directResultsObj"
|
||||||
? detailsObj.ticketnumber
|
? detailsObj.ticketnumber
|
||||||
: casesObj.reference,
|
: casesObj.reference,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"case:summary-make-representation-label"
|
"case:summary-make-representation-label",
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
@@ -551,7 +557,7 @@ const CaseSummary = (props) => {
|
|||||||
className="govuk-button govuk-button--secondary"
|
className="govuk-button govuk-button--secondary"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"case:summary-back-button-label"
|
"case:summary-back-button-label",
|
||||||
)}
|
)}
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
@@ -571,7 +577,7 @@ const CaseSummary = (props) => {
|
|||||||
{
|
{
|
||||||
startDate:
|
startDate:
|
||||||
formatDates(
|
formatDates(
|
||||||
detailsObj.pinswg_startdate
|
detailsObj.pinswg_startdate,
|
||||||
),
|
),
|
||||||
endDate:
|
endDate:
|
||||||
props
|
props
|
||||||
@@ -580,27 +586,27 @@ const CaseSummary = (props) => {
|
|||||||
.appealType ==
|
.appealType ==
|
||||||
846040019
|
846040019
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_statementduedate
|
detailsObj.pinswg_statementduedate,
|
||||||
)
|
)
|
||||||
: formatDates(
|
: formatDates(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
<br />{" "}
|
<br />{" "}
|
||||||
{t(
|
{t(
|
||||||
"case:representation-date-passed-additional-label"
|
"case:representation-date-passed-additional-label",
|
||||||
)}{" "}
|
)}{" "}
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
"mailto:" +
|
"mailto:" +
|
||||||
t(
|
t(
|
||||||
"home:login-contact-email"
|
"home:login-contact-email",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"home:login-contact-email"
|
"home:login-contact-email",
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
@@ -614,40 +620,40 @@ const CaseSummary = (props) => {
|
|||||||
{session &&
|
{session &&
|
||||||
(isWatchedCase(
|
(isWatchedCase(
|
||||||
props.currentView.caseReference
|
props.currentView.caseReference
|
||||||
.incidentid
|
.incidentid,
|
||||||
).length >
|
).length >
|
||||||
0 ==
|
0 ==
|
||||||
true ? (
|
true ? (
|
||||||
<button
|
<button
|
||||||
className="govuk-link watchCase"
|
className="govuk-link watchCase"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
(confirm(
|
||||||
t(
|
t(
|
||||||
"case:you-have-stopped-watching-label"
|
"case:you-have-stopped-watching-label",
|
||||||
) +
|
) +
|
||||||
props
|
props
|
||||||
.currentView
|
.currentView
|
||||||
.caseReference
|
.caseReference
|
||||||
.currentReference +
|
.currentReference +
|
||||||
"?"
|
"?",
|
||||||
) &&
|
) &&
|
||||||
deleteItem(
|
deleteItem(
|
||||||
isWatchedCase(
|
isWatchedCase(
|
||||||
props
|
props
|
||||||
.currentView
|
.currentView
|
||||||
.caseReference
|
.caseReference
|
||||||
.incidentid
|
.incidentid,
|
||||||
)[0]
|
)[0]
|
||||||
.pinswg_watchlistid,
|
.pinswg_watchlistid,
|
||||||
|
|
||||||
"watchedCases"
|
"watchedCases",
|
||||||
),
|
),
|
||||||
setCurrentView({
|
setCurrentView({
|
||||||
"viewName":
|
"viewName":
|
||||||
"Watched Cases",
|
"Watched Cases",
|
||||||
"viewKey":
|
"viewKey":
|
||||||
"watchedCases",
|
"watchedCases",
|
||||||
});
|
}));
|
||||||
setCurrentReference({
|
setCurrentReference({
|
||||||
"ticketnumber":
|
"ticketnumber":
|
||||||
props
|
props
|
||||||
@@ -675,11 +681,11 @@ const CaseSummary = (props) => {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
title={t(
|
title={t(
|
||||||
"case:stop-watching-case-link"
|
"case:stop-watching-case-link",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"case:stop-watching-case-link"
|
"case:stop-watching-case-link",
|
||||||
)}{" "}
|
)}{" "}
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : (
|
||||||
@@ -689,14 +695,14 @@ const CaseSummary = (props) => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
"case:you-are-watching-label"
|
"case:you-are-watching-label",
|
||||||
) +
|
) +
|
||||||
" " +
|
" " +
|
||||||
props
|
props
|
||||||
.currentView
|
.currentView
|
||||||
.caseReference
|
.caseReference
|
||||||
.currentReference +
|
.currentReference +
|
||||||
"?"
|
"?",
|
||||||
) &&
|
) &&
|
||||||
selectWatchedCase(
|
selectWatchedCase(
|
||||||
props
|
props
|
||||||
@@ -709,12 +715,12 @@ const CaseSummary = (props) => {
|
|||||||
props
|
props
|
||||||
.currentView
|
.currentView
|
||||||
.caseReference
|
.caseReference
|
||||||
.appealType
|
.appealType,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"case:watch-this-case-link"
|
"case:watch-this-case-link",
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
{/* <button
|
{/* <button
|
||||||
@@ -732,13 +738,13 @@ const CaseSummary = (props) => {
|
|||||||
<button
|
<button
|
||||||
className="govuk-link watchCase"
|
className="govuk-link watchCase"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
(confirm(
|
||||||
"Trying to watch case " +
|
"Trying to watch case " +
|
||||||
props
|
props
|
||||||
.currentView
|
.currentView
|
||||||
.caseReference
|
.caseReference
|
||||||
.currentReference +
|
.currentReference +
|
||||||
"\n\nYou will now be prompted to sign in"
|
"\n\nYou will now be prompted to sign in",
|
||||||
) &&
|
) &&
|
||||||
// signIn("email", {
|
// signIn("email", {
|
||||||
// callbackUrl:
|
// callbackUrl:
|
||||||
@@ -756,23 +762,23 @@ const CaseSummary = (props) => {
|
|||||||
"searchResultsObj"
|
"searchResultsObj"
|
||||||
? detailsObj.pinswg_name
|
? detailsObj.pinswg_name
|
||||||
: currentType ==
|
: currentType ==
|
||||||
"directResultsObj"
|
"directResultsObj"
|
||||||
? casesObj.title
|
? casesObj.title
|
||||||
: casesObj.reference,
|
: casesObj.reference,
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
expires:
|
expires:
|
||||||
expDate,
|
expDate,
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
signIn();
|
signIn());
|
||||||
}}
|
}}
|
||||||
title={t(
|
title={t(
|
||||||
"case:watch-this-case-link"
|
"case:watch-this-case-link",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"case:watch-this-case-link"
|
"case:watch-this-case-link",
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
{/* <button
|
{/* <button
|
||||||
@@ -794,19 +800,19 @@ const CaseSummary = (props) => {
|
|||||||
null) &&
|
null) &&
|
||||||
showRepsEnded(
|
showRepsEnded(
|
||||||
detailsObj.pinswg_startdate,
|
detailsObj.pinswg_startdate,
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate,
|
||||||
) && (
|
) && (
|
||||||
<div className="govuk-body">
|
<div className="govuk-body">
|
||||||
{t(
|
{t(
|
||||||
"case:representation-period-ended-on-label"
|
"case:representation-period-ended-on-label",
|
||||||
)}
|
)}
|
||||||
{props.currentView.caseReference
|
{props.currentView.caseReference
|
||||||
.appealType == 846040019
|
.appealType == 846040019
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_statementduedate
|
detailsObj.pinswg_statementduedate,
|
||||||
)
|
)
|
||||||
: formatDates(
|
: formatDates(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -844,12 +850,12 @@ const CaseSummary = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{showLoginCheck == "true" && (
|
{(showLoginCheck === "true" || showLoginCheck === true) && (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
{noRepresentationLink.includes(
|
{noRepresentationLink.includes(
|
||||||
router.pathname
|
router.pathname,
|
||||||
) == true ? (
|
) == true ? (
|
||||||
""
|
""
|
||||||
) : ShowDocLinks ? (
|
) : ShowDocLinks ? (
|
||||||
@@ -874,7 +880,7 @@ const CaseSummary = (props) => {
|
|||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"case:summary-make-representation-label"
|
"case:summary-make-representation-label",
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
@@ -898,7 +904,7 @@ const CaseSummary = (props) => {
|
|||||||
|
|
||||||
function showSummary(casesObj, detailsObj) {
|
function showSummary(casesObj, detailsObj) {
|
||||||
let appealIDObj = getFormCollectionByID(
|
let appealIDObj = getFormCollectionByID(
|
||||||
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
|
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype,
|
||||||
).PrimaryIdAttribute;
|
).PrimaryIdAttribute;
|
||||||
|
|
||||||
switch (appealIDObj) {
|
switch (appealIDObj) {
|
||||||
@@ -1187,7 +1193,7 @@ const CaseSummary = (props) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const linkCaseObj = async () => {
|
const linkCaseObj = async () => {
|
||||||
let docObj = await getLinkedCases(
|
let docObj = await getLinkedCases(
|
||||||
incidentid || setCaseQueryObj.value[0].incidentid
|
incidentid || setCaseQueryObj.value[0].incidentid,
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
setCurrentLinkedCases(data);
|
setCurrentLinkedCases(data);
|
||||||
@@ -1286,7 +1292,7 @@ const CaseSummary = (props) => {
|
|||||||
? showReps(
|
? showReps(
|
||||||
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
||||||
props.searchDetailsObj[0].value[0]
|
props.searchDetailsObj[0].value[0]
|
||||||
.pinswg_finalcommentsduedate
|
.pinswg_finalcommentsduedate,
|
||||||
)
|
)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
@@ -1296,16 +1302,16 @@ const CaseSummary = (props) => {
|
|||||||
.pinswg_speacialistcaseprocess == 846040000 && isLPA
|
.pinswg_speacialistcaseprocess == 846040000 && isLPA
|
||||||
? true
|
? true
|
||||||
: props.searchDetailsObj[0].value[0]
|
: props.searchDetailsObj[0].value[0]
|
||||||
.pinswg_speacialistcaseprocess == 846040001
|
.pinswg_speacialistcaseprocess == 846040001
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
return shouldShow;
|
return shouldShow;
|
||||||
|
|
||||||
case 846040019:
|
case 846040019:
|
||||||
return showReps(
|
return showReps(
|
||||||
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
props.searchDetailsObj[0].value[0].pinswg_startdate,
|
||||||
props.searchDetailsObj[0].value[0].pinswg_statementduedate
|
props.searchDetailsObj[0].value[0].pinswg_statementduedate,
|
||||||
);
|
);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1325,7 +1331,7 @@ const CaseSummary = (props) => {
|
|||||||
selectWatchedCase(
|
selectWatchedCase(
|
||||||
props.accountDetails.accountDetails.contactid,
|
props.accountDetails.accountDetails.contactid,
|
||||||
incidentid,
|
incidentid,
|
||||||
appealTypeID
|
appealTypeID,
|
||||||
);
|
);
|
||||||
destroyCookie({}, "pedwWatchCase", { path: "/" });
|
destroyCookie({}, "pedwWatchCase", { path: "/" });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ const Header = (props) => {
|
|||||||
"/myportal/advancedsearch",
|
"/myportal/advancedsearch",
|
||||||
"/myportal/advancedsearchresults",
|
"/myportal/advancedsearchresults",
|
||||||
"/myportal/case/[ticketnumber]",
|
"/myportal/case/[ticketnumber]",
|
||||||
|
"/status",
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasContactLink = [
|
const hasContactLink = [
|
||||||
@@ -73,14 +74,14 @@ const Header = (props) => {
|
|||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
console.info("////////////\n" + "logout" + "\n////////////");
|
||||||
window.localStorage.clear(),
|
(window.localStorage.clear(),
|
||||||
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
||||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||||
signOut({
|
signOut({
|
||||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||||
});
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -242,7 +243,7 @@ const Header = (props) => {
|
|||||||
Object.keys(router.query)
|
Object.keys(router.query)
|
||||||
.map(
|
.map(
|
||||||
(key) =>
|
(key) =>
|
||||||
key + "=" + router.query[key]
|
key + "=" + router.query[key],
|
||||||
)
|
)
|
||||||
.join("&")
|
.join("&")
|
||||||
: router.pathname
|
: router.pathname
|
||||||
@@ -268,7 +269,7 @@ const Header = (props) => {
|
|||||||
locale == "en" ? "cy" : "en",
|
locale == "en" ? "cy" : "en",
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
+3
-12
@@ -22,18 +22,9 @@ const MainHome = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
{showLogin != "true" && (
|
<CaseSearch />
|
||||||
<>
|
<Login session={session} siteurl={siteurl} />
|
||||||
<LoginSoon />
|
|
||||||
<CaseSearch />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{showLogin == "true" && (
|
|
||||||
<>
|
|
||||||
<CaseSearch />
|
|
||||||
<Login session={session} siteurl={siteurl} />
|
|
||||||
</>
|
|
||||||
)}{" "}
|
|
||||||
{/* <CaseComment /> */}
|
{/* <CaseComment /> */}
|
||||||
{/* <Dns /> */}
|
{/* <Dns /> */}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const CaseHome = (props) => {
|
|||||||
representationsObj={
|
representationsObj={
|
||||||
props.searchResultsObj.representationsObj
|
props.searchResultsObj.representationsObj
|
||||||
}
|
}
|
||||||
showLoginCheck={true}
|
showLoginCheck={props.showLoginCheck}
|
||||||
messagesObj={props.messagesObj}
|
messagesObj={props.messagesObj}
|
||||||
showFilteredDocs={props.showFilteredDocs}
|
showFilteredDocs={props.showFilteredDocs}
|
||||||
showMaps={props.showMaps}
|
showMaps={props.showMaps}
|
||||||
@@ -170,7 +170,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
searchResultsObj["@odata.count"] > 1 ||
|
searchResultsObj["@odata.count"] > 1 ||
|
||||||
searchResultsObj["@odata.count"] < 1
|
searchResultsObj["@odata.count"] < 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (searchResultsObj["@odata.count"] < 1) {
|
if (searchResultsObj["@odata.count"] < 1) {
|
||||||
@@ -211,7 +211,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
searchDetailsObj[0].value[0]
|
searchDetailsObj[0].value[0]
|
||||||
.pinswg_specialistcaseprocess
|
.pinswg_specialistcaseprocess
|
||||||
: "",
|
: "",
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,13 +225,14 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
currentType: "directResultsObj",
|
currentType: "directResultsObj",
|
||||||
docsOffline: process.env.DOCAPI_OFFLINE || false,
|
docsOffline: process.env.DOCAPI_OFFLINE || false,
|
||||||
messagesObj: await getCaseMessage(
|
messagesObj: await getCaseMessage(
|
||||||
searchResultsObj.value[0].incidentid
|
searchResultsObj.value[0].incidentid,
|
||||||
),
|
),
|
||||||
showFilteredDocs: process.env.SHOWFILTERDOCS || false,
|
showFilteredDocs: process.env.SHOWFILTERDOCS || false,
|
||||||
showMaps: process.env.SHOWMAPS,
|
showMaps: process.env.SHOWMAPS,
|
||||||
|
showLoginCheck: process.env.SHOWLOGIIN || true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user