lpa rep pdf tweaks

This commit is contained in:
2024-05-09 18:40:51 +01:00
parent b57d73dec3
commit 815a8ec818
10 changed files with 139 additions and 105 deletions
+36 -55
View File
@@ -96,7 +96,6 @@ const styles = StyleSheet.create({
richArea: {
fontSize: 12,
color: "red",
flexDirection: "column",
},
});
@@ -113,7 +112,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
return dd + "/" + mm + "/" + yyyy;
}
let values = docProps;
console.log("//////////////////////\n docprops:".docProps);
console.log("//////////////////////\n docprops:", docProps);
let appealTypeValue = getFormCollectionByID(values.appealType);
console.log("sdffhjdhjdjdgkj: ", values.procedureType);
@@ -156,7 +155,6 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
alt="PEDW Logo"
/>
</View>
<View>
<Text style={{ marginTop: 10, fontSize: 14 }}>
{getTrans(docProps.locale, "s78-heading-para-two")}
@@ -388,9 +386,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.enterNeighbouringLandAccessRequiredEvidence
}
{values.enterNeighbouringLandAccessRequiredEvidence ||
""}
</Html>
</View>
)}
@@ -423,9 +420,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.healthAndSafetyIssues == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.healthAndSafetyIssuesEvidence
}
{values.healthAndSafetyIssuesEvidence ||
""}
</Html>
</View>
)}
@@ -461,6 +457,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
</View>
</View>
<View>
<View
style={{
@@ -617,7 +614,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.ROW == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.ROWEvidence}
{values.ROWEvidence || ""}
</Html>
</View>
)}
@@ -650,7 +647,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.conservationArea == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.conservationAreaEvidence}
{values.conservationAreaEvidence ||
""}
</Html>
</View>
)}
@@ -683,9 +681,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.affectListedBuilding == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.affectListedBuildingEvidence
}
{values.affectListedBuildingEvidence ||
""}
</Html>
</View>
)}
@@ -718,7 +715,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.TPO == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.TPOEvidence}
{values.TPOEvidence || ""}
</Html>
</View>
)}
@@ -751,9 +748,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.natureConservationSite == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.natureConservationSiteEvidence
}
{values.natureConservationSiteEvidence ||
""}
</Html>
</View>
)}
@@ -786,7 +782,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.protectedSpecies == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.protectedSpeciesEvidence}
{values.protectedSpeciesEvidence ||
""}
</Html>
</View>
)}
@@ -838,9 +835,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.governmentDepartmentCommentsEvidence
}
{values.governmentDepartmentCommentsEvidence ||
""}
</Html>
</View>
)}
@@ -928,9 +924,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.developmentCarriedOutInAccordanceEvidence
}
{values.developmentCarriedOutInAccordanceEvidence ||
""}
</Html>
</View>
)}
@@ -1000,9 +995,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.developmentAnyOtherConditionsEvidence
}
{values.developmentAnyOtherConditionsEvidence ||
""}
</Html>
</View>
)}
@@ -1051,13 +1045,11 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.copyOfApplicantsCertificateEvidence
}
{values.copyOfApplicantsCertificateEvidence ||
""}
</Html>
</View>
</View>
<View
style={{
flexDirection: "column",
@@ -1086,11 +1078,10 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.advertismentGivenEvidence}
{values.advertismentGivenEvidence || ""}
</Html>
</View>
</View>
<View
style={{
flexDirection: "column",
@@ -1120,13 +1111,11 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.copyOfLetterOfAppealNotificationEvidence
}
{values.copyOfLetterOfAppealNotificationEvidence ||
""}
</Html>
</View>
</View>
<View
style={{
flexDirection: "column",
@@ -1155,12 +1144,11 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.lpaEIAOS == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.lpaEIAOSEvidence}
{values.lpaEIAOSEvidence || ""}
</Html>
</View>
)}
</View>
<View
style={{
flexDirection: "column",
@@ -1192,14 +1180,12 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.advertismentConsentDiscontinuanceNoticeEvidence
}
{values.advertismentConsentDiscontinuanceNoticeEvidence ||
""}
</Html>
</View>
)}
</View>
<View
style={{
flexDirection: "column",
@@ -1228,14 +1214,12 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.detailsOfOtherAppeals == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.detailsOfOtherAppealsEvidence
}
{values.detailsOfOtherAppealsEvidence ||
""}
</Html>
</View>
)}
</View>
<View
style={{
flexDirection: "column",
@@ -1264,14 +1248,12 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.detailsOfPreviousAppeals == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.detailsOfPreviousAppealsEvidence
}
{values.detailsOfPreviousAppealsEvidence ||
""}
</Html>
</View>
)}
</View>
<View
style={{
flexDirection: "column",
@@ -1300,9 +1282,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.otherRelevantInformation == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{
values.otherRelevantInformationEvidence
}
{values.otherRelevantInformationEvidence ||
""}
</Html>
</View>
)}
@@ -8,7 +8,6 @@ import ReactPDF, {
PDFViewer,
Font,
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import { getFormCollectionByID, bytesToSize } from "../utils";
import fs from "fs";