Merged PR 1133: changed order of so pdf doesnt get orphaned

changed order of so pdf doesnt get orphaned

Related work items: #11021
This commit is contained in:
Robert Bond
2024-04-30 13:03:13 +00:00
10 changed files with 124 additions and 72 deletions
+41
View File
@@ -327,6 +327,47 @@ export const createAppealPDFBlob = async (
const uploadBlobResponse = await blockBlobClient.uploadStream(content); const uploadBlobResponse = await blockBlobClient.uploadStream(content);
console.log(uploadBlobResponse);
const tags = {
containerid: containerName,
caseID: caseID,
blobType: "Appeal PDF",
};
//console.log("the tags:", tags);
const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags);
//return formContent.pinswg_name;
return uploadBlobResponse;
};
export const createRepPDFBlob = async (
formContent,
containerName,
caseref,
repName
) => {
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
const containerClient = new ContainerClient(sasUrl);
formContent = formContent;
let caseID = "";
caseID = caseref;
const content = formContent;
//console.log(content);
const blobName = caseID + "/files/" + repName + ".pdf";
console.log("blobName:", blobName);
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
const uploadBlobResponse = await blockBlobClient.uploadStream(content);
const tags = { const tags = {
containerid: containerName, containerid: containerName,
caseID: caseID, caseID: caseID,
+9 -9
View File
@@ -254,15 +254,15 @@ let BuildCheckSection = (props) => {
className="govuk-button" className="govuk-button"
data-module="govuk-button" data-module="govuk-button"
onClick={() => { onClick={() => {
setCurrentSection(9999), generateAppealPDF(
generateAppealPDF( pdfObj,
pdfObj, props.props.accountDetails.containerID,
props.props.accountDetails.containerID, props.appealType.caseReference.ticketnumber,
props.appealType.caseReference.ticketnumber, router.query.appealtypes,
router.query.appealtypes, pdfObj.filesList
pdfObj.filesList // props.appealType.fileList
// props.appealType.fileList ),
); setCurrentSection(9999);
}} }}
> >
{t("newappeal:submit-appeal-button")} {t("newappeal:submit-appeal-button")}
+4 -4
View File
@@ -166,7 +166,7 @@
<labels> <labels>
<label description="Please set out the potential health and safety issues" /> <label description="Please set out the potential health and safety issues" />
</labels> </labels>
<control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -250,7 +250,7 @@
<labels> <labels>
<label description="Please provide details of the appeals including our reference number, if known" /> <label description="Please provide details of the appeals including our reference number, if known" />
</labels> </labels>
<control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" /> <control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -304,13 +304,13 @@
<labels> <labels>
<label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" /> <label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" />
</labels> </labels>
<control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" /> <control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
<label description="Are you attaching a separate Costs application?" /> <label description="Are you attaching a separate Costs application?" />
</labels> </labels>
<control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" /> <control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
+6 -6
View File
@@ -91,7 +91,7 @@
<labels> <labels>
<label description="What date was your application decided on by the LPA?" /> <label description="What date was your application decided on by the LPA?" />
</labels> </labels>
<control id="pinswg_dateoflpadecision" parentField="pinswg_lpadecisiononapplicationmade" parentFieldShowOnValue="Yes" classid="{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" datafieldname="pinswg_dateoflpadecision" dateStart="-6m" dateEnd="0" disabled="false" /> <control id="pinswg_dateoflpadecision" parentField="pinswg_lpadecisiononapplicationmade" parentFieldShowOnValue="true" classid="{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" datafieldname="pinswg_dateoflpadecision" dateStart="-6m" dateEnd="0" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -205,7 +205,7 @@
<labels> <labels>
<label description="Please explain why the inspector needs to enter the site" /> <label description="Please explain why the inspector needs to enter the site" />
</labels> </labels>
<control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -217,7 +217,7 @@
<labels> <labels>
<label description="Please set out the potential health and safety issues" /> <label description="Please set out the potential health and safety issues" />
</labels> </labels>
<control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -289,7 +289,7 @@
<labels> <labels>
<label description="Please provide details of the appeals including our reference number, if known" /> <label description="Please provide details of the appeals including our reference number, if known" />
</labels> </labels>
<control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" /> <control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -325,13 +325,13 @@
<labels> <labels>
<label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" /> <label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" />
</labels> </labels>
<control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" /> <control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
<label description="Are you attaching a separate Costs application?" /> <label description="Are you attaching a separate Costs application?" />
</labels> </labels>
<control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" /> <control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -797,7 +797,7 @@
<labels> <labels>
<label description="Please explain why the inspector needs to enter the site" /> <label description="Please explain why the inspector needs to enter the site" />
</labels> </labels>
<control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -809,7 +809,7 @@
<labels> <labels>
<label description="Please set out the potential health and safety issues" /> <label description="Please set out the potential health and safety issues" />
</labels> </labels>
<control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -1116,7 +1116,7 @@
<labels> <labels>
<label description="Please provide details of the appeals including our reference number, if known" /> <label description="Please provide details of the appeals including our reference number, if known" />
</labels> </labels>
<control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" /> <control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -1170,13 +1170,13 @@
<labels> <labels>
<label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" /> <label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" />
</labels> </labels>
<control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" /> <control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
<label description="Are you attaching a separate Costs application?" /> <label description="Are you attaching a separate Costs application?" />
</labels> </labels>
<control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" /> <control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
+6 -6
View File
@@ -78,7 +78,7 @@
<labels> <labels>
<label description="What date was your application decided on by the LPA?" /> <label description="What date was your application decided on by the LPA?" />
</labels> </labels>
<control id="pinswg_dateoflpadecision" parentField="pinswg_lpadecisiononapplicationmade" parentFieldShowOnValue="Yes" classid="{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" datafieldname="pinswg_dateoflpadecision" dateStart="-6m" dateEnd="0" disabled="false" /> <control id="pinswg_dateoflpadecision" parentField="pinswg_lpadecisiononapplicationmade" parentFieldShowOnValue="true" classid="{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" datafieldname="pinswg_dateoflpadecision" dateStart="-6m" dateEnd="0" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -210,7 +210,7 @@
<labels> <labels>
<label description="Please explain why the inspector needs to enter the site" hint="newappeal:new-appeal-inspector-onsite-paragraph" /> <label description="Please explain why the inspector needs to enter the site" hint="newappeal:new-appeal-inspector-onsite-paragraph" />
</labels> </labels>
<control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -222,7 +222,7 @@
<labels> <labels>
<label description="Please set out the potential health and safety issues" /> <label description="Please set out the potential health and safety issues" />
</labels> </labels>
<control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -320,7 +320,7 @@
<labels> <labels>
<label description="Please provide details of the appeals including our reference number, if known" /> <label description="Please provide details of the appeals including our reference number, if known" />
</labels> </labels>
<control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" /> <control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -368,13 +368,13 @@
<labels> <labels>
<label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" /> <label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" />
</labels> </labels>
<control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" /> <control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
<label description="Are you attaching a separate Costs application?" /> <label description="Are you attaching a separate Costs application?" />
</labels> </labels>
<control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" /> <control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -70,7 +70,7 @@
<labels> <labels>
<label description="What date was your application decided on by the LPA?" /> <label description="What date was your application decided on by the LPA?" />
</labels> </labels>
<control id="pinswg_dateoflpadecision" parentField="pinswg_lpadecisiononapplicationmade" parentFieldShowOnValue="Yes" classid="{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" datafieldname="pinswg_dateoflpadecision" dateStart="-6m" dateEnd="0" disabled="false" /> <control id="pinswg_dateoflpadecision" parentField="pinswg_lpadecisiononapplicationmade" parentFieldShowOnValue="true" classid="{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}" datafieldname="pinswg_dateoflpadecision" dateStart="-6m" dateEnd="0" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -172,7 +172,7 @@
<labels> <labels>
<label description="Please explain why the inspector needs to enter the site" /> <label description="Please explain why the inspector needs to enter the site" />
</labels> </labels>
<control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -184,7 +184,7 @@
<labels> <labels>
<label description="Please set out the potential health and safety issues" /> <label description="Please set out the potential health and safety issues" />
</labels> </labels>
<control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -262,7 +262,7 @@
<labels> <labels>
<label description="Please provide details of the appeals including our reference number, if known" /> <label description="Please provide details of the appeals including our reference number, if known" />
</labels> </labels>
<control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" /> <control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -316,13 +316,13 @@
<labels> <labels>
<label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" /> <label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" />
</labels> </labels>
<control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" /> <control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
<label description="Are you attaching a separate Costs application?" /> <label description="Are you attaching a separate Costs application?" />
</labels> </labels>
<control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" /> <control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
+5 -5
View File
@@ -196,7 +196,7 @@
<labels> <labels>
<label description="Please explain why the inspector needs to enter the site" hint="newappeal:new-appeal-inspector-onsite-paragraph" /> <label description="Please explain why the inspector needs to enter the site" hint="newappeal:new-appeal-inspector-onsite-paragraph" />
</labels> </labels>
<control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_whyisinspectorneededonsite" parentField="pinswg_inspectorneededonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_whyisinspectorneededonsite" maxFieldLength="800" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
@@ -208,7 +208,7 @@
<labels> <labels>
<label description="Please set out the potential health and safety issues" /> <label description="Please set out the potential health and safety issues" />
</labels> </labels>
<control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" /> <control id="pinswg_outlinehealthandsafetyissuesonsite" parentField="pinswg_healthandsafetyissuesonsite" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_outlinehealthandsafetyissuesonsite" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -244,7 +244,7 @@
<labels> <labels>
<label description="Please provide details of the appeals including our reference number, if known" /> <label description="Please provide details of the appeals including our reference number, if known" />
</labels> </labels>
<control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="Yes" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" /> <control id="pinswg_additionalappealsmadedetails" parentField="pinswg_additionalappealsmade" parentFieldShowOnValue="true" classid="{E0DECE4B-6FC8-4a8f-A065-082708572369}" datafieldname="pinswg_additionalappealsmadedetails" maxFieldLength="800" disabled="false" />
</row> </row>
</rows> </rows>
</section> </section>
@@ -304,13 +304,13 @@
<labels> <labels>
<label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" /> <label description="Please submit your Cost Application" hint="newappeal:new-appeal-cost-application-hint" />
</labels> </labels>
<control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" /> <control validation="[required]" id="pinswg_costapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{E0DECE4B-6666-4a8f-A065-082708572369}" datafieldname="pinswg_costapplication" maxFieldLength="5000" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
<label description="Are you attaching a separate Costs application?" /> <label description="Are you attaching a separate Costs application?" />
</labels> </labels>
<control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="Yes,Ydw" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" /> <control validation="[required]" id="pinswg_attachcostapplication" parentField="pinswg_costappliedforindicator" parentFieldShowOnValue="true" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="pinswg_attachcostapplication" requiredDocumentValue="Yes" requiredDocumentLabel="Cost Application" disabled="false" />
</row> </row>
<row> <row>
<labels> <labels>
+19 -20
View File
@@ -180,28 +180,27 @@ export default async function handler(req, res) {
<MyDocument docProps={blobProgress} pickListData={pickListData} /> <MyDocument docProps={blobProgress} pickListData={pickListData} />
); );
createAppealPDFBlob(renderedPDF, containerID, blobProgress.pinswg_name); await createAppealPDFBlob(
renderedPDF,
console.log( containerID,
"///////////////////////////////////\nfile created: " + blobProgress.pinswg_name
).then((data) => {
console.log(
"///////////////////////////////////\nfile created: " + data,
`/files/${blobProgress.pinswg_name}.pdf`, `/files/${blobProgress.pinswg_name}.pdf`,
"\n/////////////////////////" "\n/////////////////////////"
); );
return res.status(200).json({
// uploadPDFAppealFiles( status: "success",
// process.cwd() + `/tmp/${appealBodyObj.pinswg_name}.pdf`, data: data,
// containerID, path: `/files/${blobProgress.pinswg_name}.pdf`,
// appealBodyObj.pinswg_name });
// );
// then remove from local folder
//fs.unlinkSync(process.cwd() + `/tmp/${appealBodyObj.repfile_name}.pdf`);
return res.status(200).json({
data: "success",
path: process.cwd() + `/tmp/${blobProgress.pinswg_name}.pdf`,
}); });
// return res.status(200).json({
// data: "success",
// path: process.cwd() + `/tmp/${blobProgress.pinswg_name}.pdf`,
// });
// } else { // } else {
// return res.status(400).json(); // return res.status(400).json();
// } // }
+23 -11
View File
@@ -104,7 +104,7 @@ import { other_pdf } from "../../../components/pdftemplates/other_pdf";
// ApiProxy.post(async (req, res) => { // ApiProxy.post(async (req, res) => {
export default function handler(req, res) { export default async function handler(req, res) {
var checkHash = req.query.hash; var checkHash = req.query.hash;
let reqBodyobj = req.body; //JSON.parse(req.body); let reqBodyobj = req.body; //JSON.parse(req.body);
@@ -217,25 +217,37 @@ export default function handler(req, res) {
"\n/////////////////////////" "\n/////////////////////////"
); );
ReactPDF.render( const renderedPDF = await ReactPDF.renderStream(
<MyDocument docProps={reqBodyobj} />, <MyDocument docProps={reqBodyobj} />
process.cwd() + `/tmp/${reqBodyobj.repfile_name}.pdf` );
await createRepPDFBlob(
renderedPDF,
containerID,
caseRef,
reqBodyobj.repfile_name
);
console.log(
"///////////////////////////////////\nrep pdf file created: " +
`/files/${reqBodyobj.repfile_name}.pdf`,
"\n/////////////////////////"
); );
// upload file to storage account // upload file to storage account
uploadPDFRepFiles( // uploadPDFRepFiles(
process.cwd() + `/tmp/${reqBodyobj.repfile_name}.pdf`, // process.cwd() + `/tmp/${reqBodyobj.repfile_name}.pdf`,
containerID, // containerID,
caseRef + "/" + reqBodyobj.repfile_name, // caseRef + "/" + reqBodyobj.repfile_name,
repType // repType
); // );
// remove from local folder // remove from local folder
//fs.unlinkSync(process.cwd() + `/tmp/${reqBodyobj.repfile_name}.pdf`); //fs.unlinkSync(process.cwd() + `/tmp/${reqBodyobj.repfile_name}.pdf`);
return res.status(200).json({ return res.status(200).json({
data: "success", data: "success",
path: `tmp/${reqBodyobj.repfile_name}.pdf`, path: `${reqBodyobj.repfile_name}.pdf`,
}); });
// } else { // } else {
// return res.status(400).json(); // return res.status(400).json();