decopled crm for new appeals - all made on storage

This commit is contained in:
2022-09-28 10:13:36 +01:00
parent bfcd0329c6
commit 745b51839a
15 changed files with 451 additions and 99 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ const MyPortal = (props) => {
<div className="flex-container grid-row govuk-body ">
<MakeNewAppeal />
<SearchCases />
{props.awaitingSubmission.awaitingSubmission[
{/* {props.awaitingSubmission.awaitingSubmission[
"@odata.count"
] > 0 && (
<AwaitingSubmission
@@ -102,7 +102,7 @@ const MyPortal = (props) => {
props.awaitingSubmission
}
/>
)}
)} */}
{props.awaitingSubmission
.awaitingSubmissionFromBlob["@odata.count"] >
0 && (
@@ -3,7 +3,12 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
import {
setCurrentView,
setCurrentReference,
} from "../../store/currentView/action";
import jsonpath from "jsonpath";
import transLookup from "../../data/lookuptranslations.json";
import {
deleteAwaitingSubmissionsFromBlob,
getAwaitingSubmissionFromBlobProxy,
@@ -21,6 +26,7 @@ const AwaitingSubmissionFromBlob = (props) => {
let topthreeRow = [];
let showTopThreeArr = props.awaitingSubmissionFromBlob.value;
let showTopThreeArrDets = props.awaitingSubmissionFromBlob.case;
const deleteCaseItem = (containerID, caseID) => {
let cookies = parseCookies();
@@ -40,6 +46,13 @@ const AwaitingSubmissionFromBlob = (props) => {
let topThreeOnlyArr = showTopThreeArr;
console.log(showTopThreeArr);
Object.keys(topThreeOnlyArr).map((key, index) => {
console.log(key, showTopThreeArr[key].pinswg_appealcasetype);
console.log("subsssss:", showTopThreeArr[key]);
let urlname = getFormCollectionByID(
showTopThreeArr[key].pinswg_appealcasetype
).UrlName;
topthreeRow.push(
<div className="cardModuleItem" key={index}>
<div className="cardModuleDetails">
@@ -52,10 +65,7 @@ const AwaitingSubmissionFromBlob = (props) => {
? "/fymhorth/parhauigyflwyno"
: "/myportal" +
"/" +
getFormCollectionByID(
showTopThreeArr[key]
.pinswg_appealcasetype
).UrlName +
urlname +
"?lpa=" +
showTopThreeArr[key][
"_pinswg_associatedlpa_value"
@@ -73,25 +83,14 @@ const AwaitingSubmissionFromBlob = (props) => {
className="govuk-link--no-underline"
data-id={index}
onClick={() => {
setCurrentReference({
props.setCurrentReference({
"currentReference":
topThreeType != "watchedCases"
? topThreeType !=
"myRepresentations"
? showTopThreeArr[key]
.ticketnumber
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
"currentType": topThreeType,
showTopThreeArr[key].ticketnumber,
"incidentid": getIncidentId(
topThreeType,
showTopThreeArr[key]
),
"currentType": "awaitingSubmission",
"incidentid":
showTopThreeArr[key].incidentid,
"appealType":
showTopThreeArr[key]
@@ -103,6 +102,14 @@ const AwaitingSubmissionFromBlob = (props) => {
</a>
</Link>
</div>
<div>
<b>Appeal type:</b>{" "}
{
getFormCollectionByID(
showTopThreeArr[key].pinswg_appealcasetype
).value
}
</div>
<div className="carModuleAddress">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showTopThreeArr)
@@ -131,6 +138,42 @@ const AwaitingSubmissionFromBlob = (props) => {
.pinswg_siteaddresstown
: "")}
</div>
{showTopThreeArrDets[key].pinswg_appellantagent != null && (
<div>
{showTopThreeArrDets[key].pinswg_appellantagent !=
846040000 && <b>Raised by: </b>}
{showTopThreeArrDets[key].pinswg_appellantagent !=
846040000 &&
(showTopThreeArrDets[key]
.pinswg_agentcompanyname != null &&
showTopThreeArrDets[key]
.pinswg_agentcompanyname + ", ") +
showTopThreeArrDets[key]
.pinswg_agentfirstname +
" " +
showTopThreeArrDets[key]
.pinswg_agentlastname}
</div>
)}
{showTopThreeArrDets[key].pinswg_appellantfirstname !=
null && (
<div>
<b>On behalf of: </b>
{showTopThreeArrDets[key]
.pinswg_appellantfirstname +
" " +
showTopThreeArrDets[key]
.pinswg_appellantlastname}
</div>
)}
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
showTopThreeArrDets[key]["pinswg_lpaname"] +
'")].value_cy'
)
: showTopThreeArrDets[key]["pinswg_lpaname"] || ""}
</div>
<div className="">
<a
@@ -196,6 +239,9 @@ const mapDispatchToProps = (dispatch) => {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
},
setCurrentReference: (currentReference) => {
dispatch(setCurrentReference(currentReference));
},
setAwaitingSubmissionFromBlob: (awaitingSubmission) => {
dispatch(setAwaitingSubmissionFromBlob(awaitingSubmission));
},
+7 -7
View File
@@ -177,13 +177,13 @@ let BuildSection = (props) => {
let updateFormCollection = appTypeCollection.LogicalCollectionName;
let primaryAttribute = appTypeCollection.PrimaryIdAttribute;
updateCase(
incidentId,
updateBody,
updateFormCollection,
primaryAttribute,
props.appealType.caseReference.ticketnumber
);
// updateCase(
// incidentId,
// updateBody,
// updateFormCollection,
// primaryAttribute,
// props.appealType.caseReference.ticketnumber
// );
sendSavedEmail == true &&
sendEmail(
+14 -6
View File
@@ -14,7 +14,7 @@ import {
import { getFormCollectionByID } from "../utils";
import FileUpload from "./fileupload";
import Aboutyou from "./aboutyou";
import { createNewCase, consoleLogger } from "../../actions";
import { createNewCase, createNewCaseBlob, consoleLogger } from "../../actions";
import { FieldsTranslations } from "../elements";
let CreateCase = (props) => {
@@ -448,14 +448,22 @@ let CreateCase = (props) => {
delete values.confirmHASCAS;
console.log(appTypeCollection);
createNewCase(
// createNewCase(
// appTypeCollection.appealTypeID,
// values.lpaTypes,
// props.loggedInUser,
// values,
// props.containerID
// )
createNewCaseBlob(
appTypeCollection.appealTypeID,
values.lpaTypes,
props.loggedInUser,
values,
props.containerID
props.containerID,
props1.LPAData.LPAData.value.filter((obj) => {
return obj.accountid === values.lpaTypes;
})[0].name
)
.then((data) => {
router.replace(
@@ -467,7 +475,7 @@ let CreateCase = (props) => {
"&apt=" +
whichAppealType +
"&id=" +
data.incidentid
data.ticketnumber
);
return data;
})
+16
View File
@@ -1,4 +1,5 @@
import jsonpath from "jsonpath";
import { v4 as uuidv4 } from "uuid";
import data from "../../data/collections.json";
import {
getBasicSearchDetails,
@@ -341,3 +342,18 @@ export const getProgressObj = (
//console.log(progObj);
return progObj;
};
export const getTempCaseRef = () => {
function randomString(length) {
return Math.random().toString(36).substr(2, length);
}
const randomGUID = uuidv4();
return (
"TMP-" +
randomString(5).toUpperCase() +
"-" +
randomString(6).toUpperCase()
);
};