Merged PR 2210: Rep raising and pdf for welsh

Related work items: #22095, #22305
This commit is contained in:
Robert Bond
2026-03-30 11:46:22 +00:00
8 changed files with 285 additions and 86 deletions
+14 -5
View File
@@ -213,7 +213,7 @@ let MakeRepresentation = (props) => {
}; };
default: default:
return { return {
path: `$..[?(@ && @.reference=="${caseReference}")]`, path: `$..[?(@ && @.ticketnumber=="${ticketnumber}")]`,
json: setCaseQueryObj json: setCaseQueryObj
}; };
} }
@@ -437,9 +437,14 @@ let MakeRepresentation = (props) => {
const isSpecialistNonHearing = specialistProcess !== 846040001; const isSpecialistNonHearing = specialistProcess !== 846040001;
const isAppellant = const involvementType =
props.props?.accountDetails?.accountDetails props.props?.accountDetails?.accountDetails
?.pinswg_typeofinvolvement === 846040001; ?.pinswg_typeofinvolvement;
const isAppellant = involvementType === 846040001;
const isAgent = involvementType === 846040000;
const isIP = involvementType === 846040061;
//const isLPA = involvementType === 846040000;
const startDate = new Date( const startDate = new Date(
isDNS isDNS
@@ -520,11 +525,15 @@ let MakeRepresentation = (props) => {
addRep("Statement"); addRep("Statement");
} }
const canSubmitFinalComments = isAppellant || isAgent || isIP || isLPA;
const canAddFinalComments = const canAddFinalComments =
isAppellant && canSubmitFinalComments &&
isWithin(statementDueDate, finalCommentsDate) && isWithin(statementDueDate, finalCommentsDate) &&
(appealType !== 846040004 || isSpecialistNonHearing); (appealType !== 846040004 || isSpecialistNonHearing);
// IP and Agents and LPA can do final comments.
if (canAddFinalComments) { if (canAddFinalComments) {
addRep("Final comments"); addRep("Final comments");
} }
@@ -962,7 +971,7 @@ let MakeRepresentation = (props) => {
// Find correct case details // Find correct case details
let detailsObj = jsonpath({ let detailsObj = jsonpath({
path: `$..[?(@ && @.pinswg_name=="${caseReference}")]`, path: `$..[?(@ && @.ticketnumber=="${ticketnumber}")]`,
json: setCaseDetailsObj, json: setCaseDetailsObj,
eval: true eval: true
})[0]; })[0];
+9 -7
View File
@@ -158,6 +158,7 @@ let BuildCheckSection = (props) => {
); );
pdfObj.filesList = uniqueArray; pdfObj.filesList = uniqueArray;
pdfObj.locale = locale;
confirmSections confirmSections
? (setFinaliseAppealProcess(true), ? (setFinaliseAppealProcess(true),
@@ -186,6 +187,9 @@ let BuildCheckSection = (props) => {
}; };
const triggerAppealDownload = async () => { const triggerAppealDownload = async () => {
if (!downloadAppealForm) {
return;
}
if (downloadInProgress) { if (downloadInProgress) {
return; return;
} }
@@ -199,8 +203,7 @@ let BuildCheckSection = (props) => {
); );
pdfObj.filesList = uniqueArray; pdfObj.filesList = uniqueArray;
pdfObj.locale = locale;
console.log(pdfObj);
const containerID = const containerID =
props.accountDetails?.containerID || props.accountDetails?.containerID ||
@@ -442,10 +445,9 @@ let BuildCheckSection = (props) => {
</> </>
) : ( ) : (
<> <>
<a <button
disabled={ type="button"
confirmSections ? false : true disabled={!confirmSections}
}
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
onClick={async () => { onClick={async () => {
@@ -454,7 +456,7 @@ let BuildCheckSection = (props) => {
}} }}
> >
{t("newappeal:submit-appeal-button")} {t("newappeal:submit-appeal-button")}
</a> </button>
<a <a
className="govuk-link" className="govuk-link"
href="#" href="#"
+59 -17
View File
@@ -4,7 +4,8 @@ import xpath from "xpath";
import { import {
bytesToSize, bytesToSize,
getPickListLabel, getPickListLabel,
getDocumentTypeFromFilename getDocumentTypeFromFilename,
getFormCollectionByID
} from "../../components/utils"; } from "../../components/utils";
import fieldLookup from "../../data/crmfieldlookuptranslations.json"; import fieldLookup from "../../data/crmfieldlookuptranslations.json";
@@ -15,6 +16,7 @@ import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
export const AppealRow_pdf = (props) => { export const AppealRow_pdf = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
let locale = props.props.locale;
const { const {
formXML, formXML,
@@ -146,18 +148,32 @@ export const AppealRow_pdf = (props) => {
return dateString; return dateString;
} }
const FieldsTranslations = (label) => { const FieldsTranslations = (label, locale) => {
const { appealtypes } = router.query; const appealtypes = getFormCollectionByID(
props.props.caseObj.pinswg_appealcasetype
).UrlName;
let formObj = jsonpath({ const formObj = jsonpath({
path: "$['" + appealtypes + "']", path: `$['${appealtypes}'].[?(@.value=="${label}")]`,
json: fieldLookup, json: fieldLookup,
eval: true eval: true
}); });
let labelTrans = label; const item = formObj?.[0];
return labelTrans;
if (locale === "cy" && !item?.value_cy) {
console.warn(`[Missing Welsh translation]`, {
label: item?.value,
orig: label,
appealType: appealtypes
});
}
return locale === "cy"
? (item?.value_cy ?? item?.value ?? label)
: (item?.value ?? label);
}; };
Font.registerHyphenationCallback((word) => [word]); Font.registerHyphenationCallback((word) => [word]);
function CleanHTML(htmlStr) { function CleanHTML(htmlStr) {
@@ -219,8 +235,10 @@ export const AppealRow_pdf = (props) => {
<Text <Text
style={styles.questionTextWide} style={styles.questionTextWide}
> >
{/* {FieldsTranslations(rows[0].value)} */} {FieldsTranslations(
{rows[0].value} rows[0].value,
locale
)}{" "}
</Text> </Text>
<Text <Text
@@ -260,7 +278,10 @@ export const AppealRow_pdf = (props) => {
styles.questionTextMid styles.questionTextMid
} }
> >
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
</View> </View>
<View <View
@@ -335,7 +356,10 @@ export const AppealRow_pdf = (props) => {
styles.questionTextWide styles.questionTextWide
} }
> >
{rows[0].value}{" "} {FieldsTranslations(
rows[0].value,
locale
)}{" "}
</Text> </Text>
</View> </View>
<View <View
@@ -368,7 +392,10 @@ export const AppealRow_pdf = (props) => {
styles.questionTextWide styles.questionTextWide
} }
> >
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
</View> </View>
<View <View
@@ -399,7 +426,10 @@ export const AppealRow_pdf = (props) => {
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
{/* {FieldsTranslations(rows[0].value)} */} {/* {FieldsTranslations(rows[0].value)} */}
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{getPickListLabel( {getPickListLabel(
@@ -453,7 +483,10 @@ export const AppealRow_pdf = (props) => {
styles.questionTextWide styles.questionTextWide
} }
> >
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
</View> </View>
@@ -524,7 +557,10 @@ export const AppealRow_pdf = (props) => {
styles.questionTextMid styles.questionTextMid
} }
> >
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
</View> </View>
<View <View
@@ -638,7 +674,10 @@ export const AppealRow_pdf = (props) => {
style={styles.questionText} style={styles.questionText}
wrap={false} wrap={false}
> >
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
<Text <Text
style={ style={
@@ -665,7 +704,10 @@ export const AppealRow_pdf = (props) => {
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
{rows[0].value} {FieldsTranslations(
rows[0].value,
locale
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{ {
+142 -53
View File
@@ -6,7 +6,7 @@ import ReactPDF, {
Image, Image,
StyleSheet, StyleSheet,
PDFViewer, PDFViewer,
Font, Font
} from "@react-pdf/renderer"; } from "@react-pdf/renderer";
import Html from "react-pdf-html"; import Html from "react-pdf-html";
import { getFormCollectionByID, bytesToSize } from "../utils"; import { getFormCollectionByID, bytesToSize } from "../utils";
@@ -17,28 +17,42 @@ import _ from "lodash";
import { DOMParser, XMLSerializer } from "@xmldom/xmldom"; import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
import { AppealRow_pdf } from "./appealRow_pdf"; import { AppealRow_pdf } from "./appealRow_pdf";
import transLookupCY from "../../locales/cy/newappeal.json";
import transLookupEN from "../../locales/en/newappeal.json";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import { JSONPath as jsonpath } from "jsonpath-plus";
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({ const styles = StyleSheet.create({
page: { page: {
backgroundColor: "white", backgroundColor: "white",
padding: 20, padding: 20,
fontSize: 16, fontSize: 16,
paddingBottom: 50, paddingBottom: 50
}, },
header: { header: {
fontSize: 25, fontSize: 25,
fontFamily: "Helvetica", fontFamily: "Helvetica",
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between"
}, },
subHeader: { subHeader: {
fontSize: 20, fontSize: 20
}, },
logoImage: { width: "200pt" }, logoImage: { width: "200pt" },
questionBullet: { width: "5%", fontSize: 12 }, questionBullet: { width: "5%", fontSize: 12 },
questionText: { questionText: {
width: "35%", width: "35%",
fontSize: 12, fontSize: 12,
fontFamily: "Helvetica-Bold", fontFamily: "Helvetica-Bold"
}, },
questionTextMid: { width: "80%", fontSize: 12 }, questionTextMid: { width: "80%", fontSize: 12 },
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 }, questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
@@ -50,7 +64,7 @@ const styles = StyleSheet.create({
border: 1, border: 1,
borderColor: "#eee", borderColor: "#eee",
paddingLeft: 10, paddingLeft: 10,
backgroundColor: "white", backgroundColor: "white"
}, },
questionAnswerMid: { questionAnswerMid: {
color: "#757575", color: "#757575",
@@ -60,7 +74,7 @@ const styles = StyleSheet.create({
border: 1, border: 1,
borderColor: "#eee", borderColor: "#eee",
paddingLeft: 10, paddingLeft: 10,
backgroundColor: "white", backgroundColor: "white"
}, },
questionAnswerWide: { questionAnswerWide: {
color: "#757575", color: "#757575",
@@ -70,14 +84,14 @@ const styles = StyleSheet.create({
border: 1, border: 1,
borderColor: "#eee", borderColor: "#eee",
backgroundColor: "white", backgroundColor: "white",
padding: 5, padding: 5
}, },
sectionContainer: { sectionContainer: {
backgroundColor: "#F8F8F8", backgroundColor: "#F8F8F8",
padding: 10, padding: 10,
marginTop: 20, marginTop: 20,
fontSize: 15, fontSize: 15
}, },
pageNumber: { pageNumber: {
position: "absolute", position: "absolute",
@@ -86,17 +100,18 @@ const styles = StyleSheet.create({
left: 0, left: 0,
right: 0, right: 0,
textAlign: "center", textAlign: "center",
color: "grey", color: "grey"
}, },
richArea: { richArea: {
fontSize: 12, fontSize: 12,
flexDirection: "column", flexDirection: "column"
}, }
}); });
export const planningappeals78_pdf = ({ docProps, pickListData }) => { export const planningappeals78_pdf = ({ docProps, pickListData }) => {
//console.log("----", docProps); //console.log("----", docProps);
const locale = docProps.locale;
function formatDates(dateObj) { function formatDates(dateObj) {
var dateObj = new Date(dateObj); var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0"); var dd = String(dateObj.getDate()).padStart(2, "0");
@@ -145,6 +160,32 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
Font.registerHyphenationCallback((word) => [word]); Font.registerHyphenationCallback((word) => [word]);
const FieldsTranslations = (label, locale) => {
const appealtypes = getFormCollectionByID(
docProps.caseObj.pinswg_appealcasetype
).UrlName;
const formObj = jsonpath({
path: `$['${appealtypes}'].[?(@.value=="${label}")]`,
json: fieldLookup,
eval: true
});
const item = formObj?.[0];
if (locale === "cy" && !item?.value_cy) {
console.warn(`[Missing Welsh translation]`, {
label: item?.value,
orig: label,
appealType: appealtypes
});
}
return locale === "cy"
? (item?.value_cy ?? item?.value ?? label)
: (item?.value ?? label);
};
return ( return (
<Document> <Document>
<Page size="A4" style={styles.page} wrap> <Page size="A4" style={styles.page} wrap>
@@ -154,10 +195,10 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
<Text <Text
style={{ style={{
width: "60%", width: "60%",
fontFamily: "Helvetica-Bold", fontFamily: "Helvetica-Bold"
}} }}
> >
Planning Appeals s78 {getTrans(locale, "pdf-s78-heading")}
</Text> </Text>
<View> <View>
<Text <Text
@@ -165,12 +206,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
width: "60%", width: "60%",
fontSize: 15, fontSize: 15,
marginTop: 20, marginTop: 20,
fontFamily: "Helvetica-Bold", fontFamily: "Helvetica-Bold"
}} }}
> >
For Planning, Conservation area, Listed {" "}
Building and Advertisement {getTrans(
applications/appeals locale,
"pdf-s78-header-paragraph"
)}
</Text> </Text>
</View> </View>
</View> </View>
@@ -188,23 +231,27 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
<View <View
style={{ style={{
marginTop: 10, marginTop: 10,
fontFamily: "Helvetica-Bold", fontFamily: "Helvetica-Bold"
}} }}
> >
<Text style={{ fontSize: 14 }}> <Text style={{ fontSize: 14 }}>
{parseInt(key)} {titles[key].value} {parseInt(key)}{" "}
{FieldsTranslations(
titles[key].value,
locale
)}
</Text> </Text>
<View style={styles.sectionContainer}> <View style={styles.sectionContainer}>
<View <View
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<View <View
style={{ style={{
flexDirection: "column", flexDirection: "column",
marginBottom: 10, marginBottom: 10
}} }}
> >
<AppealRow_pdf <AppealRow_pdf
@@ -252,7 +299,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
borderColor: "#eee", borderColor: "#eee",
padding: 20, padding: 20,
paddingTop: 30, paddingTop: 30,
height: "100%", height: "100%"
}} }}
></View> ></View>
</Page> </Page>
@@ -261,33 +308,39 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
<View <View
style={{ style={{
marginTop: 10, marginTop: 10,
fontFamily: "Helvetica-Bold", fontFamily: "Helvetica-Bold"
}} }}
> >
<Text style={{ fontSize: 14 }}>Case Details</Text> <Text style={{ fontSize: 14 }}>
{" "}
{getTrans(locale, "pdf-s78-heading")}
</Text>
<View style={styles.sectionContainer}> <View style={styles.sectionContainer}>
<View <View
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<View <View
style={{ style={{
flexDirection: "column", flexDirection: "column",
marginBottom: 10, marginBottom: 10
}} }}
> >
<View <View
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Appeal submitted on behalf of: {getTrans(
locale,
"pdf-case-details-label-1"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{" "} {" "}
@@ -298,11 +351,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Appellant or Agent {getTrans(
locale,
"pdf-case-details-label-2"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{" "} {" "}
@@ -317,11 +373,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Appellant name {getTrans(
locale,
"pdf-case-details-label-3"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{values.caseObj {values.caseObj
@@ -335,11 +394,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Appellant email address {getTrans(
locale,
"pdf-case-details-label-4"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{ {
@@ -352,11 +414,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Appellant address {getTrans(
locale,
"pdf-case-details-label-5"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{ {
@@ -369,11 +434,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Appellant phone number {getTrans(
locale,
"pdf-case-details-label-3"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{" "} {" "}
@@ -390,13 +458,16 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text <Text
style={styles.questionText} style={styles.questionText}
> >
Company name {getTrans(
locale,
"pdf-case-details-agent-label-1"
)}
</Text> </Text>
<Text <Text
style={ style={
@@ -413,13 +484,16 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text <Text
style={styles.questionText} style={styles.questionText}
> >
Agent name {getTrans(
locale,
"pdf-case-details-agent-label-2"
)}
</Text> </Text>
<Text <Text
style={ style={
@@ -440,13 +514,16 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text <Text
style={styles.questionText} style={styles.questionText}
> >
Agent email address {getTrans(
locale,
"pdf-case-details-agent-label-3"
)}
</Text> </Text>
<Text <Text
style={ style={
@@ -463,13 +540,16 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text <Text
style={styles.questionText} style={styles.questionText}
> >
Agent address {getTrans(
locale,
"pdf-case-details-agent-label-4"
)}
</Text> </Text>
<Text <Text
style={ style={
@@ -486,13 +566,16 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text <Text
style={styles.questionText} style={styles.questionText}
> >
Agent phone number {getTrans(
locale,
"pdf-case-details-agent-label-5"
)}
</Text> </Text>
<Text <Text
style={ style={
@@ -512,11 +595,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
LPA {getTrans(
locale,
"pdf-case-details-label-7"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{values.caseObj.pinswg_lpaname || {values.caseObj.pinswg_lpaname ||
@@ -547,11 +633,14 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
wrap={false} wrap={false}
style={{ style={{
flexDirection: "row", flexDirection: "row",
marginBottom: 10, marginBottom: 10
}} }}
> >
<Text style={styles.questionText}> <Text style={styles.questionText}>
Language Preference {getTrans(
locale,
"pdf-case-details-label-8"
)}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{values.caseObj {values.caseObj
+13 -1
View File
@@ -2231,7 +2231,7 @@
"value_cy": "A yw'n hanfodol i'r Arolygydd fynd i mewn i'r safle i wirio mesuriadau neu ffeithiau eraill perthnasol?" "value_cy": "A yw'n hanfodol i'r Arolygydd fynd i mewn i'r safle i wirio mesuriadau neu ffeithiau eraill perthnasol?"
}, },
{ {
"value": "Please explain why the inspector needs to enter the site", "value": "Please explain why the Inspector needs to enter the site",
"value_cy": "Eglurwch pam mae angen i'r Arolygydd fynd i mewn i'r safle" "value_cy": "Eglurwch pam mae angen i'r Arolygydd fynd i mewn i'r safle"
}, },
{ {
@@ -2433,6 +2433,18 @@
{ {
"value": "The S106 agreement or unilateral undertaking", "value": "The S106 agreement or unilateral undertaking",
"value_cy": "Cytundeb S106 neu ymgymeriad unochrog" "value_cy": "Cytundeb S106 neu ymgymeriad unochrog"
},
{
"value": "Owner",
"value_cy": "Perchennog"
},
{
"value": "Tenant name",
"value_cy": "Enw tenant"
},
{
"value": "Please submit your statement of case",
"value_cy": "Cyflwynwch eich datganiad achos"
} }
] ]
} }
+23 -1
View File
@@ -123,5 +123,27 @@
"new-appeal-finalising-label": "Wrthi'n uwchlwytho ffeiliau ar hyn o bryd a chwblhau eich cyflwyniad apêl", "new-appeal-finalising-label": "Wrthi'n uwchlwytho ffeiliau ar hyn o bryd a chwblhau eich cyflwyniad apêl",
"new-appeal-wait-label": "Arhoswch os gwelwch yn dda", "new-appeal-wait-label": "Arhoswch os gwelwch yn dda",
"invalid-email-address-errormsg": "Cyfeiriad e-bost annilys", "invalid-email-address-errormsg": "Cyfeiriad e-bost annilys",
"return-to-myportal-link": "Dychwelyd i Fy Mhorth" "return-to-myportal-link": "Dychwelyd i Fy Mhorth",
"pdf-s78-heading": "Apelau Cynllunio s78",
"pdf-s78-header-paragraph": "Ar gyfer ceisiadau/apelau Cynllunio, Ardal Gadwraeth, Adeilad Rhestredig a Hysbysebu",
"pdf-heading-1": "Manylion yr apêl",
"pdf-case-subheading-1": "Manylion perchnogaeth safle'r apêl",
"pdf-case-subheading-2": "Gwybodaeth am ymweliad â'r safle",
"pdf-case-subheading-3": "Apelau eraill",
"pdf-case-subheading-4": "Cyflwyno achos",
"pdf-case-subheading-5": "Uwchlwytho dogfennau",
"pdf-case-details-subheading": "Manylion yr Achos",
"pdf-case-details-label-1": "Apel a gyflwynwyd ar ran",
"pdf-case-details-label-2": "Apelydd neu Asiant",
"pdf-case-details-label-3": "Enw'r apelydd",
"pdf-case-details-label-4": "E-bost yr apelydd",
"pdf-case-details-label-5": "Cyfeiriad yr apelydd",
"pdf-case-details-label-6": "Rhif ffôn yr apelydd",
"pdf-case-details-label-7": "LPA",
"pdf-case-details-label-8": "Dewis Iaith",
"pdf-case-details-agent-label-1": "Enw'r cwmni",
"pdf-case-details-agent-label-2": "Enw'r asiant",
"pdf-case-details-agent-label-3": "Cyfeiriad e-bost yr asiant",
"pdf-case-details-agent-label-4": "Cyfeiriad yr asiant",
"pdf-case-details-agent-label-5": "Rhif ffôn yr asiant"
} }
+23 -1
View File
@@ -123,5 +123,27 @@
"new-appeal-finalising-label": "Currently uploading files and finalising your appeal submission", "new-appeal-finalising-label": "Currently uploading files and finalising your appeal submission",
"new-appeal-wait-label": "Please wait", "new-appeal-wait-label": "Please wait",
"invalid-email-address-errormsg": "Invalid email address", "invalid-email-address-errormsg": "Invalid email address",
"return-to-myportal-link": "Return to My Portal" "return-to-myportal-link": "Return to My Portal",
"pdf-s78-heading": "Planning Appeals s78",
"pdf-s78-header-paragraph": "For Planning, Conservation area, Listed Building and Advertisement applications/appeals",
"pdf-heading-1": "Appeal details",
"pdf-case-subheading-1": "Appeal site ownership details",
"pdf-case-subheading-2": "Site visit information",
"pdf-case-subheading-3": "Other appeals",
"pdf-case-subheading-4": "Submission of case",
"pdf-case-subheading-5": "Upload documents",
"pdf-case-details-subheading": "Case Details",
"pdf-case-details-label-1": "Appeal submitted on behalf of",
"pdf-case-details-label-2": "Appellant or Agent",
"pdf-case-details-label-3": "Appellant name",
"pdf-case-details-label-4": "Appellant email address",
"pdf-case-details-label-5": "Appellant address",
"pdf-case-details-label-6": "Appellant phone number",
"pdf-case-details-label-7": "LPA",
"pdf-case-details-label-8": "Language Preference",
"pdf-case-details-agent-label-1": "Company name",
"pdf-case-details-agent-label-2": "Agent name",
"pdf-case-details-agent-label-3": "Agent email address",
"pdf-case-details-agent-label-4": "Agent address",
"pdf-case-details-agent-label-5": "Agent phone number"
} }
+2 -1
View File
@@ -100,6 +100,7 @@ export default async function handler(req, res) {
typeof req.body === "string" ? JSON.parse(req.body) : req.body; typeof req.body === "string" ? JSON.parse(req.body) : req.body;
const containerID = appealBodyObj.containerID; const containerID = appealBodyObj.containerID;
const casefolderID = appealBodyObj.casefolderID; const casefolderID = appealBodyObj.casefolderID;
const locale = appealBodyObj.locale || "en";
let checkquerypath = "/api/file/generateappealpdf"; let checkquerypath = "/api/file/generateappealpdf";
if ( if (
@@ -207,7 +208,7 @@ export default async function handler(req, res) {
const renderedPDF = await ReactPDF.renderToStream( const renderedPDF = await ReactPDF.renderToStream(
MyDocument({ MyDocument({
docProps: blobProgress, docProps: { ...blobProgress, locale },
pickListData: pickListData pickListData: pickListData
}) })
); );