Merged PR 1409: PII UAT defects 050225

Related work items: #12956
This commit is contained in:
Robert Bond
2025-02-05 11:25:32 +00:00
10 changed files with 262 additions and 145 deletions
+73 -45
View File
@@ -673,49 +673,77 @@ export const uploadSingleFile = async (
"\n////////////////////////////"
);
let whichLocation =
files[prop][0].fieldName.indexOf("_Statement_of_Case") > 0 ||
files[prop][0].fieldName.indexOf("_-_Statement_of_Case") > 0 ||
files[prop][0].fieldName.indexOf("_-_Application_Form") > 0 ||
files[prop][0].fieldName.indexOf("_-_Site_Ownership_Certificate") >
0 ||
files[prop][0].fieldName.indexOf("_-_Decision_Notice") > 0 ||
files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") > 0 ||
files[prop][0].fieldName.indexOf("_-_Plans_Drawing_Documents") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_Additional_Plans_Drawings_Documents"
) > 0 ||
files[prop][0].fieldName.indexOf("_-_Design_and_Access_Statement") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_NSB_LPA_Additional_Documents"
) > 0 ||
files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") > 0 ||
files[prop][0].fieldName.indexOf("_-_LPA_Original_Permission") >
0 ||
files[prop][0].fieldName.indexOf("_-_LPA's_Registration_Letter") >
0 ||
files[prop][0].fieldName.indexOf("_-_Environmental_Statement") >
0 ||
files[prop][0].fieldName.indexOf("_-_Cost_of_Application") > 0 ||
files[prop][0].fieldName.indexOf("_-_Other_Relevant_Material") >
0 ||
files[prop][0].fieldName.indexOf(
"_-_S106_Agreement_or_Unilateral_Undertaking" > 0
)
? "846040000"
: files[prop][0].fieldName.indexOf("_IP_") > 0
? "846040005"
: files[prop][0].fieldName.indexOf("_Statement_") > 0
? "846040002"
: files[prop][0].fieldName.indexOf("_Questionnaire_") > 0
? "846040001"
: files[prop][0].fieldName.indexOf("_Comments_") > 0
? "846040003"
: files[prop][0].fieldName.indexOf("_Impact_") > 0
? "846040001"
: "846040000";
// let whichLocation =
// files[prop][0].fieldName.indexOf("_Statement_of_Case") > 0 ||
// files[prop][0].fieldName.indexOf("_-_Statement_of_Case") > 0 ||
// files[prop][0].fieldName.indexOf("_-_Application_Form") > 0 ||
// files[prop][0].fieldName.indexOf("_-_Site_Ownership_Certificate") >
// 0 ||
// files[prop][0].fieldName.indexOf("_-_Decision_Notice") > 0 ||
// files[prop][0].fieldName.indexOf("_-_Site_Location_Plan") > 0 ||
// files[prop][0].fieldName.indexOf("_-_Plans_Drawing_Documents") >
// 0 ||
// files[prop][0].fieldName.indexOf(
// "_-_Additional_Plans_Drawings_Documents"
// ) > 0 ||
// files[prop][0].fieldName.indexOf("_-_Design_and_Access_Statement") >
// 0 ||
// files[prop][0].fieldName.indexOf(
// "_-_NSB_LPA_Additional_Documents"
// ) > 0 ||
// files[prop][0].fieldName.indexOf("_-_LPA_Correspondence") > 0 ||
// files[prop][0].fieldName.indexOf("_-_LPA_Original_Permission") >
// 0 ||
// files[prop][0].fieldName.indexOf("_-_LPA's_Registration_Letter") >
// 0 ||
// files[prop][0].fieldName.indexOf("_-_Environmental_Statement") >
// 0 ||
// files[prop][0].fieldName.indexOf("_-_Cost_of_Application") > 0 ||
// files[prop][0].fieldName.indexOf("_-_Other_Relevant_Material") >
// 0 ||
// files[prop][0].fieldName.indexOf(
// "_-_S106_Agreement_or_Unilateral_Undertaking" > 0
// )
// ? "846040000"
// : files[prop][0].fieldName.indexOf("_IP_") > 0
// ? "846040005"
// : files[prop][0].fieldName.indexOf("_Statement_") > 0
// ? "846040002"
// : files[prop][0].fieldName.indexOf("_Questionnaire_") > 0
// ? "846040001"
// : files[prop][0].fieldName.indexOf("_Comments_") > 0
// ? "846040003"
// : files[prop][0].fieldName.indexOf("_Impact_") > 0
// ? "846040001"
// : "846040000";
const fieldName = files[prop][0].fieldName;
// Define the patterns and corresponding values
const patternMapping = [
{
pattern:
/_Statement_of_Case|_-_Statement_of_Case|_-_Application_Form|_-_Site_Ownership_Certificate|_-_Decision_Notice|_-_Site_Location_Plan|_-_Plans_Drawing_Documents|_-_Additional_Plans_Drawings_Documents|_-_Design_and_Access_Statement|_-_NSB_LPA_Additional_Documents|_-_LPA_Correspondence|_-_LPA_Original_Permission|_-_LPA's_Registration_Letter|_-_Environmental_Statement|_-_Cost_of_Application|_-_Other_Relevant_Material|_-_S106_Agreement_or_Unilateral_Undertaking/,
value: "846040000",
},
{ pattern: /_IP_/, value: "846040005" },
{ pattern: /_Statement_/, value: "846040002" },
{ pattern: /_Questionnaire_/, value: "846040001" },
{ pattern: /_Comments_/, value: "846040003" },
{ pattern: /_Impact_/, value: "846040001" },
];
// Find a matching pattern or fallback to default
let whichLocation = "846040000"; // Default value
for (const { pattern, value } of patternMapping) {
if (pattern.test(fieldName)) {
whichLocation = value;
break;
}
}
// return whichLocation;
const tags = {
containerid: containerName,
@@ -723,6 +751,7 @@ export const uploadSingleFile = async (
documentType: files[prop][0].fieldName.split(".")[1],
blobType: "RepresentationFile",
ishareLocation: whichLocation,
documentLocationId: whichLocation,
};
const withTags = await blockBlobClient.setTags(tags);
const withMeta = await blockBlobClient.setMetadata(tags);
@@ -1275,8 +1304,7 @@ export const getAllProgressBlobs = async (containerName) => {
(value, index, self) =>
index ===
self.findIndex(
(t) =>
t.name === value.name // Change 'id' to the property you're checking for uniqueness
(t) => t.name === value.name // Change 'id' to the property you're checking for uniqueness
)
);
return unique;
+1 -1
View File
@@ -113,7 +113,7 @@ let MakeRepresentation = (props) => {
const repDate = new Date();
let day = ("0" + repDate.getDate()).slice(-2);
let month = ("0" + repDate.getMonth() + 1).slice(-2);
let month = ("0" + (repDate.getMonth() + 1)).slice(-2);
let year = repDate.getFullYear();
switch (values.representationCapacity) {
@@ -16,7 +16,7 @@ let RepLPAQuestionnaireCheck_s78 = (props) => {
let repFormData = formObj.representationForm.values;
repFormData = updateLinks(formObj);
repFormData = updateLinks(repFormData);
return (
<>
@@ -159,15 +159,47 @@ const AwaitingSubmissionFromBlob = (props) => {
}
</Link>
)}
{!showTopThreeArr[key].hasOwnProperty(
"appealComplete"
) && (
<div className="deleteCase">
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t(
"case:do-you-want-to-delete-case-label"
) +
showTopThreeArr[key]
.ticketnumber +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteCaseItem(
props.containerID,
showTopThreeArr[key]
.ticketnumber
);
}}
>
&mdash;
</button>
</div>
)}
</div>
<div>
<div className="cardModuleReference">
<b>{t("myportal:lpa-reference-label")}:</b>{" "}
{
showTopThreeArr[key]
.pinswg_lpaapplicationreference
}
</div>
<div>
<div className="cardModuleReference">
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{router.locale == "cy"
? jsonpath(
@@ -184,7 +216,7 @@ const AwaitingSubmissionFromBlob = (props) => {
.pinswg_appealcasetype
).value || ""}
</div>
<div className="carModuleAddress">
<div className="cardModuleReference">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showTopThreeArr)
? t("myportal:case-address-not-entered")
@@ -218,7 +250,7 @@ const AwaitingSubmissionFromBlob = (props) => {
</div>
{showTopThreeArr[key].pinswg_appellantagent !=
null && (
<div>
<div className="cardModuleReference">
{showTopThreeArr[key]
.pinswg_appellantagent !=
846040000 && (
@@ -244,7 +276,7 @@ const AwaitingSubmissionFromBlob = (props) => {
)}
{showTopThreeArr[key].pinswg_appellantagent !=
846040000 && (
<div>
<div className="cardModuleReference">
<b>
{t("myportal:on-behalf-of-label")}:{" "}
</b>
@@ -255,17 +287,21 @@ const AwaitingSubmissionFromBlob = (props) => {
.pinswg_appellantlastname}
</div>
)}
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
showTopThreeArr[key][
"pinswg_lpaname"
] +
'")].value_cy',
transLookup
)
: showTopThreeArr[key]["pinswg_lpaname"] ||
""}
<div className="cardModuleReference">
<b>LPA:</b>
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
showTopThreeArr[key][
"pinswg_lpaname"
] +
'")].value_cy',
transLookup
)
: showTopThreeArr[key][
"pinswg_lpaname"
] || ""}
</div>
<div className="cardModuleReference">
<b>{t("myportal:date-raised")}:</b>
{" "}
@@ -285,38 +321,6 @@ const AwaitingSubmissionFromBlob = (props) => {
</div>
)}
</div>
{!showTopThreeArr[key].hasOwnProperty(
"appealComplete"
) && (
<div className="">
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t(
"case:do-you-want-to-delete-case-label"
) +
showTopThreeArr[key]
.ticketnumber +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteCaseItem(
props.containerID,
showTopThreeArr[key]
.ticketnumber
);
}}
>
&mdash;
</button>
</div>
)}
</div>
);
})}
+77 -18
View File
@@ -266,8 +266,64 @@ const TopThree = (props) => {
]}{" "}
</Link>
)}
{topThreeType == "watchedCases" && !props.myReps && (
<div className="deleteCase">
<button
title={t(
"case:you-have-stopped-watching-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t(
"case:you-have-stopped-watching-label"
) +
showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]
) &&
deleteItem(
showTopThreeArr[key]
.pinswg_watchlistid,
"watchedCases"
);
}}
>
&mdash;
</button>
</div>
)}
{topThreeType == "awaitingSubmission" && (
<div className="deleteCase">
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t(
"case:do-you-want-to-delete-case-label"
) +
showTopThreeArr[key]
.ticketnumber +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteItem(
showTopThreeArr[key].incidentid,
"awaitingSubmission"
);
}}
>
&mdash;
</button>
</div>
)}
</div>
<div>
<div className="cardModuleReference">
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{router.locale == "cy"
? jsonpath(
@@ -284,7 +340,7 @@ const TopThree = (props) => {
</div>
{/* )} */}
{/* {topThreeType != "awaitingSubmission" ? ( */}
<div className="carModuleAddress">
<div className="cardModuleReference">
<b>{t("myportal:case-address")}:</b>{" "}
{_.isEmpty(showTopThreeArr[key])
? t("myportal:case-address-not-entered")
@@ -311,7 +367,7 @@ const TopThree = (props) => {
: "")}
</div>
{showTopThreeArr[key].pinswg_appellantagent != null && (
<div>
<div className="cardModuleReference">
{showTopThreeArr[key].pinswg_appellantagent !=
846040000 && (
<b>{t("myportal:raised-by-label")}: </b>
@@ -330,25 +386,28 @@ const TopThree = (props) => {
</div>
)}
{showTopThreeArr[key].pinswg_appellantfirstname != null && (
<div>
<div className="cardModuleReference">
<b>{t("myportal:on-behalf-of-label")}: </b>
{showTopThreeArr[key].pinswg_appellantfirstname +
" " +
showTopThreeArr[key].pinswg_appellantlastname}
</div>
)}
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
<div className="cardModuleReference">
<b>LPA:</b>
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
</div>
{topThreeType == "awaitingSubmission" ? (
<div className="carModuleAddress">
Case Incomplete, not submitted
@@ -387,7 +446,7 @@ const TopThree = (props) => {
</div>
)}
</div>
{topThreeType == "watchedCases" && !props.myReps && (
{/* {topThreeType == "watchedCases" && !props.myReps && (
<div className="">
<button
title={t("case:you-have-stopped-watching-label")}
@@ -432,7 +491,7 @@ const TopThree = (props) => {
&mdash;
</button>
</div>
)}
)} */}
</div>
);
});
+35 -25
View File
@@ -228,6 +228,41 @@ const TopThree = (props) => {
{showTopThreeArr[key].pinswg_name}
</Link>
)}
{!showTopThreeArr[key].hasOwnProperty(
"repComplete"
) && (
<div className="deleteCase">
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t(
"case:do-you-want-to-delete-case-label"
) +
showTopThreeArr[key]
.pinswg_name +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteRepItem(
props.accountDetails
.containerID,
showTopThreeArr[key]
.pinswg_name,
showTopThreeArr[key]
.repfile_name
);
}}
>
&mdash;
</button>
</div>
)}
</div>
<div className="cardModuleReference">
<b>{t("myportal:representation-type")}:</b>
@@ -287,31 +322,6 @@ const TopThree = (props) => {
</div>
)}
</div>
{!showTopThreeArr[key].hasOwnProperty("repComplete") && (
<div className="">
<button
title={t("case:do-you-want-to-delete-case-label")}
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
confirm(
t("case:do-you-want-to-delete-case-label") +
showTopThreeArr[key].pinswg_name +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteRepItem(
props.accountDetails.containerID,
showTopThreeArr[key].pinswg_name,
showTopThreeArr[key].repfile_name
);
}}
>
&mdash;
</button>
</div>
)}
</div>
);
});
+1 -1
View File
@@ -43,7 +43,7 @@
"norecords-awaiting-submissions": "You have no awaiting submissions",
"on-behalf-of-label": "On behalf of",
"appeal-type-label": "Appeal type",
"lpa-reference-label": "LPA reference number",
"lpa-reference-label": "LPA reference",
"raised-by-label": "Raised by",
"representation-id": "Representation ID",
"representation-type": "Representation type",
+1 -1
View File
@@ -8,7 +8,7 @@
"county-label": "County",
"postcode-label": "Postcode",
"lpa-label": "Local Planning Authority",
"lpa-reference-label": "LPA reference number",
"lpa-reference-label": "LPA reference",
"appealtype-label": "Select a case type",
"case-status-label": "Case Status",
"case-type-label": "Case type",
+18 -4
View File
@@ -9,7 +9,7 @@
margin-bottom: 2em;
}
@media screen and (min-width: 600px) and (max-width: 900px) {
@media screen and (min-width: 769px) and (max-width: 900px) {
.card {
flex-basis: 45.99%;
@@ -252,21 +252,35 @@ div.cardModuleItem:last-of-type {
.cardModuleItem {
display: flex;
padding: 10px 10px 10px 0;
padding: 10px 0px 10px 0;
border-bottom: 1px solid lightgrey;
.cardModuleDetails {
width: 95%;
width: 100%;
}
.cardModuleReference {
display: flex;
justify-content: flex-start;
line-height: 1.5;
b {
min-width: 122px;
@media screen and (max-width: 600px) {
min-width: 120px;
margin-right: 3px;
}
@media screen and (min-width: 769px) {
min-width: 160px;
}
margin-right: 10px;
}
.deleteCase {
margin-left: auto
}
}
+3 -1
View File
@@ -379,7 +379,9 @@ a.longLinkBreak {
}
}
.govuk-width-container {
max-width: 1000px;
}
.wgForm {
background: $lightgrey_offwhite;