partial synch with ph2 updates
This commit is contained in:
@@ -57,6 +57,7 @@ const CaseSummary = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
appealTypeID,
|
||||
incidentid,
|
||||
caseReference,
|
||||
myCases,
|
||||
@@ -76,9 +77,9 @@ const CaseSummary = (props) => {
|
||||
currentView,
|
||||
messagesObj,
|
||||
docsOffline,
|
||||
ticketnumber,
|
||||
} = props;
|
||||
|
||||
let appealTypeID = props.appealTypeID || router.query.appealType;
|
||||
const showLoginCheck =
|
||||
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
||||
const { data: session, status } = useSession();
|
||||
@@ -233,13 +234,13 @@ const CaseSummary = (props) => {
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.title=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: searchResultsObj,
|
||||
eval: true,
|
||||
}))
|
||||
: currentType == "watchedCases"
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
@@ -251,7 +252,7 @@ const CaseSummary = (props) => {
|
||||
}))
|
||||
: currentType == "directResultsObj"
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
@@ -481,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(
|
||||
@@ -541,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(
|
||||
@@ -1955,7 +1963,9 @@ const CaseSummary = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
const linkCaseObj = async () => {
|
||||
let docObj = await getLinkedCases(incidentid).then((data) => {
|
||||
let docObj = await getLinkedCases(
|
||||
incidentid || setCaseQueryObj.value[0].incidentid
|
||||
).then((data) => {
|
||||
//console.log(data);
|
||||
setCurrentLinkedCases(data);
|
||||
return data;
|
||||
@@ -1972,6 +1982,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:
|
||||
@@ -2019,6 +2090,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,
|
||||
|
||||
Reference in New Issue
Block a user