updated naming convention meta and pdf fixes

This commit is contained in:
2024-05-20 12:42:53 +01:00
parent 206d08fa5e
commit d829213a6a
16 changed files with 254 additions and 143 deletions
+27 -6
View File
@@ -423,9 +423,12 @@ let MakeRepresentation = (props) => {
setRepresentationCapacity
}
setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
caseReference={caseReference}
setRepFileName={setRepFileName}
/>
);
}
@@ -495,9 +498,15 @@ let MakeRepresentation = (props) => {
Object.assign(values, {
"containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
"appealType":
props.props.currentView.caseReference.appealType ||
props.props.currentView.caseReference.repDetails.appealType,
"incidentID":
props.props.currentView.caseReference.incidentid ||
props.props.currentView.caseReference.repDetails.incidentid,
"caseRef": props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
"pinswg_questionnaireduedate":
detailsObj.pinswg_questionnaireduedate,
"pinswg_statementduedate": detailsObj.pinswg_statementduedate,
@@ -550,8 +559,14 @@ let MakeRepresentation = (props) => {
"pinswg_name":
props.props.currentView.caseReference.currentReference,
"containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
"appealType":
props.props.currentView.caseReference.appealType ||
props.props.currentView.caseReference.repDetails.appealType,
"casereference":
props.props.currentView.caseReference.currentReference,
"incidentID":
props.props.currentView.caseReference.incidentid ||
props.props.currentView.caseReference.repDetails.incidentid,
"caseRef": props.props.currentView.caseReference.currentReference,
});
@@ -658,10 +673,16 @@ let MakeRepresentation = (props) => {
(Object.assign(values, formObj.representationForm.values),
Object.assign(values, {
"containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
"appealType":
props.props.currentView.caseReference.appealType ||
props.props.currentView.caseReference.repDetails.appealType,
"incidentID":
props.props.currentView.caseReference.incidentid ||
props.props.currentView.caseReference.repDetails.incidentid,
"caseRef":
props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
"pinswg_questionnaireduedate":
detailsObj.pinswg_questionnaireduedate,
"pinswg_statementduedate": detailsObj.pinswg_statementduedate,
@@ -81,103 +81,120 @@ const RepAgent = (props) => {
)}
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
name="representationOnBehalfOf"
datafieldname="representationOnBehalfOf"
// label={t("myrepresentations:capacity-select-what-capacity-label")}
options={["Yes", "No"]}
id="representationOnBehalfOf"
className="govuk-radios__input"
errorMsg={t("newappeal:select-an-option-label")}
component={RenderCondtionalRadioList}
validate={[required]}
legend={
"Are you acting on behalf of a company, group or organisation?"
}
/>
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{t("myrepresentations:enter-comment-label")}
</p>
<fieldset
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
<div id="commentBox-hint" className="govuk-hint">
{t("myrepresentations:comments-set-out-label")}:
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values.representationType !=
"undefined") && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
name="representationComments"
id="representationComments"
component={RenderRichMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
{t("myrepresentations:publish-policy-label")}
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
</a>
</p>
</div>
<div className="govuk-form-group govuk-!-margin-bottom-9">
<FileUploadField
name={"representationDocuments"}
label={t("myrepresentations:add-files-label")}
ticketnumber={props.props.caseReference}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
containerID={
props.props.props.accountDetails.containerID
name="representationOnBehalfOf"
datafieldname="representationOnBehalfOf"
// label={t("myrepresentations:capacity-select-what-capacity-label")}
options={["Yes", "No"]}
id="representationOnBehalfOf"
className="govuk-radios__input"
errorMsg={t("newappeal:select-an-option-label")}
component={RenderCondtionalRadioList}
validate={[required]}
legend={
"Are you acting on behalf of a company, group or organisation?"
}
filenamePrefix={props}
/>
</div>
{props.currentView.caseReference.hasOwnProperty(
"repDetails"
) &&
props.currentView.caseReference.repDetails.filesList
.length > 0 ? (
<div className="govuk-form-group govuk-!-margin-bottom-9">
{props.currentView.caseReference.repDetails.filesList.map(
(blob, i) => (
<div
key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb "
>
<img
src={getThumbnailIconByExtension(
blob.name
)}
alt={blob.name}
width="50"
/>
</div>
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name} (
{bytesToSize(blob.size)})
</span>
</div>
)
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{t("myrepresentations:enter-comment-label")}
</p>
<fieldset
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
<div
id="commentBox-hint"
className="govuk-hint"
>
{t(
"myrepresentations:comments-set-out-label"
)}
:
</div>
<div className="govuk-form-group">
<Field
name="representationComments"
id="representationComments"
component={RenderRichMultiline}
type="text"
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
/>
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
{t(
"myrepresentations:publish-policy-label"
)}
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
</a>
</p>
</div>
<div className="govuk-form-group govuk-!-margin-bottom-9">
<FileUploadField
name={"representationDocuments"}
label={t(
"myrepresentations:add-files-label"
)}
ticketnumber={props.props.caseReference}
hint={"sdsd"}
fileList={[]}
setFilesForRepresentation={[]}
containerID={
props.props.props.accountDetails
.containerID
}
filenamePrefix={props}
/>
</div>
{props.currentView.caseReference.hasOwnProperty(
"repDetails"
) &&
props.currentView.caseReference.repDetails
.filesList.length > 0 ? (
<div className="govuk-form-group govuk-!-margin-bottom-9">
{props.currentView.caseReference.repDetails.filesList.map(
(blob, i) => (
<div
key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb "
>
<img
src={getThumbnailIconByExtension(
blob.name
)}
alt={blob.name}
width="50"
/>
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name} (
{bytesToSize(blob.size)}
)
</span>
</div>
)
)}
</div>
) : (
""
)}
</div>
) : (
""
)}
</fieldset>
</div>{" "}
</div>
</fieldset>
</div>{" "}
</div>
</>
)}
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -1,4 +1,5 @@
import Link from "next/link";
import _ from "lodash";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
@@ -225,9 +226,10 @@ let RepLPA = (props) => {
);
resultsObj = resultsObj[0];
props.formObj["representationForm"].values.hasOwnProperty(
"representationCapacity"
) &&
props.formObj["representationForm"].hasOwnProperty("values") &&
props.formObj["representationForm"].values.hasOwnProperty(
"representationCapacity"
) &&
props.formObj["representationForm"].values.hasOwnProperty(
"representationType"
) &&
@@ -237,7 +239,39 @@ let RepLPA = (props) => {
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
{!_.has(
formObj["representationForm"],
["values", "representationType"] ||
typeof props.representationType != "undefined"
) ? (
<>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:representation-from-an-lpa-heading"
)}
</label>
<Field
id="representationType"
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={appellantApplicantRepresentationArr}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
Representation Type:{" "}
{
formObj.representationForm.values
.representationType
}{" "}
</label>
)}
{/* {!formObj["representationForm"].hasOwnProperty("values") ||
typeof formObj.representationForm.values
.representationType == "undefined" ? (
<>
<h2 className="govuk-heading-m ">
@@ -269,15 +303,13 @@ let RepLPA = (props) => {
currentView.caseReference.appealType
).value}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:representation-from-an-agent-heading"
"myrepresentations:representation-from-an-lpa-heading"
)}
?
</label>
<Field
id="representationType"
@@ -295,14 +327,16 @@ let RepLPA = (props) => {
.representationType
}{" "}
</label>
)}
)} */}
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") &&
{(_.has(formObj["representationForm"], [
"values",
"representationType",
]) ||
typeof props.representationType != "undefined") &&
(props.representationType != "Questionnaire" ? (
<>
<p className="govuk-body">
@@ -369,8 +403,7 @@ let RepLPA = (props) => {
<div className="govuk-grid-row">
<div className="govuk-button-group">
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") &&
_.has(formObj, "values", "representationType")) &&
props.representationType == "Questionnaire" && (
<>
{showQuestionnaireSection}
@@ -423,8 +456,7 @@ let RepLPA = (props) => {
</>
)}{" "}
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") &&
_.has(formObj, "values", "representationType")) &&
props.representationType != "Questionnaire" && (
<>
<button
@@ -486,6 +518,7 @@ const mapStateToProps = (state, props) => {
appealType: state.appealType,
currentView: state.currentView,
myRepresentations: state.myRepresentations,
watchedCases: state.watchedCases,
initialValues: initialValuesTemp,
};
};
@@ -48,7 +48,11 @@ let Enforcement_Questionnaire = (props) => {
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
@@ -63,7 +67,11 @@ let Enforcement_Questionnaire = (props) => {
let setCaseResultssObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj;
detailsObj = detailsObj[0];
@@ -51,7 +51,11 @@ let S78_Questionnaire = (props) => {
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
@@ -66,7 +70,11 @@ let S78_Questionnaire = (props) => {
let setCaseResultssObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj;
detailsObj = detailsObj[0];
@@ -102,9 +110,6 @@ let S78_Questionnaire = (props) => {
return (
<>
{props.representationTypeValue}
{props.procedureTypeValue}
{showQuestionnaireSection == 1 && (
<fieldset
className="govuk-fieldset"
+1 -1
View File
@@ -273,7 +273,7 @@ export const finalComments_pdf = ({ docProps }) => {
:
</Text>
<Text style={styles.questionAnswer}>
{appealTypeValue.value}
{appealTypeValue.value || ""}
</Text>
</View>
</View>
+18 -19
View File
@@ -208,7 +208,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswer}>
{values.lpaRef}
{values.lpaRef || " "}
</Text>
</View>
<View
@@ -244,7 +244,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswer}>
{appealTypeValue.value}
{appealTypeValue.value || ""}
</Text>
</View>
</View>
@@ -287,14 +287,14 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.procedureType}
{values.procedureType || ""}
</Text>
</View>
{values.procedureType !=
"Written representations" && (
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.procedureTypeEvidence}
{values.procedureTypeEvidence || ""}
</Html>
</View>
)}
@@ -314,7 +314,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.enterToView}
{values.enterToView || ""}
</Text>
</View>
@@ -340,7 +340,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.enterNeighbouringLandToViewSite}
{values.enterNeighbouringLandToViewSite ||
" "}
</Text>
</View>
@@ -348,9 +349,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && (
<View style={styles.questionAnswerWide}>
<Html style={{ fontSize: 12 }}>
{
values.enterNeighbouringLandToViewSiteEvidence
}
{values.enterNeighbouringLandToViewSiteEvidence ||
" "}
</Html>
</View>
)}
@@ -377,9 +377,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{
values.enterNeighbouringLandAccessRequired
}
{values.enterNeighbouringLandAccessRequired ||
" "}
</Text>
</View>
{values.enterNeighbouringLandAccessRequired !=
@@ -414,7 +413,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.healthAndSafetyIssues}
{values.healthAndSafetyIssues || ""}
</Text>
</View>
{values.healthAndSafetyIssues == "Yes" && (
@@ -451,13 +450,12 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.LPAcontactDetails}
{values.LPAcontactDetails || ""}
</Html>
</View>
</View>
</View>
</View>
<View>
<View
style={{
@@ -489,7 +487,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps}
{values.LPAcaseFileAndReps || ""}
</Html>
</View>
</View>
@@ -509,7 +507,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAldpAndMap}
{values.LPAldpAndMap || ""}
</Html>
</View>
</View>
@@ -529,7 +527,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAlocalGuidance}
{values.LPAlocalGuidance || ""}
</Html>
</View>
</View>
@@ -548,7 +546,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)}
</Text>
<Text style={styles.questionAnswerMid}>
{values.LPAintentionToSubmitFullStatement}
{values.LPAintentionToSubmitFullStatement ||
""}
</Text>
</View>
</View>
+2
View File
@@ -11,6 +11,7 @@ import ReactPDF, {
import { createElement } from "react";
import Html from "react-pdf-html";
import { getFormCollectionByID } from "../../components/utils";
import useTranslation from "next-translate/useTranslation";
const styles = StyleSheet.create({
page: {
@@ -88,6 +89,7 @@ const styles = StyleSheet.create({
});
export const other_pdf = ({ docProps }) => {
let { t } = useTranslation();
//console.log("----", docProps);
function formatDates(dateObj) {
var dateObj = new Date(dateObj);
+2 -2
View File
@@ -270,7 +270,7 @@ export const statement_pdf = ({ docProps }) => {
:
</Text>
<Text style={styles.questionAnswer}>
{appealTypeValue.value}
{appealTypeValue.value || ""}
</Text>
</View>
</View>
@@ -315,7 +315,7 @@ export const statement_pdf = ({ docProps }) => {
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments}
{values.representationComments || ""}
</Html>
</View>
</View>
@@ -201,7 +201,7 @@ export const writtenStatement_pdf = ({ docProps }) => {
Case Type:
</Text>
<Text style={styles.questionAnswer}>
{appealTypeValue.value}
{appealTypeValue.value || ""}
</Text>
</View>
</View>