filename changes to include case ref and cat code

This commit is contained in:
2022-06-21 12:09:03 +01:00
parent bd04900ff8
commit eb5d03a068
11 changed files with 128 additions and 35 deletions
+62 -5
View File
@@ -108,7 +108,7 @@ export function Textfield(props) {
// console.log(parentField, showIfHasParentShowValue);
// console.log(parentField, formProps, form);
console.log("validation props:", validation);
//console.log("validation props:", validation);
return (
<div className="govuk-form-group">
@@ -1207,6 +1207,8 @@ export function FileUploadField(props) {
//validate={[required]}
label={props.label}
errorMsg="Is required"
ticketnumber={props.ticketnumber}
documentTypeCode={props.documentTypeCode}
/>
</>
);
@@ -1399,12 +1401,67 @@ const RenderFileUpload = (field) => {
break;
}
};
const getDocumentType = (docCode) => {
console.log(docCode);
switch (docCode) {
case "000001":
return "000001";
break;
case "000002":
return "000002";
break;
case "000003":
return "000003";
break;
case "000004":
return "000004";
break;
case "000005":
return "000005";
break;
case "000006":
return "000006";
break;
case "000007":
return "000007";
break;
case "000008":
return "000008";
break;
case "000009":
return "000009";
break;
case "000010":
return "000010";
break;
default:
return "000000";
}
};
return (
<>
<Dropzone
onDrop={(filesToUpload, e) =>
field.input.onChange(filesToUpload)
}
// onDrop={(filesToUpload, e) =>
// field.input.onChange(filesToUpload)
// }
onDrop={(filesToUpload, e) => {
console.log(field.ticketnumber, field.documentTypeCode);
const renamedAcceptedFiles = filesToUpload.map(
(file) =>
new File(
[file],
`${field.ticketnumber}_${getDocumentType(
field.documentTypeCode
)}_${file.name}`,
{
type: file.type,
}
)
);
field.input.onChange(renamedAcceptedFiles);
}}
>
{({ getRootProps, getInputProps }) => (
<>
@@ -1435,7 +1492,7 @@ const RenderFileUpload = (field) => {
alt={file.name}
width="50"
/>
<span className="govuk-body govuk-!-padding-left-5">
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{file.name} ({bytesToSize(file.size)})
</span>
</div>
+1
View File
@@ -63,6 +63,7 @@ const MyPortal = (props) => {
signOut({ callbackUrl: "/logout" });
};
console.log("showFileUpload :", showFileUpload);
return (
<>
<main className="" id="main-content" role="main">
+14 -3
View File
@@ -161,9 +161,20 @@ const RenderFileUpload = (field) => {
return (
<div>
<Dropzone
onDrop={(filesToUpload, e) =>
field.input.onChange(filesToUpload)
}
// onDrop={(filesToUpload, e) =>
// field.input.onChange(filesToUpload)
// }
onDrop={(filesToUpload, e) => {
const renamedAcceptedFiles = filesToUpload.map(
(file) =>
new File([file], `${file.name}_${+new Date()}`, {
type: file.type,
})
);
field.input.onChange(renamedAcceptedFiles);
console.log(renamedAcceptedFiles);
}}
>
{({ getRootProps, getInputProps }) => (
<div className="govuk-grid-row">
+5
View File
@@ -176,6 +176,11 @@ export default function BuildField(props) {
<FileUploadField
name={props.datafieldname}
label={props.label}
ticketnumber={
props.props.props.props.appealType.caseReference
.ticketnumber
}
documentTypeCode={props.documentTypeCode}
/>
</div>
);
+11
View File
@@ -58,6 +58,11 @@ export default function BuildRow(props) {
doc
);
var documentTypeCode = xpath.select(
"//@ishareDocumentCode",
doc
);
var hint = xpath.select("//label/@hint", doc);
var dateStart = xpath.select("//@dateStart", doc);
var dateEnd = xpath.select("//@dateEnd", doc);
@@ -87,6 +92,10 @@ export default function BuildRow(props) {
!_.isEmpty(requiredDocumentLabel) &&
requiredDocumentLabel[0].value;
documentTypeCode =
!_.isEmpty(documentTypeCode) &&
documentTypeCode[0].value;
dateStart = !_.isEmpty(dateStart) && dateStart[0].value;
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
@@ -110,6 +119,7 @@ export default function BuildRow(props) {
props.props.props.formData.pickListData
}
mandatoryFieldsData={mandatoryFieldsData}
documentTypeCode={documentTypeCode}
/>
);
} else {
@@ -146,6 +156,7 @@ export default function BuildRow(props) {
documentList={
props.props.appealType.documentList
}
documentTypeCode={documentTypeCode}
/>
);
// } else {
+5 -5
View File
@@ -410,7 +410,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Site plan" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
<label description="Site plan" ishareDocumentCode="000001" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
</labels>
<control id="pinswg_fileUpload" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -418,7 +418,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Plans, drawings and documents submitted to the LPA (and list)" languagecode="1033" />
<label description="Plans, drawings and documents submitted to the LPA (and list)" ishareDocumentCode="000002" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload2" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload2" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -426,7 +426,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="The discontinuance notice" languagecode="1033" />
<label description="The discontinuance notice" ishareDocumentCode="000008" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload3" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload7" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -434,7 +434,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Correspondence with the LPA relating to the application" languagecode="1033" />
<label description="Correspondence with the LPA relating to the application" ishareDocumentCode="000004" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload4" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload4" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -442,7 +442,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Any other material you may deem relevant" languagecode="1033" />
<label description="Any other material you may deem relevant" ishareDocumentCode="000006" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload5" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload5" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
+5 -5
View File
@@ -479,7 +479,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Site plan" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
<label description="Site plan" ishareDocumentCode="000001" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
</labels>
<control id="pinswg_fileUpload" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -487,7 +487,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Plans, drawings and documents submitted to the LPA (and list)" languagecode="1033" />
<label description="Plans, drawings and documents submitted to the LPA (and list)" ishareDocumentCode="000002" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload2" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload2" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -495,7 +495,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Design and Access Statement (if relevant)" languagecode="1033" />
<label description="Design and Access Statement (if relevant)" ishareDocumentCode="000003" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload3" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload3" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -503,7 +503,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Correspondence with the LPA relating to the application" languagecode="1033" />
<label description="Correspondence with the LPA relating to the application" ishareDocumentCode="000004" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload4" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload4" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -511,7 +511,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Any other material you may deem relevant" languagecode="1033" />
<label description="Any other material you may deem relevant" ishareDocumentCode="000006" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload5" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload5" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -452,7 +452,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Site plan" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
<label description="Site plan" ishareDocumentCode="000001" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
</labels>
<control id="pinswg_fileUpload" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -460,7 +460,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Plans, drawings and documents submitted to the LPA (and list)" languagecode="1033" />
<label description="Plans, drawings and documents submitted to the LPA (and list)" ishareDocumentCode="000002" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload2" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload2" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -468,7 +468,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Design and Access Statement (if relevant)" languagecode="1033" />
<label description="Design and Access Statement (if relevant)" ishareDocumentCode="000003" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload3" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload3" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -476,7 +476,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Correspondence with the LPA relating to the application" languagecode="1033" />
<label description="Correspondence with the LPA relating to the application" ishareDocumentCode="000004" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload4" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload4" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -484,7 +484,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Any other material you may deem relevant" languagecode="1033" />
<label description="Any other material you may deem relevant" ishareDocumentCode="000006" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload4" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload4" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -492,7 +492,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="If the appeal is against the LPA's refusal or failure to decide an application which relates to a condition, we must have a copy of the original permission with the condition attached" languagecode="1033" />
<label description="If the appeal is against the LPA's refusal or failure to decide an application which relates to a condition, we must have a copy of the original permission with the condition attached" ishareDocumentCode="000009" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload5" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload5" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -500,7 +500,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="If the appeal is against the LPA's failure to decide an application please supply a copy of the LPA's letter registering your application" languagecode="1033" />
<label description="If the appeal is against the LPA's failure to decide an application please supply a copy of the LPA's letter registering your application" ishareDocumentCode="000010" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload6" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload6" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
+7 -7
View File
@@ -503,7 +503,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Site plan" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
<label description="Site plan" ishareDocumentCode="000001" languagecode="1033" hint="Site plan (preferably on a copy of an Ordnance Survey map at not less than 10,000 scale) showing the general location of the proposed development and its boundary. This plan should show two named roads so as to assist the location of the appeal site or premises. The application site should be edged or shaded in red and any other adjoining land owned or controlled by the appellant (if any) edged or shaded in blue." />
</labels>
<control id="pinswg_fileUpload" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -511,7 +511,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Plans, drawings and documents submitted to the LPA (and list)" languagecode="1033" />
<label description="Plans, drawings and documents submitted to the LPA (and list)" ishareDocumentCode="000002" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload2" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload2" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -519,7 +519,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Design and Access Statement (if relevant)" languagecode="1033" />
<label description="Design and Access Statement (if relevant)" ishareDocumentCode="000003" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload3" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload3" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -527,7 +527,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Correspondence with the LPA relating to the application" languagecode="1033" />
<label description="Correspondence with the LPA relating to the application" ishareDocumentCode="000004" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload4" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload4" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -535,7 +535,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Environmental Statement plus certificates and notices relating to publicity (if relevant)" languagecode="1033" />
<label description="Environmental Statement plus certificates and notices relating to publicity (if relevant)" ishareDocumentCode="000005" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload5" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload5" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -543,7 +543,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="Any other material you may deem relevant" languagecode="1033" />
<label description="Any other material you may deem relevant" ishareDocumentCode="000006" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload6" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload6" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
@@ -551,7 +551,7 @@
<row>
<cell id="{16D63FD6-119B-4353-BDCA-18358721C3FE}" showlabel="true" locklevel="0">
<labels>
<label description="The S106 agreement or unilateral undertaking" languagecode="1033" />
<label description="The S106 agreement or unilateral undertaking" ishareDocumentCode="000007" languagecode="1033" />
</labels>
<control id="pinswg_fileUpload7" classid="{16D63FD6-119B-4353-BDCA-18358721C3FE}" datafieldname="pinswg_fileUpload7" disabled="false" uniqueid="{5a91c72e-ce0a-4589-ad92-6433524fb090}" />
</cell>
+8
View File
@@ -51,6 +51,7 @@ const Home = (props) => {
awaitingSubmission,
accountDetails,
govGateway,
showFileUpload,
} = props;
let { t, lang } = useTranslation();
@@ -60,6 +61,8 @@ const Home = (props) => {
const { data: session } = useSession();
console.log("eeee", process.env.SHOWFILEUPLOAD);
return (
<div>
<Head>
@@ -140,6 +143,7 @@ const Home = (props) => {
awaitingSubmission={awaitingSubmission}
accountDetails={accountDetails}
ggLogout={govGateway.config.end_session_endpoint}
showFileUpload={showFileUpload}
/>
</div>
<Footer footerLinks={footerLinks} />
@@ -220,6 +224,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(
setAwaitingSubmissionDetails(awaitingSubmissionDetails)
);
return {
props: { showFileUpload: process.env.SHOWFILEUPLOAD },
};
}
}
);
+3 -3
View File
@@ -108,9 +108,9 @@ const makeStore = ({ isServer }) => {
const persistConfig = {
key: "acp",
whitelist: [
// "currentView",
"currentView",
// "search",
// "searchResultsObj",
"searchResultsObj",
"formData",
"appealType",
"LPAData",
@@ -122,7 +122,7 @@ const makeStore = ({ isServer }) => {
"govGateway",
"form",
],
version: 1.2,
version: 1.3,
storage: storage,
stateReconciler: autoMergeLevel2, // if needed, use a safer storage
migrate: (state) => {