my cases portal module by loggedin user

This commit is contained in:
robert.bond@test.gov.wales
2021-09-17 16:37:06 +01:00
parent 219e6a4744
commit c96a72f124
26 changed files with 673 additions and 107 deletions
+26 -2
View File
@@ -7,6 +7,8 @@ import BuildRow from "./buildrow";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath";
import data from "../../data/collections.json";
import {
setAppealType,
setAppealTypeTitle,
@@ -174,7 +176,7 @@ let CreateCase = (props) => {
"," +
optionsObj[key].value
.replace(
/[\s\-\+\(\)\,]/g,
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
@@ -201,11 +203,33 @@ let CreateCase = (props) => {
const required = (value) => (value ? undefined : "Required");
const getFormCollection = (formtype) => {
formtype =
"pinswg_" +
(formtype.length > 39 ? formtype.slice(0, 39) : formtype);
const collectionName = jsonpath.query(
data,
"$..[?(@.LogicalName=='" + formtype + "')].UrlName"
);
//console.log(collectionName[0]);
return collectionName[0];
};
const onHandleSubmit = (values) => {
event.preventDefault();
var appTypeCollection = values.appealTypes.split(",")[1];
appTypeCollection = getFormCollection(
appTypeCollection.length > 39
? appTypeCollection.slice(0, 39)
: appTypeCollection
);
router.replace(
"/newappeal/" +
values.appealTypes.split(",")[1] +
appTypeCollection +
"?lpa=" +
values.lpaTypes +
"&apt=" +