Merged PR 1066: added agent details to new appeal pdf

added agent details to new appeal pdf

Related work items: #9494
This commit is contained in:
Robert Bond
2024-01-23 13:15:27 +00:00
7 changed files with 758 additions and 354 deletions
+12
View File
@@ -782,6 +782,18 @@ export const getCaseBlob = async (
return blobName;
};
export const getTempCaseBlob = async (containerName, caseReference) => {
const blobName = caseReference + "/case/" + caseReference + "_case.json";
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
const blobClient = containerClient.getBlobClient(blobName);
const downloadedBlob = await blobClient.download(0);
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
return JSON.parse(downloaded.toString());
};
export const getProgressBlobs = async (containerName, caseReference) => {
const containerToken = await createContainerSas(containerName);
+7 -2
View File
@@ -1388,7 +1388,8 @@ export const generateAppealPDF = async (
formValues,
containerID,
casefolderID,
appealType
appealType,
fileList
) => {
//let files = filesObj;
@@ -1396,7 +1397,11 @@ export const generateAppealPDF = async (
// var formData = new FormData();
// formValues.append("appealData", JSON.stringify(formValues));
// formValues.append("containerID", containerID);
// formValues.append("casefolderID", casefolderID);
//formValues.append("filesList", fileList);
Object.assign(formValues, {
"filesList": fileList.hasOwnProperty("value") ? fileList.value : [],
});
var queryUrl = "/api/file/generateappealpdf?appealType=" + appealType;
+307 -315
View File
@@ -1,14 +1,9 @@
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { useEffect } from "react";
import { useEffect, useState } from "react";
import { Field, formValueSelector, reduxForm, change } from "redux-form";
import {
FieldsTranslations,
Radiofield,
Textfield,
MultiLinefield,
} from "../elements";
import { tr } from "date-fns/locale";
const RenderTextfield = ({
id,
@@ -24,7 +19,7 @@ const RenderTextfield = ({
meta: { touched, error },
...custom
}) => {
console.log(custom);
//console.log(custom);
return (
<>
<div
@@ -108,6 +103,278 @@ const RenderMultiline = ({
);
};
const RenderYesNo = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
aria-describedby={name + "-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>
)}
<div className="govuk-radios govuk-radios--inline govuk-radios--small">
{Object.keys(options).map((key, index) => (
<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]}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{options[key]}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
const RenderRadio = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
let { t } = useTranslation();
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={datafieldname + "-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>
)}
<div
className={
custom.inline == false
? "govuk-radios govuk-radios--small"
: "govuk-radios govuk-radios--inline govuk-radios--small"
}
>
{" "}
{custom.hint != false ||
(custom.hint != undefined && (
<div className="govuk-hint">
{t(custom.hint)}
</div>
))}
{Object.keys(options).map((key, index) => (
<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].split("|")[0]}
validate={[required]}
// checked={
// value ==
// parseInt(options[key].split("|")[0])
// }
onChange={(e) => {
let docListObj = custom.documentList;
if (
custom.requiredDocumentValue ==
"Yes"
) {
e.target.value != "846040000"
? (docListObj = Object.assign(
docListObj,
{
["documentCheckList_" +
id]:
custom.requiredDocumentLabel,
}
))
: delete docListObj[
"documentCheckList_" + id
];
custom.setDocumentsList(docListObj);
}
}}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{t(options[key].split("|")[1])}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
function Radiofield(props) {
const {
name,
label,
datafieldname,
parentField,
form,
formProps,
parentFieldShowOnValue,
validation,
} = props;
const router = useRouter();
const required = (value) => (value ? undefined : "Required");
// console.log(props.options);
const fieldOptions = props.options
.slice(1, props.options.length - 1)
.split(",");
//parentFieldShowOnValue
var showIfHasParentShowValue = parentField != false;
//debugger;
// parentField != false &&
// !_.isEmpty(formProps[form]) &&
// _.has(formProps[form].values, parentField) &&
// parentFieldShowOnValue.indexOf(
// formProps[form].values[parentField].toString()
// ) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
// console.log(
// datafieldname,
// showIfHasParentShowValue,
// formProps[form].values[parentField]
// );
let { t } = useTranslation();
return (
<>
{parentField != false ? (
showIfHasParentShowValue && (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)
) : (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)}
</>
);
}
let AboutYou = (props) => {
let { t } = useTranslation();
@@ -122,6 +389,8 @@ let AboutYou = (props) => {
updateField,
} = props;
const [isAgent, setIsAgent] = useState(false);
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
const appellantAgent =
router.locale == "cy" ? ["Apelydd", "Asiant"] : ["Appellant", "Agent"];
@@ -142,282 +411,6 @@ let AboutYou = (props) => {
? "Invalid phone number"
: undefined;
const RenderYesNo = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
return (
<>
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group "
}
>
<fieldset
className="govuk-fieldset"
aria-describedby={name + "-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>
)}
<div className="govuk-radios govuk-radios--inline govuk-radios--small">
{Object.keys(options).map((key, index) => (
<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]}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{options[key]}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
const RenderRadio = ({
datafieldname,
name,
label,
id,
errorMsg,
options,
input: { onChange, value },
meta: { touched, error },
...custom
}) => {
let { t } = useTranslation();
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={datafieldname + "-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>
)}
<div
className={
custom.inline == false
? "govuk-radios govuk-radios--small"
: "govuk-radios govuk-radios--inline govuk-radios--small"
}
>
{" "}
{custom.hint != false ||
(custom.hint != undefined && (
<div className="govuk-hint">
{t(custom.hint)}
</div>
))}
{Object.keys(options).map((key, index) => (
<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].split("|")[0]}
validate={[required]}
// checked={
// value ==
// parseInt(options[key].split("|")[0])
// }
onChange={(e) => {
let docListObj =
custom.documentList;
if (
custom.requiredDocumentValue ==
"Yes"
) {
e.target.value != "846040000"
? (docListObj =
Object.assign(
docListObj,
{
["documentCheckList_" +
id]:
custom.requiredDocumentLabel,
}
))
: delete docListObj[
"documentCheckList_" +
id
];
custom.setDocumentsList(
docListObj
);
}
}}
/>
<label
className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index}
>
{t(options[key].split("|")[1])}
</label>
</div>
))}
</div>
</fieldset>
</div>
</>
);
};
function Radiofield(props) {
const {
name,
label,
datafieldname,
parentField,
form,
formProps,
parentFieldShowOnValue,
validation,
} = props;
const router = useRouter();
const required = (value) => (value ? undefined : "Required");
// console.log(props.options);
const fieldOptions = props.options
.slice(1, props.options.length - 1)
.split(",");
//parentFieldShowOnValue
var showIfHasParentShowValue = parentField != false;
//debugger;
// parentField != false &&
// !_.isEmpty(formProps[form]) &&
// _.has(formProps[form].values, parentField) &&
// parentFieldShowOnValue.indexOf(
// formProps[form].values[parentField].toString()
// ) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
// console.log(
// datafieldname,
// showIfHasParentShowValue,
// formProps[form].values[parentField]
// );
return (
<>
{parentField != false ? (
showIfHasParentShowValue && (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)
) : (
<Field
name={name}
datafieldname={datafieldname}
label={label}
options={fieldOptions}
id={name}
validate={[required]}
errorMsg={t("newappeal:select-an-option-label")}
component={RenderRadio}
inline={props.inline}
hint={props.hint}
//validate={eval(validation)}
requiredDocumentLabel={props.requiredDocumentLabel}
requiredDocumentValue={props.requiredDocumentValue}
setDocumentsList={props.setDocumentsList}
documentList={props.documentList}
/>
)}
</>
);
}
const onHandleSubmit = (values) => {
event.preventDefault();
console.log(JSON.stringify(values));
@@ -425,39 +418,39 @@ let AboutYou = (props) => {
};
const handlePartialUpdate = () => {
if (appellantAgentValue == "846040001") {
if (appellantAgentValue == "846040001" && isAgent == false) {
updateField("caseForm", "pinswg_appellantfirstname", "");
updateField("caseForm", "pinswg_appellantlastname", "");
updateField("caseForm", "pinswg_appellantemailaddress", "");
updateField("caseForm", "pinswg_appellantaddress", "");
updateField("caseForm", "pinswg_appellantphonenumber", "");
} else {
updateField(
"caseForm",
"pinswg_appellantfirstname",
props.initialValues.pinswg_appellantfirstname
);
updateField(
"caseForm",
"pinswg_appellantlastname",
props.initialValues.pinswg_appellantlastname
);
updateField(
"caseForm",
"pinswg_appellantemailaddress",
props.initialValues.pinswg_appellantemailaddress
);
updateField(
"caseForm",
"pinswg_appellantaddress",
props.initialValues.pinswg_appellantaddress
);
updateField(
"caseForm",
"pinswg_appellantphonenumber",
props.initialValues.pinswg_appellantphonenumber
);
}
setIsAgent(true);
} //else {
// updateField(
// "caseForm",
// "pinswg_appellantfirstname",
// props.initialValues.pinswg_appellantfirstname
// );
// updateField(
// "caseForm",
// "pinswg_appellantlastname",
// props.initialValues.pinswg_appellantlastname
// );
// updateField(
// "caseForm",
// "pinswg_appellantemailaddress",
// props.initialValues.pinswg_appellantemailaddress
// );
// updateField(
// "caseForm",
// "pinswg_appellantaddress",
// props.initialValues.pinswg_appellantaddress
// );
// updateField(
// "caseForm",
// "pinswg_appellantphonenumber",
// props.initialValues.pinswg_appellantphonenumber
// );
};
useEffect(() => {
@@ -506,7 +499,7 @@ let AboutYou = (props) => {
{t("newappeal:about-you-appellant-contact-details")}
</h2>
<Field
name={"[pinswg_appellantfirstname"}
name={"pinswg_appellantfirstname"}
id={"pinswg_appellantfirstname"}
component={RenderTextfield}
type="text"
@@ -595,7 +588,7 @@ let AboutYou = (props) => {
</h2>
<Field
name={"pinswg_appellantfirstname"}
id={"appellantfirstname"}
id={"pinswg_appellantfirstname"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
@@ -812,7 +805,6 @@ export default connect(
reduxForm({
form: "caseForm",
enableReinitialize: true, // this is needed!!
destroyOnUnmount: false,
})(AboutYou)
);
+2 -1
View File
@@ -188,7 +188,8 @@ let BuildSection = (props) => {
pdfObj,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber,
router.query.appealtypes
router.query.appealtypes,
props.appealType.fileList
),
props.setNewAppealProgress(
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
+56 -2
View File
@@ -9,6 +9,7 @@ import {
getFormCollectionByID,
getPickListLabel,
getRadioLabel,
bytesToSize,
} from "../../components/utils";
import ReactPDF, {
@@ -178,9 +179,17 @@ export const AppealRow_pdf = (props) => {
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
var datafieldcontent = xpath.select("//@datafieldcontent", doc);
var parentField = xpath.select("//@parentField", doc);
var parentFieldShowOnValue = xpath.select(
"//@parentFieldShowOnValue",
doc
);
var documentTypeCode = xpath.select(
"//@ishareDocumentCode",
doc
);
console.log(datafieldname[0].value);
return (
@@ -380,6 +389,52 @@ export const AppealRow_pdf = (props) => {
</View>
);
break;
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
const blobList = jsonpath.query(
props.filesList,
"$..[?(@.documentType=='" +
documentTypeCode[0].value +
"')]"
);
return (
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={
styles.questionTextWide
}
>
{rows[0].value}
</Text>
</View>
<View
style={
styles.questionAnswerWide
}
>
{blobList.map((blob, i) => (
<Text>
{blob.name} -{" "}
{bytesToSize(
blob.contentLength
)}
</Text>
))}
</View>
</View>
);
break;
default:
return (
<View
@@ -390,7 +445,6 @@ export const AppealRow_pdf = (props) => {
}}
>
<Text style={styles.questionText}>
{/* {FieldsTranslations(rows[0].value)} */}
{rows[0].value}
</Text>
<Text style={styles.questionAnswer}>
+359 -34
View File
@@ -10,7 +10,7 @@ import ReactPDF, {
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import { getFormCollectionByID } from "../utils";
import { getFormCollectionByID, bytesToSize } from "../utils";
import fs from "fs";
import xpath from "xpath";
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
@@ -36,7 +36,11 @@ const styles = StyleSheet.create({
},
logoImage: { width: "200pt" },
questionBullet: { width: "5%", fontSize: 12 },
questionText: { width: "30%", fontSize: 12 },
questionText: {
width: "35%",
fontSize: 12,
fontFamily: "Helvetica-Bold",
},
questionTextMid: { width: "80%", fontSize: 12 },
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
questionAnswer: {
@@ -139,7 +143,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
doc
);
//console.log(titles);
console.log("\n//////////\n The Case:\n", docProps.caseObj);
return (
<Document>
@@ -177,6 +181,326 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
/>
</View>
<View>
<View
style={{
marginTop: 10,
fontFamily: "Helvetica-Bold",
}}
>
<Text style={{ fontSize: 14 }}>Case Details</Text>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<View
style={{
flexDirection: "column",
marginBottom: 10,
}}
>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Appeal submitted on behalf of:
</Text>
<Text style={styles.questionAnswer}>
{" "}
{
values.caseObj
.pinswg_onbehalfof
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Appellant or Agent
</Text>
<Text style={styles.questionAnswer}>
{" "}
{values.caseObj
.pinswg_appellantagent ==
"846040000"
? "Appellant"
: "Agent"}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Appellant name
</Text>
<Text style={styles.questionAnswer}>
{values.caseObj
.pinswg_appellantfirstname +
" " +
values.caseObj
.pinswg_appellantlastname}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Appellant email address
</Text>
<Text style={styles.questionAnswer}>
{
values.caseObj
.pinswg_appellantemailaddress
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Appellant address
</Text>
<Text style={styles.questionAnswer}>
{
values.caseObj
.pinswg_appellantaddress
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Appellant phone number
</Text>
<Text style={styles.questionAnswer}>
{" "}
{
values.caseObj
.pinswg_appellantphonenumber
}
</Text>
</View>
{values.caseObj.pinswg_appellantagent !=
"846040000" && (
<>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={
styles.questionText
}
>
Company name
</Text>
<Text
style={
styles.questionAnswer
}
>
{
values.caseObj
.pinswg_agentcompanyname
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={
styles.questionText
}
>
Agent name
</Text>
<Text
style={
styles.questionAnswer
}
>
{
values.caseObj
.pinswg_agentfirstname
}{" "}
{
values.caseObj
.pinswg_agentlastname
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={
styles.questionText
}
>
Agent email address
</Text>
<Text
style={
styles.questionAnswer
}
>
{
values.caseObj
.pinswg_agentemailaddress
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={
styles.questionText
}
>
Agent address
</Text>
<Text
style={
styles.questionAnswer
}
>
{
values.caseObj
.pinswg_agentaddress
}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text
style={
styles.questionText
}
>
Agent phone number
</Text>
<Text
style={
styles.questionAnswer
}
>
{" "}
{
values.caseObj
.pinswg_agentphonenumber
}
</Text>
</View>
</>
)}
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
LPA
</Text>
<Text style={styles.questionAnswer}>
{values.caseObj.pinswg_lpaname}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Contact Preference
</Text>
<Text style={styles.questionAnswer}>
{values.caseObj
.pinswg_contactprefs ==
"846040000"
? "Email"
: "Post"}
</Text>
</View>
<View
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
Language Preference
</Text>
<Text style={styles.questionAnswer}>
{values.caseObj
.pinswg_contactprefs ==
"846040000"
? "English"
: "Welsh"}
</Text>
</View>
</View>
</View>
</View>
</View>
</View>
{Object.keys(titles).map((key) => (
<View key={key}>
<View
@@ -210,6 +534,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
key={key}
mandatoryFieldsData={null}
pickListData={pickListData}
filesList={values.filesList}
/>
</View>
</View>
@@ -218,7 +543,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
</View>
))}
<View>
{/* <View>
<View
style={{
marginTop: 10,
@@ -231,46 +556,46 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
</View>
<View style={styles.sectionContainer}>
<View
wrap={false}
style={{
flexDirection: "row",
flexDirection: "column",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>11.</Text>
<Text style={styles.questionTextWide}>
List of attached files
</Text>
<View
style={[
styles.questionAnswerWide,
{ flexDirection: "column" },
]}
wrap={false}
style={{
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionText}>
List of attached files
</Text>
</View>
<View
style={{
color: "#757575",
width: "100%",
fontSize: 12,
border: 1,
borderColor: "#eee",
backgroundColor: "white",
padding: 5,
marginBottom: 10,
lineHeight: 1.2,
}}
>
{values.hasOwnProperty("filesList") &&
values.filesList.map(function (p) {
return (
<View
key={p.name}
style={{
flexDirection: "row",
marginBottom: 4,
}}
>
<Text
styles={
styles.questionTextMid
}
>
{p.name} - {p.size}
</Text>
</View>
);
})}
values.filesList.map((key) => (
<Text style={{ marginBottom: 10 }}>
{key.name} -{" "}
{bytesToSize(key.contentLength)}
</Text>
))}
</View>
</View>
</View>
</View>
</View> */}
</View>
<Text
style={styles.pageNumber}
+15
View File
@@ -81,6 +81,7 @@ import {
uploadPDFAppealFiles,
downloadProgressFile,
getProgressBlobs,
getTempCaseBlob,
} from "../../../actions/azurestorage";
import { hashAPIPath } from "../../../actions";
@@ -127,6 +128,7 @@ export default async function handler(req, res) {
var containerID = appealBodyObj.containerID;
var casefolderID = appealBodyObj.casefolderID;
var caseRef = appealBodyObj.caseRef;
var filesList = appealBodyObj.filesList;
//console.log("there are files:", Object.keys(req.files).length);
@@ -165,6 +167,10 @@ export default async function handler(req, res) {
}
};
const tempCaseBlob = await getTempCaseBlob(containerID, casefolderID);
console.log("\n////////////////// the temp case blob obj:\n", tempCaseBlob);
const blobProgress = await getProgressBlobs(containerID, casefolderID).then(
(data) => {
console.log("Progress blob path:", data);
@@ -172,6 +178,15 @@ export default async function handler(req, res) {
}
);
let newFileListArr = blobProgress.filesList.concat(
appealBodyObj.filesList[0]
);
Object.assign(blobProgress, {
"filesList": newFileListArr,
"caseObj": tempCaseBlob,
});
//console.log(blobProgress);
//if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) {
// //createContainer(containerID).then((containerName) => {