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
-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}