uat defect 124, rep defect 11, questionnaire defect 26

This commit is contained in:
2025-01-13 18:21:40 +00:00
parent 59ae2db6c5
commit 665c4bbba5
8 changed files with 173 additions and 125 deletions
+55 -38
View File
@@ -129,6 +129,7 @@ let MakeRepresentation = (props) => {
repCap = "LO";
break;
case "lpa":
case "LPA":
repCap = "LPA";
break;
@@ -204,7 +205,7 @@ let MakeRepresentation = (props) => {
return values;
};
isLPA && setRepresentationCapacity("lpa");
isLPA && setRepresentationCapacity("LPA");
currentType == "searchResultsObj"
? (casesObj = jsonpath(
@@ -248,8 +249,27 @@ let MakeRepresentation = (props) => {
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
let setCaseResultsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: props.props.searchResultsObj.searchResultsObj
: props.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchResultsObj;
var detailsObj = {};
var resultsObj = {};
resultsObj = jsonpath(
'$..[?(@.ticketnumber=="' +
currentView.caseReference.currentReference +
'")]',
setCaseResultsObj
);
resultsObj = resultsObj[0];
detailsObj = jsonpath(
'$..[?(@.pinswg_name=="' +
currentView.caseReference.currentReference +
@@ -396,7 +416,7 @@ let MakeRepresentation = (props) => {
)
) {
return (
//setRepresentationCapacity("lpa"),
//setRepresentationCapacity("LPA"),
<RepLPACapacitySelection
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
@@ -474,10 +494,11 @@ let MakeRepresentation = (props) => {
);
break;
case "lpa":
case "LPA":
//setRepresentationCapacity("appellant");
//setRepresentationCapacity("lpa");
//setRepresentationCapacity("LPA");
// useEffect(() => {
// setRepresentationCapacity("lpa");
// setRepresentationCapacity("LPA");
// }, []);
// console.log(currentView.caseReference.appealType);
@@ -761,6 +782,7 @@ let MakeRepresentation = (props) => {
"pinswg_siteaddressline2": detailsObj.pinswg_siteaddressline2,
"pinswg_siteaddresstown": detailsObj.pinswg_siteaddresstown,
"pinswg_siteaddresspostcode": detailsObj.pinswg_siteaddresspostcode,
"pinswg_lpareference": resultsObj.pinswg_lpareference,
"_pinswg_appellant_value": detailsObj["_pinswg_appellant_value"],
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue":
detailsObj[
@@ -777,7 +799,7 @@ let MakeRepresentation = (props) => {
? props.props.currentView.representationCapacity
: values.representationCapacity
: isLPA
? "lpa"
? "LPA"
: values.representationCapacity,
"locale": router.locale,
});
@@ -840,23 +862,15 @@ let MakeRepresentation = (props) => {
: "/myportal"
))
: useSaveStatus
? (values.hasOwnProperty("representationDocuments") &&
(values.representationDocuments.map((Blob) =>
buildFileArray.push({
"name": Blob.name,
"size": Blob.size,
})
),
(newbuildArr = buildFileArray.concat(values.filesList)),
console.log(buildFileArray, newbuildArr),
Object.assign(values, {
"filesList": newbuildArr,
})),
generateRepPDF(
values,
props.props.accountDetails.containerID,
currentView.caseReference.currentReference
),
? (Object.assign(values, {
"filesList": props.currentView.fileList,
}),
// commented out as dont need to create pdf on save
// generateRepPDF(
// values,
// props.props.accountDetails.containerID,
// currentView.caseReference.currentReference
// ),
uploadRepresentationFiles(values),
router.replace(
router.locale != "en"
@@ -874,25 +888,26 @@ let MakeRepresentation = (props) => {
// Object.assign(values, {
// "filesList": buildFileArray,
// })),
uploadRepresentationFiles(values),
generateRepPDF(
values,
props.props.accountDetails.containerID,
currentView.caseReference.currentReference
);
console.log("updated");
uploadRepresentationFiles(values);
// generateRepPDF(
// values,
// props.props.accountDetails.containerID,
// currentView.caseReference.currentReference
// );
};
const onHandleSubmit = (values) => {
window.scrollTo({ top: 0, behavior: "smooth" });
values = setRepFileName(values);
!values.hasOwnProperty("pinswg_lpareference") &&
Object.assign(values, {
"pinswg_lpareference":
searchResultsObj.searchResultsObj.value[0]
.pinswg_lpareference,
});
// values.representationType == "Questionnaire" &&
// !values.hasOwnProperty("pinswg_lpareference") &&
// Object.assign(values, {
// "pinswg_lpareference":
// searchResultsObj?.searchResultsObj?.value[0]
// ?.pinswg_lpareference,
// });
//console.log("onHandleSubmit form values - ", JSON.stringify(values));
@@ -973,6 +988,7 @@ let MakeRepresentation = (props) => {
"pinswg_siteaddresstown": detailsObj.pinswg_siteaddresstown,
"pinswg_siteaddresspostcode":
detailsObj.pinswg_siteaddresspostcode,
"pinswg_lpareference": resultsObj.pinswg_lpareference,
"_pinswg_appellant_value":
detailsObj["_pinswg_appellant_value"],
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue":
@@ -990,7 +1006,7 @@ let MakeRepresentation = (props) => {
? props.props.currentView.representationCapacity
: values.representationCapacity
: isLPA
? "lpa"
? "LPA"
: values.representationCapacity,
"locale": router.locale,
}));
@@ -998,7 +1014,7 @@ let MakeRepresentation = (props) => {
if (currentView.representationSubmit != true) {
if (_.isEmpty(currentView.representationCapacity)) {
if (isLPA) {
setRepresentationCapacity("lpa");
setRepresentationCapacity("LPA");
} else {
setRepresentationCapacity(
values.representationCapacity
@@ -1055,6 +1071,7 @@ let MakeRepresentation = (props) => {
currentView.caseReference.currentReference
);
uploadRepresentationFiles(values);
setRepresentationSubmit(true);
setRepresentationSubmitConfirmation(true);
} else {
console.log("nit updated");
@@ -1064,7 +1081,7 @@ let MakeRepresentation = (props) => {
// currentView.representationSubmit != true
// ? _.isEmpty(currentView.representationCapacity)
// ? isLPA
// ? setRepresentationCapacity("lpa")
// ? setRepresentationCapacity("LPA")
// : setRepresentationCapacity(
// values.representationCapacity
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")