uat defect 130, reps 14

This commit is contained in:
2025-01-11 08:13:18 +00:00
parent adaae7b9b0
commit c627e100e1
8 changed files with 288 additions and 120 deletions
+49 -16
View File
@@ -8,7 +8,7 @@ import {
} from "../../components/utils";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import { StyleSheet, Text, View } from "@react-pdf/renderer";
import { StyleSheet, Text, View, Font } from "@react-pdf/renderer";
import Html from "react-pdf-html";
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
@@ -153,6 +153,16 @@ export const AppealRow_pdf = (props) => {
let labelTrans = label;
return labelTrans;
};
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<>
@@ -187,6 +197,7 @@ export const AppealRow_pdf = (props) => {
flexDirection: "row",
marginBottom: 10,
}}
wrap={false}
>
<Text
style={styles.questionTextWide}
@@ -214,6 +225,7 @@ export const AppealRow_pdf = (props) => {
flexDirection: "column",
marginBottom: 10,
}}
wrap={false}
>
<View
wrap={false}
@@ -282,6 +294,7 @@ export const AppealRow_pdf = (props) => {
flexDirection: "column",
marginBottom: 10,
}}
wrap={false}
>
<View
wrap={false}
@@ -337,9 +350,12 @@ export const AppealRow_pdf = (props) => {
}
>
<Html style={styles.richArea}>
{props.props[
datafieldname[0].value
] || ""}
{CleanHTML(
props.props[
datafieldname[0]
.value
]
)}
</Html>
</View>
</View>
@@ -385,6 +401,7 @@ export const AppealRow_pdf = (props) => {
flexDirection: "column",
marginBottom: 10,
}}
wrap={false}
>
<View
wrap={false}
@@ -438,6 +455,7 @@ export const AppealRow_pdf = (props) => {
flexDirection: "column",
marginBottom: 10,
}}
wrap={false}
>
<View
wrap={false}
@@ -522,22 +540,37 @@ export const AppealRow_pdf = (props) => {
case "{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
return (
<View
wrap={true}
style={{
flexDirection: "row",
flexDirection: "column",
marginBottom: 10,
}}
wrap={false}
>
<Text style={styles.questionText}>
{rows[0].value}
</Text>
<Text style={styles.questionAnswer}>
{props.props[
datafieldname[0].value
] == "true"
? "Yes"
: "No"}
</Text>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={styles.questionText}
wrap={false}
>
{rows[0].value}
</Text>
<Text
style={
styles.questionAnswer
}
>
{props.props[
datafieldname[0].value
] == "true"
? "Yes"
: "No"}
</Text>
</View>
</View>
);
break;
+94 -51
View File
@@ -5,6 +5,7 @@ import {
StyleSheet,
Text,
View,
Font,
} from "@react-pdf/renderer";
import Html from "react-pdf-html";
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
@@ -98,6 +99,17 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
//console.log("//////////////////////\n docpropseeeee:".docProps);
//console.log("sdffhjdhjdjdgkj: ", values.procedureType);
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -243,7 +255,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
"Written representations" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.procedureTypeEvidence || ""}
{CleanHTML(
values.procedureTypeEvidence
)}
</Html>
</View>
)}
@@ -294,8 +308,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={{ fontSize: 12 }}>
{values.enterNeighbouringLandToViewSiteEvidence ||
""}
{CleanHTML(
values.enterNeighbouringLandToViewSiteEvidence
)}
</Html>
</View>
)}
@@ -333,8 +348,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.enterNeighbouringLandAccessRequiredEvidence ||
""}
{CleanHTML(
values.enterNeighbouringLandAccessRequiredEvidence
)}
</Html>
</View>
)}
@@ -366,8 +382,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.healthAndSafetyIssues == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.healthAndSafetyIssuesEvidence ||
""}
{CleanHTML(
values.healthAndSafetyIssuesEvidence
)}
</Html>
</View>
)}
@@ -395,7 +412,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.LPAcontactDetails || ""}
{CleanHTML(values.LPAcontactDetails)}
</Html>
</View>
</View>
@@ -468,7 +485,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.feeExempt == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.feeExemptEvidence || ""}
{CleanHTML(
values.feeExemptEvidence
)}
</Html>
</View>
)}
@@ -509,8 +528,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.previousGrantedCerts == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.previousGrantedCertsEvidence ||
""}
{CleanHTML(
values.previousGrantedCertsEvidence
)}
</Html>
</View>
)}
@@ -533,7 +553,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.stopNoticeServed == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.stopNoticeServedEvidence || ""}
{CleanHTML(
values.stopNoticeServedEvidence
)}
</Html>
</View>
)}
@@ -558,7 +580,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.relatedCases == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.relatedCasesEvidence || ""}
{CleanHTML(values.relatedCasesEvidence)}
</Html>
</View>
)}
@@ -581,8 +603,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.previousEnforcement == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.previousEnforcementEvidence ||
""}
{CleanHTML(
values.previousEnforcementEvidence
)}
</Html>
</View>
)}
@@ -605,7 +628,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.subjectArticle4 == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.subjectArticle4Evidence || ""}
{CleanHTML(
values.subjectArticle4Evidence
)}
</Html>
</View>
)}
@@ -629,8 +654,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.previousPDRRestriction == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.previousPDRRestrictionEvidence ||
""}
{CleanHTML(
values.previousPDRRestrictionEvidence
)}
</Html>
</View>
)}
@@ -663,7 +689,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAldpAndMap || ""}
{CleanHTML(values.LPAldpAndMap)}
</Html>
</View>
</View>
@@ -681,7 +707,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAlocalGuidance || ""}
{CleanHTML(values.LPAlocalGuidance)}
</Html>
</View>
</View>
@@ -757,7 +783,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.ROW == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.ROWEvidence || ""}
{CleanHTML(values.ROWEvidence)}
</Html>
</View>
)}
@@ -788,8 +814,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.conservationArea == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.conservationAreaEvidence ||
""}
{CleanHTML(
values.conservationAreaEvidence
)}
</Html>
</View>
)}
@@ -822,8 +849,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.affectListedBuilding == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.affectListedBuildingEvidence ||
""}
{CleanHTML(
values.affectListedBuildingEvidence
)}
</Html>
</View>
)}
@@ -854,7 +882,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.TPO == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.TPOEvidence || ""}
{CleanHTML(values.TPOEvidence)}
</Html>
</View>
)}
@@ -887,8 +915,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.natureConservationSite == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.natureConservationSiteEvidence ||
""}
{CleanHTML(
values.natureConservationSiteEvidence
)}
</Html>
</View>
)}
@@ -919,8 +948,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.protectedSpecies == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.protectedSpeciesEvidence ||
""}
{CleanHTML(
values.protectedSpeciesEvidence
)}
</Html>
</View>
)}
@@ -967,7 +997,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.floodingIssue == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.floodingIssueEvidence || ""}
{CleanHTML(
values.floodingIssueEvidence
)}
</Html>
</View>
)}
@@ -1002,8 +1034,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.governmentDepartmentCommentsEvidence ||
""}
{CleanHTML(
values.governmentDepartmentCommentsEvidence
)}
</Html>
</View>
)}
@@ -1073,8 +1106,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.developmentCarriedOutInAccordanceEvidence ||
""}
{CleanHTML(
values.developmentCarriedOutInAccordanceEvidence
)}
</Html>
</View>
)}
@@ -1155,8 +1189,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.developmentAnyOtherConditionsEvidence ||
""}
{CleanHTML(
values.developmentAnyOtherConditionsEvidence
)}
</Html>
</View>
)}
@@ -1200,8 +1235,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.copyOfEnforcementNoticeEvidence ||
""}
{CleanHTML(
values.copyOfEnforcementNoticeEvidence
)}
</Html>
</View>
</View>
@@ -1231,7 +1267,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.enforcementNoticePlan || ""}
{CleanHTML(
values.enforcementNoticePlan
)}
</Html>
</View>
</View>
@@ -1261,8 +1299,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.listOfNotifiedOfEnforcementEvidence ||
""}
{CleanHTML(
values.listOfNotifiedOfEnforcementEvidence
)}
</Html>
</View>
</View>
@@ -1294,8 +1333,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.copyOfLetterOfAppealNotificationEvidence ||
""}
{CleanHTML(
values.copyOfLetterOfAppealNotificationEvidence
)}
</Html>
</View>
</View>
@@ -1327,7 +1367,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.lpaEIAOS == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.lpaEIAOSEvidence || ""}
{CleanHTML(values.lpaEIAOSEvidence)}
</Html>
</View>
)}
@@ -1360,8 +1400,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.detailsOfOtherAppeals == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.detailsOfOtherAppealsEvidence ||
""}
{CleanHTML(
values.detailsOfOtherAppealsEvidence
)}
</Html>
</View>
)}
@@ -1394,8 +1435,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.detailsOfPreviousAppeals == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.detailsOfPreviousAppealsEvidence ||
""}
{CleanHTML(
values.detailsOfPreviousAppealsEvidence
)}
</Html>
</View>
)}
@@ -1427,8 +1469,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
{values.otherRelevantInformation == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.otherRelevantInformationEvidence ||
""}
{CleanHTML(
values.otherRelevantInformationEvidence
)}
</Html>
</View>
)}
+17 -3
View File
@@ -120,6 +120,17 @@ export const finalComments_pdf = ({ docProps }) => {
})
: [];
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -229,8 +240,9 @@ export const finalComments_pdf = ({ docProps }) => {
</Text>
<Text style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.conditional_representationCapacity_Comments ||
""}
{CleanHTML(
values.conditional_representationCapacity_Comments
)}
</Html>
</Text>
</View>
@@ -321,7 +333,9 @@ export const finalComments_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments || ""}
{CleanHTML(
values.representationComments
)}
</Html>
</View>
</View>
+78 -45
View File
@@ -5,6 +5,7 @@ import {
StyleSheet,
Text,
View,
Font,
} from "@react-pdf/renderer";
import Html from "react-pdf-html";
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
@@ -111,6 +112,18 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
let appealTypeValue = getFormCollectionByID(values.appealType);
//console.log("sdffhjdhjdjdgkj: ", values.procedureType);
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -239,7 +252,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswer}>
{appealTypeValue.value || ""}
{appealTypeValue.value}
</Text>
</View>
</View>
@@ -282,14 +295,16 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.procedureType || ""}
{values.procedureType}
</Text>
</View>
{values.procedureType !=
"Written representations" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.procedureTypeEvidence || ""}
{CleanHTML(
values.procedureTypeEvidence
)}
</Html>
</View>
)}
@@ -309,7 +324,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.enterToView || ""}
{values.enterToView}
</Text>
</View>
@@ -344,8 +359,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={{ fontSize: 12 }}>
{values.enterNeighbouringLandToViewSiteEvidence ||
" "}
{CleanHTML(
values.enterNeighbouringLandToViewSiteEvidence
)}
</Html>
</View>
)}
@@ -380,8 +396,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.enterNeighbouringLandAccessRequiredEvidence ||
""}
{CleanHTML(
values.enterNeighbouringLandAccessRequiredEvidence
)}
</Html>
</View>
)}
@@ -408,14 +425,15 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.healthAndSafetyIssues || ""}
{values.healthAndSafetyIssues}
</Text>
</View>
{values.healthAndSafetyIssues == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.healthAndSafetyIssuesEvidence ||
""}
{CleanHTML(
values.healthAndSafetyIssuesEvidence
)}
</Html>
</View>
)}
@@ -445,7 +463,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.LPAcontactDetails || ""}
{CleanHTML(values.LPAcontactDetails)}
</Html>
</View>
</View>
@@ -482,7 +500,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps || ""}
{CleanHTML(values.LPAcaseFileAndReps)}
</Html>
</View>
</View>
@@ -502,7 +520,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAldpAndMap || ""}
{CleanHTML(values.LPAldpAndMap)}
</Html>
</View>
</View>
@@ -522,7 +540,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAlocalGuidance || ""}
{CleanHTML(values.LPAlocalGuidance)}
</Html>
</View>
</View>
@@ -608,7 +626,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.ROW == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.ROWEvidence || ""}
{CleanHTML(values.ROWEvidence)}
</Html>
</View>
)}
@@ -641,8 +659,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.conservationArea == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.conservationAreaEvidence ||
""}
{CleanHTML(
values.conservationAreaEvidence
)}
</Html>
</View>
)}
@@ -675,8 +694,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.affectListedBuilding == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.affectListedBuildingEvidence ||
""}
{CleanHTML(
values.affectListedBuildingEvidence
)}
</Html>
</View>
)}
@@ -709,7 +729,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.TPO == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.TPOEvidence || ""}
{CleanHTML(values.TPOEvidence)}
</Html>
</View>
)}
@@ -742,8 +762,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.natureConservationSite == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.natureConservationSiteEvidence ||
""}
{CleanHTML(
values.natureConservationSiteEvidence
)}
</Html>
</View>
)}
@@ -776,8 +797,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.protectedSpecies == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.protectedSpeciesEvidence ||
""}
{CleanHTML(
values.protectedSpeciesEvidence
)}
</Html>
</View>
)}
@@ -829,8 +851,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.governmentDepartmentCommentsEvidence ||
""}
{CleanHTML(
values.governmentDepartmentCommentsEvidence
)}
</Html>
</View>
)}
@@ -918,8 +941,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.developmentCarriedOutInAccordanceEvidence ||
""}
{CleanHTML(
values.developmentCarriedOutInAccordanceEvidence
)}
</Html>
</View>
)}
@@ -989,8 +1013,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.developmentAnyOtherConditionsEvidence ||
""}
{CleanHTML(
values.developmentAnyOtherConditionsEvidence
)}
</Html>
</View>
)}
@@ -1039,8 +1064,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.copyOfApplicantsCertificateEvidence ||
""}
{CleanHTML(
values.copyOfApplicantsCertificateEvidence
)}
</Html>
</View>
</View>
@@ -1072,7 +1098,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.advertismentGivenEvidence || ""}
{CleanHTML(
values.advertismentGivenEvidence
)}
</Html>
</View>
</View>
@@ -1105,8 +1133,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.copyOfLetterOfAppealNotificationEvidence ||
""}
{CleanHTML(
values.copyOfLetterOfAppealNotificationEvidence
)}
</Html>
</View>
</View>
@@ -1138,7 +1167,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.lpaEIAOS == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.lpaEIAOSEvidence || ""}
{CleanHTML(values.lpaEIAOSEvidence)}
</Html>
</View>
)}
@@ -1174,8 +1203,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.advertismentConsentDiscontinuanceNoticeEvidence ||
""}
{CleanHTML(
values.advertismentConsentDiscontinuanceNoticeEvidence
)}
</Html>
</View>
)}
@@ -1208,8 +1238,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.detailsOfOtherAppeals == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.detailsOfOtherAppealsEvidence ||
""}
{CleanHTML(
values.detailsOfOtherAppealsEvidence
)}
</Html>
</View>
)}
@@ -1242,8 +1273,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.detailsOfPreviousAppeals == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.detailsOfPreviousAppealsEvidence ||
""}
{CleanHTML(
values.detailsOfPreviousAppealsEvidence
)}
</Html>
</View>
)}
@@ -1276,8 +1308,9 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
{values.otherRelevantInformation == "Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.otherRelevantInformationEvidence ||
""}
{CleanHTML(
values.otherRelevantInformationEvidence
)}
</Html>
</View>
)}
+14 -1
View File
@@ -120,6 +120,17 @@ export const other_pdf = ({ docProps }) => {
})
: [];
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -262,7 +273,9 @@ export const other_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments || ""}
{CleanHTML(
values.representationComments
)}
</Html>
</View>
</View>
@@ -143,6 +143,8 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
//console.log("\n//////////\n The Case:\n", docProps.caseObj);
Font.registerHyphenationCallback((word) => [word]);
return (
<Document>
<Page size="A4" style={styles.page} wrap>
+19 -3
View File
@@ -5,6 +5,7 @@ import {
StyleSheet,
Text,
View,
Font,
} from "@react-pdf/renderer";
import Html from "react-pdf-html";
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
@@ -116,6 +117,17 @@ export const statement_pdf = ({ docProps }) => {
})
: [];
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -224,8 +236,9 @@ export const statement_pdf = ({ docProps }) => {
</Text>
<Text style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.conditional_representationCapacity_Comments ||
""}
{CleanHTML(
values.conditional_representationCapacity_Comments
)}
</Html>
</Text>
</View>
@@ -315,7 +328,10 @@ export const statement_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments || ""}
(
{CleanHTML(
values.representationComments
)}
</Html>
</View>
</View>
@@ -5,6 +5,7 @@ import {
StyleSheet,
Text,
View,
Font,
} from "@react-pdf/renderer";
import Html from "react-pdf-html";
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
@@ -104,6 +105,17 @@ export const writtenStatement_pdf = ({ docProps }) => {
})
: [];
Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) {
let cleanStr =
typeof htmlStr === "string"
? htmlStr.replace(/<p><br><\/p>/g, "")
: "";
return cleanStr;
}
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -239,7 +251,9 @@ export const writtenStatement_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments || ""}
{CleanHTML(
values.representationComments
)}
</Html>
</View>
</View>