uat defect 130, reps 14
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user