Merged PR 1289: moved alot of stuff from client side
moved alot of stuff from client side Related work items: #12688
This commit is contained in:
@@ -389,6 +389,8 @@ let MakeRepresentation = (props) => {
|
||||
caseReference={caseReference}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
@@ -408,6 +410,8 @@ let MakeRepresentation = (props) => {
|
||||
caseReference={caseReference}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
/>;
|
||||
break;
|
||||
case "appellant":
|
||||
@@ -431,6 +435,8 @@ let MakeRepresentation = (props) => {
|
||||
props={props}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -464,6 +470,8 @@ let MakeRepresentation = (props) => {
|
||||
questionnaireCount={questionnaireCount}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -488,6 +496,8 @@ let MakeRepresentation = (props) => {
|
||||
props={props}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -512,6 +522,8 @@ let MakeRepresentation = (props) => {
|
||||
props={props}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -615,6 +627,10 @@ let MakeRepresentation = (props) => {
|
||||
const sortFileObj = (filelistObj) => {
|
||||
let blobList = filelistObj;
|
||||
|
||||
function removeNullObjects(arr) {
|
||||
return arr.filter((obj) => obj !== null);
|
||||
}
|
||||
|
||||
function removeObjectsWithUndefinedKey(arr, key) {
|
||||
return arr.filter((obj) => obj[key] !== undefined);
|
||||
}
|
||||
@@ -623,6 +639,7 @@ let MakeRepresentation = (props) => {
|
||||
return arr.filter((obj) => Object.keys(obj).length > 0);
|
||||
}
|
||||
|
||||
blobList = removeNullObjects(blobList);
|
||||
blobList = removeEmptyObjects(blobList);
|
||||
blobList = removeObjectsWithUndefinedKey(blobList, "name");
|
||||
|
||||
@@ -819,6 +836,7 @@ let MakeRepresentation = (props) => {
|
||||
// Object.assign(values, {
|
||||
// "filesList": buildFileArray,
|
||||
// })),
|
||||
|
||||
uploadRepresentationFiles(values),
|
||||
generateRepPDF(
|
||||
values,
|
||||
@@ -931,54 +949,165 @@ let MakeRepresentation = (props) => {
|
||||
: values.representationCapacity,
|
||||
"locale": router.locale,
|
||||
}));
|
||||
currentView.representationSubmit != true
|
||||
? _.isEmpty(currentView.representationCapacity)
|
||||
? isLPA
|
||||
? setRepresentationCapacity("lpa")
|
||||
: setRepresentationCapacity(
|
||||
values.representationCapacity
|
||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||
.toLowerCase()
|
||||
)
|
||||
: questionnaireCount != 0 &&
|
||||
showQuestionnaireSection < questionnaireCount
|
||||
? (setShowQuestionnaireSection(showQuestionnaireSection + 1),
|
||||
updateRepresentation(values, false, false))
|
||||
: (updateRepresentation(values, false, false),
|
||||
setRepresentationSubmit(true))
|
||||
: currentView.representationSubmit == true
|
||||
? (console.log("capacity", currentView.representationCapacity),
|
||||
console.log("has errors:", props.invalid),
|
||||
Object.assign(values, { "locale": router.locale }),
|
||||
props.invalid == false &&
|
||||
updateRepresentation(values, false, false),
|
||||
// values.hasOwnProperty("representationDocuments") &&
|
||||
// (values.representationDocuments.map((Blob) =>
|
||||
// buildFileArray.push({
|
||||
// "name": Blob.name,
|
||||
// "size": Blob.size,
|
||||
// })
|
||||
// ),
|
||||
// Object.assign(values, {
|
||||
// "filesList": buildFileArray,
|
||||
// })),
|
||||
console.log(
|
||||
"====================== rep lpa payload:\n",
|
||||
JSON.stringify(values)
|
||||
),
|
||||
generateRepPDF(
|
||||
values,
|
||||
props.props.accountDetails.containerID,
|
||||
currentView.caseReference.currentReference
|
||||
),
|
||||
uploadRepresentationFiles(values),
|
||||
setRepresentationSubmitConfirmation(true))
|
||||
: console.log("nit updated");
|
||||
|
||||
if (currentView.representationSubmit != true) {
|
||||
if (_.isEmpty(currentView.representationCapacity)) {
|
||||
if (isLPA) {
|
||||
setRepresentationCapacity(
|
||||
values.representationCapacity
|
||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||
.toLowerCase()
|
||||
);
|
||||
} else {
|
||||
setRepresentationCapacity(
|
||||
values.representationCapacity
|
||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||
.toLowerCase()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (values.representationType == "Questionnaire") {
|
||||
if (
|
||||
questionnaireCount != 0 &&
|
||||
showQuestionnaireSection < questionnaireCount
|
||||
) {
|
||||
setShowQuestionnaireSection(
|
||||
showQuestionnaireSection + 1
|
||||
);
|
||||
updateRepresentation(values, false, false);
|
||||
} else {
|
||||
updateRepresentation(values, false, false);
|
||||
setRepresentationSubmit(true);
|
||||
}
|
||||
} else {
|
||||
updateRepresentation(values, false, false);
|
||||
setRepresentationSubmit(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (currentView.representationSubmit == true) {
|
||||
console.log("capacity", currentView.representationCapacity);
|
||||
console.log("has errors:", props.invalid);
|
||||
Object.assign(values, { "locale": router.locale });
|
||||
props.invalid == false &&
|
||||
updateRepresentation(values, false, false);
|
||||
// values.hasOwnProperty("representationDocuments") &&
|
||||
// (values.representationDocuments.map((Blob) =>
|
||||
// buildFileArray.push({
|
||||
// "name": Blob.name,
|
||||
// "size": Blob.size,
|
||||
// })
|
||||
// ),
|
||||
// Object.assign(values, {
|
||||
// "filesList": buildFileArray,
|
||||
// })),
|
||||
console.log(
|
||||
"====================== rep lpa payload:\n",
|
||||
JSON.stringify(values)
|
||||
);
|
||||
generateRepPDF(
|
||||
values,
|
||||
props.props.accountDetails.containerID,
|
||||
currentView.caseReference.currentReference
|
||||
);
|
||||
uploadRepresentationFiles(values);
|
||||
setRepresentationSubmitConfirmation(true);
|
||||
} else {
|
||||
console.log("nit updated");
|
||||
}
|
||||
}
|
||||
|
||||
// currentView.representationSubmit != true
|
||||
// ? _.isEmpty(currentView.representationCapacity)
|
||||
// ? isLPA
|
||||
// ? setRepresentationCapacity("lpa")
|
||||
// : setRepresentationCapacity(
|
||||
// values.representationCapacity
|
||||
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||
// .toLowerCase()
|
||||
// )
|
||||
// : questionnaireCount != 0 &&
|
||||
// showQuestionnaireSection < questionnaireCount
|
||||
// ? (setShowQuestionnaireSection(showQuestionnaireSection + 1),
|
||||
// updateRepresentation(values, false, false))
|
||||
// : (updateRepresentation(values, false, false),
|
||||
// setRepresentationSubmit(true))
|
||||
// : currentView.representationSubmit == true
|
||||
// ? (console.log("capacity", currentView.representationCapacity),
|
||||
// console.log("has errors:", props.invalid),
|
||||
// Object.assign(values, { "locale": router.locale }),
|
||||
// props.invalid == false &&
|
||||
// updateRepresentation(values, false, false),
|
||||
// // values.hasOwnProperty("representationDocuments") &&
|
||||
// // (values.representationDocuments.map((Blob) =>
|
||||
// // buildFileArray.push({
|
||||
// // "name": Blob.name,
|
||||
// // "size": Blob.size,
|
||||
// // })
|
||||
// // ),
|
||||
// // Object.assign(values, {
|
||||
// // "filesList": buildFileArray,
|
||||
// // })),
|
||||
// console.log(
|
||||
// "====================== rep lpa payload:\n",
|
||||
// JSON.stringify(values)
|
||||
// ),
|
||||
// generateRepPDF(
|
||||
// values,
|
||||
// props.props.accountDetails.containerID,
|
||||
// currentView.caseReference.currentReference
|
||||
// ),
|
||||
// uploadRepresentationFiles(values),
|
||||
// setRepresentationSubmitConfirmation(true))
|
||||
// : console.log("nit updated");
|
||||
|
||||
//window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`);
|
||||
};
|
||||
|
||||
const cleanFilesList = (blobList) => {
|
||||
let newblobList = blobList.filesList;
|
||||
function removeNullObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj !== null);
|
||||
}
|
||||
|
||||
function removeObjectsWithUndefinedKey(arr, key) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj[key] !== undefined);
|
||||
}
|
||||
|
||||
function removeEmptyObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter(
|
||||
(obj) =>
|
||||
obj &&
|
||||
typeof obj === "object" &&
|
||||
Object.keys(obj).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
newblobList = removeNullObjects(newblobList);
|
||||
newblobList = removeEmptyObjects(newblobList);
|
||||
newblobList = removeObjectsWithUndefinedKey(newblobList, "name");
|
||||
|
||||
Object.assign(blobList, {
|
||||
"filesList": newblobList,
|
||||
});
|
||||
|
||||
return blobList;
|
||||
};
|
||||
|
||||
const uploadRepresentationFiles = (values) => {
|
||||
values = values.hasOwnProperty("filesList")
|
||||
? cleanFilesList(values)
|
||||
: values;
|
||||
|
||||
// get filelists from values object
|
||||
let fileListObj = _.filter(values, function (v, key) {
|
||||
return _.includes(key, "representationDocuments");
|
||||
@@ -1011,19 +1140,8 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
const repForm = props.props.form;
|
||||
|
||||
// try {
|
||||
// let value = props.initialValues;
|
||||
// setRepresentationCapacity(
|
||||
// props.initialValues.representationCapacity.toLowerCase()
|
||||
// );
|
||||
// //setRepresentationSubmit(false);
|
||||
// } catch {
|
||||
// console.log("not has props");
|
||||
// }
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>hello {currentView.representationSubmit ? "yep" : "no"}</div>
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
{currentView.representationSubmit == true ? (
|
||||
<RepCompleteSubmit
|
||||
@@ -1045,7 +1163,7 @@ let MakeRepresentation = (props) => {
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
{!session ? (
|
||||
{/* {!session ? (
|
||||
<>
|
||||
<div>
|
||||
<p className="govuk-body">
|
||||
@@ -1077,172 +1195,103 @@ let MakeRepresentation = (props) => {
|
||||
)}
|
||||
</button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<h1 className="govuk-heading-l">
|
||||
{t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{currentView.caseReference.currentReference}{" "}
|
||||
</h1>
|
||||
{currentView.caseReference.caseReference}
|
||||
<div id="rep-form">
|
||||
<div className="govuk-grid-column-three-quarters wgForm">
|
||||
{whichControl()}
|
||||
</div>
|
||||
) : ( */}
|
||||
<>
|
||||
<h1 className="govuk-heading-l">
|
||||
{t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{currentView.caseReference.currentReference}{" "}
|
||||
</h1>
|
||||
<div id="rep-form">
|
||||
<div className="govuk-grid-column-three-quarters wgForm">
|
||||
{whichControl()}
|
||||
</div>
|
||||
|
||||
<div className="govuk-grid-column-one-quarter">
|
||||
{" "}
|
||||
<div className="card">
|
||||
<div className="card-body">
|
||||
<h2 className="govuk-heading-s">
|
||||
{t(
|
||||
"myrepresentations:timetable-title"
|
||||
)}{" "}
|
||||
<div className="govuk-grid-column-one-quarter">
|
||||
{" "}
|
||||
<div className="card">
|
||||
<div className="card-body">
|
||||
<h2 className="govuk-heading-s">
|
||||
{t(
|
||||
"myrepresentations:timetable-title"
|
||||
)}{" "}
|
||||
{currentView.caseReference
|
||||
.appealType == 846040011}
|
||||
</h2>
|
||||
<div className="govuk-summary-list">
|
||||
<div className="govuk-body-s">
|
||||
{currentView.caseReference
|
||||
.appealType ==
|
||||
846040011}
|
||||
</h2>
|
||||
<div className="govuk-summary-list">
|
||||
<div className="govuk-body-s">
|
||||
{currentView
|
||||
.caseReference
|
||||
.appealType ==
|
||||
846040011
|
||||
? t(
|
||||
"myrepresentations:local-impact-report"
|
||||
)
|
||||
: t(
|
||||
"myrepresentations:questionnaire-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_questionnaireduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
.appealType == 846040011
|
||||
? t(
|
||||
"myrepresentations:local-impact-report"
|
||||
)
|
||||
: t(
|
||||
"myrepresentations:questionnaire-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_questionnaireduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:statements-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
{currentView.caseReference
|
||||
.appealType !=
|
||||
846040011 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:statements-due-label"
|
||||
"myrepresentations:final-comments-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
detailsObj.pinswg_finalcommentsduedate
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
{currentView.caseReference
|
||||
.appealType !=
|
||||
846040011 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:final-comments-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_finalcommentsduedate
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>{" "}
|
||||
{/* {typeof props.props.currentView
|
||||
.representationCapacity !=
|
||||
"undefined" &&
|
||||
props.props.currentView
|
||||
.representationCapacity.length >
|
||||
0 && (
|
||||
<div className="govuk-grid-row">
|
||||
{savingStatus ? (
|
||||
<span className=" progress-save-active">
|
||||
{router.locale ==
|
||||
"cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"}
|
||||
<img
|
||||
className="data-loading-icon"
|
||||
src="/assets/images/loading.gif"
|
||||
alt={
|
||||
router.locale ==
|
||||
"cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"
|
||||
}
|
||||
/>
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props
|
||||
.form[
|
||||
props
|
||||
.form
|
||||
].values ||
|
||||
{};
|
||||
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
valuesObj
|
||||
);
|
||||
|
||||
delete valuesObj[
|
||||
"_pinswg_appellant_value"
|
||||
];
|
||||
|
||||
console.log(
|
||||
"on save:",
|
||||
valuesObj
|
||||
);
|
||||
updateRepresentation(
|
||||
valuesObj,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"common:save-exit-button"
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
ee
|
||||
</div>
|
||||
)} */}
|
||||
<div>
|
||||
{formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"representationType"
|
||||
) &&
|
||||
formObj["representationForm"]
|
||||
.values
|
||||
.representationType ==
|
||||
"Questionnaire" &&
|
||||
whichProgress()}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"representationType"
|
||||
) &&
|
||||
formObj["representationForm"].values
|
||||
.representationType ==
|
||||
"Questionnaire" &&
|
||||
whichProgress()}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
{/* )} */}
|
||||
</>
|
||||
)}
|
||||
</form>
|
||||
@@ -1266,7 +1315,6 @@ const mapStateToProps = (state) => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setRepresentationCapacity: (representationCapacity) => {
|
||||
//dispatch(reset("representationForm"));
|
||||
dispatch(setRepresentationCapacity(representationCapacity));
|
||||
},
|
||||
setRepresentationSubmit: (representationSubmit) => {
|
||||
|
||||
@@ -27,9 +27,10 @@ const RepAgent = (props) => {
|
||||
currentView,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
|
||||
@@ -179,7 +180,7 @@ const RepAgent = (props) => {
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
filenamePrefix={props.formObj}
|
||||
/>
|
||||
</div>
|
||||
{props.currentView.caseReference.hasOwnProperty(
|
||||
|
||||
@@ -30,9 +30,10 @@ const RepAppellant = (props) => {
|
||||
currentView,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
|
||||
@@ -157,7 +158,7 @@ const RepAppellant = (props) => {
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
filenamePrefix={props.formObj}
|
||||
/>
|
||||
</div>
|
||||
{props.currentView.caseReference.hasOwnProperty(
|
||||
|
||||
@@ -966,16 +966,33 @@ export const RenderFileUpload = (field) => {
|
||||
|
||||
let blobList = filelistObj;
|
||||
|
||||
function removeNullObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj !== null);
|
||||
}
|
||||
|
||||
function removeObjectsWithUndefinedKey(arr, key) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj[key] !== undefined);
|
||||
}
|
||||
|
||||
function removeEmptyObjects(arr) {
|
||||
return arr.filter((obj) => Object.keys(obj).length > 0);
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter(
|
||||
(obj) =>
|
||||
obj && typeof obj === "object" && Object.keys(obj).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
blobList = removeEmptyObjects(blobList);
|
||||
blobList = removeObjectsWithUndefinedKey(blobList, "name");
|
||||
blobList = removeNullObjects(blobList);
|
||||
|
||||
let buildAppealFilesArray = [];
|
||||
|
||||
@@ -1079,7 +1096,7 @@ export const RenderFileUpload = (field) => {
|
||||
{field.meta.touched && field.meta.error && (
|
||||
<span className="error">{field.meta.error}</span>
|
||||
)}
|
||||
{blobList && Array.isArray(files) && (
|
||||
{/* {files && Array.isArray(files) && (
|
||||
<ul>
|
||||
{files.map(
|
||||
(file, i) =>
|
||||
@@ -1100,7 +1117,7 @@ export const RenderFileUpload = (field) => {
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
)}
|
||||
)} */}
|
||||
{blobList.map((blob, i) => (
|
||||
<div
|
||||
key={blob.name + "_" + i}
|
||||
@@ -1169,8 +1186,19 @@ export function FileUploadField(props) {
|
||||
setFilesForAppeal={props.setFilesForAppeal}
|
||||
containerID={props.containerID}
|
||||
filenamePrefix={
|
||||
props.filenamePrefix.formObj.representationForm.values
|
||||
.repfile_name
|
||||
props.filenamePrefix.hasOwnProperty("representationForm") &&
|
||||
props.filenamePrefix.representationForm.hasOwnProperty(
|
||||
"values"
|
||||
) &&
|
||||
props.filenamePrefix.representationForm.values.hasOwnProperty(
|
||||
"repfile_name"
|
||||
)
|
||||
? props.filenamePrefix.representationForm.values
|
||||
.repfile_name
|
||||
: props.filenamePrefix.hasOwnProperty("formObj")
|
||||
? props.filenamePrefix.formObj["representationForm"]
|
||||
.values.repfile_name
|
||||
: ""
|
||||
}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -26,11 +26,12 @@ const RepInterestedPartyPerson = (props) => {
|
||||
setRepresentationSubmit,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
} = props;
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
setRepFileName(formObj.representationForm.values);
|
||||
|
||||
@@ -175,7 +176,7 @@ const RepInterestedPartyPerson = (props) => {
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
filenamePrefix={props.formObj}
|
||||
/>
|
||||
</div>
|
||||
{props.currentView.caseReference.hasOwnProperty(
|
||||
|
||||
@@ -19,7 +19,6 @@ import S78_Questionnaire from "./representationQuestionnaires/representationLPAQ
|
||||
|
||||
let RepLPA = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
@@ -38,9 +37,11 @@ let RepLPA = (props) => {
|
||||
setQuestionnaireCount,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
@@ -197,6 +198,13 @@ let RepLPA = (props) => {
|
||||
) &&
|
||||
setRepFileName(props.formObj["representationForm"].values);
|
||||
|
||||
let filesListObj =
|
||||
props.formObj.hasOwnProperty("representationForm") &&
|
||||
props.formObj["representationForm"].hasOwnProperty("values") &&
|
||||
props.formObj["representationForm"].values.hasOwnProperty("filesList")
|
||||
? props.formObj["representationForm"].values.filesList
|
||||
: {};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
@@ -291,6 +299,35 @@ let RepLPA = (props) => {
|
||||
>
|
||||
{" "}
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
{console.log(
|
||||
"--------",
|
||||
props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList
|
||||
: ""
|
||||
)}
|
||||
{/* {props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
) && ( */}
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
@@ -302,17 +339,32 @@ let RepLPA = (props) => {
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.props.props.form[
|
||||
(props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
].values.filesList || []
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty(
|
||||
"values"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
) &&
|
||||
props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList) ||
|
||||
[]
|
||||
}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
filenamePrefix={props.formObj}
|
||||
/>
|
||||
{/* // )} */}
|
||||
</div>
|
||||
</fieldset>
|
||||
</>
|
||||
@@ -434,7 +486,7 @@ let RepLPA = (props) => {
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
wwwww {t("common:continue-button")}
|
||||
</button>
|
||||
{/* {router.query.state != "edit" && (
|
||||
<a
|
||||
@@ -471,8 +523,9 @@ let RepLPA = (props) => {
|
||||
className="govuk-button progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props.form[props.form]
|
||||
.values || {};
|
||||
props.props.props.form[
|
||||
props.form
|
||||
].values || {};
|
||||
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
|
||||
@@ -197,6 +197,7 @@ const TopThree = (props) => {
|
||||
query: {
|
||||
case: showTopThreeArr[key].caseRef,
|
||||
state: "edit",
|
||||
created: showTopThreeArr[key].repfile_name,
|
||||
},
|
||||
}}
|
||||
className="govuk-link--no-underline"
|
||||
|
||||
@@ -24,6 +24,7 @@ const CaseRepresentation = (props) => {
|
||||
caseReference={props.caseReference}
|
||||
currentType={props.currentType}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
searchString={props.searchString}
|
||||
props={props.props}
|
||||
/>
|
||||
|
||||
@@ -58,6 +58,7 @@ const buildId = Date.now().toString();
|
||||
|
||||
module.exports = {
|
||||
//output: "standalone",
|
||||
reactStrictMode: false,
|
||||
env: {
|
||||
BUILD_ID_ENV: buildId,
|
||||
},
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@
|
||||
"@redux-devtools/extension": "^3.3.0",
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"applicationinsights": "^2.9.1",
|
||||
"axios": "^1.6.2",
|
||||
"axios": "^1.7.7",
|
||||
"compression": "^1.7.4",
|
||||
"cookie-cutter": "^0.2.0",
|
||||
"crypto-js": "^4.2.0",
|
||||
@@ -97,4 +97,4 @@
|
||||
"eslint-plugin-jsdoc": "^48.2.3",
|
||||
"prisma": "^5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +109,49 @@ export default async function handler(req, res) {
|
||||
var checkHash = req.query.hash;
|
||||
let reqBodyobj = req.body; //JSON.parse(req.body);
|
||||
|
||||
const cleanFilesList = (blobList) => {
|
||||
let newblobList = blobList.filesList;
|
||||
function removeNullObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj !== null);
|
||||
}
|
||||
|
||||
function removeObjectsWithUndefinedKey(arr, key) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter((obj) => obj[key] !== undefined);
|
||||
}
|
||||
|
||||
function removeEmptyObjects(arr) {
|
||||
if (arr.length === 0) {
|
||||
return arr;
|
||||
}
|
||||
return arr.filter(
|
||||
(obj) =>
|
||||
obj &&
|
||||
typeof obj === "object" &&
|
||||
Object.keys(obj).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
newblobList = removeEmptyObjects(newblobList);
|
||||
newblobList = removeObjectsWithUndefinedKey(newblobList, "name");
|
||||
newblobList = removeNullObjects(newblobList);
|
||||
|
||||
Object.assign(blobList, {
|
||||
"filesList": newblobList,
|
||||
});
|
||||
|
||||
return blobList;
|
||||
};
|
||||
|
||||
reqBodyobj = reqBodyobj.hasOwnProperty("filesList")
|
||||
? cleanFilesList(reqBodyobj)
|
||||
: reqBodyobj;
|
||||
|
||||
console.log(
|
||||
"//////////////////////\nreqBodyobj" +
|
||||
req +
|
||||
|
||||
@@ -5,7 +5,16 @@ import { useEffect } from "react";
|
||||
import { getSession, useSession } from "next-auth/react";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect, useDispatch } from "react-redux";
|
||||
import { getPersonalAccount, getPortalLoginProxy } from "../../actions";
|
||||
import {
|
||||
getPersonalAccount,
|
||||
getPortalLoginProxy,
|
||||
getPortalLogin,
|
||||
getRepsFromBlob,
|
||||
getCase,
|
||||
getPortalModuleDetails,
|
||||
getBasicSearch,
|
||||
} from "../../actions";
|
||||
import { getFormCollectionByID } from "../../components/utils";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
import Footer from "../../components/footer";
|
||||
@@ -16,13 +25,33 @@ import {
|
||||
setContainerID,
|
||||
setLoggedInUserId,
|
||||
} from "../../store/accountDetails/action";
|
||||
import { wrapper } from "../../store/store";
|
||||
import { getSearchDetails } from "../../components/utils";
|
||||
|
||||
import {
|
||||
setCurrentReference,
|
||||
setCurrentView,
|
||||
setRepresentationCapacity,
|
||||
} from "../../store/currentView/action";
|
||||
import {
|
||||
setSearchDetails,
|
||||
setSearchResults,
|
||||
} from "../../store/searchOutput/action";
|
||||
import { setSearch } from "../../store/search/action";
|
||||
|
||||
import NoSessionWarning from "../../components/nosession";
|
||||
import ServiceBanner from "../../components/myportal/servicebanner";
|
||||
import TimeOut from "../../components/timeout";
|
||||
|
||||
import {
|
||||
setMyRepresentations,
|
||||
setMyRepresentationsDetails,
|
||||
setMySubmittedReps,
|
||||
setMySubmittedRepsDetails,
|
||||
} from "../../store/myRepresentations/action";
|
||||
|
||||
const RepresentationF = (props) => {
|
||||
const { footerLinks, pages, accountDetails } = props;
|
||||
const { footerLinks, pages } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -31,34 +60,34 @@ const RepresentationF = (props) => {
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
useEffect(() => {
|
||||
const updateAccountStore = async () => {
|
||||
const thisSession = await getSession();
|
||||
// useEffect(() => {
|
||||
// const updateAccountStore = async () => {
|
||||
// const thisSession = await getSession();
|
||||
|
||||
if (thisSession) {
|
||||
let loggedInUser = await getPortalLoginProxy(
|
||||
thisSession.user.email
|
||||
);
|
||||
dispatch(
|
||||
setAccountDetails(
|
||||
await getPersonalAccount(
|
||||
loggedInUser.value[0].contactid
|
||||
)
|
||||
)
|
||||
);
|
||||
dispatch(setContainerID(thisSession.user.id));
|
||||
dispatch(setLoggedInUserId(loggedInUser.value[0].contactid));
|
||||
//dispatch(setRepresentationSubmit(true));
|
||||
}
|
||||
};
|
||||
updateAccountStore();
|
||||
}, [dispatch]);
|
||||
// if (thisSession) {
|
||||
// let loggedInUser = await getPortalLoginProxy(
|
||||
// thisSession.user.email
|
||||
// );
|
||||
// dispatch(
|
||||
// setAccountDetails(
|
||||
// await getPersonalAccount(
|
||||
// loggedInUser.value[0].contactid
|
||||
// )
|
||||
// )
|
||||
// );
|
||||
// dispatch(setContainerID(thisSession.user.id));
|
||||
// dispatch(setLoggedInUserId(loggedInUser.value[0].contactid));
|
||||
// //dispatch(setRepresentationSubmit(true));
|
||||
// }
|
||||
// };
|
||||
// updateAccountStore();
|
||||
// }, [dispatch]);
|
||||
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
if (status === "loading") {
|
||||
return <NoSessionWarning loading={true} />;
|
||||
}
|
||||
// if (status === "loading") {
|
||||
// return <NoSessionWarning loading={true} />;
|
||||
// }
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -169,60 +198,241 @@ const RepresentationF = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
||||
// (store) => async (ctx) => {
|
||||
// const { query, req, res } = ctx;
|
||||
// console.log("The query", query);
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
console.log("The query", query);
|
||||
|
||||
// const { cookies } = req;
|
||||
const { cookies } = req;
|
||||
|
||||
// let loggedInUserCookie = cookies.pinsUser;
|
||||
let loggedInUserCookie = cookies.pinsUser;
|
||||
|
||||
// let thisSession = await getSession(ctx);
|
||||
// let loggedInUser = {};
|
||||
let thisSession = await getSession(ctx);
|
||||
let loggedInUser = {};
|
||||
|
||||
// if (!thisSession) {
|
||||
// console.log("not has sesssion.......");
|
||||
// return {
|
||||
// redirect: {
|
||||
// destination: "/auth/signin",
|
||||
// permanent: false,
|
||||
// },
|
||||
// };
|
||||
// } else {
|
||||
// [loggedInUser] = await Promise.all([
|
||||
// await getPortalLogin(thisSession.user.email),
|
||||
// ]);
|
||||
if (!thisSession) {
|
||||
console.log("not has sesssion.......");
|
||||
return {
|
||||
redirect: {
|
||||
destination: "/auth/signin",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
[loggedInUser] = await Promise.all([
|
||||
await getPortalLogin(thisSession.user.email),
|
||||
]);
|
||||
|
||||
// console.log(
|
||||
// "=====//////////=====",
|
||||
// thisSession,
|
||||
// thisSession.user.email,
|
||||
// loggedInUser
|
||||
// );
|
||||
// loggedInUser = loggedInUser.value[0].contactid;
|
||||
// }
|
||||
console.log(
|
||||
"=====//////////=====",
|
||||
thisSession,
|
||||
thisSession.user.email,
|
||||
loggedInUser
|
||||
);
|
||||
loggedInUser = loggedInUser.value[0].contactid;
|
||||
}
|
||||
|
||||
// const accountDetails = await getPersonalAccount(loggedInUser);
|
||||
const [accountDetails, myRepresentations] = await Promise.all([
|
||||
await getPersonalAccount(loggedInUser),
|
||||
await getRepsFromBlob(thisSession.user.id),
|
||||
]);
|
||||
|
||||
// console.log(accountDetails);
|
||||
// store.dispatch(setAccountDetails(accountDetails));
|
||||
// return {
|
||||
// props: {
|
||||
// containerID: thisSession.user.id,
|
||||
// },
|
||||
// };
|
||||
// }
|
||||
// );
|
||||
const myRepresentationsDetails = await getDetails(
|
||||
myRepresentations,
|
||||
"myRepresentations"
|
||||
);
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setAccountDetails: (loggedInUser) => {
|
||||
dispatch(setAccountDetails(loggedInUser));
|
||||
},
|
||||
};
|
||||
console.log(accountDetails);
|
||||
|
||||
const isLPA =
|
||||
accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
] == "LPA"
|
||||
? true
|
||||
: false;
|
||||
|
||||
isLPA && store.dispatch(setRepresentationCapacity("lpa"));
|
||||
|
||||
if (query.hasOwnProperty("state")) {
|
||||
console.log("is lpa?:", isLPA);
|
||||
|
||||
store.dispatch(setContainerID(thisSession.user.id));
|
||||
store.dispatch(setMyRepresentations(myRepresentations));
|
||||
store.dispatch(
|
||||
setMyRepresentationsDetails(myRepresentationsDetails)
|
||||
);
|
||||
|
||||
function findObjectByKeyValue(arr, key, value) {
|
||||
return arr.find((obj) => obj[key] === value);
|
||||
}
|
||||
|
||||
const result = findObjectByKeyValue(
|
||||
myRepresentations.value,
|
||||
"repfile_name",
|
||||
query.created
|
||||
);
|
||||
|
||||
store.dispatch(
|
||||
setCurrentReference({
|
||||
"ticketnumber": result.ticketnumber,
|
||||
"currentReference": result.caseRef,
|
||||
"currentType": "myRepresentations",
|
||||
"incidentid": result.incidentID,
|
||||
"appealType": result.appealType,
|
||||
"repDetails": result,
|
||||
})
|
||||
);
|
||||
store.dispatch(setAccountDetails(accountDetails));
|
||||
|
||||
return {
|
||||
props: {
|
||||
containerID: thisSession.user.id,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
const searchResultsObj = await getBasicSearch(query.case);
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
|
||||
store.dispatch(setContainerID(thisSession.user.id));
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.case));
|
||||
store.dispatch(
|
||||
setCurrentView({
|
||||
"viewName": "My Representations",
|
||||
"viewKey": "myRepresentations",
|
||||
})
|
||||
);
|
||||
store.dispatch(
|
||||
setCurrentReference({
|
||||
"ticketnumber": searchResultsObj.value[0].ticketnumber,
|
||||
"currentReference": searchResultsObj.value[0].title,
|
||||
"currentType": "myRepresentations",
|
||||
"incidentid": searchResultsObj.value[0].incidentid,
|
||||
"appealType":
|
||||
searchResultsObj.value[0].pinswg_appealcasetype,
|
||||
|
||||
"specialistProcess":
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_speacialistcaseprocess != null ||
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_specialistcaseprocess != null
|
||||
? searchDetailsObj[0].value[0]
|
||||
.pinswg_speacialistcaseprocess ||
|
||||
searchDetailsObj[0].value[0]
|
||||
.pinswg_specialistcaseprocess
|
||||
: "",
|
||||
})
|
||||
);
|
||||
store.dispatch(setAccountDetails(accountDetails));
|
||||
|
||||
// return {
|
||||
// props: {
|
||||
// searchResultsObj: {
|
||||
// searchResultsObj: searchResultsObj,
|
||||
// searchDetailsObj: searchDetailsObj,
|
||||
// },
|
||||
// containerID: thisSession.user.id,
|
||||
// },
|
||||
// };
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const getDetails = (resultsObj, detailsType) => {
|
||||
let detailsArr = [];
|
||||
|
||||
resultsObj =
|
||||
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
|
||||
|
||||
if (detailsType == "myRepresentations") {
|
||||
const repsObj = resultsObj.map((searchDetail, index) => {
|
||||
detailsArr.push(
|
||||
getCase(searchDetail["incidentID"]).then((data) => {
|
||||
let caseID = "";
|
||||
|
||||
switch (detailsType) {
|
||||
case "myCases":
|
||||
caseID = data.pinswg_title;
|
||||
break;
|
||||
case "myWatchedCases":
|
||||
case "mySubmittedReps":
|
||||
caseID =
|
||||
data[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
];
|
||||
break;
|
||||
case "awaitingSubmission":
|
||||
case "myRepresentations":
|
||||
caseID = data.ticketnumber;
|
||||
break;
|
||||
default:
|
||||
caseID = data.pinswg_title;
|
||||
}
|
||||
return getPortalModuleDetails(
|
||||
getFormCollectionByID(data.pinswg_appealcasetype)
|
||||
.LogicalCollectionName,
|
||||
caseID
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// const detailsObj = resultsObj.map(async (searchDetail, index) => {
|
||||
// let caseID = "";
|
||||
|
||||
// switch (detailsType) {
|
||||
// case "myCases":
|
||||
// caseID = searchDetail.pinswg_title;
|
||||
// break;
|
||||
// case "myWatchedCases":
|
||||
// case "mySubmittedReps":
|
||||
// caseID =
|
||||
// searchDetail[
|
||||
// "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
// ];
|
||||
// break;
|
||||
// case "awaitingSubmission":
|
||||
// caseID = searchDetail.ticketnumber;
|
||||
// break;
|
||||
// case "myRepresentations":
|
||||
// caseID = searchDetail.casereference;
|
||||
// break;
|
||||
// default:
|
||||
// caseID = searchDetail.pinswg_title;
|
||||
// }
|
||||
|
||||
// console.log(detailsType, " case id : ", caseID);
|
||||
|
||||
// searchDetail.pinswg_appealcasetype != null &&
|
||||
// detailsArr.push(
|
||||
// getPortalModuleDetails(
|
||||
// getFormCollectionByID(searchDetail.pinswg_appealcasetype)
|
||||
// .LogicalCollectionName,
|
||||
// caseID
|
||||
// // detailsType != "myWatchedCases"
|
||||
// // ? searchDetail.ticketnumber
|
||||
// // : searchDetail[
|
||||
// // "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
// // ]
|
||||
// )
|
||||
// );
|
||||
// });
|
||||
|
||||
let detArr = Promise.all(detailsArr);
|
||||
console.log(detArr);
|
||||
return detArr;
|
||||
};
|
||||
|
||||
// const mapDispatchToProps = (dispatch) => {
|
||||
// return {
|
||||
// setAccountDetails: (loggedInUser) => {
|
||||
// dispatch(setAccountDetails(loggedInUser));
|
||||
// },
|
||||
// };
|
||||
// };
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
accountDetails: state.accountDetails,
|
||||
@@ -239,4 +449,4 @@ const mapStateToProps = (state) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(RepresentationF);
|
||||
export default connect(mapStateToProps)(RepresentationF);
|
||||
|
||||
Reference in New Issue
Block a user