moved alot of stuff from client side
This commit is contained in:
@@ -19,7 +19,6 @@ import S78_Questionnaire from "./representationQuestionnaires/representationLPAQ
|
||||
|
||||
let RepLPA = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const {
|
||||
@@ -38,9 +37,11 @@ let RepLPA = (props) => {
|
||||
setQuestionnaireCount,
|
||||
setRepFileName,
|
||||
updateRepresentation,
|
||||
setSavingStatus,
|
||||
savingStatus,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
const files = acceptedFiles.map((file) => (
|
||||
<li key={file.path}>
|
||||
{file.path} - {file.size} bytes
|
||||
@@ -197,6 +198,13 @@ let RepLPA = (props) => {
|
||||
) &&
|
||||
setRepFileName(props.formObj["representationForm"].values);
|
||||
|
||||
let filesListObj =
|
||||
props.formObj.hasOwnProperty("representationForm") &&
|
||||
props.formObj["representationForm"].hasOwnProperty("values") &&
|
||||
props.formObj["representationForm"].values.hasOwnProperty("filesList")
|
||||
? props.formObj["representationForm"].values.filesList
|
||||
: {};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="govuk-grid-row">
|
||||
@@ -291,6 +299,35 @@ let RepLPA = (props) => {
|
||||
>
|
||||
{" "}
|
||||
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||
{console.log(
|
||||
"--------",
|
||||
props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
)
|
||||
? props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList
|
||||
: ""
|
||||
)}
|
||||
{/* {props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty("values") &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
) && ( */}
|
||||
<FileUploadField
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
@@ -302,17 +339,32 @@ let RepLPA = (props) => {
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.props.props.form[
|
||||
(props.formObj.hasOwnProperty(
|
||||
"representationForm"
|
||||
].values.filesList || []
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].hasOwnProperty(
|
||||
"values"
|
||||
) &&
|
||||
props.formObj[
|
||||
"representationForm"
|
||||
].values.hasOwnProperty(
|
||||
"filesList"
|
||||
) &&
|
||||
props.props.props.form[
|
||||
"representationForm"
|
||||
].values.filesList) ||
|
||||
[]
|
||||
}
|
||||
setFilesForRepresentation={[]}
|
||||
containerID={
|
||||
props.props.props.accountDetails
|
||||
.containerID
|
||||
}
|
||||
filenamePrefix={props}
|
||||
filenamePrefix={props.formObj}
|
||||
/>
|
||||
{/* // )} */}
|
||||
</div>
|
||||
</fieldset>
|
||||
</>
|
||||
@@ -434,7 +486,7 @@ let RepLPA = (props) => {
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
wwwww {t("common:continue-button")}
|
||||
</button>
|
||||
{/* {router.query.state != "edit" && (
|
||||
<a
|
||||
@@ -471,8 +523,9 @@ let RepLPA = (props) => {
|
||||
className="govuk-button progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props.form[props.form]
|
||||
.values || {};
|
||||
props.props.props.form[
|
||||
props.form
|
||||
].values || {};
|
||||
|
||||
console.log(
|
||||
"valuesobj:",
|
||||
|
||||
Reference in New Issue
Block a user