cleaned up rep functionality

This commit is contained in:
2024-01-24 14:19:36 +00:00
parent a650452d18
commit b7a643a6b1
15 changed files with 57 additions and 235 deletions
+4 -20
View File
@@ -165,12 +165,6 @@ let MakeRepresentation = (props) => {
};
const whichControl = () => {
// console.log(isLPA);
// console.log(
// currentView.representationCapacity,
// _.isEmpty(currentView.representationCapacity)
// );
if (isLPA && _.isEmpty(currentView.representationCapacity)) {
return (
<RepLPACapacitySelection
@@ -334,7 +328,6 @@ let MakeRepresentation = (props) => {
const whichProgress = () => {
{
console.log("curr");
switch (currentView.caseReference.appealType) {
case 846040000:
case 846040001:
@@ -456,10 +449,6 @@ let MakeRepresentation = (props) => {
}
});
//console.log(updateBody);
//window.alert(`form is :\n\n${JSON.stringify(updateBody, null, 2)}`);
const reference = "PEDW-PARTIAL-REP";
const templateId = "021b0a7b-df00-41f1-b94e-c269bee98c75";
const emailAddress = props.props.accountDetails.loggedinUserEmail;
@@ -568,7 +557,6 @@ let MakeRepresentation = (props) => {
: values.representationCapacity,
"locale": locale,
}));
console.log(values);
currentView.representationSubmit != true
? _.isEmpty(currentView.representationCapacity)
? isLPA
@@ -610,11 +598,12 @@ let MakeRepresentation = (props) => {
return _.includes(key, "representationDocuments");
});
console.log(fileListObj);
console.log(
"\n////////////////////////\n upload files:",
values.containerID
values.containerID,
"\n////////////////////////\n fileListObj:",
fileListObj,
"\n////////////////////////\n"
);
var dataObj = values;
@@ -630,8 +619,6 @@ let MakeRepresentation = (props) => {
values.containerID,
props.caseReference + "/" + dataObj.repfile_name
).then((data) => {
//console.log("hello", data);
return data;
});
};
@@ -640,7 +627,6 @@ let MakeRepresentation = (props) => {
try {
let value = props.initialValues;
//console.log("has props"), value;
setRepresentationCapacity(
props.initialValues.representationCapacity.toLowerCase()
);
@@ -1192,8 +1178,6 @@ let MakeRepresentation = (props) => {
};
const mapStateToProps = (state) => {
//console.log("\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \n in map state", state);
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
@@ -41,8 +41,6 @@ const RepAppellant = (props) => {
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
// console.log(props);
return (
<>
<div className="govuk-grid-row">
@@ -41,7 +41,6 @@ const RepCompleteSubmit = (props) => {
const whichQuestionnaireCheck = () => {
{
console.log("curr");
switch (currentView.caseReference.appealType) {
case 846040000:
return (
@@ -36,8 +36,6 @@ const RepDetails = (props) => {
detailsObj = detailsObj[0];
console.log("-----detailsObj:", detailsObj);
return (
<>
{" "}
@@ -980,7 +980,6 @@ export const RenderFileUpload = (field) => {
getblobshash,
casefolderID
) => {
//console.log(containerName, blobName, deleteblobhash);
deleteBlob(containerName, blobName, deleteblobhash, casefolderID)
.then((data) => data)
.then(() => {
@@ -55,7 +55,6 @@ let RepLPA = (props) => {
const whichQuestionnaire = () => {
{
console.log("curr");
switch (currentView.caseReference.appealType) {
case 846040000:
case 846040001:
@@ -107,7 +106,6 @@ let RepLPA = (props) => {
const whichProgress = () => {
{
console.log("curr");
switch (currentView.caseReference.appealType) {
case 846040000:
case 846040001:
@@ -190,8 +188,6 @@ let RepLPA = (props) => {
);
resultsObj = resultsObj[0];
//console.log(resultsObj, detailsObj);
return (
<>
<div className="govuk-grid-row">
@@ -57,7 +57,6 @@ RepLPAQuestionnaire = connect((state) => {
})(RepLPAQuestionnaire);
const mapStateToProps = (state, props) => {
console.log();
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
@@ -1192,7 +1192,6 @@ Enforcement_Questionnaire = connect((state) => {
})(Enforcement_Questionnaire);
const mapStateToProps = (state, props) => {
console.log();
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
-45
View File
@@ -30,10 +30,6 @@ import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
export const AppealRow_pdf = (props) => {
let { t } = useTranslation();
// const router = useRouter();
// console.log(router);
// const { locale } = router;
const {
formXML,
whichSection,
@@ -131,8 +127,6 @@ export const AppealRow_pdf = (props) => {
doc
);
//console.log(rowXML);
function formatDate(dateObj) {
var m = new Date(dateObj);
var dateString;
@@ -149,20 +143,10 @@ export const AppealRow_pdf = (props) => {
}
const FieldsTranslations = (label) => {
// const router = useRouter();
// const { locale } = router;
const { appealtypes } = router.query;
let formObj = jsonpath.query(fieldLookup, "$['" + appealtypes + "']");
// let labelTrans =
// router.locale == "cy"
// ? jsonpath.query(
// formObj,
// "$..[?(@.value=='" + label + "')].value_cy"
// )
// : label;
let labelTrans = label;
return labelTrans;
};
@@ -173,9 +157,7 @@ export const AppealRow_pdf = (props) => {
var newRowXML = new XMLSerializer().serializeToString(
rowXML[key]
);
//console.log(newRowXML);
var doc = parser.parseFromString(newRowXML, "text/xml");
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
@@ -190,7 +172,6 @@ export const AppealRow_pdf = (props) => {
"//@ishareDocumentCode",
doc
);
console.log(datafieldname[0].value);
return (
<>
@@ -460,32 +441,6 @@ export const AppealRow_pdf = (props) => {
break;
}
})()}
{/* <Text className="govuk-summary-list__value">
{fieldtype[0].value ==
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}"
? formatDate(
props.props.values[datafieldname[0].value]
)
: fieldtype[0].value ==
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}"
? getPickListLabel(
props.props.formData.pickListData,
datafieldname[0].value,
props.props.values[datafieldname[0].value]
)
: fieldtype[0].value ==
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}"
? getRadioLabel(
props.props.formData.pickListData,
datafieldname[0].value,
props.props.values[datafieldname[0].value]
)
: fieldtype[0].value ==
"{16D63FD6-119B-4353-BDCA-18358721C3FE}"
? "ssss"
: props.props.values[datafieldname[0].value]}
</Text> */}
</>
);
})}
@@ -143,7 +143,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
doc
);
console.log("\n//////////\n The Case:\n", docProps.caseObj);
//console.log("\n//////////\n The Case:\n", docProps.caseObj);
return (
<Document>
@@ -514,7 +514,6 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
</Text>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
@@ -542,60 +541,6 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
</View>
</View>
))}
{/* <View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>
Supporting documents
</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
List of attached files
</Text>
</View>
<View
style={{
color: "#757575",
width: "100%",
fontSize: 12,
border: 1,
borderColor: "#eee",
backgroundColor: "white",
padding: 5,
marginBottom: 10,
lineHeight: 1.2,
}}
>
{values.hasOwnProperty("filesList") &&
values.filesList.map((key) => (
<Text style={{ marginBottom: 10 }}>
{key.name} -{" "}
{bytesToSize(key.contentLength)}
</Text>
))}
</View>
</View>
</View>
</View> */}
</View>
<Text
style={styles.pageNumber}