+15
-1
@@ -1270,7 +1270,21 @@ export const getAllProgressBlobs = async (containerName) => {
|
||||
// "\n////////////////////////////"
|
||||
// );
|
||||
|
||||
return blobObj;
|
||||
function removeDuplicates(arr) {
|
||||
const unique = arr.filter(
|
||||
(value, index, self) =>
|
||||
index ===
|
||||
self.findIndex(
|
||||
(t) =>
|
||||
t.name === value.name // Change 'id' to the property you're checking for uniqueness
|
||||
)
|
||||
);
|
||||
return unique;
|
||||
}
|
||||
|
||||
const result = removeDuplicates(blobObj);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getRepsBlobs = async (containerName) => {
|
||||
|
||||
@@ -865,50 +865,23 @@ let MakeRepresentation = (props) => {
|
||||
? (Object.assign(values, {
|
||||
"filesList": props.currentView.fileList,
|
||||
}),
|
||||
// commented out as dont need to create pdf on save
|
||||
// generateRepPDF(
|
||||
// values,
|
||||
// props.props.accountDetails.containerID,
|
||||
// currentView.caseReference.currentReference
|
||||
// ),
|
||||
uploadRepresentationFiles(values),
|
||||
router.replace(
|
||||
router.locale != "en"
|
||||
? router.locale + "/myportal"
|
||||
: "/myportal"
|
||||
))
|
||||
: //values.hasOwnProperty("representationDocuments") &&
|
||||
// sortFileObj()
|
||||
// (values.representationDocuments.map((Blob) =>
|
||||
// buildFileArray.push({
|
||||
// "name": Blob.name,
|
||||
// "size": Blob.size,
|
||||
// })
|
||||
// ),
|
||||
// Object.assign(values, {
|
||||
// "filesList": buildFileArray,
|
||||
// })),
|
||||
console.log("updated");
|
||||
uploadRepresentationFiles(values);
|
||||
// generateRepPDF(
|
||||
// values,
|
||||
// props.props.accountDetails.containerID,
|
||||
// currentView.caseReference.currentReference
|
||||
// );
|
||||
: Object.assign(values, {
|
||||
"filesList": props.currentView.fileList,
|
||||
}),
|
||||
console.log("Rep Updated - props.caseReference"),
|
||||
uploadRepresentationFiles(values);
|
||||
};
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
values = setRepFileName(values);
|
||||
|
||||
// values.representationType == "Questionnaire" &&
|
||||
// !values.hasOwnProperty("pinswg_lpareference") &&
|
||||
// Object.assign(values, {
|
||||
// "pinswg_lpareference":
|
||||
// searchResultsObj?.searchResultsObj?.value[0]
|
||||
// ?.pinswg_lpareference,
|
||||
// });
|
||||
|
||||
//console.log("onHandleSubmit form values - ", JSON.stringify(values));
|
||||
|
||||
const buildFileArray = [];
|
||||
@@ -1074,55 +1047,9 @@ let MakeRepresentation = (props) => {
|
||||
setRepresentationSubmit(true);
|
||||
setRepresentationSubmitConfirmation(true);
|
||||
} else {
|
||||
console.log("nit updated");
|
||||
console.log("not updated");
|
||||
}
|
||||
}
|
||||
|
||||
// currentView.representationSubmit != true
|
||||
// ? _.isEmpty(currentView.representationCapacity)
|
||||
// ? isLPA
|
||||
// ? setRepresentationCapacity("LPA")
|
||||
// : setRepresentationCapacity(
|
||||
// values.representationCapacity
|
||||
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||
// .toLowerCase()
|
||||
// )
|
||||
// : questionnaireCount != 0 &&
|
||||
// showQuestionnaireSection < questionnaireCount
|
||||
// ? (setShowQuestionnaireSection(showQuestionnaireSection + 1),
|
||||
// updateRepresentation(values, false, false))
|
||||
// : (updateRepresentation(values, false, false),
|
||||
// setRepresentationSubmit(true))
|
||||
// : currentView.representationSubmit == true
|
||||
// ? (console.log("capacity", currentView.representationCapacity),
|
||||
// console.log("has errors:", props.invalid),
|
||||
// Object.assign(values, { "locale": router.locale }),
|
||||
// props.invalid == false &&
|
||||
// updateRepresentation(values, false, false),
|
||||
// // values.hasOwnProperty("representationDocuments") &&
|
||||
// // (values.representationDocuments.map((Blob) =>
|
||||
// // buildFileArray.push({
|
||||
// // "name": Blob.name,
|
||||
// // "size": Blob.size,
|
||||
// // })
|
||||
// // ),
|
||||
// // Object.assign(values, {
|
||||
// // "filesList": buildFileArray,
|
||||
// // })),
|
||||
// console.log(
|
||||
// "====================== rep lpa payload:\n",
|
||||
// JSON.stringify(values)
|
||||
// ),
|
||||
// generateRepPDF(
|
||||
// values,
|
||||
// props.props.accountDetails.containerID,
|
||||
// currentView.caseReference.currentReference
|
||||
// ),
|
||||
// uploadRepresentationFiles(values),
|
||||
// setRepresentationSubmitConfirmation(true))
|
||||
// : console.log("nit updated");
|
||||
|
||||
//window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`);
|
||||
};
|
||||
|
||||
const cleanFilesList = (blobList) => {
|
||||
@@ -1184,14 +1111,9 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
var dataObj = values;
|
||||
|
||||
// for (let key in dataObj) {
|
||||
// _.includes(key, "representationDocuments") == true &&
|
||||
// delete dataObj[key];
|
||||
// }
|
||||
|
||||
uploadRepFiles(
|
||||
dataObj,
|
||||
fileListObj,
|
||||
[{}],
|
||||
values.containerID,
|
||||
props.caseReference + "/" + dataObj.repfile_name
|
||||
).then((data) => {
|
||||
@@ -1229,140 +1151,103 @@ let MakeRepresentation = (props) => {
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
{/* {!session ? (
|
||||
<>
|
||||
<div>
|
||||
<p className="govuk-body">
|
||||
{t(
|
||||
"myrepresentations:sign-in-to-raise-rep-label"
|
||||
)}{" "}
|
||||
<a
|
||||
href={
|
||||
"mailto:" +
|
||||
t(
|
||||
"myrepresentations:login-contact-email"
|
||||
)
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:login-contact-email"
|
||||
)}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
className="govuk-button withChevron govuk-button-cta"
|
||||
type="button"
|
||||
onClick={() => signIn()}
|
||||
>
|
||||
{t(
|
||||
"myrepresentations:sign-in-to-raise-rep-button"
|
||||
)}
|
||||
</button>
|
||||
</>
|
||||
) : ( */}
|
||||
<>
|
||||
<h1 className="govuk-heading-l">
|
||||
{t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{currentView.caseReference.currentReference}{" "}
|
||||
</h1>
|
||||
<div id="rep-form">
|
||||
<div className="govuk-grid-column-three-quarters wgForm">
|
||||
{whichControl()}
|
||||
</div>
|
||||
<h1 className="govuk-heading-l">
|
||||
{t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{currentView.caseReference.currentReference}{" "}
|
||||
</h1>
|
||||
<div id="rep-form">
|
||||
<div className="govuk-grid-column-three-quarters wgForm">
|
||||
{whichControl()}
|
||||
</div>
|
||||
|
||||
<div className="govuk-grid-column-one-quarter">
|
||||
{" "}
|
||||
<div className="card">
|
||||
<div className="card-body">
|
||||
<h2 className="govuk-heading-s">
|
||||
{t(
|
||||
"myrepresentations:timetable-title"
|
||||
)}{" "}
|
||||
</h2>
|
||||
<div className="govuk-summary-list">
|
||||
<div className="govuk-body-s">
|
||||
{currentView.caseReference
|
||||
.appealType == 846040011
|
||||
? t(
|
||||
"myrepresentations:local-impact-report"
|
||||
<div className="govuk-grid-column-one-quarter">
|
||||
{" "}
|
||||
<div className="card">
|
||||
<div className="card-body">
|
||||
<h2 className="govuk-heading-s">
|
||||
{t(
|
||||
"myrepresentations:timetable-title"
|
||||
)}{" "}
|
||||
</h2>
|
||||
<div className="govuk-summary-list">
|
||||
<div className="govuk-body-s">
|
||||
{currentView.caseReference
|
||||
.appealType == 846040011
|
||||
? t(
|
||||
"myrepresentations:local-impact-report"
|
||||
)
|
||||
: t(
|
||||
"myrepresentations:questionnaire-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{detailsObj.hasOwnProperty(
|
||||
"pinswg_questionnaireduedate"
|
||||
) ||
|
||||
detailsObj.hasOwnProperty(
|
||||
"pinswg_endofrepresentationperiod"
|
||||
)
|
||||
? formatDates(
|
||||
detailsObj.pinswg_questionnaireduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)
|
||||
: t(
|
||||
"myrepresentations:questionnaire-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{detailsObj.hasOwnProperty(
|
||||
"pinswg_questionnaireduedate"
|
||||
) ||
|
||||
detailsObj.hasOwnProperty(
|
||||
"pinswg_endofrepresentationperiod"
|
||||
)
|
||||
? formatDates(
|
||||
detailsObj.pinswg_questionnaireduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)
|
||||
: "N/A"}
|
||||
</span>
|
||||
</div>
|
||||
: "N/A"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:statements-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
{currentView.caseReference
|
||||
.appealType != 846040011 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:statements-due-label"
|
||||
"myrepresentations:final-comments-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
detailsObj.pinswg_finalcommentsduedate
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
{currentView.caseReference
|
||||
.appealType !=
|
||||
846040011 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:final-comments-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_finalcommentsduedate
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{formObj.hasOwnProperty(
|
||||
</div>
|
||||
<div>
|
||||
{formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"representationType"
|
||||
) &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"representationType"
|
||||
) &&
|
||||
formObj["representationForm"].values
|
||||
.representationType ==
|
||||
"Questionnaire" &&
|
||||
whichProgress()}
|
||||
</div>
|
||||
formObj["representationForm"].values
|
||||
.representationType ==
|
||||
"Questionnaire" &&
|
||||
whichProgress()}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
{/* )} */}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</form>
|
||||
|
||||
@@ -251,7 +251,7 @@ const RepCompleteSubmit = (props) => {
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
<a
|
||||
{/* <a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
@@ -261,11 +261,11 @@ const RepCompleteSubmit = (props) => {
|
||||
{t("common:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
{FieldsTranslations(
|
||||
rows[0].value
|
||||
)} */}
|
||||
)}
|
||||
</span>
|
||||
</a>
|
||||
</a> */}
|
||||
</dd>
|
||||
</div>
|
||||
{_.has(
|
||||
@@ -344,38 +344,41 @@ const RepCompleteSubmit = (props) => {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:representation-comments")}
|
||||
</dt>
|
||||
{repFormData.representationType !=
|
||||
"Questionnaire" && (
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:representation-comments")}
|
||||
</dt>
|
||||
|
||||
<dd className="govuk-summary-list__value">
|
||||
<span
|
||||
className="multiline-elipsis"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: repFormData.representationComments,
|
||||
}}
|
||||
/>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value">
|
||||
<span
|
||||
className="multiline-elipsis"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: repFormData.representationComments,
|
||||
}}
|
||||
/>
|
||||
</dd>
|
||||
|
||||
<dd className="govuk-summary-list__actions">
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setSubmitBack();
|
||||
}}
|
||||
>
|
||||
{t("common:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
<dd className="govuk-summary-list__actions">
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
setSubmitBack();
|
||||
}}
|
||||
>
|
||||
{t("common:change-link-label")}
|
||||
<span className="govuk-visually-hidden">
|
||||
{" "}
|
||||
{/* {FieldsTranslations(
|
||||
rows[0].value
|
||||
)} */}
|
||||
</span>
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
</span>
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
<div className="govuk-summary-list__row">
|
||||
<dt className="govuk-summary-list__key">
|
||||
{t("case:representation-files")}
|
||||
@@ -453,7 +456,10 @@ const RepCompleteSubmit = (props) => {
|
||||
{t(
|
||||
"myrepresentations:rep-check-tandc-para-two"
|
||||
)}{" "}
|
||||
<Link href={t("common:footer-privacy-link")}>
|
||||
<Link
|
||||
href={t("common:footer-privacy-link")}
|
||||
target="_blank"
|
||||
>
|
||||
{t(
|
||||
"common:footer-privacy-notice-link-label"
|
||||
)}
|
||||
|
||||
@@ -410,7 +410,7 @@ export const RenderLPACondtionalRadioList = ({
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
id={id + "-hint"}
|
||||
>
|
||||
{t(custom.hint)}
|
||||
{custom.hint}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -578,6 +578,7 @@ export const RenderTextfield = ({
|
||||
name={name}
|
||||
id={id}
|
||||
type={type}
|
||||
disabled={custom.disabled == true ? true : false}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -1045,7 +1046,6 @@ export const RenderFileUpload = (field) => {
|
||||
|
||||
// Handle accepted files (clear error message when files are accepted)
|
||||
const handleDropAccepted = () => {
|
||||
setErrorMessage(null); // Clear any previous error messages when files are accepted
|
||||
setRejectedFiles([]); // Clear any previously rejected file errorsss
|
||||
};
|
||||
|
||||
|
||||
+2
-1
@@ -1067,6 +1067,7 @@ let S78_Questionnaire = (props) => {
|
||||
label={t(
|
||||
"myrepresentations:s78-section-question-onbehalf"
|
||||
)}
|
||||
disabled={true}
|
||||
errorMsg={t("myrepresentations:is-required-label")}
|
||||
/>
|
||||
</div>
|
||||
@@ -1077,7 +1078,7 @@ let S78_Questionnaire = (props) => {
|
||||
component={RenderDatePicker}
|
||||
validate={[required]}
|
||||
dateStart="0"
|
||||
dateEnd="1-y"
|
||||
dateEnd="0"
|
||||
errorMsg={t("myrepresentations:is-required-label")}
|
||||
locale={locale}
|
||||
/>
|
||||
|
||||
@@ -9,7 +9,7 @@ import React, { useMemo, useState } from "react";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import Dropzone from "react-dropzone";
|
||||
import { Field, FieldArray } from "redux-form";
|
||||
import { Field, FieldArray, change } from "redux-form";
|
||||
import {
|
||||
deleteBlob,
|
||||
getFilesFromBlobHashed,
|
||||
@@ -2364,6 +2364,8 @@ export const FieldArrayForm = (props) => {
|
||||
maxSubField,
|
||||
} = props;
|
||||
|
||||
const dispatch = useDispatch(); // Get dispatch using useDispatch hook
|
||||
|
||||
var showIfHasParentShowValue =
|
||||
parentField != false &&
|
||||
!_.isEmpty(formProps[form]) &&
|
||||
@@ -2375,6 +2377,8 @@ export const FieldArrayForm = (props) => {
|
||||
(showIfHasParentShowValue == parentField) != false &&
|
||||
showIfHasParentShowValue;
|
||||
|
||||
!showIfHasParentShowValue && dispatch(change("appealForm", name, null));
|
||||
|
||||
parentFieldShowOnValue;
|
||||
const { handleSubmit, pristine, reset, submitting } = props;
|
||||
|
||||
|
||||
@@ -302,35 +302,41 @@ let BuildCheckRow = (props) => {
|
||||
"undefined" &&
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
].map((tenant, index) => {
|
||||
console.log(
|
||||
typeof tenant.pinswg_owners
|
||||
);
|
||||
return typeof tenant.pinswg_owners !=
|
||||
"undefined" ||
|
||||
typeof tenant.pinswg_agriculturaltenantname !=
|
||||
"undefined" ? (
|
||||
<div
|
||||
key={index}
|
||||
style={{
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
<div className="govuk-!-width-one-half">
|
||||
{tenant.pinswg_agriculturaltenantname ||
|
||||
tenant.pinswg_owners}
|
||||
] != null ? (
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
].map((tenant, index) => {
|
||||
console.log(
|
||||
typeof tenant.pinswg_owners
|
||||
);
|
||||
return typeof tenant.pinswg_owners !=
|
||||
"undefined" ||
|
||||
typeof tenant.pinswg_agriculturaltenantname !=
|
||||
"undefined" ? (
|
||||
<div
|
||||
key={index}
|
||||
style={{
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
<div className="govuk-!-width-one-half">
|
||||
{tenant.pinswg_agriculturaltenantname ||
|
||||
tenant.pinswg_owners}
|
||||
</div>
|
||||
<div className="govuk-!-width-one-half">
|
||||
Served:{" "}
|
||||
{formatDate(
|
||||
tenant.dateserved
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-!-width-one-half">
|
||||
Served:{" "}
|
||||
{formatDate(
|
||||
tenant.dateserved
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
);
|
||||
})
|
||||
) : (
|
||||
""
|
||||
);
|
||||
})
|
||||
) : (
|
||||
"N/A"
|
||||
)
|
||||
) : (
|
||||
props.props.form["appealForm"].values[
|
||||
datafieldname[0].value
|
||||
@@ -358,6 +364,7 @@ let BuildCheckRow = (props) => {
|
||||
</dd>
|
||||
</div>
|
||||
);
|
||||
|
||||
// }
|
||||
}
|
||||
})}
|
||||
|
||||
@@ -298,6 +298,7 @@ let BuildCheckSection = (props) => {
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two"
|
||||
)}{" "}
|
||||
<Link
|
||||
target="_blank"
|
||||
href={t(
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two-link"
|
||||
)}
|
||||
|
||||
@@ -158,7 +158,10 @@ export const AppealRow_pdf = (props) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
|
||||
@@ -104,7 +104,10 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
|
||||
@@ -21,7 +21,7 @@ const getTrans = (locale, key) => {
|
||||
|
||||
let jsonObj = locale == "cy" ? transLookupCY : transLookupEN;
|
||||
|
||||
console.log(locale, jsonObj[key]);
|
||||
//console.log(locale, jsonObj[key]);
|
||||
return jsonObj[key];
|
||||
};
|
||||
|
||||
@@ -68,9 +68,8 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
questionAnswerWide: {
|
||||
color: "#757575",
|
||||
width: "95%",
|
||||
width: "100%",
|
||||
fontSize: 12,
|
||||
marginLeft: "5%",
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
@@ -125,7 +124,10 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
@@ -398,7 +400,10 @@ export const finalComments_pdf = ({ docProps }) => {
|
||||
}
|
||||
>
|
||||
{p.name} -{" "}
|
||||
{bytesToSize(p.size)}{" "}
|
||||
{bytesToSize(
|
||||
p.size ||
|
||||
p.contentLength
|
||||
)}{" "}
|
||||
{"\n"}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@@ -61,6 +61,7 @@ const styles = StyleSheet.create({
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
paddingLeft: 10,
|
||||
paddingRight: 10,
|
||||
backgroundColor: "white",
|
||||
marginRight: 10,
|
||||
},
|
||||
@@ -86,9 +87,8 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
questionAnswerWide: {
|
||||
color: "#757575",
|
||||
width: "95%",
|
||||
width: "100%",
|
||||
fontSize: 12,
|
||||
marginLeft: "5%",
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
@@ -148,7 +148,10 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
@@ -557,7 +560,6 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
wrap={false}
|
||||
>
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
@@ -584,10 +586,8 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
flexDirection: "column",
|
||||
marginBottom: 10,
|
||||
}}
|
||||
wrap={false}
|
||||
>
|
||||
<View
|
||||
wrap={false}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
marginBottom: 10,
|
||||
@@ -1440,7 +1440,7 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{ width: "20%", fontSize: 12 }}
|
||||
style={{ width: "15%", fontSize: 12 }}
|
||||
>
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
@@ -1448,10 +1448,19 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
)}
|
||||
</Text>
|
||||
<Text
|
||||
style={styles.questionAnswerSmall}
|
||||
wrap={false}
|
||||
style={{
|
||||
color: "#757575",
|
||||
width: "310",
|
||||
fontSize: 12,
|
||||
padding: 5,
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
paddingRight: 10,
|
||||
}}
|
||||
wrap={true}
|
||||
>
|
||||
w{values.caseOfficer}
|
||||
{values.caseOfficer}
|
||||
</Text>
|
||||
</View>
|
||||
<View
|
||||
@@ -1461,7 +1470,13 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ width: "75", fontSize: 12 }}>
|
||||
<Text
|
||||
style={{
|
||||
width: "40",
|
||||
fontSize: 12,
|
||||
marginLeft: 10,
|
||||
}}
|
||||
>
|
||||
{getTrans(
|
||||
docProps.locale,
|
||||
"s78-section-question-date"
|
||||
|
||||
@@ -21,7 +21,7 @@ const getTrans = (locale, key) => {
|
||||
|
||||
let jsonObj = locale == "cy" ? transLookupCY : transLookupEN;
|
||||
|
||||
console.log(locale, jsonObj[key]);
|
||||
//console.log(locale, jsonObj[key]);
|
||||
return jsonObj[key];
|
||||
};
|
||||
|
||||
@@ -129,7 +129,10 @@ export const other_pdf = ({ docProps }) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
|
||||
@@ -18,7 +18,7 @@ const getTrans = (locale, key) => {
|
||||
|
||||
let jsonObj = locale == "cy" ? transLookupCY : transLookupEN;
|
||||
|
||||
console.log(locale, jsonObj[key]);
|
||||
//console.log(locale, jsonObj[key]);
|
||||
return jsonObj[key];
|
||||
};
|
||||
|
||||
@@ -65,9 +65,8 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
questionAnswerWide: {
|
||||
color: "#757575",
|
||||
width: "95%",
|
||||
width: "100%",
|
||||
fontSize: 12,
|
||||
marginLeft: "5%",
|
||||
border: 1,
|
||||
borderColor: "#eee",
|
||||
backgroundColor: "white",
|
||||
@@ -97,7 +96,7 @@ const styles = StyleSheet.create({
|
||||
});
|
||||
|
||||
export const statement_pdf = ({ docProps }) => {
|
||||
console.log("----", docProps);
|
||||
//console.log("----", docProps);
|
||||
function formatDates(dateObj) {
|
||||
var dateObj = new Date(dateObj);
|
||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||
@@ -122,7 +121,10 @@ export const statement_pdf = ({ docProps }) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
@@ -395,7 +397,10 @@ export const statement_pdf = ({ docProps }) => {
|
||||
}
|
||||
>
|
||||
{p.name} -{" "}
|
||||
{bytesToSize(p.size)}{" "}
|
||||
{bytesToSize(
|
||||
p.size ||
|
||||
p.contentLength
|
||||
)}{" "}
|
||||
{"\n"}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@@ -110,7 +110,10 @@ export const writtenStatement_pdf = ({ docProps }) => {
|
||||
function CleanHTML(htmlStr) {
|
||||
let cleanStr =
|
||||
typeof htmlStr === "string"
|
||||
? htmlStr.replace(/<p><br><\/p>/g, "")
|
||||
? htmlStr.replace(
|
||||
/<p><br><\/p>|<p class=\"ql-align-justify\"><br><\/p>/g,
|
||||
""
|
||||
)
|
||||
: "";
|
||||
|
||||
return cleanStr;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ class MyDocument extends Document {
|
||||
csp += `form-action 'self' ` + process.env.NEXTAUTH_URL + ` ;`;
|
||||
csp += `object-src 'self' data:;`;
|
||||
csp += `default-src 'self' https://www.google-analytics.com;`;
|
||||
csp += `connect-src 'self' http://127.0.0.1 https://maps.googleapis.com https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com;`;
|
||||
csp += `connect-src 'self' http://127.0.0.1 https://maps.googleapis.com https://uksouth-1.in.applicationinsights.azure.com https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com;`;
|
||||
csp += `script-src 'self' 'unsafe-eval' 'unsafe-inline' https://maps.googleapis.com https://ukwest-0.in.applicationinsights.azure.com https://region1.google-analytics.com https://www.google-analytics.com/ https://tagmanager.google.com/ https://www.googletagmanager.com/;`;
|
||||
csp += `style-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://www.google-analytics.com https://tagmanager.google.com/ https://www.googletagmanager.com/ https://fonts.googleapis.com/;`;
|
||||
csp += `img-src 'self' 'unsafe-inline' https://maps.gstatic.com https://maps.googleapis.com https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com https://www.google-analytics.com https://ssl.gstatic.com/ blob: data:;`;
|
||||
|
||||
+18
-12
@@ -35,20 +35,26 @@ ApiProxy.post(async (req, res) => {
|
||||
|
||||
repOrAppeal
|
||||
? createRepBlob(appealData, containerID, casefolderID).then((data) => {
|
||||
Object.keys(req.files).length > 0 &&
|
||||
uploadFile(req.files, containerID, casefolderID).then(
|
||||
(data) => {
|
||||
return res.status(200).json({ data });
|
||||
}
|
||||
);
|
||||
// Object.keys(req.files).length > 0 &&
|
||||
// uploadFile(req.files, containerID, casefolderID).then(
|
||||
// (data) => {
|
||||
// return res.status(200).json({ data });
|
||||
// }
|
||||
// );
|
||||
console.log("================================\nRepfile updated");
|
||||
return res.status(200).json({ data });
|
||||
})
|
||||
: createBlob(appealData, containerID, casefolderID).then((data) => {
|
||||
Object.keys(req.files).length > 0 &&
|
||||
uploadFile(req.files, containerID, casefolderID).then(
|
||||
(data) => {
|
||||
return res.status(200).json({ data });
|
||||
}
|
||||
);
|
||||
// Object.keys(req.files).length > 0 &&
|
||||
// uploadFile(req.files, containerID, casefolderID).then(
|
||||
// (data) => {
|
||||
// return res.status(200).json({ data });
|
||||
// }
|
||||
// );
|
||||
console.log(
|
||||
"================================\nAppeal file updated"
|
||||
);
|
||||
return res.status(200).json({ data });
|
||||
});
|
||||
//});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user