rich text field and pdf create for appeal

This commit is contained in:
2024-01-16 14:23:11 +00:00
parent e0badd6b11
commit 5f82c59abb
30 changed files with 592 additions and 288 deletions
+6
View File
@@ -24,6 +24,7 @@ const RenderTextfield = ({
meta: { touched, error },
...custom
}) => {
console.log(custom);
return (
<>
<div
@@ -53,6 +54,10 @@ const RenderTextfield = ({
id={id}
type={type}
disabled={disabled ? true : false}
maxLength={
custom.hasOwnProperty("maxFieldLength") &&
custom.maxFieldLength
}
/>
</div>
</>
@@ -469,6 +474,7 @@ let AboutYou = (props) => {
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t("newappeal:about-you-on-behalf-label")}
maxFieldLength="25"
/>
<div className="govuk-form-group">
<details className="govuk-details" data-module="govuk-details">
+19
View File
@@ -10,6 +10,7 @@ import {
PickList,
Radiofield,
ReadOnlyfield,
RichMultiLinefield,
Textfield,
YesNofield,
} from "../elements";
@@ -114,6 +115,7 @@ export default function BuildField(props) {
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
hint={props.hint}
maxFieldLength={props.maxFieldLength}
/>
);
break;
@@ -142,6 +144,21 @@ export default function BuildField(props) {
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
maxFieldLength={props.maxFieldLength}
/>
);
break;
case "{E0DECE4B-6666-4a8f-A065-082708572369}":
return (
<RichMultiLinefield
name={props.datafieldname}
label={props.label}
form={props.props.props.form}
formProps={props.props.props.props.form}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
validation={props.validation}
maxFieldLength={props.maxFieldLength}
/>
);
break;
@@ -155,6 +172,7 @@ export default function BuildField(props) {
validation={props.validation}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
maxFieldLength={props.maxFieldLength}
/>
);
break;
@@ -168,6 +186,7 @@ export default function BuildField(props) {
validation={props.validation}
parentField={props.parentField}
parentFieldShowOnValue={props.parentFieldShowOnValue}
maxFieldLength={props.maxFieldLength}
/>
);
break;
+5
View File
@@ -36,6 +36,7 @@ export default function BuildRow(props) {
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var validation = xpath.select("//@validation", doc);
var maxFieldLength = xpath.select("//@maxFieldLength", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
var datafieldcontent = xpath.select(
"//@datafieldcontent",
@@ -73,6 +74,9 @@ export default function BuildRow(props) {
? validation[0].value
: [];
maxFieldLength =
!_.isEmpty(maxFieldLength) && maxFieldLength[0].value;
parentField =
!_.isEmpty(parentField) && parentField[0].value;
@@ -150,6 +154,7 @@ export default function BuildRow(props) {
requiredDocumentLabel={requiredDocumentLabel}
requiredDocumentValue={requiredDocumentValue}
validation={validation}
maxFieldLength={maxFieldLength}
dateStart={dateStart}
dateEnd={dateEnd}
setDocumentsList={props.props.setDocumentsList}
+56 -3
View File
@@ -15,7 +15,13 @@ import {
setNewAppealProgress,
} from "../../store/appealType/action";
import { getFormCollectionByID, getProgressObj } from "../utils";
import { updateCase, patchCase, uploadFiles, sendEmail } from "../../actions";
import {
updateCase,
patchCase,
uploadFiles,
sendEmail,
generateAppealPDF,
} from "../../actions";
import { FieldsTranslations } from "../elements";
import jsonpath from "jsonpath";
@@ -132,13 +138,60 @@ let BuildSection = (props) => {
) => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = values || {};
let buildAppealFilesArray = [];
console.log("attached docs: - ", buildAppealFilesArray);
let filesUplaodObj = Object.keys(values)
.filter(function (k) {
return k.indexOf("pinswg_fileUpload") == 0;
})
.reduce(function (newData, k) {
newData[k] = values[k];
return newData;
}, {});
console.log(filesUplaodObj);
for (let key in filesUplaodObj) {
for (let j in filesUplaodObj[key]) {
buildAppealFilesArray.push({
"name": filesUplaodObj[key][j].name,
"size": filesUplaodObj[key][j].size,
});
}
}
console.log(buildAppealFilesArray);
Object.assign(values, { "filesList": buildAppealFilesArray });
setSavingStatus(useSaveStatus);
uploadAppealFiles(values);
props.setNewAppealProgress(
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
console.log(
"\n////////////////////////\n appeal pdf payload",
values,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber,
"\n////////////////////////\n"
);
let pdfObj = values;
Object.assign(pdfObj, {
"containerID": props.props.accountDetails.containerID,
"casefolderID": props.appealType.caseReference.ticketnumber,
});
generateAppealPDF(
pdfObj,
props.props.accountDetails.containerID,
props.appealType.caseReference.ticketnumber
),
props.setNewAppealProgress(
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
);
let appTypeCollection = getFormCollectionByID(
props.appealType.appealTypeID
);