create pdf reps for lpa

This commit is contained in:
2023-09-26 09:12:57 +01:00
parent 34c3e06ee3
commit 41847b3433
55 changed files with 8798 additions and 168 deletions
+206 -104
View File
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useState, useEffect } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import jsonpath, { value } from "jsonpath";
import _, { property } from "lodash";
import {
Field,
@@ -23,11 +23,13 @@ import {
setRepresentationReset,
} from "../../../store/currentView/action";
import RepCapacitySelection from "./representationCapacitySelection";
import RepLPACapacitySelection from "./representationLPACapacitySelection";
import RepDetails from "./representationDetails";
import RepAppellant from "./representationAppellant";
import RepAgent from "./representationAgent";
import RepInterestedPartyPerson from "./representationInterestedPartyPerson";
import RepLandOwner from "./representationLandowner";
import RepLPA from "./representationLPA";
import RepCompleteSubmit from "./representationCompleteSubmit";
import { useSession, signIn, signOut } from "next-auth/react";
import {
@@ -35,6 +37,7 @@ import {
patchCase,
uploadRepFiles,
sendEmail,
generateRepPDF,
} from "../../../actions";
import {
@@ -43,6 +46,16 @@ import {
RenderTextfield,
} from "./representationElements";
import ReactPDF, {
Document,
Page,
Text,
View,
StyleSheet,
PDFViewer,
} from "@react-pdf/renderer";
import { object } from "prop-types";
let MakeRepresentation = (props) => {
let { t } = useTranslation();
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
@@ -87,28 +100,33 @@ let MakeRepresentation = (props) => {
var detailsObj = {};
const capacityOptionsArr = [
"Appellant",
"Agent",
"Interested Party/Person",
"Land Owner",
];
const capacityOptionsArr = ["Appellant", "Agent", "Interested Party"];
const appellantApplicantRepresentationArr = [
"Other",
"Statement",
"Statement of common ground",
"Final comments",
"Written statement of evidence",
"Other",
];
const interestedPersonRepresentationArr = [
"Interested Party/Person correspondence",
"Statement",
"Final comments",
"Other",
];
const lpaRepresentationArr = [
"Questionnaire",
"Final comments",
"Written statement of evidence",
"Other",
];
const landOwnerRepresentationArr = [
"Other",
"Statement",
"Final comments",
"Written statement of evidence",
"Other",
];
const repCapacityType = () => {
@@ -125,10 +143,38 @@ let MakeRepresentation = (props) => {
.toLowerCase();
};
const isLPA =
props.props.accountDetails.accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
] == "LPA"
? true
: false;
const whichControl = () => {
switch (currentView.representationCapacity) {
case false:
return (
console.log(isLPA);
console.log(
currentView.representationCapacity,
_.isEmpty(currentView.representationCapacity)
);
if (isLPA && _.isEmpty(currentView.representationCapacity)) {
return (
<RepLPACapacitySelection
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
currentType={currentType}
casesObj={casesObj}
setRepresentationCapacity={"LPA"}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
caseReference={caseReference}
/>
);
} else {
switch (currentView.representationCapacity) {
case false:
<RepCapacitySelection
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
@@ -141,89 +187,120 @@ let MakeRepresentation = (props) => {
setSubmitBack={setSubmitBack}
props={props}
caseReference={caseReference}
/>
);
break;
case "appellant":
//setRepresentationCapacity("appellant");
return (
<RepAppellant
formObj={formObj}
appellantApplicantRepresentationArr={
appellantApplicantRepresentationArr
}
setRepresentationCapacity={setRepresentationCapacity}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "agent":
//setRepresentationCapacity("agent");
return (
<RepAgent
formObj={formObj}
appellantApplicantRepresentationArr={
appellantApplicantRepresentationArr
}
setRepresentationCapacity={setRepresentationCapacity}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "interestedparty/person":
// setRepresentationCapacity("interestedpartyperson");
return (
<RepInterestedPartyPerson
formObj={formObj}
interestedPersonRepresentationArr={
interestedPersonRepresentationArr
}
setRepresentationCapacity={setRepresentationCapacity}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "landowner":
//setRepresentationCapacity("landowner");
return (
<RepLandOwner
formObj={formObj}
landOwnerRepresentationArr={landOwnerRepresentationArr}
setRepresentationCapacity={setRepresentationCapacity}
onHandleSubmit={onHandleSubmit}
setRepresentationSubmit={setRepresentationSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
default:
return (
<RepCapacitySelection
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
currentType={currentType}
casesObj={casesObj}
setRepresentationCapacity={setRepresentationCapacity}
setRepresentationSubmit={setRepresentationSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
/>;
break;
case "appellant":
//setRepresentationCapacity("appellant");
return (
<RepAppellant
formObj={formObj}
appellantApplicantRepresentationArr={
appellantApplicantRepresentationArr
}
setRepresentationCapacity={
setRepresentationCapacity
}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "lpa":
//setRepresentationCapacity("appellant");
return (
<RepLPA
formObj={formObj}
appellantApplicantRepresentationArr={
lpaRepresentationArr
}
setRepresentationCapacity={
setRepresentationCapacity
}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "agent":
//setRepresentationCapacity("agent");
return (
<RepAgent
formObj={formObj}
appellantApplicantRepresentationArr={
appellantApplicantRepresentationArr
}
setRepresentationCapacity={
setRepresentationCapacity
}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "interestedparty/person":
// setRepresentationCapacity("interestedpartyperson");
return (
<RepInterestedPartyPerson
formObj={formObj}
interestedPersonRepresentationArr={
interestedPersonRepresentationArr
}
setRepresentationCapacity={
setRepresentationCapacity
}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
case "landowner":
//setRepresentationCapacity("landowner");
return (
<RepLandOwner
formObj={formObj}
landOwnerRepresentationArr={
landOwnerRepresentationArr
}
setRepresentationCapacity={
setRepresentationCapacity
}
onHandleSubmit={onHandleSubmit}
setRepresentationSubmit={setRepresentationSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
default:
return (
<RepCapacitySelection
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
currentType={currentType}
casesObj={casesObj}
setRepresentationCapacity={
setRepresentationCapacity
}
setRepresentationSubmit={setRepresentationSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
}
}
};
@@ -258,6 +335,9 @@ let MakeRepresentation = (props) => {
case "Land Owner":
repType = "LO";
break;
case "LPA":
repType = "LPA";
break;
default:
// code block
@@ -280,6 +360,7 @@ let MakeRepresentation = (props) => {
"containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
"caseRef": props.props.currentView.caseReference.currentReference,
});
updateBody = JSON.stringify(updateBody);
@@ -321,19 +402,40 @@ let MakeRepresentation = (props) => {
};
const onHandleSubmit = (values) => {
console.log("form values - ", JSON.stringify(values));
Object.assign(values, {
"containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
"caseRef": props.props.currentView.caseReference.currentReference,
"pinswg_name":
props.props.currentView.caseReference.currentReference,
"firstname": props.props.accountDetails.accountDetails.firstname,
"lastname": props.props.accountDetails.accountDetails.lastname,
"emailAddress":
props.props.accountDetails.accountDetails.emailaddress1,
});
currentView.representationSubmit != true
? _.isEmpty(currentView.representationCapacity)
? setRepresentationCapacity(
values.representationCapacity
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
)
? isLPA
? setRepresentationCapacity("lpa")
: setRepresentationCapacity(
values.representationCapacity
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
)
: setRepresentationSubmit(true)
: currentView.representationSubmit == true
? (console.log("capacity", currentView.representationCapacity),
console.log("has errors:", props.invalid),
props.invalid == false &&
updateRepresentation(values, false, false),
generateRepPDF(
values,
props.props.accountDetails.containerID,
currentView.caseReference.currentReference
),
uploadRepresentationFiles(values),
setRepresentationSubmitConfirmation(true))
: console.log("nit updated");
@@ -376,8 +478,8 @@ let MakeRepresentation = (props) => {
const repForm = props.props.form;
console.log(
"waht is representationSubmit:",
currentView.representationSubmit
"what is representationSubmit state: " +
currentView.representationSubmit
);
return (
@@ -7,6 +7,7 @@ import {
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderRichMultiline,
RenderCondtionalRadioList,
FileUploadField,
} from "./representationElements";
@@ -109,7 +110,7 @@ const RepAgent = (props) => {
<Field
name="representationComments"
id="representationComments"
component={RenderMultiline}
component={RenderRichMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
@@ -10,6 +10,7 @@ import {
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderRichMultiline,
RenderFileUpload,
FileUploadField,
} from "./representationElements";
@@ -89,7 +90,7 @@ const RepAppellant = (props) => {
<Field
name="representationComments"
id="representationComments"
component={RenderMultiline}
component={RenderRichMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
@@ -3,6 +3,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useDropzone } from "react-dropzone";
import RepComplete from "./representationComplete";
import RepLPAQuestionnaireCheck from "./representationLPAQuestionnaireCheck";
const RepCompleteSubmit = (props) => {
let { t } = useTranslation();
@@ -210,6 +211,11 @@ const RepCompleteSubmit = (props) => {
</a>
</dd>
</div>
<RepLPAQuestionnaireCheck
props={props}
formObj={formObj}
setSubmitBack={setSubmitBack}
/>
</dl>
<p>
The gathering and subsequent processing of the
@@ -24,6 +24,8 @@ const RepDetails = (props) => {
detailsObj = detailsObj[0];
console.log("-----detailsObj:", detailsObj);
return (
<>
{" "}
@@ -36,9 +38,9 @@ const RepDetails = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{casesObj.appellantApplicant || ""}
{detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] || "not entered"}
{detailsObj.firstName +
" " +
detailsObj.lastName || "not entered"}
</dd>
</div>
{/* <div className="govuk-summary-list__row">
@@ -8,6 +8,20 @@ import Link from "next/link";
import dynamic from "next/dynamic";
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
import "react-quill/dist/quill.snow.css";
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import {
addYears,
addMonths,
addDays,
subYears,
subMonths,
subDays,
parseISO,
} from "date-fns";
import { useRouter } from "next/router";
export const RenderRadioList = ({
datafieldname,
@@ -54,7 +68,13 @@ export const RenderRadioList = ({
{errorMsg}
</span>
)}
<div className="govuk-radios govuk-radios--small">
<div
className={
custom.inline == true
? "govuk-radios govuk-radios--inline govuk-radios--small"
: "govuk-radios govuk-radios--small"
}
>
{Object.keys(options).map((key, index) => (
<div
className="govuk-radios__item"
@@ -204,6 +224,121 @@ export const RenderCondtionalRadioList = ({
);
};
export const RenderLPACondtionalRadioList = ({
datafieldname,
legend,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
const required = (value) => (value ? undefined : "Required");
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
aria-describedby={id + "-hint"}
>
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
<label
className="govuk-fieldset__heading govuk-body-m"
id={id + "_label"}
>
{label}
</label>
</legend>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errorMsg}
</span>
)}
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
<label
className=" govuk-body-m"
id="representationCapacity_label"
>
{legend}
</label>
</legend>
<div id={id + "-hint"} className="govuk-hint"></div>
<div className="govuk-radios govuk-radios--small">
{Object.keys(options).map((key, index) => (
<div key={key} className="govuk-!-margin-bottom-3">
<div
className="govuk-radios__item"
data-children-count={key}
key={key}
>
<Field
id={id + "_" + index}
name={id}
component="input"
type="radio"
className="govuk-radios__input"
value={options[key]}
validate={[required]}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{options[key]}
</label>
</div>
{value == custom.optionSelect &&
options[key] == custom.optionSelect && (
<div
className="govuk-radios__conditional "
id={id}
>
<div
className="govuk-form-group"
key={"yes_group_" + key}
>
<label
className="govuk-label"
htmlFor={id + "_details"}
>
{custom.conditionalLabel}
</label>
<Field
className="govuk-input govuk-!-width-one-half"
id={id + "Evidence"}
name={id + "Evidence"}
component={RenderMultiline}
/>
</div>
</div>
)}
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
export const RenderPickList = ({
datafieldname,
name,
@@ -294,6 +429,118 @@ export const RenderTextfield = ({
);
};
export const RenderDatePicker = ({
datafieldname,
name,
label,
id,
errorMsg,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
const router = useRouter();
var startDateArr =
custom.dateStart != "0" ? custom.dateStart.split("") : custom.dateStart;
var endDateArr =
custom.dateEnd != "0" ? custom.dateEnd.split("") : custom.dateEnd;
var minDate =
startDateArr == 0
? new Date()
: startDateArr[0] == "-"
? startDateArr[2] == "y"
? subYears(new Date(), startDateArr[1])
: startDateArr[2] == "m"
? subMonths(new Date(), startDateArr[1])
: subDays(new Date(), startDateArr[1])
: startDateArr[2] == "y"
? addYears(new Date(), startDateArr[1])
: startDateArr[2] == "m"
? addMonths(new Date(), startDateArr[1])
: addDays(new Date(), startDateArr[1]);
var maxDate =
endDateArr == 0
? new Date()
: startDateArr[0] == "-"
? startDateArr[2] == "y"
? subYears(new Date(), startDateArr[1])
: startDateArr[2] == "m"
? subMonths(new Date(), startDateArr[1])
: subDays(new Date(), startDateArr[1])
: startDateArr[2] == "y"
? addYears(new Date(), startDateArr[1])
: startDateArr[2] == "m"
? addMonths(new Date(), startDateArr[1])
: addDays(new Date(), startDateArr[1]);
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
role="group"
aria-describedby={id + "_label"}
>
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
<label
className="govuk-fieldset__heading"
id={id + "_label"}
htmlFor={id}
>
{label}
</label>
</legend>
{touched && error && (
<span
id={id + "-error"}
className="govuk-error-message"
>
<span className="govuk-visually-hidden">
Error:
</span>{" "}
{errorMsg}
</span>
)}
{/* {value}
<br />
{moment(value).format("DD/MM/YY")}
<br /> */}
<DatePicker
{...custom}
locale={router.locale}
autoOk={true}
id={id}
dateFormat="dd/MM/yyyy"
onChange={onChange}
selected={
value
? typeof value != "object"
? parseISO(value)
: value
: null
} //{parseISO(value) || null}
className="govuk-input govuk-input--width-10"
minDate={minDate}
maxDate={maxDate}
//value={!value ? null : moment(value, "DD/MM/yyyy")}
/>
</fieldset>
</div>
</>
);
};
export const RenderMultiline = ({
id,
className,
@@ -314,6 +561,69 @@ export const RenderMultiline = ({
input.onChange(valStr);
};
var modules = {
toolbar: [
[{ "header": [1, 2, false] }],
["bold", "italic", "underline", "blockquote"],
[{ "list": "ordered" }, { "list": "bullet" }, "link"],
["clean"],
],
};
return (
<>
<label className="govuk-label" htmlFor={name}>
{label}
</label>
{"hint" in custom}
{"hint" in custom && (
<div
id={name + "-hint"}
className="govuk-hint govuk-!-font-size-14"
>
{custom.hint}
</div>
)}
<ReactQuill
modules={modules}
theme="snow"
value={editValue}
onChange={changeEdit}
/>
<textarea
{...input}
id={id}
name={name}
rows={rows}
className={className}
value={editValue}
style={{ display: "none" }}
></textarea>
</>
);
};
export const RenderRichMultiline = ({
id,
className,
rows,
datafieldname,
name,
label,
input,
meta: { touched, error },
...custom
}) => {
const [editValue, setEditValue] = useState(
input.value != null ? input.value : ""
);
const changeEdit = (valStr) => {
setEditValue(valStr);
input.onChange(valStr);
};
var modules = {
toolbar: [
[{ "header": [1, 2, false] }],
@@ -325,6 +635,9 @@ export const RenderMultiline = ({
return (
<>
<label className="govuk-label" htmlFor={name}>
{label}
</label>
<ReactQuill
modules={modules}
theme="snow"
@@ -7,6 +7,7 @@ import {
RenderTextfield,
RenderCondtionalRadioList,
RenderMultiline,
RenderRichMultiline,
FileUploadField,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -92,7 +93,7 @@ const RepInterestedPartyPerson = (props) => {
<Field
name="representationComments"
id="representationComments"
component={RenderMultiline}
component={RenderRichMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
@@ -0,0 +1,954 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm, formValueSelector } from "redux-form";
import {
RenderPickList,
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderCondtionalRadioList,
RenderLPACondtionalRadioList,
FileUploadField,
RenderRichMultiline,
RenderDatePicker,
} from "./representationElements";
import {
setRepresentationCapacity,
setRepresentationSubmit,
} from "../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
let RepLPA = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
formObj,
appellantApplicantRepresentationArr,
setRepresentationCapacity,
setRepresentationSubmit,
currentView,
procedureTypeValue,
onBehalfOfLPA,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
<li key={file.path}>
{file.path} - {file.size} bytes
</li>
));
const required = (value) => (value ? undefined : "Required");
return (
<div id="rep-appellant">
<div className="govuk-grid-column-full">
<div className="govuk-grid-row">
<h2 className="govuk-heading-m ">
Questionnaire from an LPA
</h2>
<div className="govuk-form-group">
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
What kind of representation are you making?
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={appellantApplicantRepresentationArr}
/>
</div>
</div>
{/* <div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-three-quarters"
id="representationDescription"
name="representationDescription"
value="email"
data-aria-controls="representationDescription"
type="text"
component={RenderTextfield}
label="Description of representation"
/>
</div>
</div> */}
{props.representationTypeValue}
{props.procedureTypeValue}
<div className="govuk-grid-row">
<div className="govuk-form-group">
{console.log(props)}
typeof props.representationTypeValue == "undefined"
{props.representationTypeValue != "Questionnaire" ? (
<>
<p className="govuk-body">
You can enter your comments in the space
provided or attach a separate document.
</p>
<fieldset
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
<div
id="commentBox-hint"
className="govuk-hint"
>
My comments are set out in:
</div>
<div className="govuk-form-group">
<Field
name="representationComments"
id="representationComments"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
/>
</div>
</fieldset>
</>
) : (
<>
<fieldset
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Appeal procedure and site visit{" "}
</h3>
<div className="govuk-form-group">
<Field
label="5. Which procedure do you consider the appeal should follow?"
name="procedureType"
optionsArr={[
"Written representations",
"Hearing",
"Inquiry",
]}
id="procedureType"
component={RenderPickList}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
/>
{(procedureTypeValue == "Hearing" ||
procedureTypeValue ==
"Inquiry") && (
<Field
label="If Hearing or Inquiry, provide reasons here for why you consider this to be justified"
name="procedureTypeEvidence"
id="procedureTypeEvidence"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
richText="false"
/>
)}
<Field
label="6. Will the Inspector need to enter the appeal site/property?"
name="enterToView"
id="enterToView"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
/>
<div className="govuk-form-group">
<Field
name="enterNeighbouringLandToViewSite"
datafieldname="enterNeighbouringLandToViewSite"
options={["Yes", "No"]}
id="enterNeighbouringLandToViewSite"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"7. Do you consider that the Inspector needs to enter neighbouring private land/property to view the site?"
}
conditionalLabel={
"If Yes, give reasons and provide the neighbouring site address. If you have them, provide the contact details of the landowner in an attachment."
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="enterNeighbouringLandAccessRequired"
datafieldname="enterNeighbouringLandAccessRequired"
options={["Yes", "No"]}
id="enterNeighbouringLandAccessRequired"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"8. If access to private land/buildings is required, are you content for the Inspector to visit the site on an access required basis, with only the landowner or their representative present?"
}
conditionalLabel={
"If No, give reasons for why you consider an Accompanied Site Visit to be necessary"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="healthAndSafetyIssues"
datafieldname="healthAndSafetyIssues"
options={["Yes", "No"]}
id="healthAndSafetyIssues"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"9. Are you aware of any health and safety issues which would need to be considered when the Inspector visits the site?"
}
conditionalLabel={
"If Yes, describe the health and safety issues to be considered"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-three-quarters"
id="LPAcontactDetails"
name="LPAcontactDetails"
value="email"
data-aria-controls="LPAcontactDetails"
type="text"
component={RenderRichMultiline}
label="10. LPA contact for site visit, hearing or inquiry arrangements:"
/>
</div>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Supporting documents{" "}
</h3>
<div className="govuk-form-group">
<Field
label="11. LPA case file and representations"
name="LPAcaseFileAndReps"
id="LPAcaseFileAndReps"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
richText="false"
hint="Insert weblink(s) to case file and representations on the LPAs public portal. This must include all documents which were before the LPA at the time of its decision or when the appeal was made. Ensure that you link directly to the case documents list, not to a generic page on the LPAs portal. If web-based comments were also made, insert a second link to that page. Alternatively, state here if you are sending relevant case file documents under separate cover."
/>
</div>
<div className="govuk-form-group">
<Field
label="12. LPAs adopted local development plan and Proposals Map:"
name="LPAldpAndMap"
id="LPAldpAndMap"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
richText="false"
hint="Insert weblinks to the Written Statement of the adopted LDP/UDP, and the accompanying Proposals Map (including map key). Alternatively, list relevant policies here and attach excerpts."
/>
</div>
<div className="govuk-form-group">
<Field
label="13. Adopted local guidance relevant to the proposal"
name="LPAlocalGuidance"
id="LPAlocalGuidance"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={
props.name + "-hint"
}
richText="false"
hint="Insert weblink(s) to any relevant any local guidance (e.g. Supplementary Planning Guidance, Conservation Area appraisals) which the LPA considers relevant, specifying the document name before the web link. Alternatively, list the relevant guidance and attach copies/excerpts."
/>
</div>
<Field
label="14. If applicable, do you intend to submit a full statement at the 4- week stage?"
name="LPAintentionToSubmitFullStatement"
id="LPAintentionToSubmitFullStatement"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Statutory considerations
</h3>
<Field
label="15. Is all or part of the site within an Area of Outstanding Natural Beauty?"
name="AONB"
id="AONB"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="ROW"
datafieldname="ROW"
options={["Yes", "No"]}
id="ROW"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"16. Does the site include any public rights of way?"
}
conditionalLabel={
"If Yes, attach or insert a link to the definitive map and statement for the local area"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="conservationArea"
datafieldname="conservationArea"
options={["Yes", "No"]}
id="conservationArea"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"17. Is all or part of the site within a Conservation Area?"
}
conditionalLabel={
"If Yes, attach or insert links to a plan showing the Conservation Area boundary"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="affectListedBuilding"
datafieldname="affectListedBuilding"
options={["Yes", "No"]}
id="affectListedBuilding"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"18. Would the proposal involve works to, or affect the setting of, a listed building, Scheduled Monument or other designated historic asset?"
}
conditionalLabel={
"If Yes, attach or insert links to the listing description(s) and location plan"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="TPO"
datafieldname="TPO"
options={["Yes", "No"]}
id="TPO"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"19. Is any part of the site subject to a Tree Preservation Order?"
}
conditionalLabel={
"If Yes, attach or insert links to the relevant plan and details"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="natureConservationSite"
datafieldname="natureConservationSite"
options={["Yes", "No"]}
id="natureConservationSite"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"20. Is the site within or likely to affect an International or National Designated Site for nature conservation (as defined in Planning Policy Wales)?"
}
conditionalLabel={
"If Yes, specify the name and attach any relevant details"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="protectedSpecies"
datafieldname="protectedSpecies"
options={["Yes", "No"]}
id="protectedSpecies"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"21. Are any protected species likely to be affected by the proposal?"
}
conditionalLabel={
"If Yes, specify which and attach any relevant details"
}
optionSelect={"Yes"}
/>
</div>
<Field
label="22. Does the case involve persons claiming Gypsy/Traveller status, whether or not this is accepted by the LPA?"
name="gypsyTravellerInvolvment"
id="gypsyTravellerInvolvment"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="governmentDepartmentComments"
datafieldname="governmentDepartmentComments"
options={["Yes", "No"]}
id="governmentDepartmentComments"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"23. Have you received comments or directions from any government department/agency or statutory undertaker, including in response to a statutory notification or consultation?"
}
conditionalLabel={
"If Yes, specify which and attach any relevant details"
}
optionSelect={"Yes"}
/>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Suggested conditions
</h3>
<div className="govuk-form-group govuk-body-m">
24. Review the following standard
conditions and advise whether they would
be necessary if permission/consent is
granted (not applicable to Advertisement
consent proposals):
</div>
<Field
label="a) The development shall begin not later than five years from the date of this decision.
Reason: To comply with Section 91 of the Town and Country Planning Act 1990 / Section 18 of the Town and Country Planning (Listed Building and Conservation Areas) Act 1990."
name="developmentNotBeginLaterThanFiveYears"
id="developmentNotBeginLaterThanFiveYears"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="developmentCarriedOutInAccordance"
datafieldname="developmentCarriedOutInAccordance"
options={["Yes", "No"]}
id="developmentCarriedOutInAccordance"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"b) The development shall be carried out in accordance with the following approved plans and documents: ............................ Reason: To ensure the development is carried out in accordance with the approved documents, plans and drawings submitted with the application."
}
conditionalLabel={
"If Yes, list the approved plans, documents and drawings here or list them in an attached document"
}
optionSelect={"Yes"}
/>
</div>
<Field
label="c) No development shall take place until a scheme for biodiversity enhancement has been submitted to and agreed in writing by the local planning authority. Development shall be carried out in accordance with the approved details.
Reason: In the interests of maintaining and enhancing biodiversity, in accordance with Future Wales Policy 9."
name="developmentNotTakePlaceBiodiversity"
id="developmentNotTakePlaceBiodiversity"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<Field
label="d) No development shall take place until a scheme to enable the provision of gigabit capable broadband infrastructure from the site boundary to the dwellings/buildings hereby permitted has been submitted to and agreed in writing by the local planning authority. Development shall be carried out in accordance with the approved details.
Reason: To support the roll-out of digital communications infrastructure across Wales in accordance with Policy 13 of Future Wales."
name="developmentNotTakePlaceBroadband"
id="developmentNotTakePlaceBroadband"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="developmentAnyOtherConditions"
datafieldname="developmentAnyOtherConditions"
options={["Yes", "No"]}
id="developmentAnyOtherConditions"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"25. Do you consider other conditions, or amended versions of the above standard conditions, to be necessary?"
}
conditionalLabel={
"If Yes, list them here or in an attached document. Include reasons and relevant development plan policies. If you intend to send suggested conditions alongside your 4 week statement, state this here."
}
optionSelect={"Yes"}
/>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Before sending, have you attached or
provided a web link to:
</h3>
<div className="govuk-form-group">
<Field
name="copyOfApplicantsCertificate"
datafieldname="copyOfApplicantsCertificate"
options={["Yes", "No"]}
id="copyOfApplicantsCertificate"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"26. A copy of the applicants certificate confirming that they notified persons with an interest in the land?"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="advertismentGiven"
datafieldname="advertismentGiven"
options={["Yes", "No"]}
id="advertismentGiven"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"27. Evidence of any publicity given to the application, including site notices and local advertisement?**"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="copyOfLetterOfAppealNotification"
datafieldname="copyOfLetterOfAppealNotification"
options={["Yes", "No"]}
id="copyOfLetterOfAppealNotification"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"28. A copy of the letter with which you notified people of the appeal AND a list of the people you notified?"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="lpaEIAOS"
datafieldname="lpaEIAOS"
options={["Yes", "No"]}
id="lpaEIAOS"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"29. If Yes, insert weblink or attach a copy of the Screening Opinion and any related correspondence"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="advertismentConsentDiscontinuanceNotice"
datafieldname="advertismentConsentDiscontinuanceNotice"
options={["Yes", "No"]}
id="advertismentConsentDiscontinuanceNotice"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"30. Advertisement consent proposals only: A true copy of the Discontinuance Notice (if one has been issued)?"
}
conditionalLabel={
"If Yes, state how the use of the site or the display of the advertisement(s) enjoys the benefit of deemed consent"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="detailsOfOtherAppeals"
datafieldname="detailsOfOtherAppeals"
options={["Yes", "No"]}
id="detailsOfOtherAppeals"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"31. Details of other appeals or applications relating to the site, or a nearby site, which are still being considered by PEDW or the Welsh Ministers?"
}
conditionalLabel={
"If Yes, provide reference numbers and, if applicable, attach or insert links to relevant documents"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="detailsOfPreviousAppeals"
datafieldname="detailsOfPreviousAppeals"
options={["Yes", "No"]}
id="detailsOfPreviousAppeals"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"32. Details of any previous appeal decision relating to the site or a nearby site referred to by the LPA or applicant?"
}
conditionalLabel={
"If Yes, provide the reference number(s) and address(es) and attach or insert links to the decision(s) and any relevant application documents"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="otherRelevantInformation"
datafieldname="otherRelevantInformation"
options={["Yes", "No"]}
id="otherRelevantInformation"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={
RenderLPACondtionalRadioList
}
validate={[required]}
legend={
"33. Any other relevant information that we should know about?"
}
conditionalLabel={
"If Yes, provide a brief description and attach or insert links to the relevant details"
}
optionSelect={"Yes"}
/>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Declaration
</h3>
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-one-half"
id="caseOfficer"
name="caseOfficer"
data-aria-controls="caseOfficer"
type="text"
component={RenderTextfield}
label="Signed"
validate={[required]}
/>
</div>
<div className="govuk-form-group">
{onBehalfOfLPA} seww
<Field
className="govuk-input govuk-!-width-one-half"
id="onBehalfOfLPA"
name="onBehalfOfLPA"
data-aria-controls="caseOfficer"
type="text"
component={RenderTextfield}
label="On behalf of"
validate={[required]}
/>
</div>
<Field
name="signedDate"
id="signedDate"
label="Date"
component={RenderDatePicker}
validate={[required]}
errorMsg="Select a date"
dateStart="0"
dateEnd="1-y"
/>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
{" "}
<div className="govuk-form-group govuk-!-margin-bottom-9">
<FileUploadField
name={"representationDocuments"}
label={"Add your files"}
ticketnumber={
props.props.caseReference
}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
containerID={
props.props.props.accountDetails
.containerID
}
/>
</div>
</fieldset>
</>
)}
</div>{" "}
</div>
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
Continue
</button>
{/* <a
onClick={() => {
setRepresentationSubmit(false);
}}
className="govuk-button"
>
Continue
</a> */}
<a
onClick={() => {
//setRepresentationCapacity();
}}
className="govuk-link"
>
Back
</a>
</div>
</div>
</div>
</div>
);
};
const selector = formValueSelector("representationForm"); // <-- same as form name
RepLPA = connect((state) => {
const representationTypeValue = selector(state, "representationType");
const procedureTypeValue = selector(state, "procedureType");
return {
procedureTypeValue,
representationTypeValue,
};
})(RepLPA);
const mapStateToProps = (state, props) => {
console.log();
return {
initialValues: {
onBehalfOfLPA:
props.props.props.accountDetails.accountDetails[
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
],
},
};
};
export default connect(mapStateToProps)(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
})(RepLPA)
);
@@ -0,0 +1,102 @@
import Link from "next/link";
import { connect } from "react-redux";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import {
Field,
reduxForm,
formValueSelector,
handleSubmit,
reset,
} from "redux-form";
import {
RenderPickList,
RenderTextfield,
RenderRadioList,
RenderMultiline,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
import RepDetails from "./representationDetails";
import RepLPADetails from "./representationLPADetails";
import { setRepresentationCapacity } from "../../../store/currentView/action";
let RepLPACapacitySelection = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
formObj,
capacityOptionsArr,
currentType,
casesObj,
validate,
handleSubmit,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
<li key={file.path}>
{file.path} - {file.size} bytes
</li>
));
const required = (value) => (value ? undefined : "Required");
return (
<>
<RepLPADetails
formObj={formObj}
currentType={currentType}
casesObj={casesObj}
caseReference={props.props.caseReference}
searchResultsObj={props.props.searchResultsObj}
/>{" "}
<div id="rep-details" className="vo_hiddens">
<div className="govuk-grid-column-full">
<div className="govuk-grid-row">
{/* <h2 className="govuk-heading-m ">
Your details - {props.firstValue}
</h2> */}
{/* <div className="">
<label className="govuk-visually-hidden2">
<Field
name="representationCapacity"
datafieldname="representationCapacity"
label="In what capacity do you wish to make representations on this case?"
options={["LPA"]}
id="representationCapacity"
//className="govuk-radios__input "
errorMsg={t(
"newappeal:select-an-option-label"
)}
component="input"
validate={[required]}
value="LPA"
checked={"true"}
type="radio"
/>
LPA
</label>
</div> */}
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="govuk-button-group">
<button
type="submit"
className="govuk-button"
data-module="govuk-button"
>
{t("common:continue-button")}
</button>
</div>
</div>
</div>
</div>
</>
);
};
export default RepLPACapacitySelection;
@@ -0,0 +1,78 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm, formValueSelector } from "redux-form";
import {
RenderPickList,
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderCondtionalRadioList,
RenderLPACondtionalRadioList,
FileUploadField,
RenderRichMultiline,
RenderDatePicker,
} from "./representationElements";
let RepLPAQuestionnaire = (props) => {
return (
<>
<p className="govuk-body">
You can enter your comments in the space provided or attach a
separate document.
</p>
<fieldset
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
<div id="commentBox-hint" className="govuk-hint">
My comments are set out in: vcc
</div>
<div className="govuk-form-group">
<Field
name="representationComments"
id="representationComments"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
</div>
</fieldset>
</>
);
};
const selector = formValueSelector("representationForm"); // <-- same as form name
RepLPAQuestionnaire = connect((state) => {
const representationTypeValue = selector(state, "representationType");
const procedureTypeValue = selector(state, "procedureType");
return {
procedureTypeValue,
representationTypeValue,
};
})(RepLPAQuestionnaire);
const mapStateToProps = (state, props) => {
console.log();
return {
initialValues: {
onBehalfOfLPA:
props.props.props.props.accountDetails.accountDetails[
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
],
},
};
};
export default connect(mapStateToProps)(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
})(RepLPAQuestionnaire)
);
@@ -0,0 +1,103 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { Field, reduxForm } from "redux-form";
import { RenderPickList, RenderTextfield } from "./representationElements";
import jsonpath from "jsonpath";
const RepLPADetails = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const { currentType, casesObj, caseReference } = props;
let setCaseDetailsObj = props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
detailsObj = jsonpath.query(
setCaseDetailsObj,
'$..[?(@.pinswg_name=="' + caseReference + '")]'
);
detailsObj = detailsObj[0];
return (
<>
{" "}
<div className="govuk-grid-column-full">
<div id="rep-sumamry" className="govuk-grid-row">
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-applicant-label")}
</dt>
<dd className="govuk-summary-list__value">
{casesObj.appellantApplicant || ""}
{detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] || "not entered"}
</dd>
</div>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-agent-label")}
</dt>
<dd className="govuk-summary-list__value">
Mr A Agent
</dd>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-site-address-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1") &&
detailsObj.pinswg_siteaddressline1 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline2")
? detailsObj.pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline2") &&
detailsObj.pinswg_siteaddressline2 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
: ""}
{_.has(
detailsObj,
"pinswg_siteaddresscounty"
) &&
detailsObj.pinswg_siteaddresscounty !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresspostcode")
? detailsObj.pinswg_siteaddresspostcode
: ""}
</dd>
</div>
</dl>
</div>
<div className="govuk-grid-row">
<p className="govuk-body">
This form enables you to submit statements, comments and
questionaires on a case to Planning and Environment
Decisions Wales.{" "}
</p>
</div>
</div>
</>
);
};
export default RepLPADetails;
@@ -0,0 +1,795 @@
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm, formValueSelector } from "redux-form";
import {
RenderPickList,
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderCondtionalRadioList,
RenderLPACondtionalRadioList,
FileUploadField,
RenderRichMultiline,
RenderDatePicker,
} from "./representationElements";
import {
setRepresentationCapacity,
setRepresentationSubmit,
} from "../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
let RepLPAQuestionnaire = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
formObj,
appellantApplicantRepresentationArr,
setRepresentationCapacity,
setRepresentationSubmit,
currentView,
procedureTypeValue,
onBehalfOfLPA,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
<li key={file.path}>
{file.path} - {file.size} bytes
</li>
));
const required = (value) => (value ? undefined : "Required");
return (
<>
{props.representationTypeValue}
{props.procedureTypeValue}
<div className="govuk-grid-row">
<div className="govuk-form-group">
<>
<fieldset
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Appeal procedure and site visit{" "}
</h3>
<div className="govuk-form-group">
<Field
label="5. Which procedure do you consider the appeal should follow?"
name="procedureType"
optionsArr={[
"Written representations",
"Hearing",
"Inquiry",
]}
id="procedureType"
component={RenderPickList}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
{(procedureTypeValue == "Hearing" ||
procedureTypeValue == "Inquiry") && (
<Field
label="If Hearing or Inquiry, provide reasons here for why you consider this to be justified"
name="procedureTypeEvidence"
id="procedureTypeEvidence"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
richText="false"
/>
)}
<Field
label="6. Will the Inspector need to enter the appeal site/property?"
name="enterToView"
id="enterToView"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="enterNeighbouringLandToViewSite"
datafieldname="enterNeighbouringLandToViewSite"
options={["Yes", "No"]}
id="enterNeighbouringLandToViewSite"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"7. Do you consider that the Inspector needs to enter neighbouring private land/property to view the site?"
}
conditionalLabel={
"If Yes, give reasons and provide the neighbouring site address. If you have them, provide the contact details of the landowner in an attachment."
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="enterNeighbouringLandAccessRequired"
datafieldname="enterNeighbouringLandAccessRequired"
options={["Yes", "No"]}
id="enterNeighbouringLandAccessRequired"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"8. If access to private land/buildings is required, are you content for the Inspector to visit the site on an access required basis, with only the landowner or their representative present?"
}
conditionalLabel={
"If No, give reasons for why you consider an Accompanied Site Visit to be necessary"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="healthAndSafetyIssues"
datafieldname="healthAndSafetyIssues"
options={["Yes", "No"]}
id="healthAndSafetyIssues"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"9. Are you aware of any health and safety issues which would need to be considered when the Inspector visits the site?"
}
conditionalLabel={
"If Yes, describe the health and safety issues to be considered"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-three-quarters"
id="LPAcontactDetails"
name="LPAcontactDetails"
value="email"
data-aria-controls="LPAcontactDetails"
type="text"
component={RenderRichMultiline}
label="10. LPA contact for site visit, hearing or inquiry arrangements:"
/>
</div>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Supporting documents{" "}
</h3>
<div className="govuk-form-group">
<Field
label="11. LPA case file and representations"
name="LPAcaseFileAndReps"
id="LPAcaseFileAndReps"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
richText="false"
hint="Insert weblink(s) to case file and representations on the LPAs public portal. This must include all documents which were before the LPA at the time of its decision or when the appeal was made. Ensure that you link directly to the case documents list, not to a generic page on the LPAs portal. If web-based comments were also made, insert a second link to that page. Alternatively, state here if you are sending relevant case file documents under separate cover."
/>
</div>
<div className="govuk-form-group">
<Field
label="12. LPAs adopted local development plan and Proposals Map:"
name="LPAldpAndMap"
id="LPAldpAndMap"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
richText="false"
hint="Insert weblinks to the Written Statement of the adopted LDP/UDP, and the accompanying Proposals Map (including map key). Alternatively, list relevant policies here and attach excerpts."
/>
</div>
<div className="govuk-form-group">
<Field
label="13. Adopted local guidance relevant to the proposal"
name="LPAlocalGuidance"
id="LPAlocalGuidance"
component={RenderMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
richText="false"
hint="Insert weblink(s) to any relevant any local guidance (e.g. Supplementary Planning Guidance, Conservation Area appraisals) which the LPA considers relevant, specifying the document name before the web link. Alternatively, list the relevant guidance and attach copies/excerpts."
/>
</div>
<Field
label="14. If applicable, do you intend to submit a full statement at the 4- week stage?"
name="LPAintentionToSubmitFullStatement"
id="LPAintentionToSubmitFullStatement"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Statutory considerations
</h3>
<Field
label="15. Is all or part of the site within an Area of Outstanding Natural Beauty?"
name="AONB"
id="AONB"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="ROW"
datafieldname="ROW"
options={["Yes", "No"]}
id="ROW"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"16. Does the site include any public rights of way?"
}
conditionalLabel={
"If Yes, attach or insert a link to the definitive map and statement for the local area"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="conservationArea"
datafieldname="conservationArea"
options={["Yes", "No"]}
id="conservationArea"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"17. Is all or part of the site within a Conservation Area?"
}
conditionalLabel={
"If Yes, attach or insert links to a plan showing the Conservation Area boundary"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="affectListedBuilding"
datafieldname="affectListedBuilding"
options={["Yes", "No"]}
id="affectListedBuilding"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"18. Would the proposal involve works to, or affect the setting of, a listed building, Scheduled Monument or other designated historic asset?"
}
conditionalLabel={
"If Yes, attach or insert links to the listing description(s) and location plan"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="TPO"
datafieldname="TPO"
options={["Yes", "No"]}
id="TPO"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"19. Is any part of the site subject to a Tree Preservation Order?"
}
conditionalLabel={
"If Yes, attach or insert links to the relevant plan and details"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="natureConservationSite"
datafieldname="natureConservationSite"
options={["Yes", "No"]}
id="natureConservationSite"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"20. Is the site within or likely to affect an International or National Designated Site for nature conservation (as defined in Planning Policy Wales)?"
}
conditionalLabel={
"If Yes, specify the name and attach any relevant details"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="protectedSpecies"
datafieldname="protectedSpecies"
options={["Yes", "No"]}
id="protectedSpecies"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"21. Are any protected species likely to be affected by the proposal?"
}
conditionalLabel={
"If Yes, specify which and attach any relevant details"
}
optionSelect={"Yes"}
/>
</div>
<Field
label="22. Does the case involve persons claiming Gypsy/Traveller status, whether or not this is accepted by the LPA?"
name="gypsyTravellerInvolvment"
id="gypsyTravellerInvolvment"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="governmentDepartmentComments"
datafieldname="governmentDepartmentComments"
options={["Yes", "No"]}
id="governmentDepartmentComments"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"23. Have you received comments or directions from any government department/agency or statutory undertaker, including in response to a statutory notification or consultation?"
}
conditionalLabel={
"If Yes, specify which and attach any relevant details"
}
optionSelect={"Yes"}
/>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Suggested conditions
</h3>
<div className="govuk-form-group govuk-body-m">
24. Review the following standard conditions and
advise whether they would be necessary if
permission/consent is granted (not applicable to
Advertisement consent proposals):
</div>
<Field
label="a) The development shall begin not later than five years from the date of this decision.
Reason: To comply with Section 91 of the Town and Country Planning Act 1990 / Section 18 of the Town and Country Planning (Listed Building and Conservation Areas) Act 1990."
name="developmentNotBeginLaterThanFiveYears"
id="developmentNotBeginLaterThanFiveYears"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="developmentCarriedOutInAccordance"
datafieldname="developmentCarriedOutInAccordance"
options={["Yes", "No"]}
id="developmentCarriedOutInAccordance"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"b) The development shall be carried out in accordance with the following approved plans and documents: ............................ Reason: To ensure the development is carried out in accordance with the approved documents, plans and drawings submitted with the application."
}
conditionalLabel={
"If Yes, list the approved plans, documents and drawings here or list them in an attached document"
}
optionSelect={"Yes"}
/>
</div>
<Field
label="c) No development shall take place until a scheme for biodiversity enhancement has been submitted to and agreed in writing by the local planning authority. Development shall be carried out in accordance with the approved details.
Reason: In the interests of maintaining and enhancing biodiversity, in accordance with Future Wales Policy 9."
name="developmentNotTakePlaceBiodiversity"
id="developmentNotTakePlaceBiodiversity"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<Field
label="d) No development shall take place until a scheme to enable the provision of gigabit capable broadband infrastructure from the site boundary to the dwellings/buildings hereby permitted has been submitted to and agreed in writing by the local planning authority. Development shall be carried out in accordance with the approved details.
Reason: To support the roll-out of digital communications infrastructure across Wales in accordance with Policy 13 of Future Wales."
name="developmentNotTakePlaceBroadband"
id="developmentNotTakePlaceBroadband"
component={RenderRadioList}
options={["Yes", "No"]}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<div className="govuk-form-group">
<Field
name="developmentAnyOtherConditions"
datafieldname="developmentAnyOtherConditions"
options={["Yes", "No"]}
id="developmentAnyOtherConditions"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"25. Do you consider other conditions, or amended versions of the above standard conditions, to be necessary?"
}
conditionalLabel={
"If Yes, list them here or in an attached document. Include reasons and relevant development plan policies. If you intend to send suggested conditions alongside your 4 week statement, state this here."
}
optionSelect={"Yes"}
/>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">
Before sending, have you attached or provided a
web link to:
</h3>
<div className="govuk-form-group">
<Field
name="copyOfApplicantsCertificate"
datafieldname="copyOfApplicantsCertificate"
options={["Yes", "No"]}
id="copyOfApplicantsCertificate"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"26. A copy of the applicants certificate confirming that they notified persons with an interest in the land?"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="advertismentGiven"
datafieldname="advertismentGiven"
options={["Yes", "No"]}
id="advertismentGiven"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"27. Evidence of any publicity given to the application, including site notices and local advertisement?**"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="copyOfLetterOfAppealNotification"
datafieldname="copyOfLetterOfAppealNotification"
options={["Yes", "No"]}
id="copyOfLetterOfAppealNotification"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"28. A copy of the letter with which you notified people of the appeal AND a list of the people you notified?"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"No"}
/>
</div>
<div className="govuk-form-group">
<Field
name="lpaEIAOS"
datafieldname="lpaEIAOS"
options={["Yes", "No"]}
id="lpaEIAOS"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"29. If Yes, insert weblink or attach a copy of the Screening Opinion and any related correspondence"
}
conditionalLabel={
"Insert weblink here if available online. If No, give reasons"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="advertismentConsentDiscontinuanceNotice"
datafieldname="advertismentConsentDiscontinuanceNotice"
options={["Yes", "No"]}
id="advertismentConsentDiscontinuanceNotice"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"30. Advertisement consent proposals only: A true copy of the Discontinuance Notice (if one has been issued)?"
}
conditionalLabel={
"If Yes, state how the use of the site or the display of the advertisement(s) enjoys the benefit of deemed consent"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="detailsOfOtherAppeals"
datafieldname="detailsOfOtherAppeals"
options={["Yes", "No"]}
id="detailsOfOtherAppeals"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"31. Details of other appeals or applications relating to the site, or a nearby site, which are still being considered by PEDW or the Welsh Ministers?"
}
conditionalLabel={
"If Yes, provide reference numbers and, if applicable, attach or insert links to relevant documents"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="detailsOfPreviousAppeals"
datafieldname="detailsOfPreviousAppeals"
options={["Yes", "No"]}
id="detailsOfPreviousAppeals"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"32. Details of any previous appeal decision relating to the site or a nearby site referred to by the LPA or applicant?"
}
conditionalLabel={
"If Yes, provide the reference number(s) and address(es) and attach or insert links to the decision(s) and any relevant application documents"
}
optionSelect={"Yes"}
/>
</div>
<div className="govuk-form-group">
<Field
name="otherRelevantInformation"
datafieldname="otherRelevantInformation"
options={["Yes", "No"]}
id="otherRelevantInformation"
className="govuk-radios__input"
errorMsg={t(
"newappeal:select-an-option-label"
)}
component={RenderLPACondtionalRadioList}
validate={[required]}
legend={
"33. Any other relevant information that we should know about?"
}
conditionalLabel={
"If Yes, provide a brief description and attach or insert links to the relevant details"
}
optionSelect={"Yes"}
/>
</div>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
<h3 className="govuk-heading-s ">Declaration</h3>
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-one-half"
id="caseOfficer"
name="caseOfficer"
data-aria-controls="caseOfficer"
type="text"
component={RenderTextfield}
label="Signed"
validate={[required]}
/>
</div>
<div className="govuk-form-group">
{onBehalfOfLPA} seww
<Field
className="govuk-input govuk-!-width-one-half"
id="onBehalfOfLPA"
name="onBehalfOfLPA"
data-aria-controls="caseOfficer"
type="text"
component={RenderTextfield}
label="On behalf of"
validate={[required]}
/>
</div>
<Field
name="signedDate"
id="signedDate"
label="Date"
component={RenderDatePicker}
validate={[required]}
errorMsg="Select a date"
dateStart="0"
dateEnd="1-y"
/>
</fieldset>
<fieldset
className="govuk-fieldset govuk-!-margin-top-9"
aria-describedby="commentBox-hint"
>
{" "}
<div className="govuk-form-group govuk-!-margin-bottom-9">
<FileUploadField
name={"representationDocuments"}
label={"Add your files"}
ticketnumber={props.props.caseReference}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
containerID={
props.props.props.props.accountDetails
.containerID
}
/>
</div>
</fieldset>
</>
</div>{" "}
</div>
</>
);
};
const selector = formValueSelector("representationForm"); // <-- same as form name
RepLPAQuestionnaire = connect((state) => {
const representationTypeValue = selector(state, "representationType");
const procedureTypeValue = selector(state, "procedureType");
return {
procedureTypeValue,
representationTypeValue,
};
})(RepLPAQuestionnaire);
const mapStateToProps = (state, props) => {
console.log();
return {
initialValues: {
onBehalfOfLPA:
props.props.props.props.accountDetails.accountDetails[
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
],
},
};
};
export default connect(mapStateToProps)(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
})(RepLPAQuestionnaire)
);
File diff suppressed because it is too large Load Diff
@@ -7,6 +7,7 @@ import {
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderRichMultiline,
FileUploadField,
} from "./representationElements";
import { useDropzone } from "react-dropzone";
@@ -88,7 +89,7 @@ const RepLandOwner = (props) => {
<Field
name="representationComments"
id="representationComments"
component={RenderMultiline}
component={RenderRichMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
+27 -1
View File
@@ -385,7 +385,32 @@ const CaseSummary = (props) => {
</dl>
</div>
</div>
{/* <div className="govuk-grid-row">
<div className="govuk-grid-column-full">
todays date - {formatDates(new Date())}
<br />
pinswg_startdate -{" "}
{formatDates(detailsObj.pinswg_startdate)}
<br />
days between pinswg_startdate & todays date -
{Math.floor(
(new Date(detailsObj.pinswg_startdate) -
new Date()) /
(24 * 3600 * 1000)
)}
<br />
pinswg_statementduedate -{" "}
{formatDates(detailsObj.pinswg_statementduedate)}
<br />
pinswg_finalcommentsduedate -{" "}
{formatDates(detailsObj.pinswg_finalcommentsduedate)}
<br />
pinswg_startdatetimeiftheevent -{" "}
{formatDates(detailsObj.pinswg_startdatetimeiftheevent)}
<br /> <br />
</div>
</div>
*/}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="govuk-button-group">
@@ -415,6 +440,7 @@ const CaseSummary = (props) => {
)}
</a>
</Link>
<a
onClick={() => {
//spinnerState();
+6 -1
View File
@@ -182,7 +182,12 @@ const TopThree = (props) => {
<div className="cardModuleReference">
<b>{t("myportal:case-reference")}:</b>
{" "}
{showTopThreeArr[key].casereference}
{showTopThreeArr[key].caseRef}
</div>
<div className="cardModuleReference">
<b>Representation type:</b>
{" "}
{showTopThreeArr[key].representationType}
</div>
</div>
</div>
@@ -0,0 +1,392 @@
import ReactPDF, {
Document,
Page,
Text,
View,
Image,
StyleSheet,
PDFViewer,
Font,
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
const styles = StyleSheet.create({
page: {
backgroundColor: "white",
padding: 20,
fontSize: 16,
paddingBottom: 50,
},
header: {
fontSize: 25,
fontFamily: "Helvetica",
flexDirection: "row",
justifyContent: "space-between",
},
subHeader: {
fontSize: 20,
},
logoImage: { width: "200pt" },
questionBullet: { width: "5%", fontSize: 12 },
questionText: { width: "30%", fontSize: 12 },
questionTextMid: { width: "80%", fontSize: 12 },
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
questionAnswer: {
color: "#757575",
width: "65%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerMid: {
color: "#757575",
width: "20%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerWide: {
color: "#757575",
width: "95%",
fontSize: 12,
marginLeft: "5%",
border: 1,
borderColor: "#eee",
backgroundColor: "white",
padding: 5,
},
sectionContainer: {
backgroundColor: "#F8F8F8",
padding: 10,
marginTop: 20,
fontSize: 15,
},
pageNumber: {
position: "absolute",
fontSize: 12,
bottom: 20,
left: 0,
right: 0,
textAlign: "center",
color: "grey",
},
richArea: {
fontSize: 12,
color: "red",
flexDirection: "column",
},
});
// const renderer_1 = require("@react-pdf/renderer");
// const renderPara = {
// "p": ({ style, element, children }) =>
// createElement(renderer_1.View, { style: style }, children),
// };
export const finalComments_pdf = ({ docProps }) => {
//console.log("----", docProps);
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
return dd + "/" + mm + "/" + yyyy;
}
let values = docProps;
return (
<Document>
<Page size="A4" style={styles.page} wrap>
<View style={{ padding: 20 }}>
<View style={styles.header}>
<View>
<Text
style={{
width: "60%",
fontFamily: "Helvetica-Bold",
}}
>
Final Comments
</Text>
<View>
<Text
style={{
width: "60%",
fontSize: 15,
marginTop: 20,
fontFamily: "Helvetica-Bold",
}}
>
For Planning, Conservation area, Listed
Building and Advertisement
applications/appeals
</Text>
</View>
</View>
<Image
style={styles.logoImage}
src="public/assets/images/pedw_logo.png"
/>
</View>
<View style={styles.section}>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Case details</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>1.</Text>
<Text style={styles.questionText}>
PEDW reference:
</Text>
<Text style={styles.questionAnswer}>
{values.caseRef}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>2.</Text>
<Text style={styles.questionText}>
LPA reference:
</Text>
<Text style={styles.questionAnswer}>
{values.lpaRef}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>3.</Text>
<Text style={styles.questionText}>
Site address/grid ref:
</Text>
<Text style={styles.questionAnswer}>
123 Big Street, Small Town, Little County,
XD23 54X
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>4.</Text>
<Text style={styles.questionText}>
Case Type:
</Text>
<Text style={styles.questionAnswer}>
Planning applicaiton (s78)
</Text>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Comments</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>
5.
</Text>
<Text style={styles.questionTextMid}>
Final Comments
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.representationComments}
</Html>
</View>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>
Supporting documents
</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>11.</Text>
<Text style={styles.questionText}>
List of attachec files
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps}
</Html>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text>Declaration</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text
style={{ width: "40%", fontSize: 12 }}
>
Signed:
</Text>
<Text style={styles.questionAnswer}>
{values.caseOfficer}
</Text>
</View>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text style={styles.questionText}>
Date:
</Text>
<Text style={styles.questionAnswer}>
{formatDates(values.signedDate)}
</Text>
</View>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={{ width: "18%", fontSize: 12 }}>
On behalf of:
</Text>
<Text style={styles.questionAnswerWide}>
{values.onBehalfOfLPA}
</Text>
</View>
</View>
<View style={{ marginTop: 50, fontSize: 12 }}>
<Text>
* Article 11 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Regulation 7 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) (Wales) Regulations 2012
</Text>
<Text style={{ marginTop: 20 }}>
** Article 12 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Section 67/73 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) Act 1990; Regulation 10 of The Town and
Country Planning (Listed Buildings and
Conservation Areas) (Wales) Regulations 2012
</Text>
</View>
</View>
</View>
<Text
style={styles.pageNumber}
render={({ pageNumber, totalPages }) =>
`${pageNumber} / ${totalPages}`
}
fixed
/>
<View
fixed
style={{
position: "absolute",
top: 20,
left: 20,
bottom: 20,
right: 20,
border: 1,
borderColor: "#eee",
padding: 20,
paddingTop: 30,
height: "100%",
}}
></View>
</Page>
</Document>
);
};
File diff suppressed because it is too large Load Diff
+348
View File
@@ -0,0 +1,348 @@
import ReactPDF, {
Document,
Page,
Text,
View,
Image,
StyleSheet,
PDFViewer,
Font,
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
const styles = StyleSheet.create({
page: {
backgroundColor: "white",
padding: 20,
fontSize: 16,
paddingBottom: 50,
},
header: {
fontSize: 25,
fontFamily: "Helvetica",
flexDirection: "row",
justifyContent: "space-between",
},
subHeader: {
fontSize: 20,
},
logoImage: { width: "200pt" },
questionBullet: { width: "5%", fontSize: 12 },
questionText: { width: "30%", fontSize: 12 },
questionTextMid: { width: "80%", fontSize: 12 },
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
questionAnswer: {
color: "#757575",
width: "65%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerMid: {
color: "#757575",
width: "20%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerWide: {
color: "#757575",
width: "95%",
fontSize: 12,
marginLeft: "5%",
border: 1,
borderColor: "#eee",
backgroundColor: "white",
padding: 5,
},
sectionContainer: {
backgroundColor: "#F8F8F8",
padding: 10,
marginTop: 20,
fontSize: 15,
},
pageNumber: {
position: "absolute",
fontSize: 12,
bottom: 20,
left: 0,
right: 0,
textAlign: "center",
color: "grey",
},
richArea: {
fontSize: 12,
color: "red",
flexDirection: "column",
},
});
// const renderer_1 = require("@react-pdf/renderer");
// const renderPara = {
// "p": ({ style, element, children }) =>
// createElement(renderer_1.View, { style: style }, children),
// };
export const other_pdf = ({ docProps }) => {
//console.log("----", docProps);
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
return dd + "/" + mm + "/" + yyyy;
}
let values = docProps;
return (
<Document>
<Page size="A4" style={styles.page} wrap>
<View style={{ padding: 20 }}>
<View style={styles.header}>
<View>
<Text
style={{
width: "60%",
fontFamily: "Helvetica-Bold",
}}
>
Other
</Text>
<View>
<Text
style={{
width: "60%",
fontSize: 15,
marginTop: 20,
fontFamily: "Helvetica-Bold",
}}
>
For Planning, Conservation area, Listed
Building and Advertisement
applications/appeals
</Text>
</View>
</View>
<Image
style={styles.logoImage}
src="public/assets/images/pedw_logo.png"
/>
</View>
<View style={styles.section}>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Case details</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>1.</Text>
<Text style={styles.questionText}>
PEDW reference:
</Text>
<Text style={styles.questionAnswer}>
{values.caseRef}
</Text>
</View>
{/* <View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>4.</Text>
<Text style={styles.questionText}>
Case Type:
</Text>
<Text style={styles.questionAnswer}>
Planning applicaiton (s78)
</Text>
</View> */}
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Comments</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments}
</Html>
</View>
</View>
</View>
</View>
{/* <View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>
Supporting documents
</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>11.</Text>
<Text style={styles.questionText}>
List of attached files
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps}
</Html>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text>Declaration</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text
style={{ width: "40%", fontSize: 12 }}
>
Signed:
</Text>
<Text style={styles.questionAnswer}>
{values.caseOfficer}
</Text>
</View>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text style={styles.questionText}>
Date:
</Text>
<Text style={styles.questionAnswer}>
{formatDates(values.signedDate)}
</Text>
</View>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={{ width: "18%", fontSize: 12 }}>
On behalf of:
</Text>
<Text style={styles.questionAnswerWide}>
{values.onBehalfOfLPA}
</Text>
</View>
</View>
<View style={{ marginTop: 50, fontSize: 12 }}>
<Text>
* Article 11 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Regulation 7 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) (Wales) Regulations 2012
</Text>
<Text style={{ marginTop: 20 }}>
** Article 12 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Section 67/73 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) Act 1990; Regulation 10 of The Town and
Country Planning (Listed Buildings and
Conservation Areas) (Wales) Regulations 2012
</Text>
</View>
</View> */}
</View>
<Text
style={styles.pageNumber}
render={({ pageNumber, totalPages }) =>
`${pageNumber} / ${totalPages}`
}
fixed
/>
<View
fixed
style={{
position: "absolute",
top: 20,
left: 20,
bottom: 20,
right: 20,
border: 1,
borderColor: "#eee",
padding: 20,
paddingTop: 30,
height: "100%",
}}
></View>
</Page>
</Document>
);
};
+390
View File
@@ -0,0 +1,390 @@
import ReactPDF, {
Document,
Page,
Text,
View,
Image,
StyleSheet,
PDFViewer,
Font,
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
const styles = StyleSheet.create({
page: {
backgroundColor: "white",
padding: 20,
fontSize: 16,
paddingBottom: 50,
},
header: {
fontSize: 25,
fontFamily: "Helvetica",
flexDirection: "row",
justifyContent: "space-between",
},
subHeader: {
fontSize: 20,
},
logoImage: { width: "200pt" },
questionBullet: { width: "5%", fontSize: 12 },
questionText: { width: "30%", fontSize: 12 },
questionTextMid: { width: "80%", fontSize: 12 },
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
questionAnswer: {
color: "#757575",
width: "65%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerMid: {
color: "#757575",
width: "20%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerWide: {
color: "#757575",
width: "95%",
fontSize: 12,
marginLeft: "5%",
border: 1,
borderColor: "#eee",
backgroundColor: "white",
padding: 5,
},
sectionContainer: {
backgroundColor: "#F8F8F8",
padding: 10,
marginTop: 20,
fontSize: 15,
},
pageNumber: {
position: "absolute",
fontSize: 12,
bottom: 20,
left: 0,
right: 0,
textAlign: "center",
color: "grey",
},
richArea: {
fontSize: 12,
color: "red",
flexDirection: "column",
},
});
// const renderer_1 = require("@react-pdf/renderer");
// const renderPara = {
// "p": ({ style, element, children }) =>
// createElement(renderer_1.View, { style: style }, children),
// };
export const statement_pdf = ({ docProps }) => {
//console.log("----", docProps);
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
return dd + "/" + mm + "/" + yyyy;
}
let values = docProps;
return (
<Document>
<Page size="A4" style={styles.page} wrap>
<View style={{ padding: 20 }}>
<View style={styles.header}>
<View>
<Text
style={{
width: "60%",
fontFamily: "Helvetica-Bold",
}}
>
Statement
</Text>
<View>
<Text
style={{
width: "60%",
fontSize: 15,
marginTop: 20,
fontFamily: "Helvetica-Bold",
}}
>
For Planning, Conservation area, Listed
Building and Advertisement
applications/appeals
</Text>
</View>
</View>
<Image
style={styles.logoImage}
src="public/assets/images/pedw_logo.png"
/>
</View>
<View style={styles.section}>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Case details</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>1.</Text>
<Text style={styles.questionText}>
PEDW reference:
</Text>
<Text style={styles.questionAnswer}>
{values.caseRef}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>2.</Text>
<Text style={styles.questionText}>
LPA reference:
</Text>
<Text style={styles.questionAnswer}>
{values.lpaRef}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>3.</Text>
<Text style={styles.questionText}>
Site address/grid ref:
</Text>
<Text style={styles.questionAnswer}>
123 Big Street, Small Town, Little County,
XD23 54X
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>4.</Text>
<Text style={styles.questionText}>
Case Type:
</Text>
<Text style={styles.questionAnswer}>
Planning applicaiton (s78)
</Text>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Comments</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>
5.
</Text>
<Text style={styles.questionTextMid}>
Stament
</Text>
<Text style={styles.questionAnswerMid}>
{values.representationComment}
</Text>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>
Supporting documents
</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>11.</Text>
<Text style={styles.questionText}>
List of attached files
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps}
</Html>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text>Declaration</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text
style={{ width: "40%", fontSize: 12 }}
>
Signed:
</Text>
<Text style={styles.questionAnswer}>
{values.caseOfficer}
</Text>
</View>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text style={styles.questionText}>
Date:
</Text>
<Text style={styles.questionAnswer}>
{formatDates(values.signedDate)}
</Text>
</View>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={{ width: "18%", fontSize: 12 }}>
On behalf of:
</Text>
<Text style={styles.questionAnswerWide}>
{values.onBehalfOfLPA}
</Text>
</View>
</View>
<View style={{ marginTop: 50, fontSize: 12 }}>
<Text>
* Article 11 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Regulation 7 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) (Wales) Regulations 2012
</Text>
<Text style={{ marginTop: 20 }}>
** Article 12 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Section 67/73 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) Act 1990; Regulation 10 of The Town and
Country Planning (Listed Buildings and
Conservation Areas) (Wales) Regulations 2012
</Text>
</View>
</View>
</View>
<Text
style={styles.pageNumber}
render={({ pageNumber, totalPages }) =>
`${pageNumber} / ${totalPages}`
}
fixed
/>
<View
fixed
style={{
position: "absolute",
top: 20,
left: 20,
bottom: 20,
right: 20,
border: 1,
borderColor: "#eee",
padding: 20,
paddingTop: 30,
height: "100%",
}}
></View>
</Page>
</Document>
);
};
@@ -0,0 +1,390 @@
import ReactPDF, {
Document,
Page,
Text,
View,
Image,
StyleSheet,
PDFViewer,
Font,
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
const styles = StyleSheet.create({
page: {
backgroundColor: "white",
padding: 20,
fontSize: 16,
paddingBottom: 50,
},
header: {
fontSize: 25,
fontFamily: "Helvetica",
flexDirection: "row",
justifyContent: "space-between",
},
subHeader: {
fontSize: 20,
},
logoImage: { width: "200pt" },
questionBullet: { width: "5%", fontSize: 12 },
questionText: { width: "30%", fontSize: 12 },
questionTextMid: { width: "80%", fontSize: 12 },
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
questionAnswer: {
color: "#757575",
width: "65%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerMid: {
color: "#757575",
width: "20%",
fontSize: 12,
padding: 5,
border: 1,
borderColor: "#eee",
paddingLeft: 10,
backgroundColor: "white",
},
questionAnswerWide: {
color: "#757575",
width: "95%",
fontSize: 12,
marginLeft: "5%",
border: 1,
borderColor: "#eee",
backgroundColor: "white",
padding: 5,
},
sectionContainer: {
backgroundColor: "#F8F8F8",
padding: 10,
marginTop: 20,
fontSize: 15,
},
pageNumber: {
position: "absolute",
fontSize: 12,
bottom: 20,
left: 0,
right: 0,
textAlign: "center",
color: "grey",
},
richArea: {
fontSize: 12,
color: "red",
flexDirection: "column",
},
});
// const renderer_1 = require("@react-pdf/renderer");
// const renderPara = {
// "p": ({ style, element, children }) =>
// createElement(renderer_1.View, { style: style }, children),
// };
export const writtenStatement_pdf = ({ docProps }) => {
//console.log("----", docProps);
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
var dd = String(dateObj.getDate()).padStart(2, "0");
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
var yyyy = dateObj.getFullYear();
return dd + "/" + mm + "/" + yyyy;
}
let values = docProps;
return (
<Document>
<Page size="A4" style={styles.page} wrap>
<View style={{ padding: 20 }}>
<View style={styles.header}>
<View>
<Text
style={{
width: "60%",
fontFamily: "Helvetica-Bold",
}}
>
Written Statement
</Text>
<View>
<Text
style={{
width: "60%",
fontSize: 15,
marginTop: 20,
fontFamily: "Helvetica-Bold",
}}
>
For Planning, Conservation area, Listed
Building and Advertisement
applications/appeals
</Text>
</View>
</View>
<Image
style={styles.logoImage}
src="public/assets/images/pedw_logo.png"
/>
</View>
<View style={styles.section}>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Case details</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>1.</Text>
<Text style={styles.questionText}>
PEDW reference:
</Text>
<Text style={styles.questionAnswer}>
{values.caseRef}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>2.</Text>
<Text style={styles.questionText}>
LPA reference:
</Text>
<Text style={styles.questionAnswer}>
{values.lpaRef}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>3.</Text>
<Text style={styles.questionText}>
Site address/grid ref:
</Text>
<Text style={styles.questionAnswer}>
123 Big Street, Small Town, Little County,
XD23 54X
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>4.</Text>
<Text style={styles.questionText}>
Case Type:
</Text>
<Text style={styles.questionAnswer}>
Planning applicaiton (s78)
</Text>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Comments</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>
5.
</Text>
<Text style={styles.questionTextMid}>
Stament
</Text>
<Text style={styles.questionAnswerMid}>
{values.representationComment}
</Text>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>
Supporting documents
</Text>
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>11.</Text>
<Text style={styles.questionText}>
List of attached files
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps}
</Html>
</View>
</View>
</View>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text>Declaration</Text>
</View>
<View style={styles.sectionContainer}>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text
style={{ width: "40%", fontSize: 12 }}
>
Signed:
</Text>
<Text style={styles.questionAnswer}>
{values.caseOfficer}
</Text>
</View>
<View
style={{
flexDirection: "row",
marginBottom: 10,
alignItems: "center",
}}
>
<Text style={styles.questionText}>
Date:
</Text>
<Text style={styles.questionAnswer}>
{formatDates(values.signedDate)}
</Text>
</View>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={{ width: "18%", fontSize: 12 }}>
On behalf of:
</Text>
<Text style={styles.questionAnswerWide}>
{values.onBehalfOfLPA}
</Text>
</View>
</View>
<View style={{ marginTop: 50, fontSize: 12 }}>
<Text>
* Article 11 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Regulation 7 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) (Wales) Regulations 2012
</Text>
<Text style={{ marginTop: 20 }}>
** Article 12 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Section 67/73 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) Act 1990; Regulation 10 of The Town and
Country Planning (Listed Buildings and
Conservation Areas) (Wales) Regulations 2012
</Text>
</View>
</View>
</View>
<Text
style={styles.pageNumber}
render={({ pageNumber, totalPages }) =>
`${pageNumber} / ${totalPages}`
}
fixed
/>
<View
fixed
style={{
position: "absolute",
top: 20,
left: 20,
bottom: 20,
right: 20,
border: 1,
borderColor: "#eee",
padding: 20,
paddingTop: 30,
height: "100%",
}}
></View>
</Page>
</Document>
);
};
+1 -1
View File
@@ -238,7 +238,7 @@ export const getProgressObj = (
};
const BuildRowObj = (rowXML, titleList) => {
const rowObj = Object.keys(rowXML).map((key, index) => {
let rowObj = Object.keys(rowXML).map((key, index) => {
var doc = parser.parseFromString(rowXML[key].outerHTML, "text/xml");
if (_.isEmpty(rowXML[key].innerHTML)) {
("");