From 8f94b2feb2efd58c5b33b8b63bc313a2bae0e236 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 29 Jan 2025 10:32:26 +0000
Subject: [PATCH 1/8] uat defect - pdf failing to be generated
---
components/pdftemplates/appealRow_pdf.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/components/pdftemplates/appealRow_pdf.js b/components/pdftemplates/appealRow_pdf.js
index 6bba3c15..a4671f82 100644
--- a/components/pdftemplates/appealRow_pdf.js
+++ b/components/pdftemplates/appealRow_pdf.js
@@ -489,6 +489,13 @@ export const AppealRow_pdf = (props) => {
{props.props.hasOwnProperty(
datafieldname[0].value
) &&
+ props.props[
+ datafieldname[0].value
+ ] == null ? (
+
+ N/A
+
+ ) : (
props.props[
datafieldname[0]
.value
@@ -535,7 +542,8 @@ export const AppealRow_pdf = (props) => {
""
);
}
- )}
+ )
+ )}
From 2882330c5d16f5b3c952055033f2e9ca9260ec68 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 29 Jan 2025 13:29:16 +0000
Subject: [PATCH 2/8] uat defect 136
---
locales/cy/common.json | 2 +-
locales/en/common.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/locales/cy/common.json b/locales/cy/common.json
index 5448a326..1c740397 100644
--- a/locales/cy/common.json
+++ b/locales/cy/common.json
@@ -83,7 +83,7 @@
"further-details-title": "Mae angen rhagor o fanylion",
"further-details-header": "Ni allwch fewngofnodi ar hyn o bryd",
"further-details-para-one": "Mae angen i PEDW gadarnhau ychydig mwy o wybodaeth amdanoch cyn y gallwch barhau.",
- "further-details-para-two": "Ffoniwch 01234 567890 neu cysylltwch â ni ar ",
+ "further-details-para-two": "Ffoniwch 0300 123 1590 neu cysylltwch â ni ar ",
"login-modal-message": "Mae eich sesiwn ar fin dod i ben mewn {{remaining}} eiliad oherwydd anweithgarwch. Byddwch yn cael eich ailgyfeirio i'r dudalen fewngofnodi.",
"login-modal-button": "Arhoswch wedi mewngofnodi"
}
\ No newline at end of file
diff --git a/locales/en/common.json b/locales/en/common.json
index 7fe9c3dc..6aea36d1 100644
--- a/locales/en/common.json
+++ b/locales/en/common.json
@@ -83,7 +83,7 @@
"further-details-title": "Further details required",
"further-details-header": "You can not be logged in at this time",
"further-details-para-one": "PEDW needs to confirm a bit more informtion about you before you can continue.",
- "further-details-para-two": "Please call 01234 567890 or contact us on ",
+ "further-details-para-two": "Please call 0300 123 1590 or contact us on ",
"login-modal-message": "Your session is about to expire in {{remaining}} seconds due to inactivity. You will be redirected to the login page.",
"login-modal-button": "Stay logged in "
}
\ No newline at end of file
From 69e61b35d7043f2363cc250b2ce49417ad4fce92 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 30 Jan 2025 14:06:17 +0000
Subject: [PATCH 3/8] uat defect 135,136
---
locales/cy/myrepresentations.json | 7 ++++++-
locales/cy/newappeal.json | 5 ++++-
locales/en/common.json | 2 +-
locales/en/myrepresentations.json | 7 ++++++-
locales/en/newappeal.json | 5 ++++-
5 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json
index 2c51b52b..9f7317eb 100644
--- a/locales/cy/myrepresentations.json
+++ b/locales/cy/myrepresentations.json
@@ -229,5 +229,10 @@
"is-required-label": "Yn ofynnol",
"select-a-date-label": "Dewiswch ddyddiad",
"questionnaire-evidence-label": "Tystiolaeth",
- "questionnaire-hint-para": "Cwblhewch yr Holiadur canlynol. Os oes angen atodi dogfennau mewn ymateb i unrhyw gwestiynau, gallwch eu huwchlwytho yn y cam 'Ychwanegu eich ffeiliau'."
+ "questionnaire-hint-para": "Cwblhewch yr Holiadur canlynol. Os oes angen atodi dogfennau mewn ymateb i unrhyw gwestiynau, gallwch eu huwchlwytho yn y cam 'Ychwanegu eich ffeiliau'.",
+ "rep-finalising-heading": "Cwblhau eich cyflwyniad sylwadau ",
+ "rep-finalising-label": "Wrthi'n uwchlwytho ffeiliau ar hyn o bryd ac yn cwblhau eich cyflwyniad cynrychioliad ",
+ "rep-wait-label": "Arhoswch os gwelwch yn dda",
+ "rep-period-passed-heading": "Mae'r cyfnod cynrychioli wedi mynd heibio",
+ "rep-period-notice-label": "Aeth y dyddiad dyledus ar gyfer y sylw hwn heibio. Ni allwch gyflwyno'r wybodaeth a ddarparwyd gennych mwyach."
}
\ No newline at end of file
diff --git a/locales/cy/newappeal.json b/locales/cy/newappeal.json
index a5686250..6a34d353 100644
--- a/locales/cy/newappeal.json
+++ b/locales/cy/newappeal.json
@@ -113,5 +113,8 @@
"planning-obligation-(s106/unilateral)": "Rhwymedigaeth gynllunio (S106/Unochrog)",
"site-location-plan": "Cynllun Lleoliad Safle",
"registration-of-application-letter": "Llythyr Cofrestru Cais",
- "previously-added-files": "Ffeiliau wedi'u llwytho i fyny"
+ "previously-added-files": "Ffeiliau wedi'u llwytho i fyny",
+ "new-appeal-finalising-heading": "Cwblhau cyflwyniad eich apêl",
+ "new-appeal-finalising-label": "Wrthi'n uwchlwytho ffeiliau ar hyn o bryd a chwblhau eich cyflwyniad apêl",
+ "new-appeal-wait-label": "Arhoswch os gwelwch yn dda"
}
\ No newline at end of file
diff --git a/locales/en/common.json b/locales/en/common.json
index 6aea36d1..0168e85a 100644
--- a/locales/en/common.json
+++ b/locales/en/common.json
@@ -82,7 +82,7 @@
"error-instruction-label": "If you are unable to view your recent activity, press Ctrl, Shift and R to refresh your browser (or Cmd and R if you are using a Mac).",
"further-details-title": "Further details required",
"further-details-header": "You can not be logged in at this time",
- "further-details-para-one": "PEDW needs to confirm a bit more informtion about you before you can continue.",
+ "further-details-para-one": "PEDW needs to confirm a bit more information about you before you can continue.",
"further-details-para-two": "Please call 0300 123 1590 or contact us on ",
"login-modal-message": "Your session is about to expire in {{remaining}} seconds due to inactivity. You will be redirected to the login page.",
"login-modal-button": "Stay logged in "
diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json
index 99f6763a..e823eb5d 100644
--- a/locales/en/myrepresentations.json
+++ b/locales/en/myrepresentations.json
@@ -229,5 +229,10 @@
"is-required-label": "Is required",
"select-a-date-label": "Select a date",
"questionnaire-evidence-label": "Evidence",
- "questionnaire-hint-para": "Please complete the following Questionnaire. If you need to attach documents in response to any questions, you can upload them in the 'Add your files' step."
+ "questionnaire-hint-para": "Please complete the following Questionnaire. If you need to attach documents in response to any questions, you can upload them in the 'Add your files' step.",
+ "rep-finalising-heading": "Finalising your representation submission",
+ "rep-finalising-label": "Currently uploading files and finalising your representation submission",
+ "rep-wait-label": "Please wait",
+ "rep-period-passed-heading": "Representation period has passed",
+ "rep-period-notice-label": "The due date for this representation passed. You can no longer submit the information you have provided."
}
\ No newline at end of file
diff --git a/locales/en/newappeal.json b/locales/en/newappeal.json
index c19e9279..689fc3c4 100644
--- a/locales/en/newappeal.json
+++ b/locales/en/newappeal.json
@@ -113,5 +113,8 @@
"planning-obligation-(s106/unilateral)": "Planning obligation (S106/Unilateral)",
"site-location-plan": "Site Location Plan",
"registration-of-application-letter": "Registration of Application letter",
- "previously-added-files": "Uploaded files"
+ "previously-added-files": "Uploaded files",
+ "new-appeal-finalising-heading": "Finalising your appeal submission",
+ "new-appeal-finalising-label": "Currently uploading files and finalising your appeal submission",
+ "new-appeal-wait-label": "Please wait"
}
\ No newline at end of file
From 933e30f626c9fc19de291f3d62bf140721982be9 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 30 Jan 2025 14:07:27 +0000
Subject: [PATCH 4/8] enf defect 17
---
data/collections.json | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/data/collections.json b/data/collections.json
index 8ea26447..2c9309f6 100644
--- a/data/collections.json
+++ b/data/collections.json
@@ -159,31 +159,13 @@
{
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
"LogicalName": "pinswg_enforcementlistedbuildingconservationap",
- "PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconseid",
- "UrlName": "enforcementlistedbuildingconservationap",
- "MetadataId": "c697be96-9481-eb11-aac0-00224800be9c",
- "appealTypeID": "846040006",
- "NavigationProperty": "pinswg_EnforcementListedBuildingConseIds"
- },
- {
- "LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
- "LogicalName": "pinswg_enforcementlistedbuildingandconservationappeals39",
- "PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconseid",
+ "PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconservationapid",
"UrlName": "enforcementlistedbuildingconservationap",
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c",
"appealTypeID": "846040006",
"NavigationProperty": "pinswg_EnforcementListedBuildingConseIds",
"value": "Enforcement Listed Building and Conservation Appeal - S39"
},
- {
- "LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
- "LogicalName": "pinswg_enforcementlistedbuildingandconservationap",
- "PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconseid",
- "UrlName": "enforcementlistedbuildingconservationap",
- "MetadataId": "c697be96-9481-eb11-aac0-00224800be9c",
- "appealTypeID": "846040006",
- "NavigationProperty": "pinswg_EnforcementListedBuildingConseIds"
- },
{
"LogicalCollectionName": "pinswg_callinss77s",
"LogicalName": "pinswg_callinss77",
From f91cc1b9530b71658a35bcbb04a94e7fa8cbaf38 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 30 Jan 2025 14:08:48 +0000
Subject: [PATCH 5/8] added rep type on view all for clarity
---
components/myportal/viewall.js | 229 ++++++++++++++++++---------------
1 file changed, 123 insertions(+), 106 deletions(-)
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js
index c5682ac8..8e353e9e 100644
--- a/components/myportal/viewall.js
+++ b/components/myportal/viewall.js
@@ -148,117 +148,134 @@ const ViewAllResults = (props) => {
{t("myportal:appeal-pending-label")}
) : (
-
+ {
- currentView.viewKey == "watchedCases" &&
- setSearchResults(
- props.watchedCases.watchedCases
- ),
- setSearchDetails(
- props.watchedCases
- .watchedCasesDetails
- ),
- setCurrentReference({
- "ticketnumber":
- resultsArr[key].ticketnumber,
- "currentReference":
- currentView.viewKey !=
- "watchedCases"
- ? currentView.viewKey ==
- "myRepresentations"
+ : "/case/" +
+ resultsArr[key].ticketnumber
+ }
+ onClick={() => {
+ currentView.viewKey == "watchedCases" &&
+ setSearchResults(
+ props.watchedCases.watchedCases
+ ),
+ setSearchDetails(
+ props.watchedCases
+ .watchedCasesDetails
+ ),
+ setCurrentReference({
+ "ticketnumber":
+ resultsArr[key]
+ .ticketnumber,
+ "currentReference":
+ currentView.viewKey !=
+ "watchedCases"
+ ? currentView.viewKey ==
+ "myRepresentations"
+ ? resultsArr[key]
+ .caseRef
+ : resultsArr[key]
+ .ticketnumber
+ : resultsArr[key][
+ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
+ ],
+
+ "currentType":
+ currentView.viewKey,
+ "incidentid":
+ currentView.viewKey !=
+ "watchedCases"
? resultsArr[key]
- .caseRef
- : resultsArr[key]
- .ticketnumber
- : resultsArr[key][
- "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- ],
+ .incidentid
+ : resultsArr[key][
+ "_pinswg_watchedcase_value"
+ ],
- "currentType": currentView.viewKey,
- "incidentid":
- currentView.viewKey !=
- "watchedCases"
- ? resultsArr[key].incidentid
- : resultsArr[key][
- "_pinswg_watchedcase_value"
- ],
-
- "appealType":
- resultsArr[key]
- .pinswg_appealcasetype,
- "repDetails":
- currentView.viewKey ==
- "myRepresentations" &&
- resultsArr[key],
- }),
- setCurrentView({
- "viewName": currentView.viewName,
- "viewKey": currentView.viewKey,
- });
- }}
- >
-
- {t(
- "search:searchresults-case-reference-label"
- )}
- :
-
- {currentView.viewKey != "watchedCases"
- ? currentView.viewKey == "myRepresentations"
- ? resultsArr[key].caseRef
- : resultsArr[key].ticketnumber
- : resultsArr[key][
- "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
- ]}
-
+ "appealType":
+ resultsArr[key]
+ .pinswg_appealcasetype,
+ "repDetails":
+ currentView.viewKey ==
+ "myRepresentations" &&
+ resultsArr[key],
+ }),
+ setCurrentView({
+ "viewName":
+ currentView.viewName,
+ "viewKey": currentView.viewKey,
+ });
+ }}
+ >
+
+ {t(
+ "search:searchresults-case-reference-label"
+ )}
+ :
+
+ {currentView.viewKey != "watchedCases"
+ ? currentView.viewKey ==
+ "myRepresentations"
+ ? resultsArr[key].caseRef
+ : resultsArr[key].ticketnumber
+ : resultsArr[key][
+ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
+ ]}
+
+ {currentView.viewKey == "myRepresentations" && (
+ <>
+
+
+ {resultsArr[key].representationType}
+
+ >
+ )}
+ >
)}
{/*
From 390758bfd385a19d7b6f9e8d6348979adcdb9e4e Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 30 Jan 2025 14:09:31 +0000
Subject: [PATCH 6/8] noticed date raised incorrect after change in file naming
convention.. didnt sort correctly
---
components/myportal/topthree_reps.js | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js
index 976b5225..fe9b3df3 100644
--- a/components/myportal/topthree_reps.js
+++ b/components/myportal/topthree_reps.js
@@ -56,9 +56,13 @@ const TopThree = (props) => {
let showTopThreeArr = showTopThree.value;
Object.keys(showTopThreeArr).map((key, index) => {
- let createdDate = parseInt(
- showTopThreeArr[key].repfile_name.split("-")[3]
- );
+ let createdDate = showTopThreeArr[key].repfile_name.split("_-_");
+ createdDate =
+ createdDate[0].replace(
+ /(?<=\d{4}-\d{2}-\d{2})-(?=\d{2}:\d{2}:\d{2})/,
+ "T"
+ ) + "Z";
+
showTopThreeArr[key].createdDate = createdDate;
});
@@ -163,18 +167,17 @@ const TopThree = (props) => {
};
const repRaisedDate = (datePart) => {
+ var dateStr = datePart.split("_-_")[0];
+ var timeStr = dateStr.split("-")[3];
+
var dateObj = new Date(
- datePart.split("-")[0] +
+ dateStr.split("-")[0] +
"-" +
- datePart.split("-")[1] +
+ dateStr.split("-")[1] +
"-" +
- datePart.split("-")[2] +
+ dateStr.split("-")[2] +
" " +
- datePart.split("-")[3].split("_")[0].slice(0, 2) +
- ":" +
- datePart.split("-")[3].split("_")[0].slice(2, 4) +
- ":" +
- datePart.split("-")[3].split("_")[0].slice(4, 6)
+ timeStr
);
return dateObj.toLocaleString();
From 6fb4f5722abfcc4d3c6cf0c697f3b405e74f6962 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 30 Jan 2025 14:11:17 +0000
Subject: [PATCH 7/8] rep defect 42, questionnaire defect 67, enf defect 16
---
components/utils/index.js | 57 +++++++++++++++++++++++++++------------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/components/utils/index.js b/components/utils/index.js
index 296d8f4d..954d662a 100644
--- a/components/utils/index.js
+++ b/components/utils/index.js
@@ -561,14 +561,23 @@ export const updateLinks = (jsonObj) => {
// Find all text nodes in the document
const walk = (node) => {
if (node.nodeType === Node.TEXT_NODE) {
- // Check if the text node contains a URL (simple check for a URL pattern)
const urlRegex =
/(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})(\/[^\s]*)?/g;
let match;
+ let currentText = node.textContent;
+ let lastIndex = 0;
+ let newNodeContent = [];
- // Process the text node if it contains a URL
- while ((match = urlRegex.exec(node.textContent)) !== null) {
- // Construct the full URL by adding the protocol if missing, and the domain and path
+ // Process all URLs found in the current text node
+ while ((match = urlRegex.exec(currentText)) !== null) {
+ // Before the URL
+ if (match.index > lastIndex) {
+ newNodeContent.push(
+ currentText.slice(lastIndex, match.index)
+ );
+ }
+
+ // Construct the full URL (default to https://)
let fullUrl = match[0];
if (
!fullUrl.startsWith("http://") &&
@@ -577,21 +586,35 @@ export const updateLinks = (jsonObj) => {
fullUrl = `https://${match[1]}${match[2] || ""}`; // Default to https
}
- // Check if the match is already inside an tag, if so, skip it
- if (node.parentNode.tagName !== "A") {
- const anchor = document.createElement("a");
- anchor.href = fullUrl;
- anchor.textContent = match[0];
+ // Create the anchor element
+ const anchor = document.createElement("a");
+ anchor.href = fullUrl;
+ anchor.textContent = match[0];
+ anchor.setAttribute("rel", "noopener noreferrer");
- // Add rel="noopener noreferrer" for security
- anchor.setAttribute("rel", "noopener noreferrer");
+ // Add the anchor tag to the node content
+ newNodeContent.push(anchor);
- // Replace the URL with the anchor element in the text node
- const range = document.createRange();
- range.selectNodeContents(node);
- range.deleteContents();
- range.insertNode(anchor);
- }
+ // Update the last index processed
+ lastIndex = urlRegex.lastIndex;
+ }
+
+ // Add the remaining text after the last URL
+ if (lastIndex < currentText.length) {
+ newNodeContent.push(currentText.slice(lastIndex));
+ }
+
+ // If there were any replacements, update the text node
+ if (newNodeContent.length > 0) {
+ const fragment = document.createDocumentFragment();
+ newNodeContent.forEach((item) => {
+ if (typeof item === "string") {
+ fragment.appendChild(document.createTextNode(item));
+ } else {
+ fragment.appendChild(item);
+ }
+ });
+ node.parentNode.replaceChild(fragment, node);
}
}
From 6dded01501abd2abc5c45a6c9ff44b5c904107ec Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Thu, 30 Jan 2025 14:12:15 +0000
Subject: [PATCH 8/8] reps defect 43 - also handles not submitting reps when
date passed
---
components/case/representation/index.js | 49 ++++--
.../representationCompleteSubmit.js | 163 ++++++++++++++++--
.../case/representation/representationLPA.js | 5 +
components/newappeal/buildchecksection.js | 9 +-
4 files changed, 192 insertions(+), 34 deletions(-)
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index 9ec3af74..b060c141 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -271,12 +271,24 @@ let MakeRepresentation = (props) => {
resultsObj = resultsObj[0];
- detailsObj = jsonpath(
- '$..[?(@.pinswg_name=="' +
- currentView.caseReference.currentReference +
- '")]',
- setCaseDetailsObj
- );
+ detailsObj = router.query.hasOwnProperty("state")
+ ? router.query.state == "edit"
+ ? jsonpath(
+ '$..[?(@.repfile_name =="' + router.query.created + '")]',
+ setCaseDetailsObj
+ )
+ : jsonpath(
+ '$..[?(@.pinswg_name =="' +
+ currentView.caseReference.currentReference +
+ '")]',
+ setCaseDetailsObj
+ )
+ : jsonpath(
+ '$..[?(@.pinswg_name =="' +
+ currentView.caseReference.currentReference +
+ '")]',
+ setCaseDetailsObj
+ );
detailsObj = detailsObj[0];
@@ -409,12 +421,11 @@ let MakeRepresentation = (props) => {
const whichControl = () => {
if (
isLPA &&
- _.isEmpty(
- currentView.representationCapacity ||
- (currentView.caseReference.hasOwnProperty("repDetails") &&
- currentView.caseReference.repDetails
- .representationCapacity)
- )
+ _.isEmpty(currentView.representationCapacity)
+ // ||
+ // (isLPA &&
+ // currentView.caseReference.hasOwnProperty("repDetails") &&
+ // !currentView.caseReference.repDetails.representationCapacity)
) {
return (
//setRepresentationCapacity("LPA"),
@@ -502,7 +513,7 @@ let MakeRepresentation = (props) => {
// setRepresentationCapacity("LPA");
// }, []);
- // console.log(currentView.caseReference.appealType);
+ console.log(currentView.caseReference.appealType);
return (
{
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
],
"_pinswg_localplanningauthority_value":
- detailsObj["_pinswg_localplanningauthority_value"],
+ detailsObj["_pinswg_localplanningauthority_value"] ||
+ detailsObj["_pinswg_associatedlpa_value"],
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue":
detailsObj[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
+ ] ||
+ detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
],
"representationCapacity": router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -970,10 +985,14 @@ let MakeRepresentation = (props) => {
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
],
"_pinswg_localplanningauthority_value":
- detailsObj["_pinswg_localplanningauthority_value"],
+ detailsObj["_pinswg_localplanningauthority_value"] ||
+ detailsObj["_pinswg_associatedlpa_value"],
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue":
detailsObj[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
+ ] ||
+ detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
],
"representationCapacity": router.query.hasOwnProperty("state")
? router.query.state == "edit"
diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js
index 6e53f348..2306107e 100644
--- a/components/case/representation/representationCompleteSubmit.js
+++ b/components/case/representation/representationCompleteSubmit.js
@@ -8,7 +8,16 @@ import RepComplete from "./representationComplete";
import RepLPAQuestionnaireCheck_enforcement from "./representationQuestionnairesCheck/representationLPAQuestionnaireCheck_enforcement";
import RepLPAQuestionnaireCheck_s78 from "./representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78";
import Link from "next/link";
-import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
+import {
+ bytesToSize,
+ getThumbnailIconByExtension,
+ formatDates,
+} from "../../utils";
+
+import {
+ setCurrentReference,
+ setCurrentView,
+} from "../../../store/currentView/action";
const RepCompleteSubmit = (props) => {
let { t } = useTranslation();
@@ -30,6 +39,7 @@ const RepCompleteSubmit = (props) => {
showQuestionnaireSection,
questionnaireCount,
finaliseAppealProcess,
+ setCurrentReference,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
@@ -203,6 +213,34 @@ const RepCompleteSubmit = (props) => {
});
let filterFiles = [];
+
+ function showRepsEnded(endDate) {
+ let date = new Date();
+ date = new Date(date.toDateString());
+ const end = new Date(endDate);
+ return end > date ? false : true;
+ }
+
+ const checkRepDatePassed = () => {
+ if (repFormData.representationType == "Questionnaire") {
+ return false;
+ } else {
+ if (repFormData.representationType == "Final comments") {
+ return repFormData.hasOwnProperty(
+ "pinswg_finalcommentsduedate"
+ ) && showRepsEnded(repFormData.pinswg_finalcommentsduedate)
+ ? true
+ : false;
+ }
+ if (repFormData.representationType == "Statement") {
+ return repFormData.hasOwnProperty("pinswg_statementduedate") &&
+ showRepsEnded(repFormData.pinswg_statementduedate)
+ ? true
+ : false;
+ }
+ }
+ };
+
return (
<>
{currentView.representationSubmitConfirmation == true ? (
@@ -291,7 +329,24 @@ const RepCompleteSubmit = (props) => {
className="govuk-link"
href="#"
onClick={() => {
- setSubmitBack();
+ // setSubmitBack();
+ setCurrentReference({
+ "ticketnumber":
+ repFormData.ticketnumber,
+ "currentReference":
+ repFormData.caseRef,
+ "currentType":
+ "myRepresentations",
+ "incidentid":
+ repFormData.incidentID,
+ "appealType":
+ repFormData.appealType,
+ "repDetails":
+ repFormData,
+ });
+ setRepresentationSubmit(
+ false
+ );
}}
>
{t(
@@ -326,7 +381,26 @@ const RepCompleteSubmit = (props) => {
className="govuk-link"
href="#"
onClick={() => {
- setSubmitBack();
+ // setSubmitBack();
+ setCurrentReference(
+ {
+ "ticketnumber":
+ repFormData.ticketnumber,
+ "currentReference":
+ repFormData.caseRef,
+ "currentType":
+ "myRepresentations",
+ "incidentid":
+ repFormData.incidentID,
+ "appealType":
+ repFormData.appealType,
+ "repDetails":
+ repFormData,
+ }
+ );
+ setRepresentationSubmit(
+ false
+ );
}}
>
{t(
@@ -365,7 +439,25 @@ const RepCompleteSubmit = (props) => {
className="govuk-link"
href="#"
onClick={() => {
- setSubmitBack();
+ // setSubmitBack();
+
+ setCurrentReference({
+ "ticketnumber":
+ repFormData.ticketnumber,
+ "currentReference":
+ repFormData.caseRef,
+ "currentType":
+ "myRepresentations",
+ "incidentid":
+ repFormData.incidentID,
+ "appealType":
+ repFormData.appealType,
+ "repDetails":
+ repFormData,
+ });
+ setRepresentationSubmit(
+ false
+ );
}}
>
{t("common:change-link-label")}
@@ -427,7 +519,23 @@ const RepCompleteSubmit = (props) => {
setRepresentationSubmit(
false
))
- : setSubmitBack();
+ : (setCurrentReference({
+ "ticketnumber":
+ repFormData.ticketnumber,
+ "currentReference":
+ repFormData.caseRef,
+ "currentType":
+ "myRepresentations",
+ "incidentid":
+ repFormData.incidentID,
+ "appealType":
+ repFormData.appealType,
+ "repDetails":
+ repFormData,
+ }),
+ setRepresentationSubmit(
+ false
+ ));
}}
>
{t("common:change-link-label")}
@@ -451,7 +559,6 @@ const RepCompleteSubmit = (props) => {
"myrepresentations:rep-check-tandc-para-one"
)}
-
{t(
"myrepresentations:rep-check-tandc-para-two"
@@ -466,25 +573,47 @@ const RepCompleteSubmit = (props) => {
.
-
{t(
"myrepresentations:rep-check-tandc-para-three"
)}
-
- {finaliseAppealProcess ? (
+ {checkRepDatePassed() ? (
+
+
+
+ Warning
+
+
+
+
+
+ {t(
+ "myrepresentations:rep-period-passed-heading"
+ )}
+
+
+ {t(
+ "myrepresentations:rep-period-notice-label"
+ )}
+
+
+
+
+ ) : finaliseAppealProcess ? (
- Finalising your representation
- submission
+ {t(
+ "myrepresentations:rep-finalising-heading"
+ )}
- Currenly uploading files and finalising
- your representation submission
+ {t(
+ "myrepresentations:rep-finalising-label"
+ )}
- Please wait
+ {t("myrepresentations:rep-wait-label")}
) : (
@@ -573,7 +702,11 @@ const mapStateToProps = (state) => {
};
const mapDispatchToProps = (dispatch) => {
- return {};
+ return {
+ setCurrentReference: (currentReference) => {
+ dispatch(setCurrentReference(currentReference));
+ },
+ };
};
export default connect(mapStateToProps, mapDispatchToProps)(RepCompleteSubmit);
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js
index 2ed5e0c9..5646ee95 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -21,6 +21,8 @@ import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations,
+ setCurrentPage,
+ setCurrentReference,
} from "../../../store/currentView/action";
let RepLPA = (props) => {
@@ -611,6 +613,9 @@ const mapDispatchToProps = (dispatch) => ({
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
},
+ setCurrentReference: (currentReference) => {
+ dispatch(setCurrentReference(currentReference));
+ },
});
const mapStateToProps = (state, props) => {
diff --git a/components/newappeal/buildchecksection.js b/components/newappeal/buildchecksection.js
index 2d2e1dc0..d34f106f 100644
--- a/components/newappeal/buildchecksection.js
+++ b/components/newappeal/buildchecksection.js
@@ -248,13 +248,14 @@ let BuildCheckSection = (props) => {
{finaliseAppealProcess ? (
- Finalising your appeal submission
+ {t("newappeal:new-appeal-finalising-heading")}
- Currenly uploading files and finalising your appeal
- submission
+ {t("newappeal:new-appeal-finalising-label")}
+
+
+ {t("newappeal:new-appeal-wait-label")}
-
Please wait
) : (
<>