enforcement pdf fixes
This commit is contained in:
@@ -10,6 +10,18 @@ import {
|
||||
import Html from "react-pdf-html";
|
||||
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
|
||||
|
||||
import transLookupCY from "../../locales/cy/myrepresentations.json";
|
||||
import transLookupEN from "../../locales/en/myrepresentations.json";
|
||||
|
||||
const getTrans = (locale, key) => {
|
||||
let jsonQuery = `$.${key}`;
|
||||
|
||||
let jsonObj = locale == "cy" ? transLookupCY : transLookupEN;
|
||||
|
||||
//console.log(locale, jsonObj[key]);
|
||||
return jsonObj[key];
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
page: {
|
||||
backgroundColor: "white",
|
||||
@@ -29,7 +41,7 @@ const styles = StyleSheet.create({
|
||||
logoImage: { width: "200pt" },
|
||||
questionBullet: { width: "5%", fontSize: 12 },
|
||||
questionText: { width: "30%", fontSize: 12 },
|
||||
questionTextMid: { width: "80%", fontSize: 12 },
|
||||
questionTextMid: { width: "75%", fontSize: 12, marginRight: 10 },
|
||||
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||
questionAnswer: {
|
||||
color: "#757575",
|
||||
@@ -41,6 +53,28 @@ const styles = StyleSheet.create({
|
||||
paddingLeft: 10,
|
||||
backgroundColor: "white",
|
||||
},
|
||||
questionAnswerSmall: {
|
||||
color: "#757575",
|
||||
width: "300",
|
||||
fontSize: 12,
|
||||
padding: 5,
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
paddingLeft: 10,
|
||||
paddingRight: 10,
|
||||
backgroundColor: "white",
|
||||
marginRight: 10,
|
||||
},
|
||||
questionAnswerSmaller: {
|
||||
color: "#757575",
|
||||
width: "90",
|
||||
fontSize: 12,
|
||||
padding: 5,
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
paddingLeft: 10,
|
||||
backgroundColor: "white",
|
||||
},
|
||||
questionAnswerMid: {
|
||||
color: "#757575",
|
||||
width: "20%",
|
||||
@@ -53,15 +87,23 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
questionAnswerWide: {
|
||||
color: "#757575",
|
||||
width: "95%",
|
||||
width: "100%",
|
||||
fontSize: 12,
|
||||
marginLeft: "5%",
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
padding: 5,
|
||||
},
|
||||
|
||||
questionAnswerFull: {
|
||||
color: "#757575",
|
||||
width: "100%",
|
||||
fontSize: 10,
|
||||
padding: 5,
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
},
|
||||
sectionContainer: {
|
||||
backgroundColor: "#F8F8F8",
|
||||
padding: 10,
|
||||
@@ -174,8 +216,9 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
>
|
||||
<Text style={styles.questionBullet}>1.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
{t(
|
||||
"myrepresentations:s78-section-question-1"
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"s78-section-question-1"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
@@ -192,13 +235,14 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
>
|
||||
<Text style={styles.questionBullet}>2.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
{t(
|
||||
"myrepresentations:s78-section-question-2"
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"s78-section-question-2"
|
||||
)}
|
||||
:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
{values.lpaRef}
|
||||
{values.lpaReference}
|
||||
</Text>
|
||||
</View>
|
||||
<View
|
||||
@@ -226,7 +270,10 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 14 }}>
|
||||
{t("myrepresentations:s78-section-heading-one")}
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"s78-section-heading-one"
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.sectionContainer}>
|
||||
@@ -681,16 +728,26 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
flexDirection: "column",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>18.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
LPA’s adopted Local Development Plan and
|
||||
Proposals Map
|
||||
</Text>
|
||||
<View style={styles.questionAnswer}>
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>
|
||||
18.
|
||||
</Text>
|
||||
<Text style={styles.questionTextWide}>
|
||||
LPA’s adopted Local Development Plan and
|
||||
Proposals Map
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.questionAnswerWide}>
|
||||
<Html style={styles.richArea}>
|
||||
{CleanHTML(values.LPAldpAndMap)}
|
||||
</Html>
|
||||
@@ -699,16 +756,26 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
flexDirection: "column",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>19.</Text>
|
||||
<Text style={styles.questionText}>
|
||||
Adopted local guidance relevant to the
|
||||
proposal:
|
||||
</Text>
|
||||
<View style={styles.questionAnswer}>
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}>
|
||||
19.
|
||||
</Text>
|
||||
<Text style={styles.questionTextWide}>
|
||||
Adopted local guidance relevant to the
|
||||
proposal:
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.questionAnswerWide}>
|
||||
<Html style={styles.richArea}>
|
||||
{CleanHTML(values.LPAlocalGuidance)}
|
||||
</Html>
|
||||
@@ -1271,7 +1338,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
<View style={styles.questionAnswerWide}>
|
||||
<Html style={styles.richArea}>
|
||||
{CleanHTML(
|
||||
values.enforcementNoticePlan
|
||||
values.enforcementNoticePlanEvidence
|
||||
)}
|
||||
</Html>
|
||||
</View>
|
||||
@@ -1506,11 +1573,23 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{ width: "40%", fontSize: 12 }}
|
||||
style={{ width: "15%", fontSize: 12 }}
|
||||
>
|
||||
Signed:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
<Text
|
||||
style={{
|
||||
color: "#757575",
|
||||
width: "310",
|
||||
fontSize: 12,
|
||||
padding: 5,
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
paddingRight: 10,
|
||||
}}
|
||||
wrap={true}
|
||||
>
|
||||
{values.caseOfficer}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -1521,10 +1600,16 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionText}>
|
||||
<Text
|
||||
style={{
|
||||
width: "40",
|
||||
fontSize: 12,
|
||||
marginLeft: 10,
|
||||
}}
|
||||
>
|
||||
Date:
|
||||
</Text>
|
||||
<Text style={styles.questionAnswer}>
|
||||
<Text style={styles.questionAnswerSmaller}>
|
||||
{formatDates(values.signedDate)}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -1534,6 +1619,7 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ width: "18%", fontSize: 12 }}>
|
||||
@@ -1559,17 +1645,24 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
flexDirection: "column",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionBullet}></Text>
|
||||
<Text style={styles.questionText}>
|
||||
List of attached files
|
||||
</Text>
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={styles.questionTextWide}>
|
||||
List of attached files
|
||||
</Text>
|
||||
</View>
|
||||
<View
|
||||
style={[
|
||||
styles.questionAnswer,
|
||||
styles.questionAnswerFull,
|
||||
{ flexDirection: "column" },
|
||||
]}
|
||||
>
|
||||
@@ -1586,12 +1679,13 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
>
|
||||
<Text
|
||||
styles={
|
||||
styles.questionTextMid
|
||||
styles.questionAnswer
|
||||
}
|
||||
>
|
||||
{p.name} -{" "}
|
||||
{bytesToSize(
|
||||
p.size
|
||||
p.size ||
|
||||
p.contentLength
|
||||
)}{" "}
|
||||
{"\n"}
|
||||
</Text>
|
||||
@@ -1602,13 +1696,6 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ marginTop: 50, fontSize: 12 }}>
|
||||
<Text>
|
||||
* Regulation 45 of the Town and Country Planning
|
||||
(Environmental Impact Assessment) (Wales)
|
||||
Regulations 2017 (as amended).
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<Text
|
||||
|
||||
@@ -1492,6 +1492,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ width: "18%", fontSize: 12 }}>
|
||||
|
||||
Reference in New Issue
Block a user