copy amends
This commit is contained in:
@@ -243,6 +243,7 @@ export function MultiLinefield(props) {
|
||||
parentFieldShowOnValue,
|
||||
validation,
|
||||
maxFieldLength,
|
||||
hint,
|
||||
} = props;
|
||||
const required = (value) => (value ? undefined : "Is required");
|
||||
|
||||
@@ -258,6 +259,7 @@ export function MultiLinefield(props) {
|
||||
showIfHasParentShowValue;
|
||||
|
||||
//console.log(showIfHasParentShowValue, formProps[form].values[parentField]);
|
||||
let { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -272,6 +274,9 @@ export function MultiLinefield(props) {
|
||||
id={props.name + "-hint"}
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
>
|
||||
{props.hasOwnProperty("hint") &&
|
||||
props.hint != false &&
|
||||
t(props.hint)}{" "}
|
||||
Do not include personal or financial information.
|
||||
</div>
|
||||
<Field
|
||||
@@ -296,6 +301,9 @@ export function MultiLinefield(props) {
|
||||
id={props.name + "-hint"}
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
>
|
||||
{props.hasOwnProperty("hint") &&
|
||||
props.hint != false &&
|
||||
t(props.hint)}{" "}
|
||||
Do not include personal or financial information.
|
||||
</div>
|
||||
|
||||
@@ -394,7 +402,7 @@ export function RichMultiLinefield(props) {
|
||||
showIfHasParentShowValue;
|
||||
|
||||
//console.log(showIfHasParentShowValue, formProps[form].values[parentField]);
|
||||
|
||||
let { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
{parentField != false ? (
|
||||
@@ -407,6 +415,9 @@ export function RichMultiLinefield(props) {
|
||||
id={props.name + "-hint"}
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
>
|
||||
{props.hasOwnProperty("hint") &&
|
||||
props.hint != false &&
|
||||
t(props.hint)}{" "}
|
||||
Do not include personal or financial information.
|
||||
</div>
|
||||
<Field
|
||||
@@ -431,6 +442,9 @@ export function RichMultiLinefield(props) {
|
||||
id={props.name + "-hint"}
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
>
|
||||
{props.hasOwnProperty("hint") &&
|
||||
props.hint != false &&
|
||||
t(props.hint)}{" "}
|
||||
Do not include personal or financial information.
|
||||
</div>
|
||||
|
||||
@@ -1194,19 +1208,28 @@ const RenderPickList = ({
|
||||
};
|
||||
|
||||
export function PickList(props) {
|
||||
const { name, label, datafieldname } = props;
|
||||
|
||||
const { name, label, datafieldname, hint } = props;
|
||||
let { t } = useTranslation();
|
||||
return (
|
||||
<div className="govuk-form-group">
|
||||
<label className="govuk-label govuk-body-m" htmlFor={props.name}>
|
||||
{FieldsTranslations(label)}
|
||||
</label>
|
||||
<div
|
||||
id={props.name + "-hint"}
|
||||
className="govuk-hint govuk-!-font-size-14"
|
||||
>
|
||||
{props.hasOwnProperty("hint") &&
|
||||
props.hint != false &&
|
||||
t(props.hint)}{" "}
|
||||
</div>
|
||||
<Field
|
||||
name={props.name}
|
||||
label={props.name}
|
||||
component={RenderPickList}
|
||||
datafieldname={datafieldname}
|
||||
picklistData={props.picklistData}
|
||||
hint={props.hint}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -1389,8 +1412,10 @@ export const FieldsTranslations = (label) => {
|
||||
|
||||
let labelTrans =
|
||||
router.locale == "cy"
|
||||
? jsonpath("$..[?(@.value=='" + label + "')].value_cy", formObj)
|
||||
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
|
||||
: label;
|
||||
|
||||
console.log(label, labelTrans);
|
||||
return labelTrans;
|
||||
};
|
||||
|
||||
@@ -1413,7 +1438,9 @@ const PickListTranslations = (optionValue) => {
|
||||
export function FileUploadField(props) {
|
||||
return (
|
||||
<>
|
||||
<h2 className="govuk-heading-s">{props.label} </h2>
|
||||
<h2 className="govuk-heading-s">
|
||||
{FieldsTranslations(props.label)}{" "}
|
||||
</h2>
|
||||
<Field
|
||||
name={props.name}
|
||||
id={props.name}
|
||||
|
||||
@@ -68,7 +68,7 @@ let BuildCheckRow = (props) => {
|
||||
|
||||
let labelTrans =
|
||||
router.locale == "cy"
|
||||
? jsonpath("$..[?(@.value=='" + label + "')].value_cy", formObj)
|
||||
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
|
||||
: label;
|
||||
return labelTrans;
|
||||
};
|
||||
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
setCurrentSection,
|
||||
setFormComplete,
|
||||
} from "../../store/appealType/action";
|
||||
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
import {
|
||||
getFormCollectionByID,
|
||||
@@ -74,7 +76,7 @@ let BuildCheckSection = (props) => {
|
||||
let buildAppealFilesArray = [];
|
||||
//console.log("attached docs: - ", buildAppealFilesArray);
|
||||
|
||||
let filesUplaodObj = Object.keys(props.props.form.appealForm.values)
|
||||
let filesUploadObj = Object.keys(props.props.form.appealForm.values)
|
||||
.filter(function (k) {
|
||||
return k.indexOf("pinswg_fileUpload") == 0;
|
||||
})
|
||||
@@ -83,12 +85,12 @@ let BuildCheckSection = (props) => {
|
||||
return newData;
|
||||
}, {});
|
||||
|
||||
for (let key in filesUplaodObj) {
|
||||
for (let j in filesUplaodObj[key]) {
|
||||
typeof filesUplaodObj[key][j].name != "undefined" &&
|
||||
for (let key in filesUploadObj) {
|
||||
for (let j in filesUploadObj[key]) {
|
||||
typeof filesUploadObj[key][j].name != "undefined" &&
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUplaodObj[key][j].name,
|
||||
"size": filesUplaodObj[key][j].size,
|
||||
"name": filesUploadObj[key][j].name,
|
||||
"size": filesUploadObj[key][j].size,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -100,6 +102,22 @@ let BuildCheckSection = (props) => {
|
||||
"casefolderID": props.appealType.caseReference.ticketnumber,
|
||||
});
|
||||
|
||||
const [confirmSections, setConfirmSections] = useState(false);
|
||||
|
||||
const FieldsTranslations = (label) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
|
||||
let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
|
||||
|
||||
let labelTrans =
|
||||
router.locale == "cy"
|
||||
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
|
||||
: label;
|
||||
return labelTrans;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="govuk-grid-row" key={1222}>
|
||||
<div className="govuk-grid-column-full">
|
||||
@@ -111,7 +129,7 @@ let BuildCheckSection = (props) => {
|
||||
{Object.keys(titles).map((key) => (
|
||||
<div key={key}>
|
||||
<h2 className="govuk-heading-m govuk-!-margin-top-9">
|
||||
{titles[key].value}
|
||||
{FieldsTranslations(titles[key].value)}
|
||||
</h2>
|
||||
|
||||
<BuildCheckRow
|
||||
@@ -180,8 +198,59 @@ let BuildCheckSection = (props) => {
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div className="govuk-form-group ">
|
||||
<fieldset className="govuk-fieldset">
|
||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||
<div className="govuk-checkboxes__item">
|
||||
<input
|
||||
name="pinswg_checkconfirmation"
|
||||
id="pinswg_checkconfirmation"
|
||||
type="checkbox"
|
||||
className="govuk-checkboxes__input"
|
||||
value=""
|
||||
onChange={(e) => {
|
||||
setConfirmSections(!confirmSections);
|
||||
}}
|
||||
/>
|
||||
<label
|
||||
className="govuk-label govuk-checkboxes__label"
|
||||
htmlFor="pinswg_checkconfirmation"
|
||||
>
|
||||
{t(
|
||||
"newappeal:new-appeal-check-confirm-label"
|
||||
)}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div>
|
||||
<p className="govuk-body">
|
||||
{t(
|
||||
"newappeal:new-appeal-check-confirm-paragraph-one"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="govuk-body">
|
||||
{t(
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two"
|
||||
)}{" "}
|
||||
<Link
|
||||
href={t(
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two-link"
|
||||
)}
|
||||
>
|
||||
{t(
|
||||
"newappeal:new-appeal-check-confirm-paragraph-two-link"
|
||||
)}
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="govuk-button-group">
|
||||
<a
|
||||
disabled={confirmSections ? false : true}
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
onClick={() => {
|
||||
|
||||
@@ -57,6 +57,7 @@ export default function BuildField(props) {
|
||||
datafieldname={props.datafieldname}
|
||||
picklistData={props.picklistData}
|
||||
validation={props.validation}
|
||||
hint={props.hint}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -146,6 +147,7 @@ export default function BuildField(props) {
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
maxFieldLength={props.maxFieldLength}
|
||||
hint={props.hint}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
@@ -160,6 +162,7 @@ export default function BuildField(props) {
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
validation={props.validation}
|
||||
maxFieldLength={props.maxFieldLength}
|
||||
hint={props.hint}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -104,12 +104,14 @@ export default function BuildRow(props) {
|
||||
|
||||
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
|
||||
|
||||
const isRequiredField = jsonpath(
|
||||
"$..value[?(@.LogicalName=='" +
|
||||
datafieldname[0].value +
|
||||
"')]",
|
||||
mandatoryFieldsData
|
||||
);
|
||||
// const isRequiredField = jsonpath(
|
||||
// "$..value[?(@.LogicalName=='" +
|
||||
// datafieldname[0].value +
|
||||
// "')]",
|
||||
// mandatoryFieldsData
|
||||
// );
|
||||
|
||||
console.log("build row datafieldname[0]", datafieldname[0]);
|
||||
|
||||
if (datafieldname[0].value == "pinswg_fileUpload") {
|
||||
return (
|
||||
|
||||
@@ -141,7 +141,7 @@ let BuildSection = (props) => {
|
||||
let buildAppealFilesArray = [];
|
||||
console.log("attached docs: - ", buildAppealFilesArray);
|
||||
|
||||
let filesUplaodObj = Object.keys(values)
|
||||
let filesUploadObj = Object.keys(values)
|
||||
.filter(function (k) {
|
||||
return k.indexOf("pinswg_fileUpload") == 0;
|
||||
})
|
||||
@@ -150,13 +150,13 @@ let BuildSection = (props) => {
|
||||
return newData;
|
||||
}, {});
|
||||
|
||||
console.log(filesUplaodObj);
|
||||
console.log(filesUploadObj);
|
||||
|
||||
for (let key in filesUplaodObj) {
|
||||
for (let j in filesUplaodObj[key]) {
|
||||
for (let key in filesUploadObj) {
|
||||
for (let j in filesUploadObj[key]) {
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUplaodObj[key][j].name,
|
||||
"size": filesUplaodObj[key][j].size,
|
||||
"name": filesUploadObj[key][j].name,
|
||||
"size": filesUploadObj[key][j].size,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -274,7 +274,7 @@ let BuildSection = (props) => {
|
||||
//if (currentSection == sectionCount) {
|
||||
let valuesObj = values || {};
|
||||
let buildAppealFilesArray = [];
|
||||
let filesUplaodObj = Object.keys(values)
|
||||
let filesUploadObj = Object.keys(values)
|
||||
.filter(function (k) {
|
||||
return k.indexOf("pinswg_fileUpload") == 0;
|
||||
})
|
||||
@@ -283,13 +283,13 @@ let BuildSection = (props) => {
|
||||
return newData;
|
||||
}, {});
|
||||
|
||||
console.log(filesUplaodObj);
|
||||
console.log(filesUploadObj);
|
||||
|
||||
for (let key in filesUplaodObj) {
|
||||
for (let j in filesUplaodObj[key]) {
|
||||
for (let key in filesUploadObj) {
|
||||
for (let j in filesUploadObj[key]) {
|
||||
buildAppealFilesArray.push({
|
||||
"name": filesUplaodObj[key][j].name,
|
||||
"size": filesUplaodObj[key][j].size,
|
||||
"name": filesUploadObj[key][j].name,
|
||||
"size": filesUploadObj[key][j].size,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,17 +122,27 @@ let CompleteAppeal = (props) => {
|
||||
<h2 className="govuk-heading-m">What happens next</h2>
|
||||
|
||||
<p className="govuk-body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Morbi a metus non quam mollis egestas. Integer ac leo
|
||||
cursus, laoreet nulla sed, tempus tellus. Mauris condimentum
|
||||
erat arcu.
|
||||
When we receive your appeal form, we will write to you
|
||||
letting you know if your appeal is valid, who is dealing
|
||||
with it and what happens next.
|
||||
</p>
|
||||
<p className="govuk-body">
|
||||
Sed imperdiet dignissim ipsum. Orci varius natoque penatibus
|
||||
et magnis dis parturient montes, nascetur ridiculus mus. In
|
||||
id leo in turpis aliquam venenatis ut non erat. Ut est arcu,
|
||||
luctus sit amet pretium sed, iaculis non purus. Etiam dictum
|
||||
tortor commodo luctus rhoncus.
|
||||
Any enquiries regarding this document/publication should be
|
||||
sent to us at the address above or e-mail:
|
||||
<Link href="mailto:PEDW.Casework@gov.wales">
|
||||
PEDW.Casework@gov.wales
|
||||
</Link>{" "}
|
||||
/{" "}
|
||||
<Link href="mailto:PEDW.GwaithAchos@llyw.cymru">
|
||||
PEDW.GwaithAchos@llyw.cymru
|
||||
</Link>
|
||||
</p>
|
||||
<p className="govuk-body">
|
||||
Please note you can check for updates on our current service
|
||||
at:
|
||||
<Link href="https://www.gov.wales/planning-and-environment-decisions-wales-pedw-service-update">
|
||||
https://www.gov.wales/planning-and-environment-decisions-wales-pedw-service-update
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
|
||||
Reference in New Issue
Block a user