Merge branch 'Development' into SIPS-Development
This commit is contained in:
@@ -939,10 +939,6 @@ export const RenderFileUpload = (field) => {
|
||||
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||
return "/assets/images/documenttypes/xlsx.png";
|
||||
break;
|
||||
|
||||
case "application/zip":
|
||||
return "/assets/images/documenttypes/zip.png";
|
||||
break;
|
||||
case "image/jpeg":
|
||||
return "/assets/images/documenttypes/jpg.png";
|
||||
case "image/png":
|
||||
@@ -1091,7 +1087,6 @@ export const RenderFileUpload = (field) => {
|
||||
[".docx"],
|
||||
"image/tiff": [".tif", ".tiff"],
|
||||
"image/jpeg": [".jpg", ".jpeg"],
|
||||
"application/zip": [".zip"],
|
||||
"image/png": [".png"],
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||
[".xlsx"],
|
||||
@@ -1338,7 +1333,7 @@ export const RenderFileUpload = (field) => {
|
||||
?.values?.repfile_name
|
||||
) +
|
||||
"&blobname=" +
|
||||
blob.name +
|
||||
encodeURIComponent(blob.name) +
|
||||
blob.hashedfilepath
|
||||
}
|
||||
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
||||
|
||||
+103
-195
@@ -104,6 +104,38 @@ const CaseSummary = (props) => {
|
||||
? true
|
||||
: false;
|
||||
|
||||
let ShowDocLinks = false;
|
||||
let checkShowDocLinks = docsOffline != false ? true : false;
|
||||
|
||||
const getDocLink = (docsOffline) => {
|
||||
var startTime = docsOffline.split(",")[0];
|
||||
var endTime = docsOffline.split(",")[1];
|
||||
|
||||
// console.log(startTime);
|
||||
// console.log(endTime);
|
||||
|
||||
var currentDate = new Date();
|
||||
|
||||
var startDate = new Date(currentDate.getTime());
|
||||
startDate.setHours(startTime.split(":")[0]);
|
||||
startDate.setMinutes(startTime.split(":")[1]);
|
||||
startDate.setSeconds(startTime.split(":")[2]);
|
||||
|
||||
var endDate = new Date(currentDate.getTime());
|
||||
endDate.setHours(endTime.split(":")[0]);
|
||||
endDate.setMinutes(endTime.split(":")[1]);
|
||||
endDate.setSeconds(endTime.split(":")[2]);
|
||||
|
||||
// console.log(startDate);
|
||||
// console.log(endDate);
|
||||
// console.log(currentDate);
|
||||
|
||||
var valid = startDate < currentDate && endDate > currentDate;
|
||||
ShowDocLinks = valid;
|
||||
};
|
||||
|
||||
checkShowDocLinks && getDocLink(docsOffline);
|
||||
|
||||
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
||||
let updateBody = {
|
||||
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
||||
@@ -122,7 +154,7 @@ const CaseSummary = (props) => {
|
||||
});
|
||||
});
|
||||
|
||||
setCaseInvolvment(incidentid, loggedInUser);
|
||||
//setCaseInvolvment(incidentid, loggedInUser);
|
||||
};
|
||||
|
||||
const selectEmailNotifications = (
|
||||
@@ -770,115 +802,6 @@ const CaseSummary = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<div className="govuk-button-group">
|
||||
{getFormCollectionByID(
|
||||
appealTypeID
|
||||
).PrimaryIdAttribute ==
|
||||
"pinswg_sipscase" &&
|
||||
showReps(
|
||||
detailsObj.pinswg_consultationopen,
|
||||
detailsObj.pinswg_consultationclose
|
||||
) && (
|
||||
<>
|
||||
{showRepButton(
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType
|
||||
) ? (
|
||||
<>
|
||||
<Link
|
||||
href={{
|
||||
pathname:
|
||||
"/myportal/representation",
|
||||
query: {
|
||||
case:
|
||||
currentType ==
|
||||
"searchResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: currentType ==
|
||||
"watchedCases"
|
||||
? casesObj.pinswg_title
|
||||
: currentType ==
|
||||
"directResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
: casesObj.reference,
|
||||
},
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
{props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType ==
|
||||
846040002
|
||||
? t(
|
||||
"case:summary-make-consultation-label"
|
||||
)
|
||||
: 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>
|
||||
</>
|
||||
) : !isLPA &&
|
||||
props.currentView
|
||||
.caseReference
|
||||
.appealType ==
|
||||
846040004 ? (
|
||||
""
|
||||
) : (
|
||||
<>
|
||||
<div className="govuk-grid-column-full govuk-!-padding-left-0">
|
||||
<div className="govuk-button-group">
|
||||
<p className="govuk-body">
|
||||
{t(
|
||||
"case:representation-date-passed-label",
|
||||
{
|
||||
startDate:
|
||||
formatDates(
|
||||
detailsObj.pinswg_consultationopen
|
||||
),
|
||||
endDate:
|
||||
formatDates(
|
||||
detailsObj.pinswg_consultationclose
|
||||
),
|
||||
}
|
||||
)}
|
||||
<br />{" "}
|
||||
{t(
|
||||
"case:representation-date-passed-additional-label"
|
||||
)}{" "}
|
||||
<Link
|
||||
href={
|
||||
"mailto:" +
|
||||
t(
|
||||
"home:login-contact-email"
|
||||
)
|
||||
}
|
||||
>
|
||||
{t(
|
||||
"home:login-contact-email"
|
||||
)}
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{(_.has(
|
||||
detailsObj,
|
||||
"pinswg_startdate"
|
||||
@@ -914,29 +837,21 @@ const CaseSummary = (props) => {
|
||||
case:
|
||||
currentType ==
|
||||
"searchResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
? detailsObj.ticketnumber
|
||||
: currentType ==
|
||||
"watchedCases"
|
||||
? casesObj.pinswg_title
|
||||
: currentType ==
|
||||
"directResultsObj"
|
||||
? detailsObj.pinswg_name
|
||||
? detailsObj.ticketnumber
|
||||
: casesObj.reference,
|
||||
},
|
||||
}}
|
||||
className="govuk-button"
|
||||
>
|
||||
{props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType ==
|
||||
846040002
|
||||
? t(
|
||||
"case:summary-make-consultation-label"
|
||||
)
|
||||
: t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
</Link>
|
||||
|
||||
<a
|
||||
@@ -1015,77 +930,75 @@ const CaseSummary = (props) => {
|
||||
).length >
|
||||
0 ==
|
||||
true ? (
|
||||
<>
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-have-stopped-watching-label"
|
||||
) +
|
||||
<button
|
||||
className="govuk-link watchCase"
|
||||
onClick={() => {
|
||||
confirm(
|
||||
t(
|
||||
"case:you-have-stopped-watching-label"
|
||||
) +
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"?"
|
||||
) &&
|
||||
deleteItem(
|
||||
isWatchedCase(
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference +
|
||||
"?"
|
||||
) &&
|
||||
deleteItem(
|
||||
isWatchedCase(
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid
|
||||
)[0]
|
||||
.pinswg_watchlistid,
|
||||
.incidentid
|
||||
)[0]
|
||||
.pinswg_watchlistid,
|
||||
|
||||
"watchedCases"
|
||||
),
|
||||
setCurrentView(
|
||||
{
|
||||
"viewName":
|
||||
"Watched Cases",
|
||||
"viewKey":
|
||||
"watchedCases",
|
||||
}
|
||||
);
|
||||
setCurrentReference(
|
||||
"watchedCases"
|
||||
),
|
||||
setCurrentView(
|
||||
{
|
||||
"ticketnumber":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference,
|
||||
"currentReference":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference,
|
||||
"currentType":
|
||||
"searchResultsObj",
|
||||
"incidentid":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid,
|
||||
"appealType":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType,
|
||||
"showMap":
|
||||
showMap,
|
||||
"viewName":
|
||||
"Watched Cases",
|
||||
"viewKey":
|
||||
"watchedCases",
|
||||
}
|
||||
);
|
||||
}}
|
||||
title={t(
|
||||
"case:stop-watching-case-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"case:stop-watching-case-link"
|
||||
)}{" "}
|
||||
</button>
|
||||
</>
|
||||
setCurrentReference(
|
||||
{
|
||||
"ticketnumber":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference,
|
||||
"currentReference":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.currentReference,
|
||||
"currentType":
|
||||
"searchResultsObj",
|
||||
"incidentid":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.incidentid,
|
||||
"appealType":
|
||||
props
|
||||
.currentView
|
||||
.caseReference
|
||||
.appealType,
|
||||
"showMap":
|
||||
showMap,
|
||||
}
|
||||
);
|
||||
}}
|
||||
title={t(
|
||||
"case:stop-watching-case-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"case:stop-watching-case-link"
|
||||
)}{" "}
|
||||
</button>
|
||||
) : (
|
||||
<>
|
||||
<button
|
||||
@@ -1912,14 +1825,9 @@ const CaseSummary = (props) => {
|
||||
href="/representation"
|
||||
className="govuk-button"
|
||||
>
|
||||
{props.currentView.caseReference
|
||||
.appealType == 846040002
|
||||
? t(
|
||||
"case:summary-make-consultation-label"
|
||||
)
|
||||
: t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
{t(
|
||||
"case:summary-make-representation-label"
|
||||
)}
|
||||
</Link>
|
||||
)}
|
||||
|
||||
|
||||
@@ -2378,9 +2378,9 @@ const RenderFileUpload = (field) => {
|
||||
"/api/file/downloadblob?container=" +
|
||||
field.containerID +
|
||||
"&casefolderID=" +
|
||||
field.ticketnumber +
|
||||
encodeURIComponent(field.ticketnumber) +
|
||||
"&blobname=" +
|
||||
blob.name +
|
||||
encodeURIComponent(blob.name) +
|
||||
blob.hashedfilepath
|
||||
}
|
||||
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
||||
|
||||
@@ -150,7 +150,7 @@ const DNSSearchResults = (props) => {
|
||||
};
|
||||
|
||||
const [orderByState, setOrderbyState] = useState("createdon");
|
||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||
const [selectedOption, setSelectedOption] = useState(10);
|
||||
|
||||
const cookies = parseCookies();
|
||||
@@ -1009,7 +1009,14 @@ const DNSSearchResults = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{resultsArr.length > 0 ? (
|
||||
|
||||
{!searchLoaded ? (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>Loading...</h3>
|
||||
</div>
|
||||
</div>
|
||||
) : resultsArr.length > 0 ? (
|
||||
ResultsView(resultsArr)
|
||||
) : (
|
||||
<div className="govuk-grid-row">
|
||||
@@ -1018,6 +1025,16 @@ const DNSSearchResults = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* {resultsArr.length > 0 ? (
|
||||
ResultsView(resultsArr)
|
||||
) : (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>{t("search:searchresults-no-records-label")}</h3>
|
||||
</div>
|
||||
</div>
|
||||
)} */}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
+86
-18
@@ -179,6 +179,92 @@ export const getPartSavedDetails = (searchResultsObj) => {
|
||||
* Get the details of a case from the appeal type
|
||||
* @param object searchResultsObj
|
||||
*/
|
||||
// export const getSearchDetailsPaged = (searchResultsObj) => {
|
||||
// let detailsArr = [];
|
||||
// searchResultsObj = searchResultsObj.value;
|
||||
// const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||
// if (searchDetail.pinswg_appealcasetype == null) {
|
||||
// console.log(searchDetail.title);
|
||||
// } else {
|
||||
// let formMeta = getFormCollectionByID(
|
||||
// searchDetail.pinswg_appealcasetype
|
||||
// );
|
||||
// formMeta?.LogicalCollectionName &&
|
||||
// formMeta?.LogicalCollectionName != "pinswg_sipses" &&
|
||||
// detailsArr.push(
|
||||
// getBasicSearchDetailsPaged(
|
||||
// formMeta.LogicalCollectionName,
|
||||
// searchDetail.title,
|
||||
// formMeta.PrimaryIdAttribute,
|
||||
// searchDetail.incidentid
|
||||
// )
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// return Promise.all(detailsArr);
|
||||
// };
|
||||
|
||||
// export const getSearchDetailsPaged = async (searchResultsObj) => {
|
||||
// const searchResults = searchResultsObj.value;
|
||||
|
||||
// //Group incidents by appeal type
|
||||
// const groupedByAppealType = {};
|
||||
|
||||
// searchResults.forEach((incident) => {
|
||||
// const appealType = incident.pinswg_appealcasetype;
|
||||
// if (!appealType) return;
|
||||
|
||||
// const formMeta = getFormCollectionByID(appealType);
|
||||
// if (
|
||||
// !formMeta?.LogicalCollectionName ||
|
||||
// formMeta.LogicalCollectionName === "pinswg_sipses"
|
||||
// )
|
||||
// return;
|
||||
|
||||
// const key = formMeta.LogicalCollectionName;
|
||||
// if (!groupedByAppealType[key]) groupedByAppealType[key] = [];
|
||||
// groupedByAppealType[key].push({
|
||||
// incidentID: incident.incidentid,
|
||||
// caseReference: incident.title,
|
||||
// primaryIdAttribute: formMeta.PrimaryIdAttribute,
|
||||
// });
|
||||
// });
|
||||
|
||||
// // Make all API calls in parallel per appeal type
|
||||
// const allDetails = await Promise.all(
|
||||
// Object.entries(groupedByAppealType).map(
|
||||
// async ([appealTypeName, incidents]) => {
|
||||
// console.log(
|
||||
// `Fetching details for appeal type: ${appealTypeName}, incidents: ${incidents.length}`
|
||||
// );
|
||||
|
||||
// // Fully parallel for each incident
|
||||
// const results = await Promise.all(
|
||||
// incidents.map((i) =>
|
||||
// getBasicSearchDetailsPaged(
|
||||
// appealTypeName,
|
||||
// i.caseReference,
|
||||
// i.primaryIdAttribute,
|
||||
// i.incidentID
|
||||
// ).catch((err) => {
|
||||
// console.error(
|
||||
// `Error fetching incident ${i.caseReference}:`,
|
||||
// err
|
||||
// );
|
||||
// return null; // continue other calls even if one fails
|
||||
// })
|
||||
// )
|
||||
// );
|
||||
|
||||
// return results.filter((r) => r); // remove nulls from failed calls
|
||||
// }
|
||||
// )
|
||||
// );
|
||||
|
||||
// //Flatten all results into a single array
|
||||
// return allDetails.flat();
|
||||
// };
|
||||
|
||||
export const getSearchDetailsPaged = async (searchResultsObj) => {
|
||||
searchResultsObj = searchResultsObj.value;
|
||||
|
||||
@@ -233,24 +319,6 @@ export const getSearchDetailsPaged = async (searchResultsObj) => {
|
||||
return allDetails;
|
||||
};
|
||||
|
||||
// export const absoluteUrl = (req, setLocalhost) => {
|
||||
// var protocol = "https:";
|
||||
// var host = req
|
||||
// ? req.headers["x-forwarded-host"] || req.headers["host"]
|
||||
// : window.location.host;
|
||||
|
||||
// if (host.indexOf("localhost") > -1) {
|
||||
// if (setLocalhost) host = setLocalhost;
|
||||
// protocol = "http:";
|
||||
// }
|
||||
|
||||
// return {
|
||||
// protocol: protocol,
|
||||
// host: host,
|
||||
// origin: protocol + "//" + host,
|
||||
// };
|
||||
// };
|
||||
|
||||
export const getProgressObj = (
|
||||
formObjXML,
|
||||
titleList,
|
||||
|
||||
Reference in New Issue
Block a user