added agent details to new appeal pdf
This commit is contained in:
@@ -782,6 +782,18 @@ export const getCaseBlob = async (
|
|||||||
return blobName;
|
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) => {
|
export const getProgressBlobs = async (containerName, caseReference) => {
|
||||||
const containerToken = await createContainerSas(containerName);
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -1388,7 +1388,8 @@ export const generateAppealPDF = async (
|
|||||||
formValues,
|
formValues,
|
||||||
containerID,
|
containerID,
|
||||||
casefolderID,
|
casefolderID,
|
||||||
appealType
|
appealType,
|
||||||
|
fileList
|
||||||
) => {
|
) => {
|
||||||
//let files = filesObj;
|
//let files = filesObj;
|
||||||
|
|
||||||
@@ -1396,7 +1397,11 @@ export const generateAppealPDF = async (
|
|||||||
// var formData = new FormData();
|
// var formData = new FormData();
|
||||||
// formValues.append("appealData", JSON.stringify(formValues));
|
// formValues.append("appealData", JSON.stringify(formValues));
|
||||||
// formValues.append("containerID", containerID);
|
// 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;
|
var queryUrl = "/api/file/generateappealpdf?appealType=" + appealType;
|
||||||
|
|
||||||
|
|||||||
+307
-315
@@ -1,14 +1,9 @@
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useEffect } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Field, formValueSelector, reduxForm, change } from "redux-form";
|
import { Field, formValueSelector, reduxForm, change } from "redux-form";
|
||||||
import {
|
import { tr } from "date-fns/locale";
|
||||||
FieldsTranslations,
|
|
||||||
Radiofield,
|
|
||||||
Textfield,
|
|
||||||
MultiLinefield,
|
|
||||||
} from "../elements";
|
|
||||||
|
|
||||||
const RenderTextfield = ({
|
const RenderTextfield = ({
|
||||||
id,
|
id,
|
||||||
@@ -24,7 +19,7 @@ const RenderTextfield = ({
|
|||||||
meta: { touched, error },
|
meta: { touched, error },
|
||||||
...custom
|
...custom
|
||||||
}) => {
|
}) => {
|
||||||
console.log(custom);
|
//console.log(custom);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<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 AboutYou = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -122,6 +389,8 @@ let AboutYou = (props) => {
|
|||||||
updateField,
|
updateField,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
const [isAgent, setIsAgent] = useState(false);
|
||||||
|
|
||||||
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
|
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
|
||||||
const appellantAgent =
|
const appellantAgent =
|
||||||
router.locale == "cy" ? ["Apelydd", "Asiant"] : ["Appellant", "Agent"];
|
router.locale == "cy" ? ["Apelydd", "Asiant"] : ["Appellant", "Agent"];
|
||||||
@@ -142,282 +411,6 @@ let AboutYou = (props) => {
|
|||||||
? "Invalid phone number"
|
? "Invalid phone number"
|
||||||
: undefined;
|
: 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) => {
|
const onHandleSubmit = (values) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log(JSON.stringify(values));
|
console.log(JSON.stringify(values));
|
||||||
@@ -425,39 +418,39 @@ let AboutYou = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handlePartialUpdate = () => {
|
const handlePartialUpdate = () => {
|
||||||
if (appellantAgentValue == "846040001") {
|
if (appellantAgentValue == "846040001" && isAgent == false) {
|
||||||
updateField("caseForm", "pinswg_appellantfirstname", "");
|
updateField("caseForm", "pinswg_appellantfirstname", "");
|
||||||
updateField("caseForm", "pinswg_appellantlastname", "");
|
updateField("caseForm", "pinswg_appellantlastname", "");
|
||||||
updateField("caseForm", "pinswg_appellantemailaddress", "");
|
updateField("caseForm", "pinswg_appellantemailaddress", "");
|
||||||
updateField("caseForm", "pinswg_appellantaddress", "");
|
updateField("caseForm", "pinswg_appellantaddress", "");
|
||||||
updateField("caseForm", "pinswg_appellantphonenumber", "");
|
updateField("caseForm", "pinswg_appellantphonenumber", "");
|
||||||
} else {
|
setIsAgent(true);
|
||||||
updateField(
|
} //else {
|
||||||
"caseForm",
|
// updateField(
|
||||||
"pinswg_appellantfirstname",
|
// "caseForm",
|
||||||
props.initialValues.pinswg_appellantfirstname
|
// "pinswg_appellantfirstname",
|
||||||
);
|
// props.initialValues.pinswg_appellantfirstname
|
||||||
updateField(
|
// );
|
||||||
"caseForm",
|
// updateField(
|
||||||
"pinswg_appellantlastname",
|
// "caseForm",
|
||||||
props.initialValues.pinswg_appellantlastname
|
// "pinswg_appellantlastname",
|
||||||
);
|
// props.initialValues.pinswg_appellantlastname
|
||||||
updateField(
|
// );
|
||||||
"caseForm",
|
// updateField(
|
||||||
"pinswg_appellantemailaddress",
|
// "caseForm",
|
||||||
props.initialValues.pinswg_appellantemailaddress
|
// "pinswg_appellantemailaddress",
|
||||||
);
|
// props.initialValues.pinswg_appellantemailaddress
|
||||||
updateField(
|
// );
|
||||||
"caseForm",
|
// updateField(
|
||||||
"pinswg_appellantaddress",
|
// "caseForm",
|
||||||
props.initialValues.pinswg_appellantaddress
|
// "pinswg_appellantaddress",
|
||||||
);
|
// props.initialValues.pinswg_appellantaddress
|
||||||
updateField(
|
// );
|
||||||
"caseForm",
|
// updateField(
|
||||||
"pinswg_appellantphonenumber",
|
// "caseForm",
|
||||||
props.initialValues.pinswg_appellantphonenumber
|
// "pinswg_appellantphonenumber",
|
||||||
);
|
// props.initialValues.pinswg_appellantphonenumber
|
||||||
}
|
// );
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -506,7 +499,7 @@ let AboutYou = (props) => {
|
|||||||
{t("newappeal:about-you-appellant-contact-details")}
|
{t("newappeal:about-you-appellant-contact-details")}
|
||||||
</h2>
|
</h2>
|
||||||
<Field
|
<Field
|
||||||
name={"[pinswg_appellantfirstname"}
|
name={"pinswg_appellantfirstname"}
|
||||||
id={"pinswg_appellantfirstname"}
|
id={"pinswg_appellantfirstname"}
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
@@ -595,7 +588,7 @@ let AboutYou = (props) => {
|
|||||||
</h2>
|
</h2>
|
||||||
<Field
|
<Field
|
||||||
name={"pinswg_appellantfirstname"}
|
name={"pinswg_appellantfirstname"}
|
||||||
id={"appellantfirstname"}
|
id={"pinswg_appellantfirstname"}
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
type="text"
|
type="text"
|
||||||
className="govuk-input govuk-input--width-20"
|
className="govuk-input govuk-input--width-20"
|
||||||
@@ -812,7 +805,6 @@ export default connect(
|
|||||||
reduxForm({
|
reduxForm({
|
||||||
form: "caseForm",
|
form: "caseForm",
|
||||||
enableReinitialize: true, // this is needed!!
|
enableReinitialize: true, // this is needed!!
|
||||||
|
|
||||||
destroyOnUnmount: false,
|
destroyOnUnmount: false,
|
||||||
})(AboutYou)
|
})(AboutYou)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -188,7 +188,8 @@ let BuildSection = (props) => {
|
|||||||
pdfObj,
|
pdfObj,
|
||||||
props.props.accountDetails.containerID,
|
props.props.accountDetails.containerID,
|
||||||
props.appealType.caseReference.ticketnumber,
|
props.appealType.caseReference.ticketnumber,
|
||||||
router.query.appealtypes
|
router.query.appealtypes,
|
||||||
|
props.appealType.fileList
|
||||||
),
|
),
|
||||||
props.setNewAppealProgress(
|
props.setNewAppealProgress(
|
||||||
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
|
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
getFormCollectionByID,
|
getFormCollectionByID,
|
||||||
getPickListLabel,
|
getPickListLabel,
|
||||||
getRadioLabel,
|
getRadioLabel,
|
||||||
|
bytesToSize,
|
||||||
} from "../../components/utils";
|
} from "../../components/utils";
|
||||||
|
|
||||||
import ReactPDF, {
|
import ReactPDF, {
|
||||||
@@ -178,9 +179,17 @@ export const AppealRow_pdf = (props) => {
|
|||||||
var rows = xpath.select("//label/@description", doc);
|
var rows = xpath.select("//label/@description", doc);
|
||||||
var fieldtype = xpath.select("//@classid", doc);
|
var fieldtype = xpath.select("//@classid", doc);
|
||||||
var datafieldname = xpath.select("//@datafieldname", doc);
|
var datafieldname = xpath.select("//@datafieldname", doc);
|
||||||
|
|
||||||
var datafieldcontent = xpath.select("//@datafieldcontent", 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);
|
console.log(datafieldname[0].value);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -380,6 +389,52 @@ export const AppealRow_pdf = (props) => {
|
|||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
break;
|
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:
|
default:
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
@@ -390,7 +445,6 @@ export const AppealRow_pdf = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text style={styles.questionText}>
|
<Text style={styles.questionText}>
|
||||||
{/* {FieldsTranslations(rows[0].value)} */}
|
|
||||||
{rows[0].value}
|
{rows[0].value}
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.questionAnswer}>
|
<Text style={styles.questionAnswer}>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import ReactPDF, {
|
|||||||
} from "@react-pdf/renderer";
|
} from "@react-pdf/renderer";
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
import Html from "react-pdf-html";
|
import Html from "react-pdf-html";
|
||||||
import { getFormCollectionByID } from "../utils";
|
import { getFormCollectionByID, bytesToSize } from "../utils";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import xpath from "xpath";
|
import xpath from "xpath";
|
||||||
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||||
@@ -36,7 +36,11 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
logoImage: { width: "200pt" },
|
logoImage: { width: "200pt" },
|
||||||
questionBullet: { width: "5%", fontSize: 12 },
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
questionText: { width: "30%", fontSize: 12 },
|
questionText: {
|
||||||
|
width: "35%",
|
||||||
|
fontSize: 12,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
},
|
||||||
questionTextMid: { width: "80%", fontSize: 12 },
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
questionAnswer: {
|
questionAnswer: {
|
||||||
@@ -139,7 +143,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
|
|||||||
doc
|
doc
|
||||||
);
|
);
|
||||||
|
|
||||||
//console.log(titles);
|
console.log("\n//////////\n The Case:\n", docProps.caseObj);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Document>
|
<Document>
|
||||||
@@ -177,6 +181,326 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</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) => (
|
{Object.keys(titles).map((key) => (
|
||||||
<View key={key}>
|
<View key={key}>
|
||||||
<View
|
<View
|
||||||
@@ -210,6 +534,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
|
|||||||
key={key}
|
key={key}
|
||||||
mandatoryFieldsData={null}
|
mandatoryFieldsData={null}
|
||||||
pickListData={pickListData}
|
pickListData={pickListData}
|
||||||
|
filesList={values.filesList}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -218,7 +543,7 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
|
|||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<View>
|
{/* <View>
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
@@ -231,46 +556,46 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
|
|||||||
</View>
|
</View>
|
||||||
<View style={styles.sectionContainer}>
|
<View style={styles.sectionContainer}>
|
||||||
<View
|
<View
|
||||||
wrap={false}
|
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "row",
|
flexDirection: "column",
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text style={styles.questionBullet}>11.</Text>
|
|
||||||
<Text style={styles.questionTextWide}>
|
|
||||||
List of attached files
|
|
||||||
</Text>
|
|
||||||
<View
|
<View
|
||||||
style={[
|
wrap={false}
|
||||||
styles.questionAnswerWide,
|
style={{
|
||||||
{ flexDirection: "column" },
|
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.hasOwnProperty("filesList") &&
|
||||||
values.filesList.map(function (p) {
|
values.filesList.map((key) => (
|
||||||
return (
|
<Text style={{ marginBottom: 10 }}>
|
||||||
<View
|
{key.name} -{" "}
|
||||||
key={p.name}
|
{bytesToSize(key.contentLength)}
|
||||||
style={{
|
</Text>
|
||||||
flexDirection: "row",
|
))}
|
||||||
marginBottom: 4,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
styles={
|
|
||||||
styles.questionTextMid
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{p.name} - {p.size}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View> */}
|
||||||
</View>
|
</View>
|
||||||
<Text
|
<Text
|
||||||
style={styles.pageNumber}
|
style={styles.pageNumber}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ import {
|
|||||||
uploadPDFAppealFiles,
|
uploadPDFAppealFiles,
|
||||||
downloadProgressFile,
|
downloadProgressFile,
|
||||||
getProgressBlobs,
|
getProgressBlobs,
|
||||||
|
getTempCaseBlob,
|
||||||
} from "../../../actions/azurestorage";
|
} from "../../../actions/azurestorage";
|
||||||
import { hashAPIPath } from "../../../actions";
|
import { hashAPIPath } from "../../../actions";
|
||||||
|
|
||||||
@@ -127,6 +128,7 @@ export default async function handler(req, res) {
|
|||||||
var containerID = appealBodyObj.containerID;
|
var containerID = appealBodyObj.containerID;
|
||||||
var casefolderID = appealBodyObj.casefolderID;
|
var casefolderID = appealBodyObj.casefolderID;
|
||||||
var caseRef = appealBodyObj.caseRef;
|
var caseRef = appealBodyObj.caseRef;
|
||||||
|
var filesList = appealBodyObj.filesList;
|
||||||
|
|
||||||
//console.log("there are files:", Object.keys(req.files).length);
|
//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(
|
const blobProgress = await getProgressBlobs(containerID, casefolderID).then(
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log("Progress blob path:", 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);
|
//console.log(blobProgress);
|
||||||
//if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) {
|
//if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) {
|
||||||
// //createContainer(containerID).then((containerName) => {
|
// //createContainer(containerID).then((containerName) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user