diff --git a/components/elements/index.js b/components/elements/index.js
index faf92d20..917ddf91 100644
--- a/components/elements/index.js
+++ b/components/elements/index.js
@@ -1,4 +1,4 @@
-import { Field, reduxForm } from "redux-form";
+import { Field, reduxForm, FieldArray } from "redux-form";
import { useRouter } from "next/router";
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
import React, { useCallback, useEffect, useMemo, useState } from "react";
@@ -1736,3 +1736,94 @@ const RenderFileUpload = (field) => {
>
);
};
+
+const renderField = ({ input, label, type, meta: { touched, error } }) => (
+
+
+
+
+ {touched && error && {error}}
+
+
+);
+
+const renderSubFields = ({ fields }) => (
+
+);
+
+export const FieldArrayForm = (props) => {
+ const {
+ name,
+ label,
+ validation,
+ form,
+ formProps,
+ parentFieldShowOnValue,
+ parentField,
+ maxFieldLength,
+ } = props;
+
+ var showIfHasParentShowValue =
+ parentField != false &&
+ !_.isEmpty(formProps[form]) &&
+ _.has(formProps[form].values, parentField) &&
+ parentFieldShowOnValue.indexOf(
+ formProps[form].values[parentField].toString()
+ ) > -1;
+
+ (showIfHasParentShowValue == parentField) != false &&
+ showIfHasParentShowValue;
+
+ parentFieldShowOnValue;
+ const { handleSubmit, pristine, reset, submitting } = props;
+ return (
+ <>
+ {" "}
+ {showIfHasParentShowValue && (
+
+ )}
+ >
+ );
+};
diff --git a/components/newappeal/buildCheckfield.js b/components/newappeal/buildCheckfield.js
index 1fdef5df..23bd2d81 100644
--- a/components/newappeal/buildCheckfield.js
+++ b/components/newappeal/buildCheckfield.js
@@ -42,6 +42,9 @@ export default function BuildField(props) {
case "{4273EDBD-AC1D-40d3-9FB2-095C621B552D}":
return <>{fieldValue}>;
break;
+ case "{0273EDBD-AC1D-40d3-9FB2-095C621B552D}":
+ return <>{}>;
+ break;
case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
return (
<>
diff --git a/components/newappeal/buildcheckrow.js b/components/newappeal/buildcheckrow.js
index 9197f561..b2298b83 100644
--- a/components/newappeal/buildcheckrow.js
+++ b/components/newappeal/buildcheckrow.js
@@ -10,6 +10,7 @@ import {
getFormCollectionByID,
getPickListLabel,
getRadioLabel,
+ getFieldArrayLabel,
} from "../../components/utils";
import {
@@ -169,6 +170,35 @@ let BuildCheckRow = (props) => {
: fieldtype[0].value ==
"{16D63FD6-119B-4353-BDCA-18358721C3FE}"
? "ssss"
+ : fieldtype[0].value ==
+ "{0273EDBD-AC1D-40d3-9FB2-095C621B552D}"
+ ? props.props.form[
+ "appealForm"
+ ].values[
+ datafieldname[0].value
+ ].map((tenant, index) => {
+ return (
+
+
+ {
+ tenant.pinswg_agriculturaltenantname
+ }
+
+
+ Served:{" "}
+ {formatDate(
+ tenant.dateserved
+ )}
+
+
+ );
+ })
: props.props.form["appealForm"]
.values[
datafieldname[0].value
diff --git a/components/newappeal/buildchecksection.js b/components/newappeal/buildchecksection.js
index 906866cc..5674275b 100644
--- a/components/newappeal/buildchecksection.js
+++ b/components/newappeal/buildchecksection.js
@@ -72,7 +72,7 @@ let BuildCheckSection = (props) => {
};
let buildAppealFilesArray = [];
- console.log("attached docs: - ", buildAppealFilesArray);
+ //console.log("attached docs: - ", buildAppealFilesArray);
let filesUplaodObj = Object.keys(props.props.form.appealForm.values)
.filter(function (k) {
@@ -83,8 +83,6 @@ let BuildCheckSection = (props) => {
return newData;
}, {});
- console.log(filesUplaodObj);
-
for (let key in filesUplaodObj) {
for (let j in filesUplaodObj[key]) {
typeof filesUplaodObj[key][j].name != "undefined" &&
@@ -95,8 +93,6 @@ let BuildCheckSection = (props) => {
}
}
- console.log(buildAppealFilesArray);
-
let pdfObj = props.props.form.appealForm.values;
Object.assign(pdfObj, {
diff --git a/components/newappeal/buildfield.js b/components/newappeal/buildfield.js
index 14247df0..392e0918 100644
--- a/components/newappeal/buildfield.js
+++ b/components/newappeal/buildfield.js
@@ -13,6 +13,7 @@ import {
RichMultiLinefield,
Textfield,
YesNofield,
+ FieldArrayForm,
} from "../elements";
export default function BuildField(props) {
@@ -217,6 +218,17 @@ export default function BuildField(props) {
);
break;
+ case "{0273EDBD-AC1D-40d3-9FB2-095C621B552D}":
+ return (
+
+ );
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
return (
{
backgroundColor: "white",
padding: 5,
},
-
+ questionAnswerRow: {
+ width: "100%",
+ flex: 1,
+ flexDirection: "row",
+ flexGrow: 1,
+ },
+ questionAnswerColLeft: {
+ width: "40%",
+ },
+ questionAnswerColRight: {
+ padding: 5,
+ width: "40%",
+ },
sectionContainer: {
backgroundColor: "#F8F8F8",
padding: 10,
@@ -248,6 +260,8 @@ export const AppealRow_pdf = (props) => {
break;
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
var fieldCopy = datafieldcontent[0].value
+ .replace("]", "")
+ .replace("[", "")
.split(",")
.find((a) =>
a.includes(
@@ -416,6 +430,81 @@ export const AppealRow_pdf = (props) => {
);
break;
+ case "{0273EDBD-AC1D-40d3-9FB2-095C621B552D}":
+ return (
+
+
+
+ {rows[0].value}
+
+
+
+
+ {props.props[
+ datafieldname[0].value
+ ].map((tenant) => {
+ return (
+
+
+ {
+ tenant.pinswg_agriculturaltenantname
+ }
+
+
+
+ Notice
+ served:{" "}
+ {formatDate(
+ tenant.dateserved
+ )}
+
+
+ );
+ })}
+
+
+
+ );
default:
return (
-
+
diff --git a/data/formsxml/commercialappealcas.xml b/data/formsxml/commercialappealcas.xml
index 4654f032..e1120e47 100644
--- a/data/formsxml/commercialappealcas.xml
+++ b/data/formsxml/commercialappealcas.xml
@@ -91,7 +91,7 @@
-
+
@@ -163,13 +163,7 @@
-
-
-
-
-
-
-
+
diff --git a/data/formsxml/enforcementnoticeappeals174.xml b/data/formsxml/enforcementnoticeappeals174.xml
index 610da5f3..3003edd4 100644
--- a/data/formsxml/enforcementnoticeappeals174.xml
+++ b/data/formsxml/enforcementnoticeappeals174.xml
@@ -755,13 +755,7 @@
-
-
-
-
-
-
-
+
diff --git a/data/formsxml/householderappealhas.xml b/data/formsxml/householderappealhas.xml
index 3477a75e..56aac7a6 100644
--- a/data/formsxml/householderappealhas.xml
+++ b/data/formsxml/householderappealhas.xml
@@ -76,7 +76,7 @@
-
+
@@ -148,13 +148,7 @@
-
-
-
-
-
-
-
+
diff --git a/data/formsxml/listedbuildingandconservationareaconsen.xml b/data/formsxml/listedbuildingandconservationareaconsen.xml
index cf10b1ae..38f45308 100644
--- a/data/formsxml/listedbuildingandconservationareaconsen.xml
+++ b/data/formsxml/listedbuildingandconservationareaconsen.xml
@@ -70,7 +70,7 @@
-
+
diff --git a/data/formsxml/planningappeals78.xml b/data/formsxml/planningappeals78.xml
index 72708b9d..d74fb715 100644
--- a/data/formsxml/planningappeals78.xml
+++ b/data/formsxml/planningappeals78.xml
@@ -70,7 +70,7 @@
-
+
@@ -142,13 +142,7 @@
-
-
-
-
-
-
-
+
diff --git a/pages/api/file/generateappealpdf.js b/pages/api/file/generateappealpdf.js
index 37f7be4c..c8a8bf5a 100644
--- a/pages/api/file/generateappealpdf.js
+++ b/pages/api/file/generateappealpdf.js
@@ -193,7 +193,7 @@ export default async function handler(req, res) {
return res.status(200).json({
data: "success",
- path: `tmp/${blobProgress.pinswg_name}.pdf`,
+ path: process.cwd() + `/tmp/${blobProgress.pinswg_name}.pdf`,
});
// } else {
// return res.status(400).json();
diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss
index ec673b4d..e4ca47f3 100644
--- a/styles/sass/welshgov/_application.scss
+++ b/styles/sass/welshgov/_application.scss
@@ -1003,6 +1003,7 @@ textarea,
.govuk-summary-list__value,
.govuk-summary-list__actions {
padding: 15px 10px 15px 0;
+ width: 100%;
a,
a:active,
@@ -2418,4 +2419,33 @@ fade {
text-decoration: none !important;
box-shadow: none;
}
+}
+
+.fieldArrayLink {
+ border: none;
+ background: no-repeat;
+ font-family: Arial, Helvetica, "Nimbus Sans L", sans-serif;
+ font-size: 18px;
+}
+
+.fieldArrayContainer {
+ display: flex;
+
+ .govuk-form-group {
+ margin-right: 20px;
+ margin-bottom: 0px;
+
+ legend {
+ margin-bottom: 5px;
+
+ }
+ }
+
+ .fieldArrayDelete {
+ border-radius: 10px;
+ padding: 5px !important;
+ height: 30px;
+ margin-top: 32px;
+ padding-top: 4px !important;
+ }
}
\ No newline at end of file