Merged PR 1151: updated naming convention meta and pdf fixes

updated naming convention meta and pdf fixes

Related work items: #11180
This commit is contained in:
Robert Bond
2024-05-20 11:43:39 +00:00
16 changed files with 254 additions and 143 deletions
+25 -1
View File
@@ -376,10 +376,22 @@ export const createRepPDFBlob = async (
const uploadBlobResponse = await blockBlobClient.uploadStream(content); const uploadBlobResponse = await blockBlobClient.uploadStream(content);
let whichLocation =
repName.indexOf("_IP_") > 0
? "Interested Party Representations"
: repName.indexOf("_Statement_") > 0
? "Main Party Statements"
: repName.indexOf("_Questionnaire_") > 0
? "Main Party Questionnaire"
: repName.indexOf("_Comments") > 0
? "Main Party Comments"
: "default";
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: caseID, caseID: caseID,
blobType: "Appeal PDF", blobType: "Representation PDF",
ishareLocation: whichLocation,
}; };
//console.log("the tags:", tags); //console.log("the tags:", tags);
@@ -466,11 +478,23 @@ export const uploadFile = async (formContent, containerName, foldername) => {
"\n////////////////////////////" "\n////////////////////////////"
); );
let whichLocation =
files[prop][0].fieldName.indexOf("_IP_") > 0
? "Interested Party Representations"
: files[prop][0].fieldName.indexOf("_Statement_") > 0
? "Main Party Statements"
: files[prop][0].fieldName.indexOf("_Questionnaire_") > 0
? "Main Party Questionnaire"
: files[prop][0].fieldName.indexOf("_Comments_") > 0
? "Main Party Comments"
: "default";
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: foldername.split("/")[0], caseID: foldername.split("/")[0],
documentType: files[prop][0].fieldName.split(".")[1], documentType: files[prop][0].fieldName.split(".")[1],
blobType: "RepresentationFile", blobType: "RepresentationFile",
ishareLocation: whichLocation,
}; };
const withTags = await blockBlobClient.setTags(tags); const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags); const withMeta = await blockBlobClient.setMetadata(tags);
+27 -6
View File
@@ -423,9 +423,12 @@ let MakeRepresentation = (props) => {
setRepresentationCapacity setRepresentationCapacity
} }
setRepresentationSubmit={setRepresentationSubmit} setRepresentationSubmit={setRepresentationSubmit}
onHandleSubmit={onHandleSubmit}
currentView={currentView} currentView={currentView}
setSubmitBack={setSubmitBack} setSubmitBack={setSubmitBack}
props={props} props={props}
caseReference={caseReference}
setRepFileName={setRepFileName}
/> />
); );
} }
@@ -495,9 +498,15 @@ let MakeRepresentation = (props) => {
Object.assign(values, { Object.assign(values, {
"containerID": props.props.accountDetails.containerID, "containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType, "appealType":
"incidentID": props.props.currentView.caseReference.incidentid, 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, "caseRef": props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
"pinswg_questionnaireduedate": "pinswg_questionnaireduedate":
detailsObj.pinswg_questionnaireduedate, detailsObj.pinswg_questionnaireduedate,
"pinswg_statementduedate": detailsObj.pinswg_statementduedate, "pinswg_statementduedate": detailsObj.pinswg_statementduedate,
@@ -550,8 +559,14 @@ let MakeRepresentation = (props) => {
"pinswg_name": "pinswg_name":
props.props.currentView.caseReference.currentReference, props.props.currentView.caseReference.currentReference,
"containerID": props.props.accountDetails.containerID, "containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType, "appealType":
"incidentID": props.props.currentView.caseReference.incidentid, 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, "caseRef": props.props.currentView.caseReference.currentReference,
}); });
@@ -658,10 +673,16 @@ let MakeRepresentation = (props) => {
(Object.assign(values, formObj.representationForm.values), (Object.assign(values, formObj.representationForm.values),
Object.assign(values, { Object.assign(values, {
"containerID": props.props.accountDetails.containerID, "containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType, "appealType":
"incidentID": props.props.currentView.caseReference.incidentid, props.props.currentView.caseReference.appealType ||
props.props.currentView.caseReference.repDetails.appealType,
"incidentID":
props.props.currentView.caseReference.incidentid ||
props.props.currentView.caseReference.repDetails.incidentid,
"caseRef": "caseRef":
props.props.currentView.caseReference.currentReference, props.props.currentView.caseReference.currentReference,
"casereference":
props.props.currentView.caseReference.currentReference,
"pinswg_questionnaireduedate": "pinswg_questionnaireduedate":
detailsObj.pinswg_questionnaireduedate, detailsObj.pinswg_questionnaireduedate,
"pinswg_statementduedate": detailsObj.pinswg_statementduedate, "pinswg_statementduedate": detailsObj.pinswg_statementduedate,
@@ -81,103 +81,120 @@ const RepAgent = (props) => {
)} )}
</div> </div>
</div> </div>
{(typeof props.representationType != "undefined" ||
<div className="govuk-grid-row"> typeof formObj.representationForm.values.representationType !=
<div className="govuk-form-group"> "undefined") && (
<Field <>
name="representationOnBehalfOf" <div className="govuk-grid-row">
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>
<div className="govuk-form-group"> <div className="govuk-form-group">
<Field <Field
name="representationComments" name="representationOnBehalfOf"
id="representationComments" datafieldname="representationOnBehalfOf"
component={RenderRichMultiline} // label={t("myrepresentations:capacity-select-what-capacity-label")}
type="text" options={["Yes", "No"]}
rows="5" id="representationOnBehalfOf"
className="govuk-textarea govuk-input--width-30" className="govuk-radios__input"
aria-describedby={props.name + "-hint"} errorMsg={t("newappeal:select-an-option-label")}
/> component={RenderCondtionalRadioList}
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5"> validate={[required]}
{t("myrepresentations:publish-policy-label")} legend={
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html"> "Are you acting on behalf of a company, group or organisation?"
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> </div>
{props.currentView.caseReference.hasOwnProperty( </div>
"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"> <div className="govuk-grid-row">
{blob.name} ( <div className="govuk-form-group">
{bytesToSize(blob.size)}) <p className="govuk-body">
</span> {t("myrepresentations:enter-comment-label")}
</div> </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-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
<button <button
@@ -1,4 +1,5 @@
import Link from "next/link"; import Link from "next/link";
import _ from "lodash";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux"; import { connect } from "react-redux";
@@ -225,9 +226,10 @@ let RepLPA = (props) => {
); );
resultsObj = resultsObj[0]; resultsObj = resultsObj[0];
props.formObj["representationForm"].values.hasOwnProperty( props.formObj["representationForm"].hasOwnProperty("values") &&
"representationCapacity" props.formObj["representationForm"].values.hasOwnProperty(
) && "representationCapacity"
) &&
props.formObj["representationForm"].values.hasOwnProperty( props.formObj["representationForm"].values.hasOwnProperty(
"representationType" "representationType"
) && ) &&
@@ -237,7 +239,39 @@ let RepLPA = (props) => {
<> <>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <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" ? ( .representationType == "undefined" ? (
<> <>
<h2 className="govuk-heading-m "> <h2 className="govuk-heading-m ">
@@ -269,15 +303,13 @@ let RepLPA = (props) => {
currentView.caseReference.appealType currentView.caseReference.appealType
).value} ).value}
</h2> </h2>
<label <label
className="govuk-label govuk-body-m" className="govuk-label govuk-body-m"
htmlFor="representationType" htmlFor="representationType"
> >
{t( {t(
"myrepresentations:representation-from-an-agent-heading" "myrepresentations:representation-from-an-lpa-heading"
)} )}
?
</label> </label>
<Field <Field
id="representationType" id="representationType"
@@ -295,14 +327,16 @@ let RepLPA = (props) => {
.representationType .representationType
}{" "} }{" "}
</label> </label>
)} )} */}
</div> </div>
</div> </div>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-form-group"> <div className="govuk-form-group">
{(typeof props.representationType != "undefined" || {(_.has(formObj["representationForm"], [
typeof formObj.representationForm.values "values",
.representationType != "undefined") && "representationType",
]) ||
typeof props.representationType != "undefined") &&
(props.representationType != "Questionnaire" ? ( (props.representationType != "Questionnaire" ? (
<> <>
<p className="govuk-body"> <p className="govuk-body">
@@ -369,8 +403,7 @@ let RepLPA = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-button-group"> <div className="govuk-button-group">
{(typeof props.representationType != "undefined" || {(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values _.has(formObj, "values", "representationType")) &&
.representationType != "undefined") &&
props.representationType == "Questionnaire" && ( props.representationType == "Questionnaire" && (
<> <>
{showQuestionnaireSection} {showQuestionnaireSection}
@@ -423,8 +456,7 @@ let RepLPA = (props) => {
</> </>
)}{" "} )}{" "}
{(typeof props.representationType != "undefined" || {(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values _.has(formObj, "values", "representationType")) &&
.representationType != "undefined") &&
props.representationType != "Questionnaire" && ( props.representationType != "Questionnaire" && (
<> <>
<button <button
@@ -486,6 +518,7 @@ const mapStateToProps = (state, props) => {
appealType: state.appealType, appealType: state.appealType,
currentView: state.currentView, currentView: state.currentView,
myRepresentations: state.myRepresentations, myRepresentations: state.myRepresentations,
watchedCases: state.watchedCases,
initialValues: initialValuesTemp, initialValues: initialValuesTemp,
}; };
}; };
@@ -48,7 +48,11 @@ let Enforcement_Questionnaire = (props) => {
let setCaseDetailsObj = router.query.hasOwnProperty("state") let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations ? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj : props.props.searchResultsObj.searchDetailsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj; : props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {}; var detailsObj = {};
@@ -63,7 +67,11 @@ let Enforcement_Questionnaire = (props) => {
let setCaseResultssObj = router.query.hasOwnProperty("state") let setCaseResultssObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations ? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj : props.props.searchResultsObj.searchResultsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj; : props.props.searchResultsObj.searchResultsObj;
detailsObj = detailsObj[0]; detailsObj = detailsObj[0];
@@ -51,7 +51,11 @@ let S78_Questionnaire = (props) => {
let setCaseDetailsObj = router.query.hasOwnProperty("state") let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations ? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj : props.props.searchResultsObj.searchDetailsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj; : props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {}; var detailsObj = {};
@@ -66,7 +70,11 @@ let S78_Questionnaire = (props) => {
let setCaseResultssObj = router.query.hasOwnProperty("state") let setCaseResultssObj = router.query.hasOwnProperty("state")
? router.query.state == "edit" ? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations ? props.props.myRepresentations.myRepresentations
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj : props.props.searchResultsObj.searchResultsObj
: currentView.caseReference.currentType == "watchedCases"
? props.props.watchedCases.watchedCases
: props.props.searchResultsObj.searchResultsObj; : props.props.searchResultsObj.searchResultsObj;
detailsObj = detailsObj[0]; detailsObj = detailsObj[0];
@@ -102,9 +110,6 @@ let S78_Questionnaire = (props) => {
return ( return (
<> <>
{props.representationTypeValue}
{props.procedureTypeValue}
{showQuestionnaireSection == 1 && ( {showQuestionnaireSection == 1 && (
<fieldset <fieldset
className="govuk-fieldset" className="govuk-fieldset"
+1 -1
View File
@@ -273,7 +273,7 @@ export const finalComments_pdf = ({ docProps }) => {
: :
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{appealTypeValue.value} {appealTypeValue.value || ""}
</Text> </Text>
</View> </View>
</View> </View>
+18 -19
View File
@@ -208,7 +208,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{values.lpaRef} {values.lpaRef || " "}
</Text> </Text>
</View> </View>
<View <View
@@ -244,7 +244,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{appealTypeValue.value} {appealTypeValue.value || ""}
</Text> </Text>
</View> </View>
</View> </View>
@@ -287,14 +287,14 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswerMid}> <Text style={styles.questionAnswerMid}>
{values.procedureType} {values.procedureType || ""}
</Text> </Text>
</View> </View>
{values.procedureType != {values.procedureType !=
"Written representations" && ( "Written representations" && (
<View style={styles.questionAnswerWide}> <View style={styles.questionAnswerWide}>
<Html style={styles.richArea}> <Html style={styles.richArea}>
{values.procedureTypeEvidence} {values.procedureTypeEvidence || ""}
</Html> </Html>
</View> </View>
)} )}
@@ -314,7 +314,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswerMid}> <Text style={styles.questionAnswerMid}>
{values.enterToView} {values.enterToView || ""}
</Text> </Text>
</View> </View>
@@ -340,7 +340,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswerMid}> <Text style={styles.questionAnswerMid}>
{values.enterNeighbouringLandToViewSite} {values.enterNeighbouringLandToViewSite ||
" "}
</Text> </Text>
</View> </View>
@@ -348,9 +349,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
"Yes" && ( "Yes" && (
<View style={styles.questionAnswerWide}> <View style={styles.questionAnswerWide}>
<Html style={{ fontSize: 12 }}> <Html style={{ fontSize: 12 }}>
{ {values.enterNeighbouringLandToViewSiteEvidence ||
values.enterNeighbouringLandToViewSiteEvidence " "}
}
</Html> </Html>
</View> </View>
)} )}
@@ -377,9 +377,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswerMid}> <Text style={styles.questionAnswerMid}>
{ {values.enterNeighbouringLandAccessRequired ||
values.enterNeighbouringLandAccessRequired " "}
}
</Text> </Text>
</View> </View>
{values.enterNeighbouringLandAccessRequired != {values.enterNeighbouringLandAccessRequired !=
@@ -414,7 +413,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswerMid}> <Text style={styles.questionAnswerMid}>
{values.healthAndSafetyIssues} {values.healthAndSafetyIssues || ""}
</Text> </Text>
</View> </View>
{values.healthAndSafetyIssues == "Yes" && ( {values.healthAndSafetyIssues == "Yes" && (
@@ -451,13 +450,12 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</View> </View>
<View style={styles.questionAnswerWide}> <View style={styles.questionAnswerWide}>
<Html style={styles.richArea}> <Html style={styles.richArea}>
{values.LPAcontactDetails} {values.LPAcontactDetails || ""}
</Html> </Html>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
<View> <View>
<View <View
style={{ style={{
@@ -489,7 +487,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text> </Text>
<View style={styles.questionAnswer}> <View style={styles.questionAnswer}>
<Html style={styles.richArea}> <Html style={styles.richArea}>
{values.LPAcaseFileAndReps} {values.LPAcaseFileAndReps || ""}
</Html> </Html>
</View> </View>
</View> </View>
@@ -509,7 +507,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text> </Text>
<View style={styles.questionAnswer}> <View style={styles.questionAnswer}>
<Html style={styles.richArea}> <Html style={styles.richArea}>
{values.LPAldpAndMap} {values.LPAldpAndMap || ""}
</Html> </Html>
</View> </View>
</View> </View>
@@ -529,7 +527,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
</Text> </Text>
<View style={styles.questionAnswer}> <View style={styles.questionAnswer}>
<Html style={styles.richArea}> <Html style={styles.richArea}>
{values.LPAlocalGuidance} {values.LPAlocalGuidance || ""}
</Html> </Html>
</View> </View>
</View> </View>
@@ -548,7 +546,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
)} )}
</Text> </Text>
<Text style={styles.questionAnswerMid}> <Text style={styles.questionAnswerMid}>
{values.LPAintentionToSubmitFullStatement} {values.LPAintentionToSubmitFullStatement ||
""}
</Text> </Text>
</View> </View>
</View> </View>
+2
View File
@@ -11,6 +11,7 @@ import ReactPDF, {
import { createElement } from "react"; import { createElement } from "react";
import Html from "react-pdf-html"; import Html from "react-pdf-html";
import { getFormCollectionByID } from "../../components/utils"; import { getFormCollectionByID } from "../../components/utils";
import useTranslation from "next-translate/useTranslation";
const styles = StyleSheet.create({ const styles = StyleSheet.create({
page: { page: {
@@ -88,6 +89,7 @@ const styles = StyleSheet.create({
}); });
export const other_pdf = ({ docProps }) => { export const other_pdf = ({ docProps }) => {
let { t } = useTranslation();
//console.log("----", docProps); //console.log("----", docProps);
function formatDates(dateObj) { function formatDates(dateObj) {
var dateObj = new Date(dateObj); var dateObj = new Date(dateObj);
+2 -2
View File
@@ -270,7 +270,7 @@ export const statement_pdf = ({ docProps }) => {
: :
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{appealTypeValue.value} {appealTypeValue.value || ""}
</Text> </Text>
</View> </View>
</View> </View>
@@ -315,7 +315,7 @@ export const statement_pdf = ({ docProps }) => {
</View> </View>
<View style={styles.questionAnswerWide}> <View style={styles.questionAnswerWide}>
<Html style={styles.richArea}> <Html style={styles.richArea}>
{values.representationComments} {values.representationComments || ""}
</Html> </Html>
</View> </View>
</View> </View>
@@ -201,7 +201,7 @@ export const writtenStatement_pdf = ({ docProps }) => {
Case Type: Case Type:
</Text> </Text>
<Text style={styles.questionAnswer}> <Text style={styles.questionAnswer}>
{appealTypeValue.value} {appealTypeValue.value || ""}
</Text> </Text>
</View> </View>
</View> </View>
+1
View File
@@ -6,6 +6,7 @@
"statements-due-label": "Datganiadau yn ddyledus", "statements-due-label": "Datganiadau yn ddyledus",
"final-comments-due-label": "Sylwadau terfynol yn ddyledus", "final-comments-due-label": "Sylwadau terfynol yn ddyledus",
"representation-from-an-agent-heading": "Cynrychiolaeth gan Asiant", "representation-from-an-agent-heading": "Cynrychiolaeth gan Asiant",
"representation-from-an-lpa-heading": "Cynrychiolaeth gan ACLl",
"representation-from-an-appellant-heading": "Cynrychiolaeth gan Apelydd", "representation-from-an-appellant-heading": "Cynrychiolaeth gan Apelydd",
"representation-from-an-interested-person-heading": "Cynrychiolaeth gan Barti/Person â Diddordeb", "representation-from-an-interested-person-heading": "Cynrychiolaeth gan Barti/Person â Diddordeb",
"kind-of-rep-label": "Pa fath o gynrychiolaeth ydych chi'n ei wneud?", "kind-of-rep-label": "Pa fath o gynrychiolaeth ydych chi'n ei wneud?",
+1
View File
@@ -6,6 +6,7 @@
"statements-due-label": "Statements due", "statements-due-label": "Statements due",
"final-comments-due-label": "Final comments due", "final-comments-due-label": "Final comments due",
"representation-from-an-agent-heading": "Representation from an Agent", "representation-from-an-agent-heading": "Representation from an Agent",
"representation-from-an-lpa-heading": "Representation from an LPA",
"representation-from-an-appellant-heading": "Representation from an Appellant", "representation-from-an-appellant-heading": "Representation from an Appellant",
"representation-from-an-interested-person-heading": "Representation from an Interested Party/Person", "representation-from-an-interested-person-heading": "Representation from an Interested Party/Person",
"kind-of-rep-label": "What kind of representation are you making?", "kind-of-rep-label": "What kind of representation are you making?",
+2 -2
View File
@@ -41,7 +41,7 @@ export default async function ApiProxy(req, res) {
incidentID + incidentID +
")?$select=ticketnumber,title,pinswg_appealcasetype"; ")?$select=ticketnumber,title,pinswg_appealcasetype";
//console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl)); console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
return axios return axios
.get( .get(
@@ -56,7 +56,7 @@ export default async function ApiProxy(req, res) {
res.status(200).json(data); res.status(200).json(data);
}) })
.catch((err) => { .catch((err) => {
console.log(consoleLogger(err)); consoleLogger(err);
res.status(400).json(err); res.status(400).json(err);
}); });
} }
+2 -2
View File
@@ -99,7 +99,7 @@ import { finalComments_pdf } from "../../../components/pdftemplates/finalComment
import { statement_pdf } from "../../../components/pdftemplates/statement_pdf"; import { statement_pdf } from "../../../components/pdftemplates/statement_pdf";
import { writtenStatement_pdf } from "../../../components/pdftemplates/writtenStatement_pdf"; import { writtenStatement_pdf } from "../../../components/pdftemplates/writtenStatement_pdf";
import { other_pdf } from "../../../components/pdftemplates/other_pdf"; import { other_pdf } from "../../../components/pdftemplates/other_pdf";
import { consoleLogger } from "../../../actions";
// const ApiProxy = nextConnect(); // const ApiProxy = nextConnect();
// ApiProxy.use(middleware); // ApiProxy.use(middleware);
@@ -241,7 +241,7 @@ export default async function handler(req, res) {
}); });
}) })
.catch((err) => { .catch((err) => {
console.log(consoleLogger(err)); consoleLogger(err);
res.status(400).json(err); res.status(400).json(err);
}); });
} }
+1 -1
View File
@@ -348,7 +348,7 @@ const getDetails = (resultsObj, detailsType) => {
caseID = data.ticketnumber; caseID = data.ticketnumber;
break; break;
case "myRepresentations": case "myRepresentations":
caseID = data.casereference; caseID = data.ticketnumber;
break; break;
default: default:
caseID = data.pinswg_title; caseID = data.pinswg_title;