updated cookie login and watched cases
This commit is contained in:
@@ -8,6 +8,7 @@ import { reduxForm, formValueSelector, Field } from "redux-form";
|
||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||
import jsonpath from "jsonpath";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import { getFormCollectionByID } from "../utils";
|
||||
|
||||
import data from "../../data/collections.json";
|
||||
import {
|
||||
@@ -181,14 +182,7 @@ let CreateCase = (props) => {
|
||||
)
|
||||
? ""
|
||||
: optionsObj[key]
|
||||
.attributevalue +
|
||||
"," +
|
||||
optionsObj[key].value
|
||||
.replace(
|
||||
/(\band|[\s\-\+\(\)\,\&])/g,
|
||||
""
|
||||
)
|
||||
.toLowerCase()
|
||||
.attributevalue
|
||||
}
|
||||
>
|
||||
{_.isEmpty(optionsObj[key])
|
||||
@@ -220,34 +214,17 @@ 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];
|
||||
var appTypeCollection = values.appealTypes;
|
||||
|
||||
appTypeCollection = getFormCollection(
|
||||
appTypeCollection.length > 39
|
||||
? appTypeCollection.slice(0, 39)
|
||||
: appTypeCollection
|
||||
);
|
||||
appTypeCollection = getFormCollectionByID(appTypeCollection);
|
||||
|
||||
router.replace(
|
||||
(router.locale = "cy" ? "/apelnewydd" : "/newappeal") +
|
||||
"/" +
|
||||
appTypeCollection +
|
||||
appTypeCollection.UrlName +
|
||||
"?lpa=" +
|
||||
values.lpaTypes +
|
||||
"&apt=" +
|
||||
|
||||
Reference in New Issue
Block a user