cleared debug, updated new appeal add about you
This commit is contained in:
@@ -779,11 +779,11 @@ export function Radiofield(props) {
|
||||
(showIfHasParentShowValue == parentField) != false &&
|
||||
showIfHasParentShowValue;
|
||||
|
||||
console.log(
|
||||
datafieldname,
|
||||
showIfHasParentShowValue,
|
||||
formProps[form].values[parentField]
|
||||
);
|
||||
// console.log(
|
||||
// datafieldname,
|
||||
// showIfHasParentShowValue,
|
||||
// formProps[form].values[parentField]
|
||||
// );
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -1091,7 +1091,8 @@ const PickListTranslations = (optionValue) => {
|
||||
|
||||
export function FileUploadField(props) {
|
||||
return (
|
||||
<div className="govuk-grid-row">
|
||||
<>
|
||||
<h4>{props.label} </h4>
|
||||
<Field
|
||||
name={props.name}
|
||||
id={props.name}
|
||||
@@ -1101,7 +1102,7 @@ export function FileUploadField(props) {
|
||||
label={props.label}
|
||||
errorMsg="Is required"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1293,14 +1294,14 @@ const RenderFileUpload = (field) => {
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
<Dropzone
|
||||
onDrop={(filesToUpload, e) =>
|
||||
field.input.onChange(filesToUpload)
|
||||
}
|
||||
>
|
||||
{({ getRootProps, getInputProps }) => (
|
||||
<div className="govuk-grid-row">
|
||||
<>
|
||||
<div className="govuk-form-group"></div>
|
||||
<section className="container">
|
||||
<div {...getRootProps({ style })}>
|
||||
@@ -1310,10 +1311,9 @@ const RenderFileUpload = (field) => {
|
||||
</div>
|
||||
<aside>{thumbs}</aside>
|
||||
</section>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</Dropzone>
|
||||
|
||||
{field.meta.touched && field.meta.error && (
|
||||
<span className="error">{field.meta.error}</span>
|
||||
)}
|
||||
@@ -1328,8 +1328,7 @@ const RenderFileUpload = (field) => {
|
||||
src={getThumbnailIcon(file, file.type)}
|
||||
alt={file.name}
|
||||
width="50"
|
||||
/>{" "}
|
||||
{" "}
|
||||
/>
|
||||
<span className="govuk-body govuk-!-padding-left-5">
|
||||
{file.name} ({bytesToSize(file.size)})
|
||||
</span>
|
||||
@@ -1337,6 +1336,6 @@ const RenderFileUpload = (field) => {
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -62,22 +62,18 @@ const TopThree = (props) => {
|
||||
topThreeType == "awaitingSubmission" &&
|
||||
deleteAwaitingSubmissions(caseID)
|
||||
.then((data) => {
|
||||
console.log("zzzzz");
|
||||
|
||||
return data;
|
||||
})
|
||||
.then(() => {
|
||||
console.log("qqqqqq");
|
||||
getAwaitingSubmissionProxy(cookies.pinsUser).then(
|
||||
(data) => {
|
||||
console.log("assss", data);
|
||||
setAwaitingSubmission(data),
|
||||
getDetails(data, "awaitingSubmission").then(
|
||||
(data) => {
|
||||
console.log(
|
||||
"submission get details:",
|
||||
data
|
||||
);
|
||||
// console.log(
|
||||
// "submission get details:",
|
||||
// data
|
||||
// );
|
||||
setAwaitingSubmissionDetails(data);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -2,6 +2,12 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, formValueSelector, reduxForm } from "redux-form";
|
||||
import {
|
||||
FieldsTranslations,
|
||||
Radiofield,
|
||||
Textfield,
|
||||
MultiLinefield,
|
||||
} from "../elements";
|
||||
|
||||
let AboutYou = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -9,7 +15,7 @@ let AboutYou = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const { onSubmit, handleSubmit, appellantAgentValue } = props;
|
||||
const { onSubmit, handleSubmit, appellantAgentValue, setFormStep } = props;
|
||||
|
||||
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
|
||||
const appellantAgent =
|
||||
@@ -161,18 +167,268 @@ let AboutYou = (props) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
const RenderMultiline = ({
|
||||
id,
|
||||
className,
|
||||
rows,
|
||||
datafieldname,
|
||||
name,
|
||||
label,
|
||||
input,
|
||||
errorMsg,
|
||||
meta: { touched, error },
|
||||
...custom
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={
|
||||
touched && error
|
||||
? "govuk-form-group govuk-form-group--error"
|
||||
: "govuk-form-group "
|
||||
}
|
||||
>
|
||||
<label
|
||||
className="govuk-label "
|
||||
htmlFor={id}
|
||||
id={id + "_label"}
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
{touched && error && (
|
||||
<span
|
||||
id={id + "-error"}
|
||||
className="govuk-error-message"
|
||||
>
|
||||
<span className="govuk-visually-hidden">
|
||||
Error:
|
||||
</span>{" "}
|
||||
{touched &&
|
||||
((error && (
|
||||
<span>{errorMsg ? errorMsg : error}</span>
|
||||
)) ||
|
||||
(warning && <span>{warning}</span>))}
|
||||
</span>
|
||||
)}
|
||||
<textarea
|
||||
{...input}
|
||||
rows={rows}
|
||||
className={className}
|
||||
></textarea>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const RenderRadio = ({
|
||||
datafieldname,
|
||||
name,
|
||||
label,
|
||||
id,
|
||||
errorMsg,
|
||||
options,
|
||||
input: { onChange, value },
|
||||
meta: { touched, error },
|
||||
...custom
|
||||
}) => {
|
||||
let { t } = useTranslation();
|
||||
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={
|
||||
custom.inline == false
|
||||
? "govuk-radios govuk-radios--small"
|
||||
: "govuk-radios govuk-radios--inline govuk-radios--small"
|
||||
}
|
||||
>
|
||||
{" "}
|
||||
{custom.hint != false && (
|
||||
<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]}
|
||||
// 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="Select an option"
|
||||
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="Select an option"
|
||||
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(values);
|
||||
router.replace("/newappeal");
|
||||
console.log(JSON.stringify(values));
|
||||
setFormStep(1);
|
||||
};
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<Field
|
||||
name={"onbehalfof"}
|
||||
id={"onbehalfof"}
|
||||
name={"pinswg_onbehalfof"}
|
||||
id={"pinswg_onbehalfof"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -183,37 +439,34 @@ let AboutYou = (props) => {
|
||||
<details className="govuk-details" data-module="govuk-details">
|
||||
<summary className="govuk-details__summary">
|
||||
<span className="govuk-details__summary-text">
|
||||
Who can appeal?
|
||||
{t("newappeal:about-you-who-can-appeal-label")}
|
||||
</span>
|
||||
</summary>
|
||||
<div className="govuk-details__text">
|
||||
Only those named as an applicant on the original
|
||||
application form can submit an appeal. if you are
|
||||
submitting an appeal on behalf of a company state the
|
||||
name of the company you are representing,
|
||||
{t("newappeal:about-you-who-can-appeal-paragraph")}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<Field
|
||||
name={"appellantAgent"}
|
||||
datafieldname={"appellantAgent"}
|
||||
|
||||
<Radiofield
|
||||
name={"pinswg_appellantagent"}
|
||||
datafieldname={"pinswg_appellantagent"}
|
||||
label={t("newappeal:about-you-who-are-you-label")}
|
||||
options={appellantAgent}
|
||||
id={"appellantAgent"}
|
||||
options="[846040000|newappeal:about-you-who-are-you-label-appellant,846040001|newappeal:about-you-who-are-you-label-agent]"
|
||||
id={"pinswg_appellantagent"}
|
||||
className="govuk-radios__input"
|
||||
validate={[required]}
|
||||
//validate={[required]}
|
||||
errorMsg="Select an option"
|
||||
component={RenderYesNo}
|
||||
/>
|
||||
{(appellantAgentValue == "Appellant" ||
|
||||
appellantAgentValue == "Apelydd") && (
|
||||
|
||||
{appellantAgentValue == "846040000" && (
|
||||
<>
|
||||
<h2 className="govuk-heading-s">
|
||||
{t("newappeal:about-you-appellant-contact-details")}
|
||||
</h2>
|
||||
<Field
|
||||
name={"appellantfirstname"}
|
||||
id={"appellantfirstname"}
|
||||
name={"[pinswg_appellantfirstname"}
|
||||
id={"pinswg_appellantfirstname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -223,8 +476,8 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"appellantlastname"}
|
||||
id={"appellantlastname"}
|
||||
name={"pinswg_appellantlastname"}
|
||||
id={"pinswg_appellantlastname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -232,10 +485,22 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-lastname-label"
|
||||
)}
|
||||
/>{" "}
|
||||
/>
|
||||
<Field
|
||||
name={"appellantemailaddress"}
|
||||
id={"appellantemailaddress"}
|
||||
name={"pinswg_appellantaddress"}
|
||||
id={"pinswg_appellantaddress"}
|
||||
component={RenderMultiline}
|
||||
type="textarea"
|
||||
className="govuk-textarea govuk-input--width-20"
|
||||
validate={[required]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-address-label"
|
||||
)}
|
||||
rows={4}
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantemailaddress"}
|
||||
id={"pinswg_appellantemailaddress"}
|
||||
component={RenderTextfield}
|
||||
type="email"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -245,39 +510,50 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"appellantphonenumber"}
|
||||
id={"appellantphonenumber"}
|
||||
name={"pinswg_appellantphonenumber"}
|
||||
id={"pinswg_appellantphonenumber"}
|
||||
component={RenderTextfield}
|
||||
type="numberz"
|
||||
type="number"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required, phoneNumber]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-phone-label"
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"contactPrefs"}
|
||||
datafieldname={"contactPrefs"}
|
||||
|
||||
<Radiofield
|
||||
name={"pinswg_contactprefs"}
|
||||
datafieldname={"pinswg_contactprefs"}
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-preferences-label"
|
||||
)}
|
||||
options={contactPref}
|
||||
id={"contactPrefs"}
|
||||
options="[846040000|newappeal:about-you-agent-contact-preferences-value-email,846040001|newappeal:about-you-agent-contact-preferences-value-post]"
|
||||
id={"pinswg_contactprefs"}
|
||||
className="govuk-radios__input"
|
||||
//validate={[required]}
|
||||
validate={[required]}
|
||||
errorMsg="Select an option"
|
||||
/>
|
||||
<Radiofield
|
||||
name={"pinswg_languagepreference"}
|
||||
datafieldname={"pinswg_languagepreference"}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-language-preferences-label"
|
||||
)}
|
||||
options="[846040000|newappeal:about-you-agent-language-preferences-value-english,846040001|newappeal:about-you-agent-language-preferences-value-welsh]"
|
||||
id={"pinswg_languagepreference"}
|
||||
className="govuk-radios__input"
|
||||
validate={[required]}
|
||||
errorMsg="Select an option"
|
||||
component={RenderYesNo}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{(appellantAgentValue == "Agent" ||
|
||||
appellantAgentValue == "Asiant") && (
|
||||
{appellantAgentValue == "846040001" && (
|
||||
<>
|
||||
<h2 className="govuk-heading-s">
|
||||
{t("newappeal:about-you-appellant-contact-details")}
|
||||
</h2>
|
||||
<Field
|
||||
name={"appellantfirstname"}
|
||||
name={"pinswg_appellantfirstname"}
|
||||
id={"appellantfirstname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
@@ -288,8 +564,8 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"appellantlastname"}
|
||||
id={"appellantlastname"}
|
||||
name={"pinswg_appellantlastname"}
|
||||
id={"pinswg_appellantlastname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -297,25 +573,37 @@ let AboutYou = (props) => {
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-lastname-label"
|
||||
)}
|
||||
/>{" "}
|
||||
/>
|
||||
<Field
|
||||
name={"appellantemailaddress"}
|
||||
id={"appellantemailaddress"}
|
||||
name={"pinswg_appellantaddress"}
|
||||
id={"pinswg_appellantaddress"}
|
||||
component={RenderMultiline}
|
||||
type="textarea"
|
||||
className="govuk-textarea govuk-input--width-20"
|
||||
validate={[required]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-address-label"
|
||||
)}
|
||||
rows={4}
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_appellantemailaddress"}
|
||||
id={"pinswg_appellantemailaddress"}
|
||||
component={RenderTextfield}
|
||||
type="email"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required, email]}
|
||||
validate={[required]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-email-label"
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"appellantphonenumber"}
|
||||
id={"appellantphonenumber"}
|
||||
name={"pinswg_appellantphonenumber"}
|
||||
id={"pinswg_appellantphonenumber"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
validate={[required]}
|
||||
validate={[required, phoneNumber]}
|
||||
label={t(
|
||||
"newappeal:about-you-appellant-contact-details-phone-label"
|
||||
)}
|
||||
@@ -324,8 +612,8 @@ let AboutYou = (props) => {
|
||||
{t("newappeal:about-you-agent-contact-details")}
|
||||
</h2>{" "}
|
||||
<Field
|
||||
name={"agentcompanyname"}
|
||||
id={"agentcompanyname"}
|
||||
name={"pinswg_agentcompanyname"}
|
||||
id={"pinswg_agentcompanyname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -335,8 +623,8 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"agentfirstname"}
|
||||
id={"agentfirstname"}
|
||||
name={"pinswg_agentfirstname"}
|
||||
id={"pinswg_agentfirstname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -346,8 +634,8 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"agentlastname"}
|
||||
id={"agentlastname"}
|
||||
name={"pinswg_agentlastname"}
|
||||
id={"pinswg_agentlastname"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -357,8 +645,20 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>{" "}
|
||||
<Field
|
||||
name={"agentemailaddress"}
|
||||
id={"agentemailaddress"}
|
||||
name={"pinswg_agentaddress"}
|
||||
id={"pinswg_agentaddress"}
|
||||
component={RenderMultiline}
|
||||
type="textarea"
|
||||
className="govuk-textarea govuk-input--width-20"
|
||||
validate={[required]}
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-details-address-label"
|
||||
)}
|
||||
rows={4}
|
||||
/>
|
||||
<Field
|
||||
name={"pinswg_agentemailaddress"}
|
||||
id={"pinswg_agentemailaddress"}
|
||||
component={RenderTextfield}
|
||||
type="text"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -368,8 +668,8 @@ let AboutYou = (props) => {
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"agentphonenumber"}
|
||||
id={"agentphonenumber"}
|
||||
name={"pinswg_agentphonenumber"}
|
||||
id={"pinswg_agentphonenumber"}
|
||||
component={RenderTextfield}
|
||||
type="number"
|
||||
className="govuk-input govuk-input--width-20"
|
||||
@@ -378,18 +678,29 @@ let AboutYou = (props) => {
|
||||
"newappeal:about-you-agent-contact-details-phone-label"
|
||||
)}
|
||||
/>
|
||||
<Field
|
||||
name={"contactPrefs"}
|
||||
datafieldname={"contactPrefs"}
|
||||
<Radiofield
|
||||
name={"pinswg_contactprefs"}
|
||||
datafieldname={"pinswg_contactprefs"}
|
||||
label={t(
|
||||
"newappeal:about-you-agent-contact-preferences-label"
|
||||
)}
|
||||
options={contactPref}
|
||||
id={"contactPrefs"}
|
||||
options="[846040000|newappeal:about-you-agent-contact-preferences-value-email,846040001|newappeal:about-you-agent-contact-preferences-value-post]"
|
||||
id={"pinswg_contactprefs"}
|
||||
className="govuk-radios__input"
|
||||
//validate={[required]}
|
||||
validate={[required]}
|
||||
errorMsg="Select an option"
|
||||
/>
|
||||
<Radiofield
|
||||
name={"pinswg_languagepreference"}
|
||||
datafieldname={"pinswg_languagepreference"}
|
||||
label={t(
|
||||
"newappeal:about-you-agent-language-preferences-label"
|
||||
)}
|
||||
options="[846040000|newappeal:about-you-agent-language-preferences-value-english,846040001|newappeal:about-you-agent-language-preferences-value-welsh]"
|
||||
id={"pinswg_languagepreference"}
|
||||
className="govuk-radios__input"
|
||||
validate={[required]}
|
||||
errorMsg="Select an option"
|
||||
component={RenderYesNo}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
@@ -419,30 +730,30 @@ const mapDispatchToProps = (dispatch) => {
|
||||
return {};
|
||||
};
|
||||
|
||||
AboutYou = reduxForm({
|
||||
form: "caseForm", // a unique identifier for this form
|
||||
destroyOnUnmount: false,
|
||||
})(AboutYou);
|
||||
// AboutYou = reduxForm({
|
||||
// form: "caseForm", // a unique identifier for this form
|
||||
// destroyOnUnmount: false,
|
||||
// })(AboutYou);
|
||||
|
||||
const selector = formValueSelector("caseForm"); // <-- same as form name
|
||||
|
||||
AboutYou = connect((state) => {
|
||||
// can select values individually
|
||||
const appellantAgentValue = selector(state, "appellantAgent");
|
||||
const appellantAgentValue = selector(state, "pinswg_appellantagent");
|
||||
|
||||
return {
|
||||
appellantAgentValue,
|
||||
};
|
||||
})(AboutYou);
|
||||
|
||||
export default AboutYou;
|
||||
//export default AboutYou;
|
||||
|
||||
// export default connect(
|
||||
// mapStateToProps,
|
||||
// mapDispatchToProps
|
||||
// )(
|
||||
// reduxForm({
|
||||
// form: "caseForm",
|
||||
// destroyOnUnmount: false,
|
||||
// })(AboutYou)
|
||||
// );
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(
|
||||
reduxForm({
|
||||
form: "caseForm",
|
||||
destroyOnUnmount: false,
|
||||
})(AboutYou)
|
||||
);
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
export default function MakeAdvertApplication() {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body appealModule">
|
||||
<p className="govuk-body-s">
|
||||
An appeal relating to an advertisement application or a
|
||||
discontinuance notice.
|
||||
</p>
|
||||
<div className="appealCTA">
|
||||
<Link href="/newappeal/selectappeal">
|
||||
<a className="govuk-button">
|
||||
An advert application/Discontinuance Notice (DN)
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
import jsonpath from "jsonpath";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import xpath from "xpath";
|
||||
import { setCurrentSection } from "../../store/appealType/action";
|
||||
import { FieldsTranslations } from "../elements";
|
||||
|
||||
const BuildProgress = (props) => {
|
||||
let { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const {
|
||||
titleList,
|
||||
currentSection,
|
||||
documentListObj,
|
||||
formObjXML,
|
||||
mandatoryFieldsData,
|
||||
gotoSection,
|
||||
} = props;
|
||||
const parser = new DOMParser();
|
||||
|
||||
const BuildFormObj = (formObjXML) => {
|
||||
var doc = parser.parseFromString(formObjXML, "text/xml");
|
||||
|
||||
var tabs = xpath.select("//form/tabs/tab[*]", doc);
|
||||
|
||||
const formObj = Object.keys(tabs).map((key, index) => {
|
||||
var sectionXML = xpath.select(
|
||||
"//tabs/tab[" +
|
||||
(index + 1) +
|
||||
"]//rows/row/*/control[not(@parentField)]/../..",
|
||||
doc
|
||||
);
|
||||
|
||||
return BuildRowObj(sectionXML, titleList[key].value);
|
||||
});
|
||||
|
||||
const progressObj = Object.keys(formObj).map((key, index) => {
|
||||
let fieldObj = formObj[key].fieldsrowObj;
|
||||
|
||||
let rowCount = 0;
|
||||
typeof props.props.initialValues != "undefined" &&
|
||||
Object.keys(fieldObj).map((key, index) => {
|
||||
fieldObj[key].datafieldname in props.props.initialValues &&
|
||||
props.props.initialValues[
|
||||
fieldObj[key].datafieldname
|
||||
] != null &&
|
||||
rowCount++;
|
||||
});
|
||||
|
||||
return {
|
||||
"title": titleList[key].value,
|
||||
rowCount,
|
||||
"totalFields": formObj[key].fieldsTotal,
|
||||
"allFieldsComplete": rowCount == formObj[key].fieldsTotal,
|
||||
};
|
||||
});
|
||||
|
||||
return progressObj;
|
||||
};
|
||||
|
||||
const BuildRowObj = (rowXML, titleList) => {
|
||||
const rowObj = Object.keys(rowXML).map((key, index) => {
|
||||
var doc = parser.parseFromString(rowXML[key].outerHTML, "text/xml");
|
||||
if (_.isEmpty(rowXML[key].innerHTML)) {
|
||||
("");
|
||||
} else {
|
||||
var rows = xpath.select("//label/@description", doc);
|
||||
var fieldtype = xpath.select("//@classid", doc);
|
||||
var validation = xpath.select("//@validation", 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 requiredDocumentValue = xpath.select(
|
||||
"//@requiredDocumentValue",
|
||||
doc
|
||||
);
|
||||
|
||||
var requiredDocumentLabel = xpath.select(
|
||||
"//@requiredDocumentLabel",
|
||||
doc
|
||||
);
|
||||
|
||||
var hint = xpath.select("//label/@hint", doc);
|
||||
var dateStart = xpath.select("//@dateStart", doc);
|
||||
var dateEnd = xpath.select("//@dateEnd", doc);
|
||||
|
||||
hint = !_.isEmpty(hint) && hint[0].value;
|
||||
|
||||
validation = !_.isEmpty(validation) ? validation[0].value : [];
|
||||
|
||||
parentField = !_.isEmpty(parentField) && parentField[0].value;
|
||||
|
||||
parentFieldShowOnValue =
|
||||
!_.isEmpty(parentFieldShowOnValue) &&
|
||||
parentFieldShowOnValue[0].value;
|
||||
|
||||
datafieldcontent =
|
||||
!_.isEmpty(datafieldcontent) && datafieldcontent[0].value;
|
||||
|
||||
requiredDocumentValue =
|
||||
!_.isEmpty(requiredDocumentValue) &&
|
||||
requiredDocumentValue[0].value;
|
||||
|
||||
requiredDocumentLabel =
|
||||
!_.isEmpty(requiredDocumentLabel) &&
|
||||
requiredDocumentLabel[0].value;
|
||||
|
||||
dateStart = !_.isEmpty(dateStart) && dateStart[0].value;
|
||||
|
||||
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
|
||||
|
||||
const isRequiredField = jsonpath.query(
|
||||
mandatoryFieldsData,
|
||||
"$..value[?(@.LogicalName=='" +
|
||||
datafieldname[0].value +
|
||||
"')]"
|
||||
);
|
||||
|
||||
if (datafieldname[0].value == "pinswg_fileUpload") {
|
||||
return {
|
||||
"fieldType": fieldtype[0].value,
|
||||
"label": rows[0].value,
|
||||
"datafieldname": datafieldname[0].value,
|
||||
"key": key,
|
||||
"picklistData": props.props.formData.pickListData,
|
||||
"mandatoryFieldsData": mandatoryFieldsData,
|
||||
};
|
||||
} else {
|
||||
if (typeof isRequiredField[0] != "undefined") {
|
||||
if (isRequiredField[0].RequiredLevel.Value != "None") {
|
||||
//console.log(datafieldname[0].value, validation);
|
||||
return {
|
||||
"fieldType": fieldtype[0].value,
|
||||
"label": rows[0].value,
|
||||
"datafieldname": datafieldname[0].value,
|
||||
"datafieldcontent": datafieldcontent,
|
||||
"parentField": parentField,
|
||||
"parentFieldShowOnValue":
|
||||
parentFieldShowOnValue,
|
||||
"key": key,
|
||||
"picklistData":
|
||||
props.props.formData.pickListData,
|
||||
"mandatoryFieldsData": mandatoryFieldsData,
|
||||
"hint": hint,
|
||||
"requiredDocumentLabel": requiredDocumentLabel,
|
||||
"requiredDocumentValue": requiredDocumentValue,
|
||||
"validation": validation,
|
||||
"dateStart": dateStart,
|
||||
"dateEnd": dateEnd,
|
||||
"setDocumentsList":
|
||||
props.props.setDocumentsList,
|
||||
"documentList":
|
||||
props.props.appealType.documentList,
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
rowObj = rowObj.filter(function (el) {
|
||||
return el != null;
|
||||
});
|
||||
|
||||
const filterUnwanted = (rowObj) => {
|
||||
const required = rowObj.filter((el) => {
|
||||
return !_.isEmpty(el.validation);
|
||||
});
|
||||
return required;
|
||||
};
|
||||
|
||||
return {
|
||||
"title": titleList,
|
||||
"validationFieldsTotal": filterUnwanted(rowObj).length,
|
||||
"fieldsTotal": rowObj.length,
|
||||
"fieldsrowObj": rowObj,
|
||||
};
|
||||
};
|
||||
|
||||
const progObj = BuildFormObj(formObjXML);
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav
|
||||
role="navigation"
|
||||
aria-labelledby="progress-list"
|
||||
className="at-nav"
|
||||
>
|
||||
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey progress-heading">
|
||||
{t("newappeal:new-appeal-progress-nav-label")}:{" "}
|
||||
<span className="progress-case-reference">
|
||||
{props.props.appealType.caseReference.ticketnumber}
|
||||
</span>
|
||||
</h3>
|
||||
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
|
||||
|
||||
<ol className="govuk-list">
|
||||
<ul className="govuk-list ">
|
||||
<li className="at-nav__page">
|
||||
<ol className="govuk-list">
|
||||
{Object.keys(progObj).map((key, index) =>
|
||||
parseInt(key) + 1 == currentSection ? (
|
||||
<li key={key}>
|
||||
<b>
|
||||
{FieldsTranslations(
|
||||
progObj[index].title
|
||||
)}
|
||||
</b>
|
||||
</li>
|
||||
) : (
|
||||
<li key={key}>
|
||||
{props.props.appealType
|
||||
.formComplete == "true" ||
|
||||
parseInt(key) + 1 <
|
||||
currentSection ||
|
||||
progObj[index].allFieldsComplete ==
|
||||
true ? (
|
||||
<a
|
||||
className="govuk-link"
|
||||
href="#"
|
||||
onClick={() => {
|
||||
gotoSection(
|
||||
parseInt(key) + 1
|
||||
);
|
||||
}}
|
||||
>
|
||||
{FieldsTranslations(
|
||||
progObj[index].title
|
||||
)}
|
||||
</a>
|
||||
) : (
|
||||
FieldsTranslations(
|
||||
progObj[index].title
|
||||
)
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
)}
|
||||
</ol>
|
||||
</li>
|
||||
</ul>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
{Object.keys(documentListObj).length > 0 && (
|
||||
<div>
|
||||
<h3 className="govuk-heading-s govuk-!-font-weight-bold gov-font-dark-grey">
|
||||
{t("newappeal:new-appeal-documentlist-nav")}:
|
||||
</h3>
|
||||
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
|
||||
<ol className="govuk-list document-list">
|
||||
<ul className="govuk-list ">
|
||||
<li className="at-nav__page">
|
||||
<ol className="govuk-list govuk-list--bullet">
|
||||
{Object.entries(documentListObj).map(
|
||||
([key, value]) => {
|
||||
return <li key={key}>{value}</li>;
|
||||
}
|
||||
)}
|
||||
</ol>
|
||||
</li>
|
||||
</ul>
|
||||
</ol>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
search: state.search,
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
initialValues: state.appealType.caseReference.caseDetails,
|
||||
//form: state.form,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
gotoSection: (thisSection) => {
|
||||
dispatch(setCurrentSection(thisSection));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);
|
||||
@@ -117,54 +117,43 @@ export default function BuildRow(props) {
|
||||
// datafieldname[0].value,
|
||||
// isRequiredField[0].RequiredLevel.Value
|
||||
// );
|
||||
if (typeof isRequiredField[0] != "undefined") {
|
||||
if (
|
||||
isRequiredField[0].RequiredLevel.Value != "None"
|
||||
) {
|
||||
//console.log(datafieldname[0].value, validation);
|
||||
return (
|
||||
<BuildField
|
||||
fieldType={fieldtype[0].value}
|
||||
label={rows[0].value}
|
||||
datafieldname={datafieldname[0].value}
|
||||
datafieldcontent={datafieldcontent}
|
||||
parentField={parentField}
|
||||
parentFieldShowOnValue={
|
||||
parentFieldShowOnValue
|
||||
}
|
||||
key={key}
|
||||
props={props}
|
||||
picklistData={
|
||||
props.props.props.formData
|
||||
.pickListData
|
||||
}
|
||||
mandatoryFieldsData={
|
||||
mandatoryFieldsData
|
||||
}
|
||||
hint={hint}
|
||||
requiredDocumentLabel={
|
||||
requiredDocumentLabel
|
||||
}
|
||||
requiredDocumentValue={
|
||||
requiredDocumentValue
|
||||
}
|
||||
validation={validation}
|
||||
dateStart={dateStart}
|
||||
dateEnd={dateEnd}
|
||||
setDocumentsList={
|
||||
props.props.setDocumentsList
|
||||
}
|
||||
documentList={
|
||||
props.props.appealType.documentList
|
||||
}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
// if (typeof isRequiredField[0] != "undefined") {
|
||||
// if (
|
||||
// isRequiredField[0].RequiredLevel.Value != "None"
|
||||
// ) {
|
||||
//console.log(datafieldname[0].value, validation);
|
||||
return (
|
||||
<BuildField
|
||||
fieldType={fieldtype[0].value}
|
||||
label={rows[0].value}
|
||||
datafieldname={datafieldname[0].value}
|
||||
datafieldcontent={datafieldcontent}
|
||||
parentField={parentField}
|
||||
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||
key={key}
|
||||
props={props}
|
||||
picklistData={
|
||||
props.props.props.formData.pickListData
|
||||
}
|
||||
mandatoryFieldsData={mandatoryFieldsData}
|
||||
hint={hint}
|
||||
requiredDocumentLabel={requiredDocumentLabel}
|
||||
requiredDocumentValue={requiredDocumentValue}
|
||||
validation={validation}
|
||||
dateStart={dateStart}
|
||||
dateEnd={dateEnd}
|
||||
setDocumentsList={props.props.setDocumentsList}
|
||||
documentList={
|
||||
props.props.appealType.documentList
|
||||
}
|
||||
/>
|
||||
);
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
}
|
||||
})}
|
||||
|
||||
@@ -16,8 +16,8 @@ import { getFormCollectionByID } from "../utils";
|
||||
import { updateCase, patchCase } from "../../actions";
|
||||
|
||||
import { FieldsTranslations } from "../elements";
|
||||
|
||||
import { query } from "jsonpath";
|
||||
import jsonpath from "jsonpath";
|
||||
import BuildProgress from "./buildprogress";
|
||||
|
||||
let BuildSection = (props) => {
|
||||
// useEffect(() => {
|
||||
@@ -60,6 +60,8 @@ let BuildSection = (props) => {
|
||||
doc
|
||||
);
|
||||
|
||||
var formObjXML = xpath.select("/form/tabs", doc);
|
||||
|
||||
var titleList = xpath.select(
|
||||
"//form/tabs/tab[*]/labels/label/@description",
|
||||
doc
|
||||
@@ -99,18 +101,11 @@ let BuildSection = (props) => {
|
||||
}
|
||||
});
|
||||
|
||||
console.log(updateBody);
|
||||
//console.log(updateBody);
|
||||
|
||||
let updateFormCollection = appTypeCollection.LogicalCollectionName;
|
||||
let primaryAttribute = appTypeCollection.PrimaryIdAttribute;
|
||||
|
||||
console.log(
|
||||
incidentId,
|
||||
updateBody,
|
||||
updateFormCollection,
|
||||
primaryAttribute,
|
||||
props.appealType.caseReference.ticketnumber
|
||||
);
|
||||
updateCase(
|
||||
incidentId,
|
||||
updateBody,
|
||||
@@ -261,7 +256,16 @@ let BuildSection = (props) => {
|
||||
</div>
|
||||
<div className="govuk-grid-column-one-third">
|
||||
<div className="at-nav-container">
|
||||
<nav
|
||||
<BuildProgress
|
||||
props={props}
|
||||
titleList={titleList}
|
||||
documentListObj={documentListObj}
|
||||
formObjXML={formXML}
|
||||
mandatoryFieldsData={mandatoryFieldsData}
|
||||
currentSection={currentSection}
|
||||
initialValues={props.initialValues}
|
||||
/>
|
||||
{/* <nav
|
||||
role="navigation"
|
||||
aria-labelledby="progress-list"
|
||||
className="at-nav"
|
||||
@@ -347,12 +351,13 @@ let BuildSection = (props) => {
|
||||
</ul>
|
||||
</ol>
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj = props.props.form[props.form].values;
|
||||
let valuesObj =
|
||||
props.props.form[props.form].values || {};
|
||||
|
||||
console.log("valuesobj:", valuesObj);
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { Field, formValueSelector, reduxForm } from "redux-form";
|
||||
import { useState } from "react";
|
||||
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
setAppealLPA,
|
||||
@@ -12,6 +14,7 @@ import {
|
||||
import { getFormCollectionByID } from "../utils";
|
||||
import FileUpload from "./fileupload";
|
||||
import Aboutyou from "./aboutyou";
|
||||
import { createNewCase } from "../../actions";
|
||||
|
||||
let CreateCase = (props) => {
|
||||
// useEffect(() => {
|
||||
@@ -208,6 +211,8 @@ let CreateCase = (props) => {
|
||||
|
||||
const required = (value) => (value ? undefined : "Required");
|
||||
|
||||
const [formStep, setFormStep] = useState(0);
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -215,48 +220,84 @@ let CreateCase = (props) => {
|
||||
|
||||
appTypeCollection = getFormCollectionByID(appTypeCollection);
|
||||
|
||||
router.replace(
|
||||
"/newappeal" +
|
||||
"/" +
|
||||
appTypeCollection.UrlName +
|
||||
"?lpa=" +
|
||||
values.lpaTypes +
|
||||
"&apt=" +
|
||||
values.appealTypes.split(",")[0],
|
||||
null,
|
||||
{
|
||||
shallow: true,
|
||||
}
|
||||
);
|
||||
formStep == 0 && setFormStep(1);
|
||||
|
||||
// console.log(values);
|
||||
|
||||
// console.log(props.loggedInUser);
|
||||
|
||||
createNewCase(
|
||||
appTypeCollection.appealTypeID,
|
||||
values.lpaTypes,
|
||||
props.loggedInUser,
|
||||
values
|
||||
)
|
||||
.then((data) => {
|
||||
router.replace(
|
||||
"/newappeal" +
|
||||
"/" +
|
||||
appTypeCollection.UrlName +
|
||||
"?lpa=" +
|
||||
values.lpaTypes +
|
||||
"&apt=" +
|
||||
values.appealTypes.split(",")[0] +
|
||||
"&id=" +
|
||||
data.incidentid
|
||||
);
|
||||
return data;
|
||||
})
|
||||
.catch(({ err }) => {
|
||||
console.log(err);
|
||||
});
|
||||
// router.replace(
|
||||
// "/newappeal" +
|
||||
// "/" +
|
||||
// appTypeCollection.UrlName +
|
||||
// "?lpa=" +
|
||||
// values.lpaTypes +
|
||||
// "&apt=" +
|
||||
// values.appealTypes.split(",")[0],
|
||||
// null,
|
||||
// {
|
||||
// shallow: true,
|
||||
// }
|
||||
// );
|
||||
};
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
{/* <Aboutyou /> */}
|
||||
<Field
|
||||
name="lpaTypes"
|
||||
component={RenderLPAList}
|
||||
optionsObj={lpaOptionsObj}
|
||||
validate={[required]}
|
||||
label={t("newappeal:select-lpa-label")}
|
||||
errorMsg={t("newappeal:select-lpa-label-error-msg")}
|
||||
/>
|
||||
<Field
|
||||
name="appealTypes"
|
||||
component={RenderAppealTypeList}
|
||||
optionsObj={appealOptionsObj}
|
||||
validate={[required]}
|
||||
label={t("newappeal:select-appeal-type-label")}
|
||||
errorMsg={t("newappeal:select-appeal-type-label-error-msg")}
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
</form>
|
||||
<>
|
||||
{formStep == 0 ? (
|
||||
<Aboutyou setFormStep={setFormStep} />
|
||||
) : (
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<Field
|
||||
name="lpaTypes"
|
||||
component={RenderLPAList}
|
||||
optionsObj={lpaOptionsObj}
|
||||
validate={[required]}
|
||||
label={t("newappeal:select-lpa-label")}
|
||||
errorMsg={t("newappeal:select-lpa-label-error-msg")}
|
||||
/>
|
||||
<Field
|
||||
name="appealTypes"
|
||||
component={RenderAppealTypeList}
|
||||
optionsObj={appealOptionsObj}
|
||||
validate={[required]}
|
||||
label={t("newappeal:select-appeal-type-label")}
|
||||
errorMsg={t(
|
||||
"newappeal:select-appeal-type-label-error-msg"
|
||||
)}
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
export default function MakeLDC() {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body appealModule">
|
||||
<p className="govuk-body-s">
|
||||
An appeal relating to an application for a certificate of
|
||||
lawful use or development.
|
||||
</p>
|
||||
<div className="appealCTA">
|
||||
<Link href="/newappeal/selectappeal">
|
||||
<a className="govuk-button">
|
||||
A Lawful Development Certificate (LDC)
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
export default function MakeNewAppeal() {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body appealModule">
|
||||
<p className="govuk-body-s">
|
||||
This includes all householder applications, full planning
|
||||
applications, outline planning applications, planning listed
|
||||
building (LB) applications.
|
||||
</p>
|
||||
<div className="appealCTA">
|
||||
<Link href="./newappeal/selectappeal">
|
||||
<a className="govuk-button">A planning application</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user