Merged PR 2009: partial synch with ph2 updates

partial synch with ph2 updates

Related work items: #20553
This commit is contained in:
Robert Bond
2025-11-28 08:50:01 +00:00
34 changed files with 1425 additions and 471 deletions
+80 -4
View File
@@ -57,6 +57,7 @@ const CaseSummary = (props) => {
const router = useRouter();
const { locale } = router;
const {
appealTypeID,
incidentid,
caseReference,
myCases,
@@ -79,7 +80,6 @@ const CaseSummary = (props) => {
ticketnumber,
} = props;
let appealTypeID = props.appealTypeID || router.query.appealType;
const showLoginCheck =
currentType == "directResultsObj" ? "true" : currentView.showLogin;
const { data: session, status } = useSession();
@@ -482,14 +482,19 @@ const CaseSummary = (props) => {
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{getFormCollectionByID(
appealTypeID
appealTypeID ||
setCaseQueryObj.value[0]
.pinswg_appealcasetype
).PrimaryIdAttribute ==
"pinswg_dnsid"
? t(
"case:summary-applicantonly-label"
)
: getFormCollectionByID(
appealTypeID
appealTypeID ||
setCaseQueryObj
.value[0]
.pinswg_appealcasetype
).PrimaryIdAttribute ==
"pinswg_nonvalidationid"
? t(
@@ -542,7 +547,9 @@ const CaseSummary = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{getFormCollectionByID(
appealTypeID
appealTypeID ||
setCaseQueryObj.value[0]
.pinswg_appealcasetype
).PrimaryIdAttribute ==
"pinswg_dnsid" ||
getFormCollectionByID(
@@ -1980,6 +1987,67 @@ const CaseSummary = (props) => {
expDate.setDate(now.getDate() + 365);
function formatDates(dateObj, showTime) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
var hh = dateObj.getHours();
hh = ("0" + hh).slice(-2);
var mins = dateObj.getMinutes();
mins = ("0" + mins).slice(-2);
const dateStr = showTime
? hh == 0 && mins == 0
? ""
: hh + ":" + mins
: dd + "/" + mm + "/" + yyyy + " ";
return dateStr;
}
function linkedCasesList(linkedCasesReference) {
//console.log(linkedCasesReference);
linkedCasesReference = linkedCasesReference.value || [];
return (
<>
<ul className="govuk-list govuk-!-font-size-16">
{linkedCasesReference.map((item, key) => {
return (
<li key={key}>
<Link
href={
router.locale == "cy"
? "/canlyniadauchwilio?q=" +
item.title +
"&lk=1"
: "/searchresults?q=" +
item.title +
"&lk=1"
}
className=""
>
{item.title}
</Link>
</li>
);
//console.log(item.incidentid, item.title);
})}
</ul>
</>
);
}
function showReps(startDate, endDate) {
let date = new Date();
date = new Date(date.toDateString());
const start = new Date(startDate);
const end = new Date(endDate);
return date >= start && date <= end ? true : false;
}
function showRepButton(appealType) {
switch (appealType) {
case 846040012:
@@ -2027,6 +2095,14 @@ const CaseSummary = (props) => {
}
}
function showRepsEnded(startDate, endDate) {
let date = new Date();
date = new Date(date.toDateString());
const start = new Date(startDate);
const end = new Date(endDate);
return date > start && date > end ? true : false;
}
if (status == "authenticated" && cookies.pedwWatchCase != null) {
selectWatchedCase(
props.accountDetails.accountDetails.contactid,