Author SHA1 Message Date
robbond 8fe06c09c4 Phase 1 reliability/stabilisation: auth logging, logout client, loader+xml hardening 2026-05-13 10:05:49 +01:00
robbond d36a56c4c9 refactor(representations): decompose representation flow shell into form stage and timetable panel (Slice R4, behaviour-preserving) 2026-04-20 13:27:53 +01:00
robbond ebed61799e docs(representations): finalise refactor tracker and closeout state 2026-04-20 13:23:08 +01:00
Robert Bond 670e98a0a1 Merged PR 2258: refactor(summary-types): standardise case summary markup with SummaryCard/SummaryRow wrappers
Related work items: #22441
2026-04-20 12:15:43 +00:00
Robert Bond b6ca73d76a Merged PR 2257: refactor(representations): isolate finalisation boundary helpers (slice R8)
refactor(representations): isolate finalisation boundary helpers (slice R8)

Related work items: #22441
2026-04-17 13:23:55 +00:00
Robert Bond 7713fc3724 Merged PR 2256: refactor(representations): preserve Welsh conditional validation and summary...
refactor(representations): preserve Welsh conditional validation and summary parity

Related work items: #22441
2026-04-17 12:44:23 +00:00
Robert Bond 33f31ad3c8 Merged PR 2255: refactor(representations): extract deterministic data-resolution helpers for...
refactor(representations): extract deterministic data-resolution helpers for representation flow (Slice R6, behaviour-preserving)

Related work items: #22441
2026-04-17 10:07:52 +00:00
Robert Bond 8e21ec1dd7 Merged PR 2254: refactor(representations): normalise shared type-selector and action-row frag...
refactor(representations): normalise shared type-selector and action-row fragments in main representation variants (Slice R5, behaviour-preserving)

Related work items: #22441
2026-04-17 09:22:36 +00:00
Robert Bond d05e54c020 Merged PR 2252: refactor(representations): extract journey step-resolution helpers (Slice R3,...
refactor(representations): extract journey step-resolution helpers (Slice R3, behaviour-preserving)

Related work items: #22441
2026-04-17 06:45:21 +00:00
Robert Bond a43eb76e3a Merged PR 2251: refactor(representations): separate representation page SSR loaders into lib/...
refactor(representations): separate representation page SSR loaders into lib/representation/pageLoaders (Slice R2, behaviour-preserving)

Related work items: #22441
2026-04-17 05:30:38 +00:00
robbond 011be977a2 Merge branch 'SIPS-Development' of https://welshgovernment.visualstudio.com/PEDW%20-%20Planning%20Casework/_git/FrontEnd into refactor 2026-04-16 12:35:44 +01:00
robbond e3614dba7b Merge branch 'refactor' of https://welshgovernment.visualstudio.com/PEDW%20-%20Planning%20Casework/_git/FrontEnd into refactor 2026-04-15 10:31:59 +01:00
Robert Bond ecd6075c3a Merged PR 2246: refactor reps first slice
Related work items: #22570, #22576, #22577, #22583, #22586, #22587, #22588, #22590, #22591
2026-04-15 09:28:50 +00:00
Robert Bond f3a05db323 Merged PR 2241: refactor(newappeal): simplify start flow readability (Slice 8)
refactor(newappeal): simplify start flow readability (Slice 8)

Related work items: #22590
2026-04-13 12:55:58 +00:00
Robert Bond ffcccf8981 Merged PR 2240: refactor(newappeal): simplify nested prop boundaries (Slice 7)
refactor(newappeal): simplify nested prop boundaries (Slice 7)

Related work items: #22588
2026-04-13 12:25:45 +00:00
Robert Bond 783786b9eb Merged PR 2239: refactor(newappeal): replace BuildCheckRow formatter chain with map (Slice 6)
refactor(newappeal): replace BuildCheckRow formatter chain with map (Slice 6)

Related work items: #22587
2026-04-13 11:53:45 +00:00
Robert Bond 20eea5b128 Merged PR 2238: refactor(newappeal): extract BuildCheckSection presentation components (Slice 5)
refactor(newappeal): extract BuildCheckSection presentation components (Slice 5)

Related work items: #22586
2026-04-13 10:59:27 +00:00
Robert Bond 869264b7fa Merged PR 2237: refactor(newappeal): extract BuildSection presentation components (Slice 4)
refactor(newappeal): extract BuildSection presentation components (Slice 4)

Related work items: #22583
2026-04-13 10:15:56 +00:00
Robert Bond d0f667ffbb Merged PR 2236: refactor(newappeal): add side-effect facade wrappers (Slice 3)
refactor(newappeal): add side-effect facade wrappers (Slice 3)

Related work items: #22583
2026-04-13 09:31:14 +00:00
robbond f8b7f4fffd refactor(newappeal): add side-effect facade wrappers (Slice 3) 2026-04-13 10:26:35 +01:00
Robert Bond 21f511c34b Merged PR 2235: refactor(newappeal): extract file merge and dedupe helpers (Slice 2b)
refactor(newappeal): extract file merge and dedupe helpers (Slice 2b)

Related work items: #22577
2026-04-13 09:11:49 +00:00
robbond 7c4ce131bf refactor(newappeal): extract file merge and dedupe helpers (Slice 2b) 2026-04-13 10:07:58 +01:00
Robert Bond ddbf2116f5 Merged PR 2234: refactor(newappeal): extract payload cleanup helpers (Slice 2a)
refactor(newappeal): extract payload cleanup helpers (Slice 2a)

- extracted boolean normalization

- extracted null key removal

- extracted internal key stripping

- no behaviour change

Related work items: #22576
2026-04-13 08:31:23 +00:00
robbond 5233f62d59 refactor(newappeal): extract payload cleanup helpers (Slice 2a)
- extracted boolean normalization

- extracted null key removal

- extracted internal key stripping

- no behaviour change
2026-04-10 16:37:42 +01:00
Robert Bond 5f78a881c5 Merged PR 2232: xml form derivation
Related work items: #22570
2026-04-10 14:37:02 +00:00
robbond 7f7d4daa8f docs(refactor): update refactor tracker status 2026-04-10 15:34:06 +01:00
robbond e9d4b65a3d chore(refactor): commit current refactor branch updates and slice1 xml/form derivation extraction 2026-04-10 09:39:28 +01:00
144 changed files with 7958 additions and 10851 deletions
+9 -11
View File
@@ -18,8 +18,8 @@ CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-dev-uks-01/
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
CRMURL = "dv-pedw.crm11.dynamics.com"
CRMURL_VERSION = "v9.2"
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
CRMURL_VERSION = "v8.2"
# //New Test
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
@@ -139,10 +139,10 @@ NEXTAUTH_SECRET = SuperSecret
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// dev test sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// test sql server
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
// Pre prod sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
@@ -248,7 +248,7 @@ SHOW_DEBUG = true
// DEV Connection string
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=4b7568b3-70bd-4591-9dc2-267c0a6501d1;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=447d38b5-5d40-4238-8fb3-0ef4741b3db1
APPLICATIONINSIGHTS_CONNECTIONSTRING = InstrumentationKey=7a06e24a-793c-47bc-8987-ce80f180e035;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=9906b6d0-b791-4add-8d53-c827a534e1d4
@@ -258,12 +258,12 @@ APPLICATIONINSIGHTS_CONNECTIONSTRING = InstrumentationKey=7a06e24a-793c-47bc-898
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=cc60e8e7-5b30-4c2b-a176-8b96b21b12df;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=2a4094be-6fd1-46ab-a67d-5f241692b129
// Preprod Connection string
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=7370f0f9-834d-4c7a-b3c4-9951fcad5ad2;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=04362cb7-6dfc-469e-8274-12243e8be851
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=a41b91bf-f7dc-4f44-bb66-a67df4eee435;IngestionEndpoint=https://uksouth-1.in.applicationinsights.azure.com/;LiveEndpoint=https://uksouth.livediagnostics.monitor.azure.com/;ApplicationId=473d0632-16f1-4065-8984-d6bac62402c0
// Prod Connection string
# NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
//NEXT_PUBLIC_APP_INSIGHT = InstrumentationKey=61f358c2-8075-4164-b897-17bc6dd31fee;IngestionEndpoint=https://ukwest-0.in.applicationinsights.azure.com/;LiveEndpoint=https://ukwest.livediagnostics.monitor.azure.com/;ApplicationId=0c297349-396b-4dc6-8b56-85f5c680adc6
HIDEERRORLOGS = false
@@ -271,6 +271,4 @@ HIDEERRORLOGS = false
SHOWSIPS = true
ALLOWED_IPS=::1,203.0.113.42,198.51.100.17
UPLOAD_BATCH_COUNT = 5
NRWDOMAIN = rdbmedia.co.uk
UPLOAD_BATCH_COUNT = 5
+79 -55
View File
@@ -476,19 +476,20 @@ export const createRepPDFBlob = async (
? await blockBlobClient.uploadData(content)
: await blockBlobClient.uploadStream(content);
const locationMap = [
{ key: "_IP_-_Comments_", value: "846040038" }, // most specific first
{ key: "_IP_", value: "846040005" },
{ key: "_Statement_", value: "846040002" },
{ key: "_Questionnaire_", value: "846040001" },
{ key: "_Comments", value: "846040003" },
{ key: "_Impact", value: "846040029" },
{ key: "_Consultation_Response_", value: "846040036" }
];
const whichLocation =
locationMap.find((item) => repName.includes(item.key))?.value ||
"846040002";
let whichLocation =
repName.indexOf("_IP_") > 0
? "846040005"
: repName.indexOf("_Statement_") > 0
? "846040002"
: repName.indexOf("_Questionnaire_") > 0
? "846040001"
: repName.indexOf("_Comments") > 0
? "846040003"
: repName.indexOf("_Impact") > 0
? "846040029"
: repName.indexOf("_Consultation_Response_") > 0
? "846040036"
: "846040002";
const tags = {
containerid: containerName,
@@ -617,46 +618,71 @@ export const uploadFile = async (formContent, containerName, foldername) => {
);
console.log(data);
const fieldName = files[prop][0].fieldName;
const whichLocation =
[
// 1️⃣ LPA docs (grouped)
{
match: [
"_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"
},
{ match: ["_IP_-_Comments_"], value: "846040038" },
{
match: ["_Consultation_Response_"],
value: "846040036"
},
{ match: ["_Questionnaire_"], value: "846040001" },
{ match: ["_Statement_"], value: "846040002" },
{ match: ["_Comments_"], value: "846040003" },
{ match: ["_Impact_"], value: "846040001" },
{ match: ["_IP_"], value: "846040005" }
].find((rule) =>
rule.match.some((key) => fieldName.includes(key))
)?.value || "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"
: files[prop][0].fieldName.indexOf(
"_Consultation_Response_"
) > 0
? "846040036"
: "846040000";
const tags = {
containerid: containerName,
@@ -777,8 +803,6 @@ export const uploadSingleFile = async (
/_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_-_Comments_/, value: "846040038" },
{ pattern: /_IP_/, value: "846040005" },
{ pattern: /_Statement_/, value: "846040002" },
{ pattern: /_Questionnaire_/, value: "846040001" },
+15
View File
@@ -104,3 +104,18 @@ export const conLog = (err) => {
console.log(errStr);
return errStr;
};
export const logInfo = (event, data = {}) => {
try {
console.info(
JSON.stringify({
level: "info",
event,
data: redactSensitive(data),
ts: new Date().toISOString()
})
);
} catch (_error) {
console.info(`[info] ${event}`);
}
};
+1 -1
View File
@@ -82,7 +82,7 @@ export const getSelectQuery = (appealTypeName) => {
return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent";
case "pinswg_sipses":
// return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent";
return "&$select=pinswg_casedeadline,_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome,pinswg_redetermination,pinswg_redeterminationconsultationdeadline";
return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_casesuspensionstartdate,pinswg_casesuspensionenddate,pinswg_consultationopen,pinswg_consultationclose,pinswg_reportissuedtowelshministers,pinswg_decisionissuedtoapplicant,pinswg_decisionoutcome,pinswg_redetermination,pinswg_redeterminationconsultationdeadline";
break;
default:
return "";
-11
View File
@@ -274,14 +274,3 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
consoleLogger(error);
});
};
export const getCaseStatus = async (appealType, caseReference) => {
const route = buildFileQuery("/api/endpoint/getStatusCounts_api", {
appealType,
caseReference: encodeURI(caseReference)
});
return getJson(withBaseUrl(BASE_URL, route)).catch((error) => {
consoleLogger(error);
});
};
+2 -4
View File
@@ -16,8 +16,7 @@ import {
getPartSavedAppeal,
getIsPublishedbyID,
getPortalModuleDetails,
getPortalModuleDetailsProxy,
getCaseStatus
getPortalModuleDetailsProxy
} from "./caseDirectService";
export {
@@ -38,6 +37,5 @@ export {
getPartSavedAppeal,
getIsPublishedbyID,
getPortalModuleDetails,
getPortalModuleDetailsProxy,
getCaseStatus
getPortalModuleDetailsProxy
};
+2 -6
View File
@@ -274,14 +274,10 @@ export const sendRepCompleteMessage = async (
});
};
export const setRepInvolvment = async (caseid, contactid, involvement) => {
export const setRepInvolvment = async (caseid, contactid) => {
var queryUrl = buildFileQuery("/api/file/createrepinvolvement_api");
var data = {
"incidentid": caseid,
"contactid": contactid,
"involvement": involvement
};
var data = { "incidentid": caseid, "contactid": contactid };
var config = {
method: "post",
url: queryUrl,
-94
View File
@@ -1,94 +0,0 @@
import useTranslation from "next-translate/useTranslation";
import { parseCookies, setCookie } from "nookies";
import { useEffect, useRef, useState } from "react";
const COOKIE_NAME = "pedwAiPolicyNoticeHidden";
const COOKIE_DAYS = 7;
export default function AIPolicyNotice() {
let { t } = useTranslation();
const [hasCheckedCookie, setHasCheckedCookie] = useState(false);
const [isOpen, setIsOpen] = useState(false);
const dismissButtonRef = useRef(null);
useEffect(() => {
const cookies = parseCookies();
const isHidden = cookies[COOKIE_NAME] === "true";
setIsOpen(!isHidden);
setHasCheckedCookie(true);
}, []);
useEffect(() => {
if (isOpen && dismissButtonRef.current) {
dismissButtonRef.current.focus();
}
}, [isOpen]);
const dismissNotice = () => {
const now = new Date();
const expDate = new Date(now);
expDate.setDate(now.getDate() + COOKIE_DAYS);
setCookie(null, COOKIE_NAME, "true", {
path: "/",
expires: expDate
});
setIsOpen(false);
};
if (!hasCheckedCookie || !isOpen) {
return null;
}
return (
<div
className="modal aiModal fade show"
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
padding: "1rem"
}}
aria-hidden={false}
>
<div className="modal-dialog" style={{ margin: 0 }}>
<div
className="modal-content govuk-!-padding-6"
role="dialog"
aria-modal="true"
aria-labelledby="ai-policy-notice-title"
>
<h2
id="ai-policy-notice-title"
className="govuk-heading-m govuk-!-margin-bottom-3"
>
{t("home:ai-policy-notice-title")}
</h2>
<p className="govuk-body">
{t("home:ai-policy-notice-paragraph-one")}
</p>
<p className="govuk-body govuk-!-margin-bottom-4">
{t("home:ai-policy-notice-paragraph-two")}
</p>
<button
ref={dismissButtonRef}
type="button"
className="govuk-button govuk-!-margin-bottom-0"
data-module="govuk-button"
onClick={dismissNotice}
>
{t("home:ai-policy-notice-dismiss-button")}
</button>
</div>
</div>
<div
className="modal-backdrop fade show"
style={{ opacity: 0.2 }}
></div>
</div>
);
}
+9 -9
View File
@@ -140,12 +140,12 @@ const RenderPickList = ({
input,
optionsArr,
meta: { touched, error },
errorMsg
errorMsg,
}) => {
let { t, lang } = useTranslation();
optionsArr = [
t("account:account-preferred-language-english") + ":846040001",
t("account:account-preferred-language-welsh") + ":846040000"
t("account:account-preferred-language-welsh") + ":846040000",
];
return (
<>
@@ -202,7 +202,7 @@ let PersonalDetails = (props) => {
load,
pristine,
reset,
submitting
submitting,
} = props;
let { t, lang } = useTranslation();
@@ -324,8 +324,8 @@ let PersonalDetails = (props) => {
label={t("account:account-telephone-label")}
/>
<Field
name="pinswg_companyname"
id="pinswg_companyname"
name="company"
id="company"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
@@ -444,7 +444,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
accountDetails: state.accountDetails
accountDetails: state.accountDetails,
//form: state.form,
};
};
@@ -453,7 +453,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
}
},
};
};
@@ -484,12 +484,12 @@ const selector = formValueSelector("personalDetailsForm"); // <-- same as form n
PersonalDetails = reduxForm({
form: "personalDetailsForm",
enableReinitialize: true, // this is needed!!
destroyOnUnmount: false
destroyOnUnmount: false,
})(PersonalDetails);
// You have to connect() to any reducers that you wish to connect to yourself
PersonalDetails = connect((state) => ({
initialValues: state.accountDetails.accountDetails // pull initial values from account reducer
initialValues: state.accountDetails.accountDetails, // pull initial values from account reducer
}))(PersonalDetails);
export default PersonalDetails;
+4 -4
View File
@@ -11,7 +11,7 @@ const BuildCheckPersonalDetails = (props) => {
handleSubmit,
value,
setPersonalDetailsComplete,
setAccountUpdatedComplete
setAccountUpdatedComplete,
} = props;
let { t, lang } = useTranslation();
@@ -142,7 +142,7 @@ const BuildCheckPersonalDetails = (props) => {
<dd className="govuk-summary-list__value">
{
props.props.props.form.personalDetailsForm.values
.pinswg_companyname
.company
}
</dd>
<dd className="govuk-summary-list__actions">
@@ -354,7 +354,7 @@ const mapStateToProps = (state) => {
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
accountDetails: state.accountDetails
accountDetails: state.accountDetails,
//form: state.form,
};
};
@@ -363,7 +363,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
}
},
};
};
@@ -50,7 +50,7 @@ const PersonalDetailsComplete = (props) => {
}
doUpdate();
}, [loggedinUserId, formValues, prefLang, userLang]);
}, [loggedinUserId, formValues, prefLang]);
return (
<>
+5 -16
View File
@@ -66,7 +66,7 @@ const RegisterForm = (props) => {
setRegisterFormComplete,
setAccountCreatedComplete,
loggedInUserEmail,
emailaddress1
emailaddress1,
} = props;
let { t, lang } = useTranslation();
@@ -199,17 +199,6 @@ const RegisterForm = (props) => {
"account:register-new-account-phone-label"
)}
/>
<Field
name="company"
id="company"
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
validate={[required]}
label={t(
"account:register-new-account-company-label"
)}
/>
</fieldset>
<fieldset className="govuk-fieldset">
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
@@ -323,8 +312,8 @@ const mapStateToProps = (state, props) => {
appealType: state.appealType,
//form: state.form,
initialValues: {
emailaddress1: props.loggedInUserEmail
}
emailaddress1: props.loggedInUserEmail,
},
};
};
@@ -332,7 +321,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentSection: (currentSection) => {
dispatch(setCurrentSection(currentSection));
}
},
};
};
@@ -345,6 +334,6 @@ export default connect(
reduxForm({
form: "accountRegisterForm",
enableReinitialize: true,
destroyOnUnmount: false
destroyOnUnmount: false,
})(RegisterForm)
);
+12 -14
View File
@@ -28,15 +28,9 @@ function AppealsTab(props) {
const [fieldSortState, setfieldSortState] = useState("desc");
const [loginToWatch, setLoginToWatch] = useState("true");
const {
searchResultsObj: searchResultsState,
setSearchResults,
setSearchDetails
} = props;
const searchDetailsObj = searchResultsState.searchDetailsObj || {};
const resultsArr = searchResultsState.searchResultsObj.value || [];
const searchResultsObj = searchResultsState.searchResultsObj;
const searchDetailsObj = props.searchResultsObj.searchDetailsObj || {};
const resultsArr = props.searchResultsObj.searchResultsObj.value || [];
const searchResultsObj = props.searchResultsObj.searchResultsObj;
const { t } = useTranslation();
const router = useRouter();
@@ -81,14 +75,20 @@ function AppealsTab(props) {
fieldSort,
selectedOption
).then((data) => {
setSearchResults(data);
props.setSearchResults(data); // ✅ use props, not import
return getSearchDetailsPaged(data).then((details) => {
setSearchDetails(details);
props.setSearchDetails(details); // ✅ use props, not import
setShowSpinnerState(false);
});
});
},
[selectedOption, setSearchDetails, setSearchResults]
[
advancedSearch,
searchString,
selectedOption,
props.setSearchDetails,
props.setSearchResults
]
);
useEffect(() => {
@@ -255,8 +255,6 @@ function AppealsTab(props) {
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber":
item.ticketnumber,
"currentReference":
+9 -6
View File
@@ -936,16 +936,17 @@ const DocumentsTab = (props) => {
)
.then((data) => data)
.then((data) => {
setDocumentDetails(data);
props.setDocumentDetails(data);
setShowSpinnerState(false);
});
},
[
props.incidentid,
selectedOption,
selectedDocumentType,
selectedWeeks,
selectedDocumentOrigin,
setDocumentDetails
props.setDocumentDetails
]
);
@@ -956,7 +957,7 @@ const DocumentsTab = (props) => {
orderBy,
fieldSort
).then((data) => {
setDocumentDetails(data);
props.setDocumentDetails(data);
return data;
});
@@ -1059,7 +1060,7 @@ const DocumentsTab = (props) => {
selectedDocumentType,
selectedWeeks
).then((data) => {
setDocumentDetails(data);
props.setDocumentDetails(data);
setDocumentSearchState(true);
return data;
@@ -1071,11 +1072,13 @@ const DocumentsTab = (props) => {
//const searchDocumentResultsObj = docDetailsObj();
}, [
incidentid,
setDocumentDetails,
props.setDocumentDetails,
selectedOption,
selectedDocumentType,
fieldSortState,
orderByState,
getDocumentTypes,
getOrigin,
getDocumentResults,
lang,
selectedWeeks
@@ -1131,7 +1134,7 @@ const DocumentsTab = (props) => {
<select
onChange={(e) => {
setSelectedWeeks(e.target.value);
setCurrentPage(1);
props.setCurrentPage(1);
}}
value={selectedWeeks}
className="govuk-select"
+80 -123
View File
@@ -3,16 +3,9 @@ import { setCurrentPage } from "../../store/currentView/action";
import { connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
import { formatDates } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
} from "./summary/utils/liveEvent";
import { useRouter } from "next/router";
const EventsDetails = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const EventView = (eventsArr) => {
eventsArr = eventsArr.value;
@@ -30,6 +23,8 @@ const EventsDetails = (props) => {
return obj.hasOwnProperty(property) && obj[property] !== null;
}
//console.log(eventsArr.length > 0);
return (
eventsArr.length > 0 && (
<div className="govuk-grid-row">
@@ -68,26 +63,76 @@ const EventsDetails = (props) => {
{item.pinswg_eventname}
</div>
)}
</div>
<div className="eventColumn">
{hasOwnPropertyAndNotNull(
item,
[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
"pinswg_eventaddressline1"
) && (
<>
<div>
<b>
{t(
"case:event-address-label"
)}
</b>
:
</div>
<div>
{
item.pinswg_eventaddressline1
}
</div>
</>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline2"
) && (
<div>
<b>
{t(
"case:event-type-of-event-label"
)}
</b>
:{" "}
{
item[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
item.pinswg_eventaddressline2
}
</div>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresstown"
) && (
<div>
{
item.pinswg_eventaddresstown
}
</div>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<div>
{
item.pinswg_eventaddresscounty
}
</div>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<div>
{
item.pinswg_eventaddresspostcode
}
</div>
)}
</div>
{/* type of event
start date date of event - end date of event
if virtual event no address showNoOfRecords
show event address */}
<div className="eventColumn">
{hasOwnPropertyAndNotNull(
item,
"pinswg_dateeventrequested"
@@ -126,113 +171,25 @@ const EventsDetails = (props) => {
<div className="eventColumn">
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline1"
[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue",
]
) && (
<>
<div
style={{
display: "flex"
}}
>
<b>
{t(
"case:event-address-label"
)}
</b>
:
<div
style={{
display:
"flex",
marginLeft:
"10px",
flexDirection:
"column"
}}
>
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline1"
) && (
<span>
{
item.pinswg_eventaddressline1
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddressline2"
) && (
<span>
{
item.pinswg_eventaddressline2
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresstown"
) && (
<span>
{
item.pinswg_eventaddresstown
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<span>
{
item.pinswg_eventaddresscounty
}
</span>
)}
{hasOwnPropertyAndNotNull(
item,
"pinswg_eventaddresscounty"
) && (
<span>
{
item.pinswg_eventaddresspostcode
}
</span>
)}
</div>
</div>
</>
)}
</div>
{/* type of event
start date date of event - end date of event
if virtual event no address showNoOfRecords
show event address */}
{hasOwnPropertyAndNotNull(
item,
"pinswg_linktotheevent"
) &&
isEventLiveNow(item) && (
<div className="eventColumn">
<a
href={
locale === "en"
? item.pinswg_linktotheevent
: item.pinswg_linktotheeventstreamwelsh
}
className="govuk-link"
target="_blank"
rel="noopener noreferrer"
>
<div>
<b>
{t(
"case:live-event-link"
"case:event-type-of-event-label"
)}
</a>
</b>
:{" "}
{
item[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
]
}
</div>
)}
</div>
</div>
</>
)
@@ -246,7 +203,7 @@ const EventsDetails = (props) => {
const mapStateToProps = (state) => {
return {
...state
...state,
};
};
@@ -257,7 +214,7 @@ const mapDispatchToProps = (dispatch) => {
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
}
},
};
};
+8 -8
View File
@@ -447,19 +447,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
const { t } = useTranslation();
const router = useRouter();
const sourceMedia = mediaObj?.value;
const mediaArr = mediaObj?.value || [];
const isActive = whichTab ? whichTab === "case-media" : true;
// Build list of playable items (publishable only)
const videoItems = useMemo(() => {
const isWelsh = router.locale === "cy";
return (sourceMedia || [])
return (mediaArr || [])
.filter((x) => x?.pinswg_publishtoweb)
.map((item) => {
const link = isWelsh
? item.pinswg_videoplatformurlwelsh
: item.pinswg_videoplatformurl;
? item.pinswg_mediaLinkCY
: item.pinswg_mediaLinkEN;
const videoId = extractYouTubeId(link);
if (!videoId) return null;
@@ -468,19 +468,19 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
key:
item.pinswg_documentid ||
item.pinswg_mediaid ||
`${item.pinswg_eventrecordingid}-${videoId}`,
`${item.pinswg_name}-${videoId}`,
videoId,
name: item.pinswg_eventrecordingname || "Video",
name: item.pinswg_name || "Video",
description: item.pinswg_description || "",
// If you later store duration in CRM, map it here (e.g. "03:42")
duration: item.pinswg_duration || null,
thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
raw: item
raw: item,
};
})
.filter(Boolean);
}, [sourceMedia, router.locale]);
}, [mediaArr, router.locale]);
const [selectedIndex, setSelectedIndex] = useState(0);
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton
shouldDisableButton,
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations
setFilesForRepresentations,
} from "../../../store/currentView/action";
const ConsultationAgent = (props) => {
@@ -36,23 +36,9 @@ const ConsultationAgent = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -77,43 +63,63 @@ const ConsultationAgent = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
return (
<>
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-agent-heading"
)}
kindLabelText={t(
"myrepresentations:kind-of-consultation-label"
)}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-agent-heading"
)}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label"
)}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={
appellantApplicantRepresentationArr
}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -140,7 +146,8 @@ const ConsultationAgent = (props) => {
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{selectedRepresentationType ==
{formObj.representationForm.values
.representationType ==
"Consultation Response"
? t(
"myrepresentations:enter-comment-label"
@@ -153,7 +160,8 @@ const ConsultationAgent = (props) => {
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
{selectedRepresentationType ==
{formObj.representationForm.values
.representationType ==
"Consultation Response" && (
<div className="govuk-form-group">
<Field
@@ -257,7 +265,8 @@ const ConsultationAgent = (props) => {
</div>
</>
)}
{isTypeConfirmed && (
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -266,7 +275,7 @@ const ConsultationAgent = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj
formObj,
})}
>
{t("common:continue-button")}
@@ -340,7 +349,7 @@ const mapDispatchToProps = (dispatch) => ({
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
}
},
});
export default connect(
@@ -350,6 +359,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false
destroyOnUnmount: false,
})(ConsultationAgent)
);
@@ -2,21 +2,21 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderPickList,
RenderRichMultiline,
shouldDisableButton
shouldDisableButton,
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations
setFilesForRepresentations,
} from "../../../store/currentView/action";
const ConsultationAppellant = (props) => {
@@ -35,23 +35,9 @@ const ConsultationAppellant = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
if (JSON.stringify(formObj) != "{}") {
@@ -76,47 +62,66 @@ const ConsultationAppellant = (props) => {
index === self.findIndex((t) => t.name === value.name)
);
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
return (
<>
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-appellant-heading"
)}
kindLabelText={t(
"myrepresentations:kind-of-consultation-label"
)}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-appellant-heading"
)}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label"
)}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={
appellantApplicantRepresentationArr
}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{selectedRepresentationType ==
{formObj.representationForm.values
.representationType ==
"Consultation Response"
? t("myrepresentations:enter-comment-label")
: t(
@@ -127,7 +132,8 @@ const ConsultationAppellant = (props) => {
className="govuk-fieldset"
aria-describedby="commentBox-hint"
>
{selectedRepresentationType ==
{formObj.representationForm.values
.representationType ==
"Consultation Response" && (
<div className="govuk-form-group">
<Field
@@ -227,7 +233,8 @@ const ConsultationAppellant = (props) => {
</div>
)}
{isTypeConfirmed && (
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -236,7 +243,7 @@ const ConsultationAppellant = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj
formObj,
})}
>
{t("common:continue-button")}
@@ -246,6 +253,7 @@ const ConsultationAppellant = (props) => {
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
@@ -313,7 +321,7 @@ const mapDispatchToProps = (dispatch) => {
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
}
},
};
};
@@ -324,6 +332,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false
destroyOnUnmount: false,
})(ConsultationAppellant)
);
@@ -2,22 +2,22 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderCondtionalRadioList,
RenderPickList,
RenderRichMultiline,
shouldDisableButton
shouldDisableButton,
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import { useDropzone } from "react-dropzone";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setFilesForRepresentations
setFilesForRepresentations,
} from "../../../store/currentView/action";
const ConsultationInterestedPartyPerson = (props) => {
@@ -35,25 +35,11 @@ const ConsultationInterestedPartyPerson = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const required = (value) => (value ? undefined : "Required");
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
props.currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -76,46 +62,67 @@ const ConsultationInterestedPartyPerson = (props) => {
{file.path} - {file.size} bytes
</li>
));
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
return (
<>
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:consultation-from-an-interested-person-heading"
)}
kindLabelText={t(
"myrepresentations:kind-of-consultation-label"
)}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={interestedPersonRepresentationArr}
validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")}
/>
{isTypeConfirmed && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
<h2 className="govuk-heading-m ">
{t(
"myrepresentations:consultation-from-an-interested-person-heading"
)}
</h2>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:kind-of-consultation-label"
)}
</label>
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
validate={[required]}
optionsArr={
interestedPersonRepresentationArr
}
errorMsg={t(
"myrepresentations:select-an-option-label"
)}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -127,7 +134,7 @@ const ConsultationInterestedPartyPerson = (props) => {
t(
"myrepresentations:questionnaire-yes"
),
t("myrepresentations:questionnaire-no")
t("myrepresentations:questionnaire-no"),
]}
id="representationOnBehalfOf"
className="govuk-radios__input"
@@ -147,7 +154,8 @@ const ConsultationInterestedPartyPerson = (props) => {
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
{selectedRepresentationType ==
{formObj.representationForm.values
.representationType ==
"Consultation Response"
? t(
"myrepresentations:enter-comment-label"
@@ -161,7 +169,8 @@ const ConsultationInterestedPartyPerson = (props) => {
aria-describedby="commentBox-hint"
>
{" "}
{selectedRepresentationType ==
{formObj.representationForm.values
.representationType ==
"Consultation Response" && (
<div className="govuk-form-group">
<Field
@@ -265,7 +274,8 @@ const ConsultationInterestedPartyPerson = (props) => {
</div>
</>
)}
{isTypeConfirmed && (
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<div className="govuk-grid-row">
<div className="govuk-button-group">
<button
@@ -274,7 +284,7 @@ const ConsultationInterestedPartyPerson = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj
formObj,
})}
>
{t("common:continue-button")}
@@ -353,7 +363,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(change(form, field, newValue)),
setFilesForRepresentations: (fileList) => {
dispatch(setFilesForRepresentations(fileList));
}
},
});
export default connect(
@@ -363,6 +373,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false
destroyOnUnmount: false,
})(ConsultationInterestedPartyPerson)
);
@@ -1,134 +1,17 @@
import { Field } from "redux-form";
import router from "next/router";
import Link from "next/link";
const getRepresentationTypeHint = (option, t) => {
const map = {
"Statement": t("myrepresentations:rep-type-statement-hint"),
"Final comments": t("myrepresentations:rep-type-final-comments-hint"),
"Questionnaire": t("myrepresentations:rep-type-questionnaire-hint"),
"Consultation Response": t(
"myrepresentations:rep-type-consultation-hint"
),
"Local Impact Report": t("myrepresentations:rep-type-lir-hint"),
"Marine Impact Report": t("myrepresentations:rep-type-mir-hint")
};
import { RenderPickList } from "../representationElements";
return map[option] || "";
};
const getRepresentationTypeLabel = (option) => {
if (router.locale !== "cy") {
return option;
}
if (option === "Questionnaire") {
return "Holiadur";
}
if (option === "Statement") {
return "Datganiad";
}
if (option === "Final comments") {
return "Sylwadau terfynol";
}
return option;
};
const RenderRepresentationTypeRadioList = ({
name,
optionsArr,
errorMsg,
onRepresentationTypeChange,
input,
meta: { touched, error }
}) => {
return (
<div
className={
touched && error
? "govuk-form-group govuk-form-group--error"
: "govuk-form-group"
}
>
{touched && error && (
<span id={`${name}-error`} className="govuk-error-message">
<span className="govuk-visually-hidden">Error:</span>{" "}
{errorMsg}
</span>
)}
<div className="govuk-radios govuk-radios--small">
{optionsArr.map((option, index) => {
const optionId = `${name}_${index}`;
const hintId = `${optionId}-hint`;
return (
<div
key={option.value || optionId}
className="govuk-radios__item representation-type-option"
>
<input
className="govuk-radios__input"
id={optionId}
name={input.name}
type="radio"
value={option.value}
checked={input.value === option.value}
onChange={() => input.onChange(option.value)}
aria-describedby={
option.hint ? hintId : undefined
}
/>
<label
className="govuk-label govuk-radios__label govuk-!-font-weight-bold "
htmlFor={optionId}
>
{option.label}
{option.hint && (
<div
id={hintId}
className="govuk-hint govuk-!-margin-top-2"
>
{option.hint}
</div>
)}
</label>
</div>
);
})}
</div>
</div>
);
};
const RepresentationTypeSelectorBlock = ({
t,
headingText,
kindLabelText,
isTypeSelected,
selectedTypeDisplay,
representationType,
setTypeSelectionConfirmed,
onRepresentationTypeChange,
onTypeSelectionConfirmed,
optionsArr,
validate,
errorMsg
}) => {
const enhancedOptions = (optionsArr || [])
.filter((option) => option && option !== "Select...")
.map((option) => ({
value: option,
label: getRepresentationTypeLabel(option),
hint: getRepresentationTypeHint(option, t)
}));
const hasSelectableOptions = enhancedOptions.length > 0;
return (
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -137,59 +20,20 @@ const RepresentationTypeSelectorBlock = ({
<h2 className="govuk-heading-m ">{headingText}</h2>
<label
className="govuk-label govuk-body-m govuk-!-margin-bottom-2"
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{kindLabelText}
</label>
{hasSelectableOptions ? (
<>
<Field
name="representationType"
component={
RenderRepresentationTypeRadioList
}
onRepresentationTypeChange={
onRepresentationTypeChange
}
validate={validate}
optionsArr={enhancedOptions}
errorMsg={errorMsg}
/>
<button
type="button"
className="govuk-button"
data-module="govuk-button"
disabled={!representationType}
onClick={() => {
if (representationType) {
setTypeSelectionConfirmed(true);
onTypeSelectionConfirmed &&
onTypeSelectionConfirmed(
representationType
);
}
}}
>
{t("common:continue-button")}
</button>
</>
) : (
<>
<p className="govuk-body">
{t(
"myrepresentations:representation-type-unavailable-label"
)}
</p>
<Link className="govuk-link" href="/">
{t(
"myrepresentations:return-home-link-label"
)}
</Link>
</>
)}
<Field
name="representationType"
component={RenderPickList}
datafieldname="representationType"
validate={validate}
optionsArr={optionsArr}
errorMsg={errorMsg}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
+256 -52
View File
@@ -52,20 +52,12 @@ import {
buildSubmitEnrichedValues,
runFinalisationSequence
} from "./utils/finalisationBoundary";
import {
buildRepresentationContext,
buildRepsArrFromContext
} from "./utils/buildRepsArrRules";
let MakeRepresentation = (props) => {
let { t } = useTranslation();
const [savingStatus, setSavingStatus] = useState(false);
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
const [representationTypeConfirmed, setRepresentationTypeConfirmed] =
useState(
!!props?.currentView?.caseReference?.repDetails?.representationType
);
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
@@ -257,14 +249,9 @@ let MakeRepresentation = (props) => {
var detailsObj = {};
// const isAppellant =
// props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
// 846040001;
const isAppellant =
props.props.accountDetails.accountDetails.emailaddress1 ==
props.searchResultsObj?.searchResultsObj?.value[0].customerid_contact
.emailaddress1;
props.props.accountDetails.accountDetails.pinswg_typeofinvolvement ===
846040001;
const capacityOptionsArr = [];
@@ -316,25 +303,259 @@ let MakeRepresentation = (props) => {
const safeDetailsObj = detailsObj || {};
const safeResultsObj = resultsObj || {};
// blocked out build reps arr for refactoring
// const buildRepsArr = (detailsObj) => {
// const buildArr = [];
// const todaysDate = new Date();
// const isDNS = appealType === 846040011;
// const isSIPS = appealType === 846040002;
// const isIP = true;
// const isAppellant =
// props.props.accountDetails.accountDetails
// .pinswg_typeofinvolvement === 846040001;
// // Determine key dates based on appeal type
// const startDate = new Date(
// isDNS
// ? detailsObj.pinswg_applicationacceptedasvalid
// : detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
// );
// const questionnaireDate = new Date(
// isDNS
// ? detailsObj.pinswg_endofrepresentationperiod
// : detailsObj.pinswg_questionnaireduedate
// );
// questionnaireDate.setHours(23, 59, 59, 999);
// const finalCommentsDate = new Date(
// isDNS
// ? detailsObj.pinswg_endofrepresentationperiod
// : detailsObj.pinswg_finalcommentsduedate
// );
// finalCommentsDate.setHours(23, 59, 59, 999);
// const statementDueDate = new Date(
// isDNS
// ? detailsObj.pinswg_endofrepresentationperiod
// : detailsObj.pinswg_statementduedate ||
// detailsObj.pinswg_statementsduedate
// );
// statementDueDate.setHours(23, 59, 59, 999);
// // Shared condition
// const isWithin = (start, end) =>
// todaysDate >= start && todaysDate <= end;
// const notAppeal = (...types) => !types.includes(appealType);
// // Questionnaire
// if (
// isLPA &&
// notAppeal(846040019, 846040011, 846040015, 846040016) &&
// isWithin(startDate, finalCommentsDate)
// ) {
// buildArr.push("Questionnaire");
// }
// // DNS LPA Documents
// if (
// isLPA &&
// isDNS &&
// appealType !== 846040019 &&
// isWithin(startDate, finalCommentsDate)
// ) {
// buildArr.push("Local Impact Report", "Statement");
// }
// // Non-DNS Statement
// if (
// !isDNS &&
// appealType !== 846040004 &&
// isWithin(startDate, statementDueDate)
// ) {
// buildArr.push("Statement");
// }
// // DNS Non-LPA Statement
// if (isDNS && !isLPA && isWithin(startDate, statementDueDate)) {
// buildArr.push("Statement");
// }
// // Final Comments
// const isSpecialistNonHearing =
// currentView.caseReference.specialistProcess !== 846040001;
// if (
// (appealType !== 846040004 ||
// (appealType === 846040015 && isSpecialistNonHearing)) &&
// isWithin(statementDueDate, finalCommentsDate)
// ) {
// buildArr.push("Final comments");
// }
// if (
// appealType === 846040004 &&
// isSpecialistNonHearing &&
// isWithin(statementDueDate, finalCommentsDate)
// ) {
// buildArr.push("Final comments");
// }
// // Remove "Statement" for LPA Advert Part 3 (no statement)
// if (
// isLPA &&
// appealType === 846040018 &&
// currentView.caseReference.specialistProcess === 846040000
// ) {
// const index = buildArr.indexOf("Statement");
// if (index !== -1) buildArr.splice(index, 1);
// }
// // SIPS-related documents
// if (isSIPS) {
// const capacity = repCapacityType();
// if (capacity === "appellant") {
// buildArr.push("Consultation Response");
// } else {
// buildArr.push("Consultation Response", "Local Impact Report");
// }
// if (isNRW) {
// buildArr.push("Marine Impact Report");
// }
// }
// return buildArr;
// };
const buildRepsArr = (detailsObj) => {
const isCaseOwner =
props.props.accountDetails.accountDetails.emailaddress1 ==
props.searchResultsObj?.searchResultsObj?.value[0]
.customerid_contact.emailaddress1;
const buildArr = [];
const todaysDate = new Date();
const ctx = buildRepresentationContext({
detailsObj,
appealType,
specialistProcess: currentView.caseReference.specialistProcess,
involvementType:
props.props?.accountDetails?.accountDetails
?.pinswg_typeofinvolvement,
selectedCapacity: repCapacityType(),
isCaseOwner,
isNRW
});
const isDNS = appealType === 846040011;
const isSIPS = appealType === 846040002;
const specialistProcess = currentView.caseReference.specialistProcess;
return buildRepsArrFromContext(ctx);
const isSpecialistNonHearing = specialistProcess !== 846040001;
const involvementType =
props.props?.accountDetails?.accountDetails
?.pinswg_typeofinvolvement;
const isAppellant = involvementType === 846040001;
const isAgent = involvementType === 846040000;
const isIP = involvementType === 846040061;
//const isLPA = involvementType === 846040000;
const startDate = new Date(
isDNS
? detailsObj.pinswg_applicationacceptedasvalid
: detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
);
const finalCommentsDate = new Date(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_finalcommentsduedate
);
finalCommentsDate.setHours(23, 59, 59, 999);
const statementDueDate = new Date(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_statementduedate ||
detailsObj.pinswg_statementsduedate
);
statementDueDate.setHours(23, 59, 59, 999);
const isWithin = (start, end) =>
todaysDate >= start && todaysDate <= end;
const addRep = (value) => {
if (!buildArr.includes(value)) {
buildArr.push(value);
}
};
const canAddQuestionnaire =
isLPA &&
![846040019, 846040011, 846040015, 846040016].includes(
appealType
) &&
isWithin(startDate, finalCommentsDate);
if (canAddQuestionnaire) {
addRep("Questionnaire");
}
const isLpaAdvertPart3NoStatement =
isLPA &&
appealType === 846040018 &&
specialistProcess === 846040000;
const canAddDnsLpaDocs =
isLPA &&
isDNS &&
appealType !== 846040019 &&
!isAppellant &&
isWithin(startDate, finalCommentsDate);
if (canAddDnsLpaDocs) {
addRep("Local Impact Report");
addRep("Statement");
}
const canAddStatementForNonDns =
!isDNS &&
appealType !== 846040004 &&
!isLpaAdvertPart3NoStatement &&
!isAppellant &&
isWithin(startDate, statementDueDate);
if (canAddStatementForNonDns) {
addRep("Statement");
}
const canAddStatementForDnsNonLpa =
isDNS &&
!isLPA &&
!isAppellant &&
isWithin(startDate, statementDueDate);
if (canAddStatementForDnsNonLpa) {
addRep("Statement");
}
const canSubmitFinalComments = isAppellant || isAgent || isIP || isLPA;
const canAddFinalComments =
canSubmitFinalComments &&
isWithin(statementDueDate, finalCommentsDate) &&
(appealType !== 846040004 || isSpecialistNonHearing);
// IP and Agents and LPA can do final comments.
if (canAddFinalComments) {
addRep("Final comments");
}
if (isSIPS) {
const capacity = repCapacityType();
addRep("Consultation Response");
if (capacity !== "appellant") {
addRep("Local Impact Report");
}
if (isNRW) {
addRep("Marine Impact Report");
}
}
return buildArr;
};
const repCapacityType = () => {
@@ -365,10 +586,7 @@ let MakeRepresentation = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setCurrentReference,
onRepresentationTypeChange: () =>
setRepresentationTypeConfirmed(false),
onTypeSelectionConfirmed: () => setRepresentationTypeConfirmed(true)
setCurrentReference
};
const { controlKey } = resolveRepresentationControlKey({
@@ -874,29 +1092,15 @@ let MakeRepresentation = (props) => {
// Prepare data object for upload
const dataObj = cleanedValues;
const caseFolderReference =
props.caseReference ||
dataObj.ticketnumber ||
currentView?.caseReference?.ticketnumber ||
currentView?.caseReference?.currentReference ||
dataObj.caseRef ||
"";
// Update links on values
const updatedValues = updateLinks(cleanedValues);
const resolvedContainerID =
updatedValues.containerID ||
dataObj.containerID ||
props?.props?.accountDetails?.containerID ||
props?.props?.accountDetails?.accountDetails?.containerID;
// Perform file upload and return the promise
return uploadRepFiles(
dataObj,
[{}],
resolvedContainerID,
`${caseFolderReference}/${dataObj.repfile_name}`
updatedValues.containerID,
`${props.caseReference}/${dataObj.repfile_name}`
);
};
@@ -904,7 +1108,7 @@ let MakeRepresentation = (props) => {
const isQuestionnaire =
formObj?.representationForm?.values?.representationType ===
"Questionnaire" && representationTypeConfirmed;
"Questionnaire";
const appealIsConsultation = appealType === 846040002;
const appealIsLocalImpact =
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
@@ -36,24 +36,10 @@ const RepAgent = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
setFilesForRepresentations
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -78,23 +64,23 @@ const RepAgent = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const hasTypeSelectionInline =
typeof formObj.representationForm.values.representationType ==
"undefined" && props.representationType != "Select...";
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? formObj.representationForm.values.representationType ==
"Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
: formObj.representationForm.values.representationType ==
"Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
: formObj.representationForm.values.representationType ==
"Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
: formObj.representationForm.values.representationType
: formObj.representationForm.values.representationType;
const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {};
@@ -112,15 +98,13 @@ const RepAgent = (props) => {
"myrepresentations:representation-from-an-agent-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={isTypeConfirmed}
isTypeSelected={!hasTypeSelectionInline}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{isTypeConfirmed && (
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -243,7 +227,8 @@ const RepAgent = (props) => {
</div>
</>
)}
{isTypeConfirmed && (
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<RepresentationActionButtons
t={t}
locale={router.locale}
@@ -2,11 +2,12 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
FileUploadField,
RenderPickList,
RenderRichMultiline,
shouldDisableButton
} from "./representationElements";
@@ -35,24 +36,10 @@ const RepAppellant = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
setFilesForRepresentations
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
console.log(JSON.stringify(formObj) == "{}" ? "empty" : "value");
if (JSON.stringify(formObj) != "{}") {
@@ -77,23 +64,23 @@ const RepAppellant = (props) => {
index === self.findIndex((t) => t.name === value.name)
);
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const hasTypeSelectionInline =
typeof formObj.representationForm.values.representationType ==
"undefined" && props.representationType != "Select...";
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? formObj.representationForm.values.representationType ==
"Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
: formObj.representationForm.values.representationType ==
"Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
: formObj.representationForm.values.representationType ==
"Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
: formObj.representationForm.values.representationType
: formObj.representationForm.values.representationType;
const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {};
@@ -111,15 +98,13 @@ const RepAppellant = (props) => {
"myrepresentations:representation-from-an-appellant-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={isTypeConfirmed}
isTypeSelected={!hasTypeSelectionInline}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
/>
{isTypeConfirmed && (
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<div className="govuk-grid-row">
<div className="govuk-form-group">
<p className="govuk-body">
@@ -235,7 +220,8 @@ const RepAppellant = (props) => {
</div>
)}
{isTypeConfirmed && (
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<RepresentationActionButtons
t={t}
locale={router.locale}
@@ -66,8 +66,7 @@ const RepComplete = (props) => {
(props.props.currentView.representationMessageSent != true &&
(setRepInvolvment(
props.props.currentView.caseReference.incidentid,
props.props.props.props.accountDetails.accountDetails.contactid,
props.props.currentView.representationCapacity
props.props.props.props.accountDetails.accountDetails.contactid
),
sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import {
@@ -35,26 +35,12 @@ const RepInterestedPartyPerson = (props) => {
updateRepresentation,
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
setFilesForRepresentations
} = props;
const required = (value) => (value ? undefined : "Required");
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const persistedRepresentationType =
props.currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
if (JSON.stringify(formObj) != "{}") {
setRepFileName(formObj.representationForm.values);
@@ -78,23 +64,23 @@ const RepInterestedPartyPerson = (props) => {
</li>
));
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const hasTypeSelectionInline =
typeof formObj.representationForm.values.representationType ==
"undefined" && props.representationType != "Select...";
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? formObj.representationForm.values.representationType ==
"Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
: formObj.representationForm.values.representationType ==
"Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
: formObj.representationForm.values.representationType ==
"Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
: formObj.representationForm.values.representationType
: formObj.representationForm.values.representationType;
const handleSaveExit = () => {
let valuesObj = props.props.props.form[props.form].values || {};
@@ -112,17 +98,15 @@ const RepInterestedPartyPerson = (props) => {
"myrepresentations:consultation-from-an-interested-person-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={isTypeConfirmed}
isTypeSelected={!hasTypeSelectionInline}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={interestedPersonRepresentationArr}
validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")}
/>
{isTypeConfirmed && (
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values
.representationType != "undefined") && (
<>
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -229,7 +213,8 @@ const RepInterestedPartyPerson = (props) => {
</div>
</>
)}
{isTypeConfirmed && (
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
<RepresentationActionButtons
t={t}
locale={router.locale}
@@ -10,9 +10,9 @@ import { useState, useEffect } from "react";
import {
FileUploadField,
RenderMultiline,
shouldDisableButton
RenderPickList,
shouldDisableButton,
} from "./representationElements";
import RepresentationTypeSelectorBlock from "./elements/RepresentationTypeSelectorBlock";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
@@ -23,7 +23,7 @@ import {
setRepresentationSubmit,
setFilesForRepresentations,
setCurrentPage,
setCurrentReference
setCurrentReference,
} from "../../../store/currentView/action";
let RepLPA = (props) => {
@@ -49,8 +49,6 @@ let RepLPA = (props) => {
setSavingStatus,
savingStatus,
setFilesForRepresentations,
onRepresentationTypeChange,
onTypeSelectionConfirmed
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
@@ -61,36 +59,6 @@ let RepLPA = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const persistedRepresentationType =
currentView?.caseReference?.repDetails?.representationType;
const [typeSelectionConfirmed, setTypeSelectionConfirmed] = useState(
!!persistedRepresentationType
);
useEffect(() => {
if (persistedRepresentationType) {
setTypeSelectionConfirmed(true);
}
}, [persistedRepresentationType]);
const selectedRepresentationType =
formObj?.representationForm?.values?.representationType ||
props.representationType;
const isTypeConfirmed =
!!selectedRepresentationType && typeSelectionConfirmed;
const selectedRepresentationTypeDisplay =
router.locale == "cy"
? selectedRepresentationType == "Questionnaire"
? "Holiadur"
: selectedRepresentationType == "Statement"
? "Datganiad"
: selectedRepresentationType == "Final comments"
? "Sylwadau terfynol"
: selectedRepresentationType
: selectedRepresentationType;
const whichQuestionnaire = () => {
{
switch (currentView.caseReference.appealType) {
@@ -215,7 +183,7 @@ let RepLPA = (props) => {
currentView.caseReference.currentReference +
'")]',
json: setCaseDetailsObj,
eval: true
eval: true,
});
let setCaseResultssObj = router.query.hasOwnProperty("state")
@@ -234,7 +202,7 @@ let RepLPA = (props) => {
currentView.caseReference.currentReference +
'")]',
json: setCaseResultssObj,
eval: true
eval: true,
});
resultsObj = resultsObj[0];
@@ -257,26 +225,62 @@ let RepLPA = (props) => {
return (
<>
<RepresentationTypeSelectorBlock
t={t}
headingText={t(
"myrepresentations:representation-from-an-lpa-heading"
)}
kindLabelText={t("myrepresentations:kind-of-rep-label")}
isTypeSelected={isTypeConfirmed}
selectedTypeDisplay={selectedRepresentationTypeDisplay}
representationType={selectedRepresentationType}
setTypeSelectionConfirmed={setTypeSelectionConfirmed}
onRepresentationTypeChange={onRepresentationTypeChange}
onTypeSelectionConfirmed={onTypeSelectionConfirmed}
optionsArr={appellantApplicantRepresentationArr}
validate={[required]}
errorMsg={t("myrepresentations:select-an-option-label")}
/>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{isTypeConfirmed &&
(selectedRepresentationType != "Questionnaire" ? (
{!_.has(
formObj["representationForm"],
["values", "representationType"] ||
typeof props.currentView.caseReference.repDetails !=
"undefined"
) ? (
<>
<label
className="govuk-label govuk-body-m"
htmlFor="representationType"
>
{t(
"myrepresentations:representation-from-an-lpa-heading"
)}
</label>
<Field
id="representationType"
name="representationType"
component={RenderPickList}
datafieldname="representationType"
optionsArr={appellantApplicantRepresentationArr}
/>
</>
) : (
<label className="govuk-label govuk-body-m">
{t("myrepresentations:representation-type")}:{" "}
{router.locale == "cy"
? formObj.representationForm.values
.representationType == "Questionnaire"
? "Holiadur"
: formObj.representationForm.values
.representationType == "Statement"
? "Datganiad"
: formObj.representationForm.values
.representationType ==
"Final comments"
? "Sylwadau terfynol"
: formObj.representationForm.values
.representationType
: formObj.representationForm.values
.representationType}
</label>
)}
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{(_.has(formObj["representationForm"], [
"values",
"representationType",
]) ||
typeof props.representationType != "undefined") &&
(props.representationType != "Questionnaire" &&
props.representationType != "Select..." ? (
<>
<p className="govuk-body">
{t("myrepresentations:enter-comment-label")}
@@ -350,8 +354,7 @@ let RepLPA = (props) => {
"myrepresentations:add-files-label"
)}
ticketnumber={
props.currentView.caseReference
.ticketnumber
props.currentView.caseReference.ticketnumber
}
hint={"sdsd"}
fileList={
@@ -398,8 +401,9 @@ let RepLPA = (props) => {
</div>
<div className="govuk-grid-row">
<div className="govuk-button-group">
{isTypeConfirmed &&
selectedRepresentationType == "Questionnaire" && (
{(typeof props.representationType != "undefined" ||
_.has(formObj, "values", "representationType")) &&
props.representationType == "Questionnaire" && (
<>
{showQuestionnaireSection <
questionnaireCount && (
@@ -439,14 +443,14 @@ let RepLPA = (props) => {
// top: 0,
// behavior: "smooth",
// });
(setRepFileName(
setRepFileName(
props.formObj[
"representationForm"
].values
),
setShowQuestionnaireSection(
showQuestionnaireSection - 1
));
);
}}
className="govuk-link"
>
@@ -499,8 +503,9 @@ let RepLPA = (props) => {
)}
</>
)}{" "}
{isTypeConfirmed &&
selectedRepresentationType != "Questionnaire" && (
{(typeof props.representationType != "undefined" ||
_.has(formObj, "values", "representationType")) &&
props.representationType != "Questionnaire" && (
<>
<button
type="submit"
@@ -508,7 +513,7 @@ let RepLPA = (props) => {
data-module="govuk-button"
disabled={shouldDisableButton({
props,
formObj
formObj,
})}
onClick={() => {
let valuesObj =
@@ -607,7 +612,7 @@ RepLPA = connect((state) => {
return {
procedureType,
representationType
representationType,
};
})(RepLPA);
@@ -620,7 +625,7 @@ const mapDispatchToProps = (dispatch) => ({
},
setCurrentReference: (currentReference) => {
dispatch(setCurrentReference(currentReference));
}
},
});
const mapStateToProps = (state, props) => {
@@ -636,7 +641,8 @@ const mapStateToProps = (state, props) => {
],
"firstname":
props.props.props.accountDetails.accountDetails.firstname,
"lastname": props.props.props.accountDetails.accountDetails.lastname
"lastname":
props.props.props.accountDetails.accountDetails.lastname,
}
);
return {
@@ -647,7 +653,7 @@ const mapStateToProps = (state, props) => {
currentView: state.currentView,
myRepresentations: state.myRepresentations,
watchedCases: state.watchedCases,
initialValues: initialValuesTemp
initialValues: initialValuesTemp,
};
};
@@ -658,6 +664,6 @@ export default connect(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false
destroyOnUnmount: false,
})(RepLPA)
);
@@ -1,224 +0,0 @@
export const APPEAL_TYPES = {
SIPS: 846040002,
DNS: 846040011,
HOUSEHOLDER: 846040004,
ADVERT: 846040018,
EXCLUDE_QUESTIONNAIRE_1: 846040019,
EXCLUDE_QUESTIONNAIRE_2: 846040015,
EXCLUDE_QUESTIONNAIRE_3: 846040016
};
export const SPECIALIST_PROCESS = {
WRITTEN_REPS: 846040000,
HEARING: 846040001
};
export const INVOLVEMENT_TYPES = {
LPA: 846040012
};
export const REPRESENTATION_OPTIONS = {
QUESTIONNAIRE: "Questionnaire",
STATEMENT: "Statement",
FINAL_COMMENTS: "Final comments",
CONSULTATION_RESPONSE: "Consultation Response",
LOCAL_IMPACT_REPORT: "Local Impact Report",
MARINE_IMPACT_REPORT: "Marine Impact Report"
};
const isValidDate = (date) =>
date instanceof Date && !Number.isNaN(date.getTime());
const toDateOrNull = (value) => {
const date = new Date(value);
return isValidDate(date) ? date : null;
};
const endOfDay = (date) => {
if (!isValidDate(date)) return null;
const next = new Date(date);
next.setHours(23, 59, 59, 999);
return next;
};
const isWithinWindow = (now, start, end) => {
if (!isValidDate(now) || !isValidDate(start) || !isValidDate(end)) {
return false;
}
return now >= start && now <= end;
};
const normalizeCapacity = (value) =>
(value || "")
.toString()
.toLowerCase()
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "");
export const buildRepresentationContext = ({
detailsObj = {},
appealType,
specialistProcess,
involvementType,
selectedCapacity,
isCaseOwner,
isNRW,
now = new Date()
}) => {
const isDNS = appealType === APPEAL_TYPES.DNS;
const startDate = toDateOrNull(
isDNS
? detailsObj.pinswg_applicationacceptedasvalid
: detailsObj.pinswg_startdate || detailsObj.pinswg_startdates
);
const statementDueDate = endOfDay(
toDateOrNull(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_statementduedate ||
detailsObj.pinswg_statementsduedate
)
);
const finalCommentsDueDate = endOfDay(
toDateOrNull(
isDNS
? detailsObj.pinswg_endofrepresentationperiod
: detailsObj.pinswg_finalcommentsduedate
)
);
const capacity = normalizeCapacity(selectedCapacity);
const isLPA = involvementType === INVOLVEMENT_TYPES.LPA;
return {
appealType,
specialistProcess,
isDNS,
isSIPS: appealType === APPEAL_TYPES.SIPS,
isLPA,
isNRW: !!isNRW,
isCaseOwner: !!isCaseOwner,
isSelectedAppellant: capacity === "appellant",
isSelectedAgent: capacity === "agent",
isSelectedInterestedParty: capacity === "interestedparty",
now,
startDate,
statementDueDate,
finalCommentsDueDate
};
};
export const addQuestionnaire = (options, ctx) => {
const excludedTypes = [
APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_1,
APPEAL_TYPES.DNS,
APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_2,
APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_3
];
const canAdd =
ctx.isLPA &&
!excludedTypes.includes(ctx.appealType) &&
isWithinWindow(ctx.now, ctx.startDate, ctx.finalCommentsDueDate);
if (canAdd) {
options.add(REPRESENTATION_OPTIONS.QUESTIONNAIRE);
}
};
export const addStatements = (options, ctx) => {
const isLpaAdvertPart3NoStatement =
ctx.isLPA &&
ctx.appealType === APPEAL_TYPES.ADVERT &&
ctx.specialistProcess === SPECIALIST_PROCESS.WRITTEN_REPS;
const canAddDnsLpaDocs =
ctx.isLPA &&
ctx.isDNS &&
ctx.appealType !== APPEAL_TYPES.EXCLUDE_QUESTIONNAIRE_1 &&
!ctx.isCaseOwner &&
isWithinWindow(ctx.now, ctx.startDate, ctx.finalCommentsDueDate);
if (canAddDnsLpaDocs) {
options.add(REPRESENTATION_OPTIONS.LOCAL_IMPACT_REPORT);
options.add(REPRESENTATION_OPTIONS.STATEMENT);
}
const canAddStatementForNonDns =
!ctx.isDNS &&
ctx.appealType !== APPEAL_TYPES.HOUSEHOLDER &&
!isLpaAdvertPart3NoStatement &&
!ctx.isCaseOwner &&
isWithinWindow(ctx.now, ctx.startDate, ctx.statementDueDate);
if (canAddStatementForNonDns) {
options.add(REPRESENTATION_OPTIONS.STATEMENT);
}
const canAddStatementForDnsNonLpa =
ctx.isDNS &&
!ctx.isLPA &&
!ctx.isCaseOwner &&
isWithinWindow(ctx.now, ctx.startDate, ctx.statementDueDate);
if (canAddStatementForDnsNonLpa) {
options.add(REPRESENTATION_OPTIONS.STATEMENT);
}
};
export const addFinalComments = (options, ctx) => {
const canSubmitFinalCommentsDefault =
ctx.isSelectedAppellant ||
ctx.isSelectedAgent ||
ctx.isSelectedInterestedParty ||
ctx.isLPA;
const canSubmitFinalComments = ctx.isDNS
? ctx.isLPA
: canSubmitFinalCommentsDefault;
const isSpecialistNonHearing =
ctx.specialistProcess !== SPECIALIST_PROCESS.HEARING;
const finalCommentsWindowStart = ctx.isDNS
? ctx.startDate
: ctx.statementDueDate;
const canAdd =
canSubmitFinalComments &&
isWithinWindow(
ctx.now,
finalCommentsWindowStart,
ctx.finalCommentsDueDate
) &&
(ctx.appealType !== APPEAL_TYPES.HOUSEHOLDER || isSpecialistNonHearing);
if (canAdd) {
options.add(REPRESENTATION_OPTIONS.FINAL_COMMENTS);
}
};
export const addConsultation = (options, ctx) => {
if (!ctx.isSIPS) return;
options.add(REPRESENTATION_OPTIONS.CONSULTATION_RESPONSE);
if (!ctx.isSelectedAppellant) {
options.add(REPRESENTATION_OPTIONS.LOCAL_IMPACT_REPORT);
}
if (ctx.isNRW) {
options.add(REPRESENTATION_OPTIONS.MARINE_IMPACT_REPORT);
}
};
export const buildRepsArrFromContext = (ctx) => {
const options = new Set();
addQuestionnaire(options, ctx);
addStatements(options, ctx);
addFinalComments(options, ctx);
addConsultation(options, ctx);
return [...options];
};
-154
View File
@@ -1,154 +0,0 @@
import { setEventDetails } from "../../store/searchOutput/action";
import { setCurrentPage } from "../../store/currentView/action";
import { connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
import { formatDates } from "../utils";
import { useState } from "react";
import { getStagesForAppealType } from "./summary/utils/caseStagesByAppealType";
const statusClassMap = {
complete: "govuk-tag govuk-!-margin-top-2",
"in-progress": "govuk-tag govuk-tag--yellow govuk-!-margin-top-2",
"not-started": "govuk-tag govuk-tag--grey govuk-!-margin-top-2",
blocked: "govuk-tag govuk-tag--red govuk-!-margin-top-2"
};
const statusTextMap = {
complete: "status-complete",
"in-progress": "status-in-progress",
"not-started": "status-not-started",
blocked: "status-blocked"
};
const StatusDetails = (props) => {
let { t } = useTranslation();
const stages = getStagesForAppealType(
props.currentView?.caseReference?.appealType,
props.currentView?.caseReference?.statuscode
);
const EventView = (eventsArr) => {
eventsArr = eventsArr.value;
return eventsArr.map((item, key) => {
<div>{item.pinswg_name}</div>;
});
};
const eventsArr = props.eventsObj?.value || [];
// event publishiing flag set to true displa
function hasOwnPropertyAndNotNull(obj, property) {
return obj.hasOwnProperty(property) && obj[property] !== null;
}
const [expandAll, setExpandAll] = useState(null);
// null = use default (in-progress open)
// true = force open all
// false = force close all
const handleToggleAll = () => {
setExpandAll((prev) => (prev === true ? false : true));
};
return (
<div className="govuk-grid-row">
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h2 className="govuk-heading-m ">
{t("case:status-title")}
</h2>
<button
type="button"
className="govuk-!-margin-bottom-3 govuk-link watchCase govuk-!-font-size-16 "
onClick={handleToggleAll}
>
{expandAll === true
? t("case:status-hide-all-label")
: t("case:status-show-all-label")}
</button>
<ul className="govuk-task-list">
{stages.map((stage) => {
const isDefaultOpen =
stage.status === "in-progress";
const isOpen =
expandAll === null ? isDefaultOpen : expandAll;
return (
<li
className="govuk-task-list__item"
key={stage.id}
>
<div className="govuk-task-list__name-and-hint">
{stage.descriptionKey && (
<details
className="govuk-details govuk-!-margin-top-2 govuk-!-margin-bottom-2"
open={isOpen}
>
<summary className="govuk-details__summary">
<span className="govuk-details__summary-text">
{t(
`case-stages:${stage.titleKey}`
)}
</span>
</summary>
<div className="govuk-details__text">
{t(
`case-stages:${stage.descriptionKey}`
)}
</div>
</details>
)}
</div>
<div
className="govuk-task-list__status "
id={`${stage.id}-status`}
>
<strong
className={
statusClassMap[stage.status] ||
"govuk-tag govuk-tag--grey govuk-!-margin-top-2"
}
>
{t(
`case-stages:${
statusTextMap[
stage.status
] || "status-not-started"
}`
)}
</strong>
</div>
</li>
);
})}
</ul>
</div>
</div>
</div>
);
};
const mapStateToProps = (state) => {
return {
...state
};
};
const mapDispatchToProps = (dispatch) => {
return {
setEventDetails: (eventsObj) => {
dispatch(setEventDetails(eventsObj));
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(StatusDetails);
+6 -94
View File
@@ -9,7 +9,6 @@ import transLookup from "../../data/lookuptranslations.json";
import Documents from "./documents";
import EventsDetails from "./events";
import MediaDetails from "./media";
import StatusDetails from "./status";
import {
createWatchedCases,
@@ -33,10 +32,6 @@ import {
import { signIn, useSession } from "next-auth/react";
import { destroyCookie, parseCookies, setCookie } from "nookies";
import { getFormCollectionByID, getDetailsProxy } from "../utils";
import {
getLivePublishedEvent,
isEventLiveNow
} from "./summary/utils/liveEvent";
import * as CaseTypes from "./summaryTypes"; // ✅ must match filename exactly
import {
@@ -316,20 +311,6 @@ const CaseSummary = (props) => {
let hasEndDate = typeof d != "undefined";
const hasEventsTabData =
isObjectNotEmpty(props, "eventsObj") &&
Array.isArray(props.eventsObj?.value) &&
props.eventsObj.value.length > 0;
const hasMediaTabData =
isObjectNotEmpty(props, "mediaObj") &&
Array.isArray(props.mediaObj?.value) &&
props.mediaObj.value.length > 0;
const livePublishedEvent = hasEventsTabData
? getLivePublishedEvent(props.eventsObj)
: null;
let point = {};
let siteCoords = {};
let center = {};
@@ -368,47 +349,6 @@ const CaseSummary = (props) => {
showDetails == true ? (
<>
<div className="govuk-frontend-supported">
{livePublishedEvent && (
<div
className="govuk-notification-banner govuk-!-margin-bottom-6"
role="region"
aria-labelledby="live-event-title"
data-module="govuk-notification-banner"
>
<div className="govuk-notification-banner__header">
<h2
className="govuk-notification-banner__title"
id="live-event-title"
>
{t("case:live-event-subheading")}
</h2>
</div>
<div className="govuk-notification-banner__content">
<p className="govuk-notification-banner__heading">
{t("case:live-event-copy")}
</p>
{livePublishedEvent.pinswg_eventname && (
<p className="govuk-body">
{livePublishedEvent.pinswg_eventname}
</p>
)}
<a
href={
locale === "en"
? livePublishedEvent.pinswg_linktotheevent
: livePublishedEvent.pinswg_linktotheeventstreamwelsh
}
className="govuk-link govuk-link--no-visited-state"
target="_blank"
rel="noopener noreferrer"
>
{t("case:live-event-link")}
</a>
</div>
</div>
)}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
@@ -423,7 +363,6 @@ const CaseSummary = (props) => {
</h1>
</div>
</div>
<div className="govuk-tabs" data-module="govuk-tabs">
<h2 className="govuk-tabs__title">Contents</h2>
<ul className="govuk-tabs__list">
@@ -509,7 +448,7 @@ const CaseSummary = (props) => {
</a>
</li>
)}
{hasEventsTabData && (
{isObjectNotEmpty(props, "eventsObj") && (
<li
className={
whichTab == "case-events"
@@ -529,7 +468,7 @@ const CaseSummary = (props) => {
</a>
</li>
)}
{hasMediaTabData && (
{isObjectNotEmpty(props, "mediaObj") && (
<li
className={
whichTab == "case-media"
@@ -566,21 +505,6 @@ const CaseSummary = (props) => {
{t("case:summary-tab-documents-label")}
</a>
</li>
<li
className={
whichTab == "case-status"
? "govuk-tabs__list-item govuk-tabs__list-item--selected"
: "govuk-tabs__list-item "
}
>
<a
className="govuk-tabs__tab"
href="#case-status"
onClick={() => setWhichTab("case-status")}
>
{t("case:status-title")}
</a>
</li>
</ul>
<div
className={
@@ -1954,7 +1878,7 @@ const CaseSummary = (props) => {
.PrimaryIdAttribute == "pinswg_sipscase" && (
<EIADetails props={props} />
)}
{hasEventsTabData && (
{isObjectNotEmpty(props, "eventsObj") && (
<div
className={
whichTab == "case-events"
@@ -1967,7 +1891,7 @@ const CaseSummary = (props) => {
</div>
)}
{hasMediaTabData && (
{isObjectNotEmpty(props, "mediaObj") && (
<div
className={
whichTab == "case-media"
@@ -2004,16 +1928,6 @@ const CaseSummary = (props) => {
showFilteredDocs={props.showFilteredDocs}
/>
</div>
<div
className={
whichTab == "case-status"
? "govuk-tabs__panel "
: "govuk-tabs__panel govuk-tabs__panel--hidden"
}
id="case-status"
>
<StatusDetails />
</div>
</div>
</div>
</>
@@ -2078,12 +1992,10 @@ const CaseSummary = (props) => {
) : null;
}
const fallbackIncidentId = setCaseQueryObj?.value?.[0]?.incidentid;
useEffect(() => {
const linkCaseObj = async () => {
let docObj = await getLinkedCases(
incidentid || fallbackIncidentId
incidentid || setCaseQueryObj.value[0].incidentid
).then((data) => {
//console.log(data);
setCurrentLinkedCases(data);
@@ -2094,7 +2006,7 @@ const CaseSummary = (props) => {
};
const linkedCases = linkCaseObj();
}, [incidentid, fallbackIncidentId, setCurrentLinkedCases]);
}, [incidentid, setCurrentLinkedCases]);
let now = new Date();
let expDate = new Date(now);
@@ -1,882 +0,0 @@
const slugify = (value) =>
value
.toString()
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-|-$/g, "");
const buildStages = (stages) =>
stages.map((stage) => ({
id: slugify(stage.titleKey),
...stage
}));
export const stagesByCaseType = {
DNS: buildStages([
{
stageId: 846040001,
titleKey: "pre-application",
descriptionKey: "pre-application-desc"
},
{
stageId: 846040002,
titleKey: "environmental-impact-assessment-scoping",
descriptionKey: "environmental-impact-assessment-scoping-desc"
},
{
stageId: 846040003,
titleKey: "notification",
descriptionKey: "notification-desc"
},
{
stageId: 846040004,
titleKey: "acceptance-checking",
descriptionKey: "acceptance-checking-desc"
},
{
stageId: 846040005,
titleKey: "invalid-submission",
descriptionKey: "invalid-submission-desc"
},
{
stageId: 846040006,
titleKey: "consultation",
descriptionKey: "consultation-desc"
},
{
stageId: 846040007,
titleKey: "re-consultation",
descriptionKey: "re-consultation-desc"
},
{
stageId: 846040008,
titleKey: "reporting",
descriptionKey: "reporting-desc"
},
{
stageId: 846040009,
titleKey: "inspectors-decision",
descriptionKey: "inspectors-decision-desc"
},
{
stageId: 846040011,
titleKey: "report-to-ministers",
descriptionKey: "report-to-ministers-desc"
},
{
stageId: 846040012,
titleKey: "minister-s-decision",
descriptionKey: "minister-s-decision-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
SIP: "DNS",
PLANNING_S78: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040020,
titleKey: "event",
descriptionKey: "event-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
CONDITIONS_73_79: "PLANNING_S78",
LBCAC: "PLANNING_S78",
LDCS: "PLANNING_S78",
PLANNING_OBLIGATIONS_S106: "PLANNING_S78",
PRIOR_NOTIFICATION: "PLANNING_S78",
HAS: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
CALL_INS: buildStages([
{
stageId: 846040023,
titleKey: "application-called-in",
descriptionKey: "application-called-in-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040024,
titleKey: "application-validated",
descriptionKey: "application-validated-desc-callin"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc-callin"
},
{
stageId: 846040025,
titleKey: "lpa-to-notify",
descriptionKey: "lpa-to-notify-desc"
},
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc-callin"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-callin"
},
{
stageId: 846040020,
titleKey: "event",
descriptionKey: "event-desc-callin"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040028,
titleKey: "report-issued-to-welsh-ministers",
descriptionKey: "report-issued-to-welsh-ministers-desc"
},
{
stageId: 846040012,
titleKey: "minister-s-decision",
descriptionKey: "minister-s-decision-desc-callin"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-callin"
}
]),
ENFORCEMENT: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040029,
titleKey: "fee-due",
descriptionKey: "fee-due-desc"
},
{
stageId: 846040030,
titleKey: "validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040018,
titleKey: "representations-period",
descriptionKey: "representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040020,
titleKey: "event",
descriptionKey: "event-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
ENFORCEMENT_LISTED_BUILDING: "ENFORCEMENT",
MAINTENANCE_OF_LAND: "ENFORCEMENT",
RIGHTS_OF_WAY_SCHEDULE_14: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040031,
titleKey: "appeal-start-case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040032,
titleKey: "statements-representations-period",
descriptionKey: "statements-representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
RIGHTS_OF_WAY_ORDERS: buildStages([
{
stageId: 846040033,
titleKey: "order-submitted",
descriptionKey: "order-submitted-desc"
},
{
stageId: 846040034,
titleKey: "order-submission-registered",
descriptionKey: "order-submission-registered-desc"
},
{
stageId: 846040035,
titleKey: "order-submission-validated",
descriptionKey: "order-submission-validated-desc"
},
{
stageId: 846040036,
titleKey: "case-started-case-in-progress",
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-order"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc-order"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-order"
}
]),
REQUESTS_FOR_DIRECTION: buildStages([
{
stageId: 846040042,
titleKey: "application-submitted",
descriptionKey: "application-submitted-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040036,
titleKey: "application-start-case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "statements-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
ADVERTS: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040036,
titleKey: "case-started-case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
HEDGEROW_TPO: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040031,
titleKey: "appeal-start-case-in-progress",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040017,
titleKey: "questionnaire-lpa-to-notify",
descriptionKey: "questionnaire-lpa-to-notify-desc"
},
{
stageId: 846040032,
titleKey: "statements-representations-period",
descriptionKey: "statements-representations-period-desc"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc"
}
]),
COMMON_LAND: buildStages([
{
stageId: 846040042,
titleKey: "application-submitted",
descriptionKey: "application-submitted-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040024,
titleKey: "application-validated",
descriptionKey: "application-validated-desc"
},
{
stageId: 846040031,
titleKey: "application-start-case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040038,
titleKey: "applicant-statement-on-representations",
descriptionKey: "applicant-statement-on-representations-desc"
},
{
stageId: 846040039,
titleKey: "representatives-comment",
descriptionKey: "representatives-comment-desc"
},
{
stageId: 846040027,
titleKey: "applicants-final-comment",
descriptionKey: "applicants-final-comment-desc"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc"
},
{
stageId: 846040022,
titleKey: "decision-issued",
descriptionKey: "decision-issued-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
COMPULSORY_PURCHASE_ORDERS: buildStages([
{
stageId: 846040033,
titleKey: "order-submitted",
descriptionKey: "order-submitted-desc"
},
{
stageId: 846040040,
titleKey: "order-registered",
descriptionKey: "order-submission-registered-desc"
},
{
stageId: 846040041,
titleKey: "order-validated",
descriptionKey: "order-submission-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040019,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-cpo"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc-order"
},
{
stageId: 846040011,
titleKey: "report-to-ministers",
descriptionKey: "report-to-ministers-desc-cpo"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-order"
}
]),
ELECTRICITY_ACT: "PLANNING_S78",
HARBOUR_REVISION_ORDER: buildStages([
{
stageId: 846040033,
titleKey: "order-submitted",
descriptionKey: "order-submitted-desc"
},
{
stageId: 846040040,
titleKey: "order-registered",
descriptionKey: "order-submission-registered-desc"
},
{
stageId: 846040041,
titleKey: "order-validated",
descriptionKey: "order-submission-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "case-started-case-in-progress-desc"
},
{
stageId: 846040010,
titleKey: "statements",
descriptionKey: "statements-desc-order"
},
{
stageId: 846040055,
titleKey: "final-comments",
descriptionKey: "final-comments-desc-cpo"
},
{
stageId: 846040037,
titleKey: "event-site-visit",
descriptionKey: "event-site-visit-desc-order"
},
{
stageId: 846040056,
titleKey: "report-to-ministers",
descriptionKey: "report-to-ministers-desc-cpo"
},
{
stageId: 846040060,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-order"
}
]),
TRANSPORT_WORKS: "PLANNING_S78",
WAYLEAVE: buildStages([
{
stageId: 846040042,
titleKey: "application-submitted",
descriptionKey: "application-submitted-desc"
},
{
stageId: 846040043,
titleKey: "application-registered",
descriptionKey: "application-registered-desc"
},
{
stageId: 846040024,
titleKey: "application-validated",
descriptionKey: "application-validated-desc"
},
{
stageId: 1,
titleKey: "case-in-progress",
descriptionKey: "application-start-case-in-progress-desc"
},
{
stageId: 846040021,
titleKey: "site-visit",
descriptionKey: "site-visit-desc"
},
{
stageId: 846040044,
titleKey: "report-to-desnz",
descriptionKey: "report-to-desnz-desc"
},
{
stageId: 846040013,
titleKey: "case-closed",
descriptionKey: "case-closed-desc-application"
}
]),
NON_VALIDATION: buildStages([
{
stageId: 846040014,
titleKey: "appeal-submitted",
descriptionKey: "appeal-submitted-desc"
},
{
stageId: 846040015,
titleKey: "appeal-registered",
descriptionKey: "appeal-registered-desc"
},
{
stageId: 846040016,
titleKey: "appeal-validated",
descriptionKey: "appeal-validated-desc"
},
{
stageId: 846040045,
titleKey: "case-in-progress-assessment",
descriptionKey: "case-in-progress-desc"
},
{
stageId: 846040046,
titleKey: "decision-outcome",
descriptionKey: "decision-outcome-desc"
},
{
stageId: 846040060,
titleKey: "case-closed-nonval",
descriptionKey: "case-closed-desc"
}
])
};
export const caseTypeAliases = {
// Planning S78 group
S78: "PLANNING_S78",
PLANNING_78: "PLANNING_S78",
PLANNING_S78: "PLANNING_S78",
CONDITIONS_73_79: "CONDITIONS_73_79",
LBCAC: "LBCAC",
LDCS: "LDCS",
PLANNING_OBLIGATIONS_S106: "PLANNING_OBLIGATIONS_S106",
PRIOR_NOTIFICATION: "PRIOR_NOTIFICATION",
// Other types
HAS: "HAS",
CALL_INS: "CALL_INS",
CALL_IN: "CALL_INS",
ENFORCEMENT: "ENFORCEMENT",
ENFORCEMENT_LISTED_BUILDING: "ENFORCEMENT_LISTED_BUILDING",
MAINTENANCE_OF_LAND: "MAINTENANCE_OF_LAND",
RIGHTS_OF_WAY_SCHEDULE_14: "RIGHTS_OF_WAY_SCHEDULE_14",
RIGHTS_OF_WAY_ORDERS: "RIGHTS_OF_WAY_ORDERS",
REQUESTS_FOR_DIRECTION: "REQUESTS_FOR_DIRECTION",
ADVERTS: "ADVERTS",
HEDGEROW_TPO: "HEDGEROW_TPO",
COMMON_LAND: "COMMON_LAND",
COMPULSORY_PURCHASE_ORDERS: "COMPULSORY_PURCHASE_ORDERS",
ELECTRICITY_ACT: "ELECTRICITY_ACT",
HARBOUR_REVISION_ORDER: "HARBOUR_REVISION_ORDER",
TRANSPORT_WORKS: "TRANSPORT_WORKS",
WAYLEAVE: "WAYLEAVE",
NON_VALIDATION: "NON_VALIDATION",
DNS: "DNS",
SIP: "SIP"
};
const normaliseCaseType = (caseType) =>
caseType
?.toString()
.trim()
.toUpperCase()
.replace(/&/g, "AND")
.replace(/[^A-Z0-9]+/g, "_")
.replace(/^_|_$/g, "");
const resolveStages = (caseTypeOrAppealTypeId) => {
const appealTypeKey =
caseTypeKeyByAppealTypeId[Number(caseTypeOrAppealTypeId)];
const normalised = normaliseCaseType(caseTypeOrAppealTypeId);
const key = appealTypeKey || caseTypeAliases[normalised] || normalised;
const entry = stagesByCaseType[key];
if (!entry) return [];
if (typeof entry === "string") {
return stagesByCaseType[entry] || [];
}
return entry;
};
export const getStagesForAppealType = (caseType, currentStageId) => {
const stages = resolveStages(caseType);
const currentStageNumber = Number(currentStageId);
const currentIndex = stages.findIndex(
(stage) => Number(stage.stageId) === currentStageNumber
);
return stages.map((stage, index) => ({
...stage,
status:
currentIndex === -1
? "not-started"
: index < currentIndex
? "complete"
: index === currentIndex
? "in-progress"
: "not-started"
}));
};
export const caseTypeKeyByAppealTypeId = {
846040000: "PLANNING_S78",
846040001: "CONDITIONS_73_79",
846040002: "SIP",
846040003: "PLANNING_OBLIGATIONS_S106",
846040004: "HAS",
846040005: "ENFORCEMENT",
846040006: "ENFORCEMENT_LISTED_BUILDING",
846040007: "MAINTENANCE_OF_LAND",
846040008: "LDCS",
846040009: "PLANNING_S78",
846040010: "CALL_INS",
846040011: "DNS",
846040012: "ELECTRICITY_ACT",
846040013: "TRANSPORT_WORKS",
846040014: "HARBOUR_REVISION_ORDER",
846040015: "RIGHTS_OF_WAY_SCHEDULE_14",
846040016: "COMMON_LAND",
846040017: "HEDGEROW_TPO",
846040018: "ADVERTS",
846040019: "COMPULSORY_PURCHASE_ORDERS",
846040020: "PLANNING_S78",
846040021: "WAYLEAVE",
846040024: "NON_VALIDATION",
846040025: "LBCAC"
};
@@ -1,36 +0,0 @@
export function isEventLiveNow(item) {
if (!item?.pinswg_dateeventrequested) return false;
const now = new Date();
const start = new Date(item.pinswg_dateeventrequested);
if (isNaN(start.getTime())) return false;
const endDateValue =
item.pinswg_enddateofevent || item.pinswg_enddateoftheevent;
if (endDateValue) {
const end = new Date(endDateValue);
if (isNaN(end.getTime())) return false;
end.setHours(23, 59, 59, 999);
return now >= start && now <= end;
}
const endOfStartDay = new Date(start);
endOfStartDay.setHours(23, 59, 59, 999);
return now >= start && now <= endOfStartDay;
}
export function getLivePublishedEvent(eventsObj) {
const eventsArr = eventsObj?.value || [];
return eventsArr.find(
(item) =>
item.pinswg_eventpublishflag &&
item.pinswg_linktotheevent &&
isEventLiveNow(item)
);
}
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_advertsid = (props) => {
let { t } = useTranslation();
@@ -65,16 +64,20 @@ const Pinswg_advertsid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_callinss77id = (props) => {
let { t } = useTranslation();
@@ -44,16 +43,20 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_commonlandid = (props) => {
let { t } = useTranslation();
@@ -44,16 +43,20 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_communityinfrastructurelevyid = (props) => {
let { t } = useTranslation();
@@ -44,16 +43,20 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
+285 -168
View File
@@ -5,7 +5,6 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping/";
@@ -25,7 +24,7 @@ const Pinswg_dnsid = (props) => {
point = new OSPoint(
detailsObj.pinswg_anticipatedgridreferencenorthingtext,
detailsObj.pinswg_anticipatedgridreferenceeastingtext
detailsObj.pinswg_anticipatedgridreferenceeastingtext,
);
siteCoords = point.toOSGB36();
//console.log(siteCoords);
@@ -36,7 +35,7 @@ const Pinswg_dnsid = (props) => {
: parseFloat(siteCoords.latitude),
lng: isNaN(parseFloat(siteCoords.longitude))
? -3.437989
: parseFloat(siteCoords.longitude)
: parseFloat(siteCoords.longitude),
};
const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
@@ -59,7 +58,7 @@ const Pinswg_dnsid = (props) => {
<p className="govuk-body">
{getBilingualText(
detailsObj.pinswg_projectdescription,
router.locale
router.locale,
)}
</p>
</div>
@@ -68,7 +67,7 @@ const Pinswg_dnsid = (props) => {
<div
style={{
height: "40vh",
width: "100%"
width: "100%",
}}
>
<GoogleMapComponent
@@ -96,10 +95,11 @@ const Pinswg_dnsid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-case-type-label"
)}
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -109,23 +109,28 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
"case:summary-no-date-entered-label",
)
}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label",
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -133,7 +138,7 @@ const Pinswg_dnsid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: (
<a
@@ -141,7 +146,7 @@ const Pinswg_dnsid = (props) => {
rel="noreferrer"
href={
detailsObj.pinswg_webaddress.indexOf(
"https://"
"https://",
)
? "https://" +
detailsObj.pinswg_webaddress
@@ -154,31 +159,45 @@ const Pinswg_dnsid = (props) => {
</a>
) ||
t(
"case:summary-no-date-entered-label"
"case:summary-no-date-entered-label",
)
}
/>
)}
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label"
)}
"case:summary-eia-required-label",
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -186,21 +205,24 @@ const Pinswg_dnsid = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
transLookup,
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
"case:summary-to-be-confirmed-label",
)
}
/>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -210,15 +232,17 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
"case:summary-to-be-confirmed-label",
)
}
/>
{/* <SummaryRow
label={t("case:summary-status-label")}
@@ -253,10 +277,13 @@ const Pinswg_dnsid = (props) => {
}
/> */}
<SummaryRow
label={t(
"case:summary-type-of-event-label"
)}
"case:summary-type-of-event-label",
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -266,58 +293,68 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
"case:summary-start-event-date-label",
)}
value={
_.has(
detailsObj,
"pinswg_startdateofevent"
"pinswg_startdateofevent",
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
detailsObj.pinswg_startdateofevent,
)
? formatDates(
detailsObj.pinswg_startdateofevent
detailsObj.pinswg_startdateofevent,
)
: t(
"case:summary-no-information-to-date-label"
"case:summary-no-information-to-date-label",
)
: t(
"case:summary-no-information-to-date-label"
"case:summary-no-information-to-date-label",
)
}
/>
<SummaryRow
label={t(
"case:summary-event-date-label"
)}
label={t("case:summary-event-date-label")}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested"
"pinswg_dateeventrequested",
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
detailsObj.pinswg_dateeventrequested,
)
? formatDates(
detailsObj.pinswg_dateeventrequested
detailsObj.pinswg_dateeventrequested,
)
: t(
"case:summary-to-be-confirmed-label"
"case:summary-to-be-confirmed-label",
)
: t(
"case:summary-to-be-confirmed-label"
"case:summary-to-be-confirmed-label",
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -333,13 +370,13 @@ const Pinswg_dnsid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
"case:summary-no-information-to-date-label",
)}
<br />
@@ -352,49 +389,54 @@ const Pinswg_dnsid = (props) => {
</dd>
</div>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label",
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
"pinswg_dateofdecision",
)
? !_.isEmpty(
detailsObj.pinswg_dateofdecision
detailsObj.pinswg_dateofdecision,
)
? formatDates(
detailsObj.pinswg_dateofdecision
detailsObj.pinswg_dateofdecision,
)
: t(
"case:summary-no-information-to-date-label"
"case:summary-no-information-to-date-label",
)
: t(
"case:summary-no-information-to-date-label"
"case:summary-no-information-to-date-label",
)
}
/>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
"case:summary-case-link-status-label",
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents"
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
"case:summary-case-link-status-linked",
)
: t(
"case:summary-case-link-status-not-linked"
"case:summary-case-link-status-not-linked",
)
: t(
"case:summary-case-link-status-not-linked"
"case:summary-case-link-status-not-linked",
)}
</dd>
</div>
@@ -403,13 +445,13 @@ const Pinswg_dnsid = (props) => {
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
"case:summary-linked-cases-label",
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
.linkedCaseReferences,
)}
</dd>
</div>
@@ -467,305 +509,370 @@ const Pinswg_dnsid = (props) => {
}
/> */}
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice",
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
"pinswg_writtenacceptanceofnotification",
)
? !_.isEmpty(
detailsObj.pinswg_writtenacceptanceofnotification
detailsObj.pinswg_writtenacceptanceofnotification,
)
? formatDates(
detailsObj.pinswg_writtenacceptanceofnotification
detailsObj.pinswg_writtenacceptanceofnotification,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application",
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
"pinswg_deadlineforsubmissionofapplication",
)
? !_.isEmpty(
detailsObj.pinswg_deadlineforsubmissionofapplication
detailsObj.pinswg_deadlineforsubmissionofapplication,
)
? formatDates(
detailsObj.pinswg_deadlineforsubmissionofapplication
detailsObj.pinswg_deadlineforsubmissionofapplication,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application"
)}
"case:summary-date-of-submission-of-application",
)}
value={
_.has(
detailsObj,
"pinswg_dateofsubmissionofapplication"
"pinswg_dateofsubmissionofapplication",
)
? !_.isEmpty(
detailsObj.pinswg_dateofsubmissionofapplication
detailsObj.pinswg_dateofsubmissionofapplication,
)
? formatDates(
detailsObj.pinswg_dateofsubmissionofapplication
detailsObj.pinswg_dateofsubmissionofapplication,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
{_.has(
detailsObj,
"pinswg_applicationacceptedasvalid"
"pinswg_applicationacceptedasvalid",
) &&
!_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid
detailsObj.pinswg_applicationrejectedasinvalid,
) && (
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid"
)}
"case:summary-application-accepted-as-valid",
)}
value={
!_.isEmpty(
detailsObj.pinswg_applicationacceptedasvalid
detailsObj.pinswg_applicationacceptedasvalid,
)
? formatDates(
detailsObj.pinswg_applicationacceptedasvalid
detailsObj.pinswg_applicationacceptedasvalid,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
)}
{_.has(
detailsObj,
"pinswg_applicationrejectedasinvalid"
"pinswg_applicationrejectedasinvalid",
) &&
!_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid
detailsObj.pinswg_applicationrejectedasinvalid,
) && (
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid"
)}
"case:summary-application-rejected-as-invalid",
)}
value={
!_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid
detailsObj.pinswg_applicationrejectedasinvalid,
)
? formatDates(
detailsObj.pinswg_applicationrejectedasinvalid
detailsObj.pinswg_applicationrejectedasinvalid,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
)}
<SummaryRow
label={t(
"case:summary-end-of-representation-period"
)}
"case:summary-end-of-representation-period",
)}
value={
_.has(
detailsObj,
"pinswg_endofrepresentationperiod"
"pinswg_endofrepresentationperiod",
)
? !_.isEmpty(
detailsObj.pinswg_endofrepresentationperiod
detailsObj.pinswg_endofrepresentationperiod,
)
? formatDates(
detailsObj.pinswg_endofrepresentationperiod
detailsObj.pinswg_endofrepresentationperiod,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
{_.has(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
"pinswg_dateofrequesttovarytheapplication",
) &&
!_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication
detailsObj.pinswg_dateofrequesttovarytheapplication,
) && (
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary"
)}
"case:summary-date-of-request-to-vary",
)}
value={
!_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication
detailsObj.pinswg_dateofrequesttovarytheapplication,
)
? formatDates(
detailsObj.pinswg_dateofrequesttovarytheapplication
detailsObj.pinswg_dateofrequesttovarytheapplication,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
)}
{_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
"pinswg_confirmrequesttovaryapplication",
) &&
!_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication
detailsObj.pinswg_confirmrequesttovaryapplication,
) &&
(_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
"pinswg_rejectrequesttovaryapplication",
) &&
_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication
detailsObj.pinswg_rejectrequesttovaryapplication,
) ? (
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application"
)}
"case:summary-confirm-request-to-vary-application",
)}
value={
!_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication
detailsObj.pinswg_confirmrequesttovaryapplication,
)
? formatDates(
detailsObj.pinswg_confirmrequesttovaryapplication
detailsObj.pinswg_confirmrequesttovaryapplication,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
) : (
""
))}
{_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
"pinswg_rejectrequesttovaryapplication",
) &&
!_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication
detailsObj.pinswg_rejectrequesttovaryapplication,
) &&
(_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
"pinswg_confirmrequesttovaryapplication",
) &&
_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication
detailsObj.pinswg_confirmrequesttovaryapplication,
) ? (
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application"
)}
"case:summary-reject-request-to-vary-application",
)}
value={
!_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication
detailsObj.pinswg_rejectrequesttovaryapplication,
)
? formatDates(
detailsObj.pinswg_rejectrequesttovaryapplication
detailsObj.pinswg_rejectrequesttovaryapplication,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
) : (
""
))}
{_.has(
detailsObj,
"pinswg_suspensionstartdates"
"pinswg_suspensionstartdates",
) &&
!_.isEmpty(
detailsObj.pinswg_suspensionstartdates
detailsObj.pinswg_suspensionstartdates,
) && (
<SummaryRow
label={t(
"case:summary-suspension-start-dates"
)}
"case:summary-suspension-start-dates",
)}
value={
!_.isEmpty(
detailsObj.pinswg_suspensionstartdates
detailsObj.pinswg_suspensionstartdates,
)
? formatDates(
detailsObj.pinswg_suspensionstartdates
detailsObj.pinswg_suspensionstartdates,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
)}
<SummaryRow
label={t(
"case:summary-suspension-end-dates"
)}
"case:summary-suspension-end-dates",
)}
value={
_.has(
detailsObj,
"pinswg_suspensionenddates"
"pinswg_suspensionenddates",
)
? !_.isEmpty(
detailsObj.pinswg_suspensionenddates
detailsObj.pinswg_suspensionenddates,
)
? formatDates(
detailsObj.pinswg_suspensionenddates
detailsObj.pinswg_suspensionenddates,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
detailsObj,
"pinswg_reportdueby"
"pinswg_reportdueby",
)
? !_.isEmpty(
detailsObj.pinswg_reportdueby
detailsObj.pinswg_reportdueby,
)
? formatDates(
detailsObj.pinswg_reportdueby
detailsObj.pinswg_reportdueby,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
{/* <SummaryRow
label={t("case:summary-suspension-dates")}
@@ -789,50 +896,60 @@ const Pinswg_dnsid = (props) => {
}
/> */}
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
"case:summary-inspector-report-submission-to-welsh-government",
)}
value={
_.has(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
"pinswg_inspectorreportsubmittedtowelshgovernment",
)
? !_.isEmpty(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment,
)
? formatDates(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
{_.has(
detailsObj,
"pinswg_withdrawndate"
"pinswg_withdrawndate",
) &&
!_.isEmpty(
detailsObj.pinswg_withdrawndate
detailsObj.pinswg_withdrawndate,
) && (
<SummaryRow
label={t(
"case:summary-withdrawn-date"
)}
"case:summary-withdrawn-date",
)}
value={
!_.isEmpty(
detailsObj.pinswg_withdrawndate
detailsObj.pinswg_withdrawndate,
)
? formatDates(
detailsObj.pinswg_withdrawndate
detailsObj.pinswg_withdrawndate,
)
: t(
"case:summary-awaiting-information-label"
"case:summary-awaiting-information-label",
)
}
/>
)}
</dl>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_electricityactid = (props) => {
let { t } = useTranslation();
@@ -63,10 +62,11 @@ const Pinswg_electricityactid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-case-type-label"
)}
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -76,7 +76,7 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,28 +84,42 @@ const Pinswg_electricityactid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label"
)}
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -121,7 +135,9 @@ const Pinswg_electricityactid = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -141,10 +157,11 @@ const Pinswg_electricityactid = (props) => {
</dd>
</div>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -154,18 +171,23 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-type-of-event-label"
)}
"case:summary-type-of-event-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -175,16 +197,21 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -194,7 +221,7 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -202,7 +229,9 @@ const Pinswg_electricityactid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -218,7 +247,7 @@ const Pinswg_electricityactid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -245,7 +274,7 @@ const Pinswg_electricityactid = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents"
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
@@ -279,10 +308,13 @@ const Pinswg_electricityactid = (props) => {
""
)}
<SummaryRow
label={t(
"case:summary-case-recommendation-label"
)}
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -290,20 +322,25 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj.pinswg_recommendation ||
t(
"case:summary-no-date-entered-label"
)
}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -311,13 +348,15 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
</dl>
@@ -332,10 +371,11 @@ const Pinswg_electricityactid = (props) => {
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-event-date-label"
)}
label={t("case:summary-event-date-label")}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested"
@@ -352,13 +392,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_casedecisiondate"
@@ -375,14 +420,22 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid"
)}
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationacceptedasvalid"
@@ -399,13 +452,20 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid"
)}
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationrejectedasinvalid"
@@ -422,13 +482,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application"
)}
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
@@ -445,13 +510,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-decisions"
)}
"case:summary-date-of-decisions"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
@@ -468,13 +538,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary"
)}
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
@@ -491,13 +566,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application"
)}
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_dateofsubmissionofapplication"
@@ -514,13 +594,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-project-published-to-website"
)}
"case:summary-date-project-published-to-website"
)}
value={
_.has(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
@@ -537,13 +622,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
@@ -560,13 +650,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-end-of-representation-period"
)}
"case:summary-end-of-representation-period"
)}
value={
_.has(
detailsObj,
"pinswg_endofrepresentationperiod"
@@ -583,13 +678,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -606,13 +706,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-procedure-confirmed"
)}
"case:summary-procedure-confirmed"
)}
value={
_.has(
detailsObj,
"pinswg_procedureconfirmed"
@@ -629,13 +734,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application"
)}
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
@@ -652,11 +762,16 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
detailsObj,
"pinswg_reportdueby"
@@ -673,13 +788,16 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-dates"
)}
label={t("case:summary-suspension-dates")}
value={
_.has(
detailsObj,
"pinswg_suspensiondates"
@@ -696,13 +814,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-end-dates"
)}
"case:summary-suspension-end-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionenddates"
@@ -719,13 +842,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-start-dates"
)}
"case:summary-suspension-start-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionstartdates"
@@ -742,13 +870,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -765,11 +898,16 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
detailsObj,
"pinswg_withdrawndate"
@@ -786,13 +924,18 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
@@ -809,7 +952,9 @@ const Pinswg_electricityactid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementlistedbuildingconseid = (props) => {
let { t } = useTranslation();
@@ -44,16 +43,20 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementnoticeappeals174id = (props) => {
let { t } = useTranslation();
@@ -21,184 +20,208 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -206,119 +229,164 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -339,56 +407,79 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_environmentalpermittingid = (props) => {
let { t } = useTranslation();
@@ -21,209 +20,236 @@ const Pinswg_environmentalpermittingid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -231,119 +257,164 @@ const Pinswg_environmentalpermittingid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -364,56 +435,79 @@ const Pinswg_environmentalpermittingid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_harbourrevisionorderid = (props) => {
let { t } = useTranslation();
@@ -63,10 +62,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-case-type-label"
)}
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -76,7 +76,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,28 +84,42 @@ const Pinswg_harbourrevisionorderid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t(
"case:summary-eia-required-label"
)}
"case:summary-eia-required-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -121,7 +135,9 @@ const Pinswg_harbourrevisionorderid = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -141,10 +157,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dd>
</div>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -154,16 +171,21 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -173,7 +195,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -181,7 +203,9 @@ const Pinswg_harbourrevisionorderid = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -197,7 +221,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -224,7 +248,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents"
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
@@ -258,10 +282,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
""
)}
<SummaryRow
label={t(
"case:summary-case-recommendation-label"
)}
"case:summary-case-recommendation-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -269,20 +296,25 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_recommendation +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj.pinswg_recommendation ||
t(
"case:summary-no-date-entered-label"
)
}
/>
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -290,13 +322,15 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_webaddress +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: detailsObj.pinswg_webaddress ||
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
</dl>
@@ -311,10 +345,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-event-date-label"
)}
label={t("case:summary-event-date-label")}
value={
_.has(
detailsObj,
"pinswg_dateeventrequested"
@@ -331,13 +366,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_casedecisiondate"
@@ -354,14 +394,22 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-accepted-as-valid"
)}
"case:summary-application-accepted-as-valid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationacceptedasvalid"
@@ -378,13 +426,20 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-application-rejected-as-invalid"
)}
"case:summary-application-rejected-as-invalid"
)}
value={
_.has(
detailsObj,
"pinswg_applicationrejectedasinvalid"
@@ -401,13 +456,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-confirm-request-to-vary-application"
)}
"case:summary-confirm-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_confirmrequesttovaryapplication"
@@ -424,13 +484,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-decisions"
)}
"case:summary-date-of-decisions"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
@@ -447,13 +512,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-request-to-vary"
)}
"case:summary-date-of-request-to-vary"
)}
value={
_.has(
detailsObj,
"pinswg_dateofrequesttovarytheapplication"
@@ -470,13 +540,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-of-submission-of-application"
)}
"case:summary-date-of-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_dateofsubmissionofapplication"
@@ -493,13 +568,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-date-project-published-to-website"
)}
"case:summary-date-project-published-to-website"
)}
value={
_.has(
detailsObj,
"pinswg_dateprojectpublishedonwebsite"
@@ -516,13 +596,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
@@ -539,13 +624,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-end-of-representation-period"
)}
"case:summary-end-of-representation-period"
)}
value={
_.has(
detailsObj,
"pinswg_endofrepresentationperiod"
@@ -562,13 +652,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-inspector-report-submission-to-welsh-government"
)}
"case:summary-inspector-report-submission-to-welsh-government"
)}
value={
_.has(
detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -585,13 +680,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-procedure-confirmed"
)}
"case:summary-procedure-confirmed"
)}
value={
_.has(
detailsObj,
"pinswg_procedureconfirmed"
@@ -608,13 +708,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-reject-request-to-vary-application"
)}
"case:summary-reject-request-to-vary-application"
)}
value={
_.has(
detailsObj,
"pinswg_rejectrequesttovaryapplication"
@@ -631,11 +736,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-report-due-by")}
value={
_.has(
detailsObj,
"pinswg_reportdueby"
@@ -652,13 +762,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-dates"
)}
label={t("case:summary-suspension-dates")}
value={
_.has(
detailsObj,
"pinswg_suspensiondates"
@@ -675,13 +788,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-end-dates"
)}
"case:summary-suspension-end-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionenddates"
@@ -698,13 +816,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-suspension-start-dates"
)}
"case:summary-suspension-start-dates"
)}
value={
_.has(
detailsObj,
"pinswg_suspensionstartdates"
@@ -721,13 +844,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -744,11 +872,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-withdrawn-date")}
value={
_.has(
detailsObj,
"pinswg_withdrawndate"
@@ -765,13 +898,18 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
@@ -788,7 +926,9 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
let { t } = useTranslation();
@@ -21,230 +20,264 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
] ||
t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
/>
<SummaryRow
label={"Specialist Case Process"}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
] || ""}
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] ||
t(
"case:summary-to-be-confirmed-label"
)}
<br />
{/* <Link href="/">
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -252,119 +285,164 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -385,56 +463,79 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_householderappealhasid = (props) => {
let { t } = useTranslation();
@@ -44,16 +43,20 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
let { t } = useTranslation();
@@ -21,184 +20,208 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -206,119 +229,164 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -339,56 +407,79 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
+400 -309
View File
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_ldpid = (props) => {
let { t } = useTranslation();
@@ -21,167 +20,191 @@ const Pinswg_ldpid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
] ||
t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] || ""}
<br />
{/* <Link href="/">
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -189,119 +212,164 @@ const Pinswg_ldpid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -322,56 +390,79 @@ const Pinswg_ldpid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_listedbuildingandconservationrid = (props) => {
let { t } = useTranslation();
@@ -21,184 +20,208 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -206,119 +229,164 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -339,56 +407,79 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_starttimeofevent")
? !_.isEmpty(
detailsObj.pinswg_starttimeofevent
)
? formatDates(
detailsObj.pinswg_starttimeofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_starttimeofevent"
)
? !_.isEmpty(
detailsObj.pinswg_starttimeofevent
)
? formatDates(
detailsObj.pinswg_starttimeofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_maintenanceoflands217id = (props) => {
let { t } = useTranslation();
@@ -21,184 +20,208 @@ const Pinswg_maintenanceoflands217id = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -206,119 +229,164 @@ const Pinswg_maintenanceoflands217id = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -339,56 +407,79 @@ const Pinswg_maintenanceoflands217id = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_miscellaneouscasewordid = (props) => {
let { t } = useTranslation();
@@ -21,209 +20,236 @@ const Pinswg_miscellaneouscasewordid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -231,119 +257,164 @@ const Pinswg_miscellaneouscasewordid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -364,56 +435,79 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_nonvalidationid = (props) => {
let { t } = useTranslation();
@@ -21,95 +20,136 @@ const Pinswg_nonvalidationid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
] ||
t(
"case:summary-no-date-entered-label"
)
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
{/* <SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/> */}
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] ||
t(
"case:summary-no-date-entered-label"
)
<br />
{/* <Link href="/">
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
</dl>
</dd>
</div>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -117,46 +157,75 @@ const Pinswg_nonvalidationid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_validdate")
? !_.isEmpty(detailsObj.pinswg_validdate)
? formatDates(
detailsObj.pinswg_validdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_decisionissueddate")
? !_.isEmpty(
detailsObj.pinswg_decisionissueddate
)
? formatDates(
detailsObj.pinswg_decisionissueddate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_validdate")
? !_.isEmpty(
detailsObj.pinswg_validdate
)
? formatDates(
detailsObj.pinswg_validdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(
detailsObj,
"pinswg_decisionissueddate"
)
? !_.isEmpty(
detailsObj.pinswg_decisionissueddate
)
? formatDates(
detailsObj.pinswg_decisionissueddate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)
}
/>
</dl>
</SummaryCard>
</div>
</div>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayValue, getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningappeals78id = (props) => {
let { t } = useTranslation();
@@ -42,23 +41,35 @@ const Pinswg_planningappeals78id = (props) => {
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -72,11 +83,16 @@ const Pinswg_planningappeals78id = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -91,11 +107,16 @@ const Pinswg_planningappeals78id = (props) => {
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -113,11 +134,16 @@ const Pinswg_planningappeals78id = (props) => {
t(
"case:summary-no-information-to-date-label"
)
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -133,7 +159,9 @@ const Pinswg_planningappeals78id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -168,8 +196,11 @@ const Pinswg_planningappeals78id = (props) => {
</dd>
</div>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
@@ -181,7 +212,9 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
@@ -226,8 +259,11 @@ const Pinswg_planningappeals78id = (props) => {
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
@@ -245,15 +281,24 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
label={t("case:summary-questionnaire-due-date-label")}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -264,14 +309,24 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-statement-interested-party-due-date-label"
)}
"case:summary-statement-interested-party-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
@@ -283,7 +338,11 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
@@ -324,9 +383,18 @@ const Pinswg_planningappeals78id = (props) => {
/> */}
<SummaryRow
label={t("case:summary-final-comments-date-label")}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -337,7 +405,11 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
@@ -385,8 +457,14 @@ const Pinswg_planningappeals78id = (props) => {
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(
detailsObj,
"pinswg_startdatetimeiftheevent"
@@ -401,15 +479,22 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{detailsObj.pinswg_typeofevent == 846040002 ||
detailsObj.pinswg_typeofevent == 846040007 ||
detailsObj.pinswg_typeofevent == 846040012 ||
detailsObj.pinswg_typeofevent == 846040009 ? (
<SummaryRow
label={t("case:summary-start-event-time-label")}
value={
_.has(
detailsObj,
"pinswg_startdatetimeiftheevent"
@@ -427,7 +512,9 @@ const Pinswg_planningappeals78id = (props) => {
: t(
"case:summary-no-date-entered-label"
)
}
/>
) : (
""
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningconditionss73s79id = (props) => {
let { t } = useTranslation();
@@ -42,23 +41,35 @@ const Pinswg_planningconditionss73s79id = (props) => {
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -72,11 +83,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -91,11 +107,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -110,11 +131,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
@@ -130,7 +156,9 @@ const Pinswg_planningconditionss73s79id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
@@ -207,8 +235,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
@@ -226,15 +257,24 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
label={t("case:summary-questionnaire-due-date-label")}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
@@ -245,12 +285,22 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
@@ -262,14 +312,22 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
label={t("case:summary-interested-party-date-label")}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
@@ -297,15 +355,28 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
@@ -316,7 +387,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
label={t(
@@ -342,8 +417,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
@@ -355,12 +433,20 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
@@ -372,11 +458,18 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
@@ -388,7 +481,9 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
</SummaryCard>
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningobligationappeals106id = (props) => {
let { t } = useTranslation();
@@ -21,184 +20,208 @@ const Pinswg_planningobligationappeals106id = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -206,119 +229,164 @@ const Pinswg_planningobligationappeals106id = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -339,56 +407,79 @@ const Pinswg_planningobligationappeals106id = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
+471 -370
View File
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_rowid = (props) => {
let { t } = useTranslation();
@@ -21,230 +20,264 @@ const Pinswg_rowid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
<SummaryRow
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
] ||
t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={"Specialist Case Process"}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
/>
<SummaryRow
label={"Specialist Case Process"}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
] || ""}
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
] ||
t(
"case:summary-to-be-confirmed-label"
)}
<br />
{/* <Link href="/">
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -252,119 +285,164 @@ const Pinswg_rowid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -385,56 +463,79 @@ const Pinswg_rowid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateoftheevent")
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent
)
? formatDates(
detailsObj.pinswg_startdateoftheevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
+140 -102
View File
@@ -5,7 +5,6 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping";
@@ -29,15 +28,6 @@ const Pinswg_sipscase = (props) => {
);
}
const extensions =
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips || [];
const latest = extensions.sort(
(a, b) =>
new Date(b.pinswg_newcasedeadline) -
new Date(a.pinswg_newcasedeadline)
)[0];
return (
<>
{detailsObj.pinswg_projectdescription != null ? (
@@ -96,10 +86,11 @@ const Pinswg_sipscase = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-case-type-label"
)}
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -115,7 +106,9 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
{hasValidKey(
@@ -123,8 +116,11 @@ const Pinswg_sipscase = (props) => {
"_pinswg_projecttype_value"
) && (
<SummaryRow
label={"Project Type"}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -140,16 +136,21 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
{detailsObj.pinswg_webaddress != null && (
<SummaryRow
label={t(
"case:summary-case-website-label"
)}
"case:summary-case-website-label"
)}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -178,7 +179,9 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-no-date-entered-label"
)
}
/>
)}
{/* <div className="govuk-summary-list__row">
@@ -187,26 +190,32 @@ const Pinswg_sipscase = (props) => {
</dt>
<dd className="govuk-summary-list__value"></dd>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-lpa-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -222,11 +231,16 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<SummaryRow
label={"ES Submitted"}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -242,13 +256,16 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
<SummaryRow
label={
"Deemed Marine License Applied for"
}
label={"Deemed Marine License Applied for"}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
@@ -264,7 +281,9 @@ const Pinswg_sipscase = (props) => {
t(
"case:summary-to-be-confirmed-label"
)
}
/>
{/* <SummaryRow
@@ -403,10 +422,13 @@ const Pinswg_sipscase = (props) => {
</dd>
</div>
<SummaryRow
label={t(
"case:summary-decision-date-label"
)}
"case:summary-decision-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_dateofdecision"
@@ -423,7 +445,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-no-information-to-date-label"
)
}
/>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
@@ -494,58 +518,20 @@ const Pinswg_sipscase = (props) => {
<h3 className="govuk-heading-m govuk-!-margin-bottom-7">
{t("case:summary-dates-label")}
</h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={"Case deadline"}
value={(() => {
const fallback = t(
"case:summary-awaiting-information-label"
);
const extensions =
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips ||
[];
const latestExtension =
extensions
.filter(
(extension) =>
!_.isEmpty(
extension.pinswg_newcasedeadline
)
)
.sort(
(a, b) =>
new Date(
b.pinswg_newcasedeadline
) -
new Date(
a.pinswg_newcasedeadline
)
)[0];
const dateToDisplay =
latestExtension
? latestExtension.pinswg_newcasedeadline
: detailsObj.pinswg_casedeadline;
return !_.isEmpty(dateToDisplay)
? formatDates(dateToDisplay)
: fallback;
})()}
/>
</dl>
<h4 className="govuk-heading-s">
<h4 className="govuk-heading-s ">
{t(
"case:summary-pre-submission-sub-title"
)}
</h4>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
"case:summary-valid-notice-of-intention-to-submit-an-application"
)}
value={
_.has(
detailsObj,
"pinswg_validnoticeofintentiontosubmit"
@@ -562,13 +548,18 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-written-acceptance-of-notice"
)}
"case:summary-written-acceptance-of-notice"
)}
value={
_.has(
detailsObj,
"pinswg_writtenacceptanceofnotification"
@@ -585,13 +576,18 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
<SummaryRow
label={t(
"case:summary-deadline-for-submission-of-application"
)}
"case:summary-deadline-for-submission-of-application"
)}
value={
_.has(
detailsObj,
"pinswg_deadlineforsubmissionofapplication"
@@ -608,7 +604,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
</dl>
</div>
@@ -637,10 +635,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_validationdeadlineextension"
) && (
<SummaryRow
label={t(
"case:summary-validation-deadline-extension"
)}
"case:summary-validation-deadline-extension"
)}
value={
_.has(
detailsObj,
"pinswg_validationdeadlineextension"
@@ -657,7 +658,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -665,10 +668,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionstartdate"
) && (
<SummaryRow
label={t(
"case:summary-case-suspension-start-date"
)}
"case:summary-case-suspension-start-date"
)}
value={
_.has(
detailsObj,
"pinswg_casesuspensionstartdate"
@@ -685,7 +691,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -693,10 +701,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionenddate"
) && (
<SummaryRow
label={t(
"case:summary-case-suspension-end-date"
)}
"case:summary-case-suspension-end-date"
)}
value={
_.has(
detailsObj,
"pinswg_casesuspensionenddate"
@@ -713,7 +724,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
@@ -744,10 +757,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_reportissuedtowelshministers"
) && (
<SummaryRow
label={t(
"case:summary-report-issued-to-welsh-ministers"
)}
"case:summary-report-issued-to-welsh-ministers"
)}
value={
_.has(
detailsObj,
"pinswg_reportissuedtowelshministers"
@@ -764,7 +780,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -772,10 +790,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionissuedtoapplicant"
) && (
<SummaryRow
label={t(
"case:summary-decision-issued-to-applicant"
)}
"case:summary-decision-issued-to-applicant"
)}
value={
_.has(
detailsObj,
"pinswg_decisionissuedtoapplicant"
@@ -792,7 +813,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -800,10 +823,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionoutcome"
) && (
<SummaryRow
label={t(
"case:summary-decision-outcome"
)}
"case:summary-decision-outcome"
)}
value={
_.has(
detailsObj,
"pinswg_decisionoutcome"
@@ -820,7 +846,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
@@ -844,10 +872,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_redetermination"
) && (
<SummaryRow
label={t(
"case:summary-post-decision-redetermination-label"
)}
"case:summary-post-decision-redetermination-label"
)}
value={
_.has(
detailsObj,
"pinswg_redetermination@OData.Community.Display.V1.FormattedValue"
@@ -866,7 +897,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
{hasValidKey(
@@ -874,10 +907,13 @@ const Pinswg_sipscase = (props) => {
"pinswg_redeterminationconsultationdeadline"
) && (
<SummaryRow
label={t(
"case:summary-post-decision-redetermination-deadline-label"
)}
"case:summary-post-decision-redetermination-deadline-label"
)}
value={
_.has(
detailsObj,
"pinswg_redeterminationconsultationdeadline"
@@ -894,7 +930,9 @@ const Pinswg_sipscase = (props) => {
: t(
"case:summary-awaiting-information-label"
)
}
/>
)}
</dl>
+448 -354
View File
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_wayleaveid = (props) => {
let { t } = useTranslation();
@@ -21,209 +20,236 @@ const Pinswg_wayleaveid = (props) => {
title={t("case:summary-case-details-label")}
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-case-type-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-to-be-confirmed-label")
}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""
}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t("case:summary-no-date-entered-label")
}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<SummaryRow
<br />
{/* <Link href="/">
label={t("case:summary-case-type-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-lpa-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-eia-required-label")}
value={router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-to-be-confirmed-label"
)}
/>
<SummaryRow
label={t("case:summary-procedure-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-type-of-event-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""}
/>
<SummaryRow
label={t("case:summary-status-label")}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-date-entered-label"
)}
/>
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-decision-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] ||
t(
"case:summary-no-information-to-date-label"
)}
<br />
{/* <Link href="/">
<a>
{casesObj.caseDetails
.outcome_document || ""}
</a>
</Link> */}
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-case-link-status-label")}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, ["numberofchildincidents"])
? casesObj.numberofchildincidents > 0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-linked-cases-label")}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={
router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true
}) ||
t("case:summary-no-date-entered-label")
}
/>
</dl>
</dd>
</div>
{casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-case-link-status-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{_.has(casesObj, [
"numberofchildincidents",
])
? casesObj.numberofchildincidents >
0
? t(
"case:summary-case-link-status-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)
: t(
"case:summary-case-link-status-not-linked"
)}
</dd>
</div>
)}
{casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t(
"case:summary-linked-cases-label"
)}
</dt>
<dd className="govuk-summary-list__value">
{linkedCasesList(
props.currentView
.linkedCaseReferences
)}
</dd>
</div>
) : (
""
)}
<SummaryRow
label={t(
"case:summary-case-relevant-authoritylabel"
)}
value={router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value_cy',
json: transLookup,
eval: true,
})
: jsonpath({
path:
'$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value',
json: transLookup,
eval: true,
}) ||
t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
<SummaryCard
id="key-dates-card"
@@ -231,119 +257,164 @@ const Pinswg_wayleaveid = (props) => {
headingTag="h3"
>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow
label={t("case:summary-start-date-label")}
value={
_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(detailsObj, "pinswg_startdates")
? !_.isEmpty(detailsObj.pinswg_startdates)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
label={t("case:summary-start-date-label")}
<SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
_.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
value={_.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(
detailsObj.pinswg_startdate
)
? formatDates(
detailsObj.pinswg_startdate
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates(
detailsObj.pinswg_startdates
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={
_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
/>
<SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatements"
"pinswg_questionnaireduedate"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate
)
? formatDates(
detailsObj.pinswg_questionnaireduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
{/* <SummaryRow
/>
<SummaryRow
label={t(
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty(
detailsObj.pinswg_statementduedate
)
? formatDates(
detailsObj.pinswg_statementduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-interested-party-date-label"
)}
value={_.has(
detailsObj,
"pinswg_otherpartiesstatement"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatement
)
? formatDates(
detailsObj.pinswg_otherpartiesstatement
)
: t(
"case:summary-no-date-entered-label"
)
: _.has(
detailsObj,
"pinswg_otherpartiesstatements"
)
? !_.isEmpty(
detailsObj.pinswg_otherpartiesstatements
)
? formatDates(
detailsObj.pinswg_otherpartiesstatements
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-applicant-final-comments-date-label"
)}
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate
)
? formatDates(
detailsObj.pinswg_finalcommentsduedate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
{/* <SummaryRow
label={t(
"case:summary-inquiry-evidence-date-label"
)}
@@ -364,56 +435,79 @@ const Pinswg_wayleaveid = (props) => {
"case:summary-no-date-entered-label"
)}
/> */}
<SummaryRow
label={t("case:summary-event-date-label")}
value={
_.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
<SummaryRow
label={t("case:summary-start-event-date-label")}
value={
_.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={
_.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t("case:summary-no-date-entered-label")
}
/>
</dl>
label={t("case:summary-event-date-label")}
value={_.has(
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty(
detailsObj.pinswg_dateeventrequested
)
? formatDates(
detailsObj.pinswg_dateeventrequested
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t(
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty(
detailsObj.pinswg_startdateofevent
)
? formatDates(
detailsObj.pinswg_startdateofevent
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
<SummaryRow
label={t("case:summary-decision-date-label")}
value={_.has(
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty(
detailsObj.pinswg_casedecisiondate
)
? formatDates(
detailsObj.pinswg_casedecisiondate
)
: t(
"case:summary-no-date-entered-label"
)
: t(
"case:summary-no-date-entered-label"
)}
/>
</dl>
</SummaryCard>
</div>
</div>
+4 -3
View File
@@ -2,12 +2,12 @@ import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { destroyCookie, setCookie } from "nookies";
import { setCookie } from "nookies";
import { connect } from "react-redux";
import Banner from "../components/banner";
import { setLogout } from "../store/accountDetails/action";
import { performPortalSignOut } from "../lib/auth/sessionClient";
import { logoutClient } from "../lib/auth/logoutClient";
const Header = (props) => {
let { t, lang } = useTranslation();
@@ -84,7 +84,8 @@ const Header = (props) => {
}
const handleLogout = () => {
performPortalSignOut(locale);
console.info("////////////\n" + "logout" + "\n////////////");
logoutClient(locale);
};
//const switchLocale = locale === "en" ? "cy" : "en";
+10 -2
View File
@@ -2,6 +2,7 @@ import { signOut } from "next-auth/react";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { destroyCookie } from "nookies";
import TimeOut from "../components/timeout";
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
@@ -16,7 +17,6 @@ import MySubmittedReps from "./myportal/mysubmittedrepresentations";
import ServiceBanner from "./myportal/servicebanner";
import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../data/lookuptranslations.json";
import { performPortalSignOut } from "../lib/auth/sessionClient";
const MyPortal = (props) => {
const { showFileUpload, showLoginCheck, docsOffline } = props;
@@ -26,7 +26,15 @@ const MyPortal = (props) => {
const { locale } = router;
const handleLogout = () => {
performPortalSignOut({ locale, signOutFn: signOut });
console.info("////////////\n" + "logout" + "\n////////////");
(window.localStorage.clear(),
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
destroyCookie(null, "pedw_locale", { path: "/" }),
destroyCookie(null, "pinsUser", { path: "/" }),
signOut({
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout"
}));
};
const isLPA =
@@ -353,8 +353,8 @@ const AwaitingSubmissionFromBlob = (props) => {
<h3 className="heading-small card-heading">
{t("myportal:awatitingsubmission-card-title")}
</h3>
<TopThreeRow />
<TopThreeRow />
{props.awaitingSubmissionFromBlob["@odata.count"] > 1 && (
<div className="cardVieAll">
<Link
+2 -2
View File
@@ -44,7 +44,7 @@ const MyRepresentations = (props) => {
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations"
"viewKey": "myRepresentations",
});
}}
>
@@ -65,7 +65,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
}
},
};
};
@@ -43,7 +43,7 @@ const MyRepresentations = (props) => {
onClick={() => {
setCurrentView({
"viewName": "My Representations",
"viewKey": "myRepresentations"
"viewKey": "myRepresentations",
});
}}
>
@@ -64,7 +64,7 @@ const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
dispatch(setCurrentView(currentView));
}
},
};
};
+3 -12
View File
@@ -1,24 +1,15 @@
import useTranslation from "next-translate/useTranslation";
import router from "next/router";
import Link from "next/link";
import { performPortalSignOut } from "../../lib/auth/sessionClient";
import { logoutClient } from "../../lib/auth/logoutClient";
const ServiceBanner = (props) => {
props = props.props;
let { t, lang } = useTranslation();
const signInButton = () => {
router.push(
`${
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
}?callbackUrl=${encodeURIComponent(
window.location.href
)}&error=EmailSignin`
);
};
const handleLogout = (locale) => {
performPortalSignOut(locale);
console.info("////////////\n" + "logout" + "\n////////////");
logoutClient(locale);
};
const portalLogoLink = [
-2
View File
@@ -314,8 +314,6 @@ const TopThree = (props) => {
]
),
setCurrentReference({
"statuscode":
showTopThreeArr[key].statuscode,
"ticketnumber":
showTopThreeArr[key]
.ticketnumber,
+2 -8
View File
@@ -218,8 +218,6 @@ const TopThree = (props) => {
data-id={index}
onClick={() => {
setCurrentReference({
"statuscode":
showTopThreeArr[key].statuscode,
"ticketnumber":
showTopThreeArr[key].ticketnumber,
"currentReference":
@@ -238,12 +236,8 @@ const TopThree = (props) => {
? "/fymhorth/representation"
: "/myportal/representation",
query: {
case:
showTopThreeArr[key]
.ticketnumber ||
showTopThreeArr[key].caseRef ||
showTopThreeArr[key]
.pinswg_name,
case: showTopThreeArr[key]
.ticketnumber,
state: "edit",
created:
showTopThreeArr[key]
+13 -11
View File
@@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { parseCookies } from "nookies";
import { useState } from "react";
import { useCallback, useState } from "react";
import { connect } from "react-redux";
import {
deleteAwaitingSubmissionsFromBlob,
@@ -98,7 +98,7 @@ const ViewAllResults = (props) => {
const isWatchedCases = currentViewKey === "watchedCases";
const isMyCases = currentViewKey === "myCases";
const resultsArr = isAwaitingSubmissionDetails
var resultsArr = isAwaitingSubmissionDetails
? props["awaitingSubmission"].awaitingSubmissionDetails.case
: isMySubmittedReps
? props[currentViewKey][currentViewKey]
@@ -286,7 +286,6 @@ const ViewAllResults = (props) => {
}
setCurrentReference({
"statuscode": item.statuscode ?? null,
ticketnumber: item.ticketnumber,
currentReference: getCurrentReference(item),
currentType: currentViewKey,
@@ -452,10 +451,10 @@ const ViewAllResults = (props) => {
const renderLineBreak = valueToDisplay && idx < 4; // Only insert <br> if it's not the last element
return (
<span key={`${field}-${idx}`}>
<>
{valueToDisplay}
{renderLineBreak && <br />}
</span>
</>
);
})}
</dd>
@@ -845,12 +844,15 @@ const ViewAllResults = (props) => {
//setShowSpinnerState(true);
};
const getSearchPageResults = (pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber);
//console.log(pageNumber, orderBy, fieldSort);
resultsArr.sort(dynamicSort(orderBy, fieldSort));
//console.log(resultsArr);
};
const getSearchPageResults = useCallback(
(pageNumber, orderBy, fieldSort) => {
//console.log(advancedSearch, searchString, pageNumber);
//console.log(pageNumber, orderBy, fieldSort);
resultsArr.sort(dynamicSort(orderBy, fieldSort));
//console.log(resultsArr);
},
[selectedOption]
);
function dynamicSort(property, order) {
var sort_order = 1;
+2 -39
View File
@@ -452,14 +452,6 @@ let AboutYou = (props) => {
const isAgentSelected = appellantAgentValue == "846040001";
const isAppellantSelected = appellantAgentValue == "846040000";
console.log(
"================",
props.initialValues.pinswg_typeofinvolvement
);
//props.initialValues.pinswg_typeofinvolvement === 846040000 &&
// setIsAgent(true);
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
const appellantAgent = isWelsh
? ["Apelydd", "Asiant"]
@@ -507,14 +499,11 @@ let AboutYou = (props) => {
if (isAgentSelected && isAgent == false) {
updateField("caseForm", "pinswg_appellantfirstname", "");
updateField("caseForm", "pinswg_appellantlastname", "");
updateField("caseForm", "company", "");
updateField("caseForm", "pinswg_appellantemailaddress", "");
updateField("caseForm", "pinswg_appellantaddress", "");
updateField("caseForm", "pinswg_appellantphonenumber", "");
setIsAgent(true);
}
//else {
} //else {
// updateField(
// "caseForm",
// "pinswg_appellantfirstname",
@@ -613,17 +602,6 @@ let AboutYou = (props) => {
)}
maxFieldLength="200"
/>
<Field
name={"pinswg_appellantcompany"}
id={"pinswg_appellantcompany"}
component={RenderTextfield}
type="text"
className="govuk-input govuk-input--width-20"
label={t(
"newappeal:about-you-agent-contact-details-companyname-label"
)}
maxFieldLength="200"
/>
<Field
name={"pinswg_appellantaddress"}
id={"pinswg_appellantaddress"}
@@ -911,27 +889,12 @@ const mapStateToProps = (state) => {
state.accountDetails.accountDetails.firstname,
pinswg_appellantlastname:
state.accountDetails.accountDetails.lastname,
pinswg_appellantcompany:
state.accountDetails.accountDetails.pinswg_companyname,
pinswg_appellantemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_appellantaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_appellantphonenumber:
state.accountDetails.accountDetails.telephone1,
pinswg_agentcompanyname:
state.accountDetails.accountDetails.pinswg_companyname,
pinswg_agentfirstname:
state.accountDetails.accountDetails.firstname,
pinswg_agentlastname: state.accountDetails.accountDetails.lastname,
pinswg_agentemailaddress:
state.accountDetails.accountDetails.emailaddress1,
pinswg_agentaddress:
state.accountDetails.accountDetails.address1_composite,
pinswg_agentphonenumber:
state.accountDetails.accountDetails.telephone1,
pinswg_typeofinvolvement:
state.accountDetails.accountDetails.pinswg_typeofinvolvement
state.accountDetails.accountDetails.telephone1
}
};
};
+4 -4
View File
@@ -375,8 +375,8 @@ let BuildSection = (props) => {
doc,
whichField
);
// console.log(errorFieldLabel[0]?.value);
return errorFieldLabel[0]?.value;
return errorFieldLabel[0].value;
};
let errorItems = [];
@@ -405,10 +405,10 @@ let BuildSection = (props) => {
<div className="govuk-grid-column-two-thirds wgForm ">
<SectionHeader title={FieldsTranslations(titles[0].value)} />
<form onSubmit={handleSubmit(onHandleSubmit)}>
{/* <ErrorSummary
<ErrorSummary
hasErrors={hasErrors == true}
errorItems={getErrorItems()}
/> */}
/>
<BuildRow
rowXML={rowXML}
whichSection={props.whichSection}
+4 -4
View File
@@ -13,8 +13,6 @@ let CompleteAppeal = (props) => {
const legacyProps = props.props;
const legacyFormState = legacyProps.form;
const legacyAccountDetails = legacyProps.accountDetails;
const router = useRouter();
const { locale } = router;
useEffect(() => {
let incidentId = props.appealType.caseReference.incidentid;
@@ -79,12 +77,14 @@ let CompleteAppeal = (props) => {
legacyAccountDetails.loggedinUserId,
props.appealType.appealTypeID,
legacyAccountDetails.loggedinUserEmail,
legacyAccountDetails.containerID,
router.locale
legacyAccountDetails.containerID
]);
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
formXML,
sectionCount,
-6
View File
@@ -17,12 +17,6 @@ const CaseRepresentation = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<Summary
isAppellant={
props.props.accountDetails.accountDetails
.emailaddress1 ===
props.searchResultsObj?.value?.[0]
?.customerid_contact?.emailaddress1
}
myCases={props.myCases}
myRepresentations={props.myRepresentations}
watchedCases={props.watchedCases}
+8 -19
View File
@@ -30,7 +30,6 @@ import {
getWatchedCasesProxy
} from "../../actions/services/portalService";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -395,13 +394,6 @@ const SearchResults = (props) => {
<RepsOnResults
detailsObj={detailsObj}
/>
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -898,23 +890,20 @@ const SearchResults = (props) => {
setCurrentPage(pageNumber);
let sortedResults = [];
setResultsArr((previousResults) => {
sortedResults = _.sortBy(previousResults, [
function (o) {
return o[orderBy];
}
]);
resultsArr = _.sortBy(resultsArr, [
function (o) {
return o[orderBy];
}
]);
fieldSort == "desc" && sortedResults.reverse();
return sortedResults;
});
fieldSort == "desc" && resultsArr.reverse();
setShowSpinnerState(false);
setResultsArr(resultsArr);
console.log(
"================================\n",
sortedResults,
resultsArr,
"sort done",
"\n=================================\n"
);
+134 -125
View File
@@ -3,10 +3,8 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
import { useEffect, useState } from "react";
import transLookup from "../../data/lookuptranslations.json";
import { getCaseStatus } from "../../actions/services/caseDirectService";
import transLookup from "../../data/lookuptranslations.json";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -122,7 +120,7 @@ const RenderCaseStatusList = ({
optionsObj,
meta: { touched, error },
label,
errormsg
errormsg,
}) => {
let { t } = useTranslation();
const router = useRouter();
@@ -172,17 +170,23 @@ const RenderCaseStatusList = ({
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? `${optionsObj[key].value_cy} (${optionsObj[key].caseCount || 0})`
: `${optionsObj[key].value} (${optionsObj[key].caseCount || 0})` ||
t(
"case:summary-no-date-entered-label"
)}
? ""
: _.isEmpty(optionsObj[key].value)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.statuscode=="' +
optionsObj[key]
.statuscode +
'")].value_cy',
json: optionsObj,
eval: true,
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -199,27 +203,6 @@ let AdvancedSearch = (props) => {
const router = useRouter();
const { locale } = router;
const [caseStatusValues, setCaseStatusValues] = useState([]);
useEffect(() => {
const fetchCaseStatus = async () => {
try {
const response = await getCaseStatus();
setCaseStatusValues(
Array.isArray(response?.data)
? response.data
: response?.data?.value || response || []
);
} catch (error) {
console.error("Failed to fetch case statuses", error);
setCaseStatusValues([]);
}
};
fetchCaseStatus();
}, []);
const {
LPAData,
onSubmit,
@@ -228,7 +211,7 @@ let AdvancedSearch = (props) => {
error,
pristine,
reset,
submitting
submitting,
} = props;
const appealOptionsObj =
@@ -253,7 +236,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg
errormsg,
}) => {
return (
<>
@@ -308,7 +291,7 @@ let AdvancedSearch = (props) => {
.name +
'")].value_cy',
json: transLookup,
eval: true
eval: true,
})
: optionsObj[key].name ||
t(
@@ -331,7 +314,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg
errormsg,
}) => {
return (
<>
@@ -378,52 +361,47 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[key].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[
key
].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[key]
.value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[
key
].value +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key]
.value ||
t(
"case:summary-no-date-entered-label"
)}
.value +
'")].value_cy',
json: transLookup,
eval: true,
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -440,7 +418,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg
errormsg,
}) => {
return (
<>
@@ -487,51 +465,49 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
)
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
optionsObj[key]
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
optionsObj[
key
]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -574,7 +550,7 @@ let AdvancedSearch = (props) => {
searchString +=
values.statusCode != null
? "statuscode=" + values.statusCode + "&"
? "statuscode=" + values.projecttype + "&"
: "";
searchString +=
@@ -618,7 +594,7 @@ let AdvancedSearch = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
)
),
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield}
@@ -643,7 +619,7 @@ let AdvancedSearch = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
)
),
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderLPATextfield}
@@ -705,7 +681,40 @@ let AdvancedSearch = (props) => {
name="statusCode"
id="statusCode"
component={RenderCaseStatusList}
optionsObj={caseStatusValues}
optionsObj={[
{
"value": "In Progress",
"value_cy": "Ar y gweill",
"statuscode": 1,
},
{
"value": "On Hold",
"value_cy": "Ar Dal",
"statuscode": 2,
},
{
"value":
"Waiting for details",
"value_cy":
"Aros am fanylion",
"statuscode": 3,
},
{
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 4,
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 5,
},
{
"value": "Cancelled",
"value_cy": "Wedi'i ganslo",
"statuscode": 6,
},
]}
//validate={[required]}
label={t(
"search:case-status-label"
@@ -826,7 +835,7 @@ const mapStateToProps = (state) => {
myCases: state.myCases,
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission
awaitingSubmission: state.awaitingSubmission,
};
};
@@ -840,7 +849,7 @@ AdvancedSearch = connect((state) => {
const appealTypesValue = selector(state, "appealTypes");
return {
appealTypesValue
appealTypesValue,
};
})(AdvancedSearch);
@@ -850,6 +859,6 @@ export default connect(
)(
reduxForm({
form: "advancedSearchForm",
destroyOnUnmount: false
destroyOnUnmount: false,
})(AdvancedSearch)
);
-24
View File
@@ -8,7 +8,6 @@ import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import {
getBasicDNSSearchPaged,
@@ -439,8 +438,6 @@ const DNSSearchResults = (props) => {
className="govuk-link--no-underline"
onClick={() => {
setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber":
item.ticketnumber,
"currentReference":
@@ -471,13 +468,6 @@ const DNSSearchResults = (props) => {
item.pinswg_appealcasetype
}
/>
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -949,20 +939,6 @@ const DNSSearchResults = (props) => {
)}
</a>
</p>
<p className="govuk-body">
{t("dnsApplications:page-intro-list-item-3")}
<a
href={t(
"dnsApplications:page-intro-list-item-3-link"
)}
rel="noreferrer noopener"
target="_blank"
>
{t(
"dnsApplications:page-intro-list-item-3-link"
)}
</a>
</p>
</div>
{showMap == "true" && (
-33
View File
@@ -1,33 +0,0 @@
import useTranslation from "next-translate/useTranslation";
import { getLivePublishedEvent } from "../case/summary/utils/liveEvent";
const LiveLink = ({ detailsObj, locale }) => {
let { t } = useTranslation();
const eventsObj = {
value: detailsObj?.pinswg_sips_pinswg_sipsevent || []
};
const liveEvent = getLivePublishedEvent(eventsObj);
if (!liveEvent) return null;
return (
<div className="govuk-!-margin-top-3">
<a
href={
locale === "en"
? liveEvent.pinswg_linktotheevent
: liveEvent.pinswg_linktotheeventstreamwelsh
}
className="govuk-link"
target="_blank"
rel="noopener noreferrer"
>
{t("case:live-event-link")}
</a>
</div>
);
};
export default LiveLink;
+19 -15
View File
@@ -7,11 +7,6 @@ const RepsOnResults = (props) => {
let { t } = useTranslation();
const detailsObj = props.detailsObj;
const isLPA = Boolean(props?.isLPA);
const appealType = props?.appealType || detailsObj?.appealType;
const specialistProcess =
detailsObj?.pinswg_speacialistcaseprocess ||
detailsObj?.pinswg_specialistcaseprocess;
function showReps(startDate, endDate) {
let date = new Date();
@@ -37,18 +32,22 @@ const RepsOnResults = (props) => {
return isLPA ? true : false;
case 846040015:
return specialistProcess == 846040001
return props.searchDetailsObj[0].value[0]
.pinswg_specialistcaseprocess == 846040001
? showReps(
detailsObj.pinswg_startdate,
detailsObj.pinswg_finalcommentsduedate
props.searchDetailsObj[0].value[0].pinswg_startdate,
props.searchDetailsObj[0].value[0]
.pinswg_finalcommentsduedate
)
: true;
case 846040018:
let shouldShow =
specialistProcess == 846040000 && isLPA
props.searchDetailsObj[0].value[0]
.pinswg_speacialistcaseprocess == 846040000 && isLPA
? true
: specialistProcess == 846040001
: props.searchDetailsObj[0].value[0]
.pinswg_speacialistcaseprocess == 846040001
? true
: false;
@@ -56,8 +55,8 @@ const RepsOnResults = (props) => {
case 846040019:
return showReps(
detailsObj.pinswg_startdate,
detailsObj.pinswg_statementduedate
props.searchDetailsObj[0].value[0].pinswg_startdate,
props.searchDetailsObj[0].value[0].pinswg_statementduedate
);
default:
@@ -123,7 +122,7 @@ const RepsOnResults = (props) => {
)}
</Link> */}
<div className="govuk-body govuk-!-font-size-14">
{appealType == 846040002
{props.appealType == 846040002
? t(
"case:summary-consultation-open-label"
)
@@ -132,7 +131,9 @@ const RepsOnResults = (props) => {
)}{" "}
</div>
</>
) : !isLPA && appealType == 846040004 ? (
) : !isLPA &&
props.currentView.caseReference.appealType ==
846040004 ? (
""
) : (
<>
@@ -146,7 +147,10 @@ const RepsOnResults = (props) => {
detailsObj.pinswg_startdate
),
endDate:
appealType == 846040019
props.currentView
.caseReference
.appealType ==
846040019
? formatDates(
detailsObj.pinswg_statementduedate
)
+1 -11
View File
@@ -39,7 +39,6 @@ import {
import { sendGAEvent } from "@next/third-parties/google";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import { query } from "jsonpath";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -422,8 +421,6 @@ const SearchResults = (props) => {
}
),
setCurrentReference({
"statuscode":
item.statuscode,
"ticketnumber":
item.ticketnumber,
"currentReference":
@@ -481,13 +478,6 @@ const SearchResults = (props) => {
item.pinswg_appealcasetype
}
/>
<LiveLink
detailsObj={detailsObj}
appealType={
item.pinswg_appealcasetype
}
locale={locale}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -688,7 +678,7 @@ const SearchResults = (props) => {
'$..[?(@ && @.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
].trim() +
] +
'")].value_cy',
json: transLookup,
eval: true
+3 -3
View File
@@ -2,8 +2,7 @@ import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useState, useEffect } from "react";
import { useIdleTimer } from "react-idle-timer";
import TimeoutModal from "./timeoutmodal";
import { performPortalSignOut } from "../../lib/auth/sessionClient";
import { logoutClient } from "../../lib/auth/logoutClient";
const TimeOut = (props) => {
let { t } = useTranslation();
@@ -19,7 +18,8 @@ const TimeOut = (props) => {
const onIdle = () => {
setState("Idle");
performPortalSignOut(locale);
console.info("////////////\n" + "logout" + "\n////////////");
logoutClient(locale);
setOpen(false);
};
-287
View File
@@ -1,287 +0,0 @@
export const statusValues = [
{
"value": "Acceptance Checking",
"value_cy": "Gwirio derbyn",
"statuscode": 846040004
},
{
"value": "Appeal Registered",
"value_cy": "Apêl wedii chofrestru",
"statuscode": 846040015
},
{
"value": "Appeal Submitted",
"value_cy": "Apêl wedii chyflwyno",
"statuscode": 846040014
},
{
"value": "Appeal Validated",
"value_cy": "Apêl wedii dilysu",
"statuscode": 846040016
},
{
"value": "Applicants Final Comment",
"value_cy": "Sylw terfynol yr ymgeisydd",
"statuscode": 846040027
},
{
"value": "Application Called-In",
"value_cy": "Cais wedii alw i mewn",
"statuscode": 846040023
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040024
},
{
"value": "Case in Progress",
"value_cy": "Achos ar y gweill",
"statuscode": 1
},
{
"value": "Consultation",
"value_cy": "Ymgynghoriad",
"statuscode": 846040006
},
{
"value": "Environmental Impact Assessment Scoping",
"value_cy": "Cwmpasu Asesiad or Effaith Amgylcheddol",
"statuscode": 846040002
},
{
"value": "Inspector(s) Decision",
"value_cy": "Penderfyniad yr arolygydd/arolygwyr",
"statuscode": 846040009
},
{
"value": "Invalid Submission",
"value_cy": "Cyflwyniad annilys",
"statuscode": 846040005
},
{
"value": "Notification",
"value_cy": "Hysbysiad",
"statuscode": 846040003
},
{ "value": "On Hold", "value_cy": "Ar Dal", "statuscode": 2 },
{
"value": "Pre-Application",
"value_cy": "Cyn gwneud cais",
"statuscode": 846040001
},
{
"value": "Questionnaire / LPA to Notify",
"value_cy": "Holiadur / ACLl i hysbysu",
"statuscode": 846040017
},
{
"value": "Re-Consultation",
"value_cy": "Ail-ymgynghoriad",
"statuscode": 846040007
},
{ "value": "Researching", "value_cy": "Ymchwilio", "statuscode": 4 },
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 846040011
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 846040010
},
{ "value": "Reporting", "value_cy": "Adrodd", "statuscode": 846040008 },
{
"value": "Waiting for Details",
"value_cy": "Aros am fanylion",
"statuscode": 3
},
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 846040012
},
{
"value": "Representations Period",
"value_cy": "Cyfnod sylwadau",
"statuscode": 846040018
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040019
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040020 },
{
"value": "Site Visit",
"value_cy": "Ymweliad safle",
"statuscode": 846040021
},
{
"value": "Decision Issued",
"value_cy": "Penderfyniad wedii gyhoeddi",
"statuscode": 846040022
},
{
"value": "LPA to Notify",
"value_cy": "ACLl i hysbysu",
"statuscode": 846040025
},
{
"value": "Report Issued to Welsh Ministers",
"value_cy": "Adroddiad wedii gyhoeddi i Weinidogion Cymru",
"statuscode": 846040028
},
{
"value": "Fee Due",
"value_cy": "Ffi yn ddyledus",
"statuscode": 846040029
},
{
"value": "Validated",
"value_cy": "Wedii ddilysu",
"statuscode": 846040030
},
{
"value": "Appeal Start / Case in Progress",
"value_cy": "Apêl wedi dechrau / achos ar y gweill",
"statuscode": 846040031
},
{
"value": "Statements/Representations Period",
"value_cy": "Cyfnod datganiadau/sylwadau",
"statuscode": 846040032
},
{
"value": "Order Submitted",
"value_cy": "Gorchymyn wedii gyflwyno",
"statuscode": 846040033
},
{
"value": "Order Submission Registered",
"value_cy": "Cyflwyniad gorchymyn wedii gofrestru",
"statuscode": 846040034
},
{
"value": "Order Submission Validated",
"value_cy": "Cyflwyniad gorchymyn wedii ddilysu",
"statuscode": 846040035
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi dechrau / achos ar y gweill",
"statuscode": 846040036
},
{
"value": "Event/Site Visit",
"value_cy": "Digwyddiad/ymweliad safle",
"statuscode": 846040037
},
{
"value": "Applicant Statement on Representations",
"value_cy": "Datganiad yr ymgeisydd ar sylwadau",
"statuscode": 846040038
},
{
"value": "Representatives Comment",
"value_cy": "Sylwr cynrychiolwyr",
"statuscode": 846040039
},
{
"value": "Order Registered",
"value_cy": "Gorchymyn wedii gofrestru",
"statuscode": 846040040
},
{
"value": "Order Validated",
"value_cy": "Gorchymyn wedii ddilysu",
"statuscode": 846040041
},
{
"value": "Representations Period",
"value_cy": "Cyfnod sylwadau",
"statuscode": 846040047
},
{
"value": "Application Submitted",
"value_cy": "Cais wedii gyflwyno",
"statuscode": 846040042
},
{
"value": "Application Registered",
"value_cy": "Cais wedii gofrestru",
"statuscode": 846040043
},
{
"value": "Report to DESNZ",
"value_cy": "Adroddiad i DESNZ",
"statuscode": 846040044
},
{
"value": "Case in Progress / Assessment",
"value_cy": "Achos ar y gweill / asesiad",
"statuscode": 846040045
},
{
"value": "Decision / Outcome",
"value_cy": "Penderfyniad / canlyniad",
"statuscode": 846040046
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040048
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040049 },
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 846040050
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi dechrau / achos ar y gweill",
"statuscode": 846040051
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 846040052
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040053
},
{
"value": "Appliation Start / Case in Progress",
"value_cy": "Cais wedi dechrau / achos ar y gweill",
"statuscode": 846040054
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040055
},
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 846040056
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040057
},
{
"value": "Case in Progress",
"value_cy": "Achos ar y gweill",
"statuscode": 846040058
},
{
"value": "Case Submitted",
"value_cy": "Achos wedii gyflwyno",
"statuscode": 846040061
}
];
@@ -1,69 +0,0 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
const translateLpaName = ({ name, locale, transLookup }) => {
if (!name) return "";
if (locale !== "cy") return name;
return (
jsonpath({
path: '$..[?(@ && @.value=="' + name + '")].value_cy',
json: transLookup,
eval: true
})?.[0] || name
);
};
export const getCaseLpaNames = ({
casesObj,
detailsObj,
locale,
transLookup
}) => {
if (!casesObj) return [];
const primaryLpaName =
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "";
const translatedPrimaryLpaName = translateLpaName({
name: primaryLpaName,
locale,
transLookup
});
const additionalLpaNames = (detailsObj.additionalLPAs || []).map((lpa) =>
translateLpaName({
name: lpa?.name || "",
locale,
transLookup
})
);
return [
...new Set(
[translatedPrimaryLpaName, ...additionalLpaNames].filter(Boolean)
)
];
};
export const getCaseLpaDisplayValue = ({
casesObj,
detailsObj,
locale,
transLookup
}) => {
return getCaseLpaNames({ casesObj, detailsObj, locale, transLookup }).join(
", "
);
};
export const getCaseLpaDisplayLines = ({
casesObj,
locale,
detailsObj,
transLookup
}) => {
return getCaseLpaNames({ casesObj, detailsObj, locale, transLookup });
};
-34
View File
@@ -1,34 +0,0 @@
# Auth & Session Reliability Notes
Last updated: 2026-05-13
## Known issue
Users are intermittently prompted to sign in again despite apparently valid prior session state.
## Confirmed risk contributors in code
1. Duplicated logout/cookie clearing logic across multiple components.
2. Mixed callback cookie names in runtime history (`next-auth.callback-url` and `__Secure-next-auth.callback-url`).
3. Redirect URL parsing that could fail hard on malformed/unexpected URL inputs.
4. Hard SSR redirects to `/auth/signin` on missing/transient upstream account/contact states.
## Stabilisation changes started
- Added `lib/auth/sessionClient.js`:
- normalized cookie/session artifact cleanup
- shared signed-out callback path by locale
- shared `performPortalSignOut(...)` helper
- Adopted helper in:
- `components/timeout/index.js`
- `components/myportal/servicebanner.js`
- `components/header.js`
- Updated NextAuth callback locale detection to check both callback cookie variants.
- Hardened NextAuth URL append and redirect parsing fallbacks.
## Remaining auth hardening backlog
1. Migrate remaining logout implementations to shared helper.
2. Add request-correlation-safe auth diagnostics (no secrets/tokens).
3. Evaluate session TTL/update strategy (`maxAge`, `updateAge`) with production evidence.
4. Add env validation checks for `NEXTAUTH_URL`, `CY_API_ROOT`, proxy/header assumptions.
-38
View File
@@ -1,38 +0,0 @@
# Current Platform State (PEDW) — feature/restart-from-sips
Last updated: 2026-05-13
## Summary
PEDW is in a **late-stage refactor stabilization** phase.
- New Appeal refactor stream (Slices 18) is complete per tracker/state docs.
- Representations stream remains structurally complex and only partially decomposed.
- Platform architecture direction remains valid: bounded, behaviour-preserving slices.
## What is complete
- New Appeal slice stream documented complete (`context/refactor-tracker.md`, `context/newappeal-refactor-current-state.md`).
- Significant route/breadcrumb decomposition and helper extraction completed.
- Broad endpoint contract hardening completed across key clusters.
## What is incomplete
- Auth/session reliability hardening (intermittent re-signin prompts).
- SSR loader resilience normalization across myportal/representation/new appeal.
- Logging hardening consistency in auth/file/account-sensitive paths.
- Remaining decomposition hotspots (`components/elements/index.js`, representation flow internals).
## Operational risk profile (current)
Top active risks:
1. Auth/session intermittency (callback/cookie/SSR timing interplay).
2. Fragile nested state assumptions in loader-heavy paths.
3. Production log noise and inconsistent redaction patterns.
4. Manual effort burden for EN/CY parity and journey regression checks.
## Notes on stale/legacy guidance
- Some context docs still describe pre-refactor representation baseline; treat those as historical unless updated by active slice evidence.
- Legacy commented code remains in active files (especially journey files) and should be treated as cleanup debt, not source-of-truth runtime behaviour.
@@ -1,29 +0,0 @@
# Performance & Stability Baseline (Phase 1)
Last updated: 2026-05-13
## Baseline observations
### Performance
- Loader-heavy pages (myportal/representation/new appeal) perform multiple external calls per SSR request.
- Form XML is read/normalized repeatedly from disk in SSR path.
- Some large components still combine orchestration + rendering, increasing rerender work.
### Stability
- Several SSR/data paths assume nested API response shapes without guard rails.
- Representation resume/new loader had crash/redirect fragility around missing contact/representation objects.
- Logging noise can mask actionable failure signals.
## Changes started in this phase
1. Added in-memory XML cache in `lib/forms/readFormXml.js` (safe, process-local).
2. Added null/redirect guards in `lib/representation/pageLoaders.js` for missing user/contact and missing representation entry.
3. Began auth-path de-duplication and redirect hardening (see auth reliability doc).
## Next baseline improvements
1. Add guarded defaults in remaining loader paths (`loadNewAppealPage`, myportal page loaders).
2. Introduce structured non-sensitive SSR failure telemetry for dependency failures.
3. Expand bounded concurrency/parallelism where safe and contract-preserving.
-62
View File
@@ -1,62 +0,0 @@
# Phase 1 Stabilisation Plan (Execution Start)
Last updated: 2026-05-14
## Goal
Reduce operational risk without changing PEDW business behaviour.
## Priority order
1. **Auth/session reliability**
2. **SSR/data-loading resilience**
3. **Logging/observability hardening**
4. **Low-risk performance improvements**
## Slice plan
### Slice P0.1 (started)
- Centralize client-side signout/cookie cleanup into shared helper.
- Replace duplicated logout logic in timeout and portal/header surfaces.
Status: completed across timeout, header, service banner, myportal, furtherdetails, and auth error paths.
### Slice P0.2 (started)
- Harden NextAuth redirect/locale callback handling.
- Add safer URL parsing fallback behaviour.
Status: completed with callback-cookie parity support and redacted diagnostics.
### Slice P1.1 (started)
- Add defensive null and redirect handling in representation SSR loader path.
Status: expanded to new appeal, myportal appeal, and representation loader guard hardening.
### Slice P3.1 (started)
- Add in-memory XML read cache for form XML to reduce repeated disk read/normalization cost.
Status: completed.
## Immediate slices status (updated)
1. Add defensive wrappers for external dependency failures in new-appeal/myportal/representation SSR loaders (fallback redirects + safe defaults).
- Status: completed.
2. Expand focused tests around loader negative paths (missing query/session/cookie/search result branches).
- Status: completed with dedicated phase22 suites for newappeal, myportal, and representation loaders.
3. Add lightweight diagnostics for SSR loader dependency failures (redacted, non-sensitive).
- Status: completed.
4. Reduce remaining low-value commented legacy blocks in active flow files where behaviour is already covered by tests.
- Status: completed for active myportal case-ticket page path.
## Next recommended Phase 1 closure slices
1. Add targeted loader-dependency-failure tests (thrown service errors -> safe redirect) for newappeal/myportal/representation loaders.
- Status: in progress (newappeal + myportal dependency-failure tests added; representation search-miss redirect coverage added).
2. Perform a focused pass on remaining active flow files for stale commented code/debug remnants and remove where behaviour is covered.
- Status: in progress (myportal case-ticket path completed; further active-flow pass still open).
3. Refresh current-platform-state/auth-session-reliability notes with latest implemented slices and residual risks.
- Status: not started.
+35 -262
View File
@@ -188,268 +188,41 @@
}
],
"statusCodes": [
[
{
"value": "Pre-Application",
"value_cy": "Cyn Ymgeisio",
"statuscode": 1
},
{
"value": "Notification",
"value_cy": "Hysbysiad",
"statuscode": 2
},
{
"value": "Acceptance Checking",
"value_cy": "Gwirio Derbyn",
"statuscode": 3
},
{
"value": "Invalid Submission",
"value_cy": "Cyflwyniad Annilys",
"statuscode": 4
},
{
"value": "Consultation",
"value_cy": "Ymgynghoriad",
"statuscode": 5
},
{
"value": "Re-Consultation",
"value_cy": "Ail-Ymgynghoriad",
"statuscode": 6
},
{
"value": "Reporting",
"value_cy": "Adrodd",
"statuscode": 7
},
{
"value": "Inspector(s) Decision",
"value_cy": "Penderfyniad yr Arolygydd(ion)",
"statuscode": 8
},
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 9
},
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 10
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 11
},
{
"value": "Appeal Submitted",
"value_cy": "Apêl wedii Chyflwyno",
"statuscode": 12
},
{
"value": "Appeal Registered",
"value_cy": "Apêl wedii Chofrestru",
"statuscode": 13
},
{
"value": "Appeal Validated",
"value_cy": "Apêl wedii Dilysu",
"statuscode": 14
},
{
"value": "Case in Progress",
"value_cy": "Achos ar Waith",
"statuscode": 15
},
{
"value": "Questionnaire / LPA to Notify",
"value_cy": "Holiadur / Awdurdod Cynllunio Lleol iw Hysbysu",
"statuscode": 16
},
{
"value": "Representations Period",
"value_cy": "Cyfnod Cynrychioliadau",
"statuscode": 17
},
{
"value": "Final Comments",
"value_cy": "Sylwadau Terfynol",
"statuscode": 18
},
{
"value": "Event",
"value_cy": "Digwyddiad",
"statuscode": 19
},
{
"value": "Site Visit",
"value_cy": "Ymweliad Safle",
"statuscode": 20
},
{
"value": "Decision Issued",
"value_cy": "Penderfyniad wedii Gyhoeddi",
"statuscode": 21
},
{
"value": "Application Called-In",
"value_cy": "Cais wedii Alw i Mewn",
"statuscode": 22
},
{
"value": "Application Registered",
"value_cy": "Cais wedii Gofrestru",
"statuscode": 23
},
{
"value": "Application Validated",
"value_cy": "Cais wedii Ddilysu",
"statuscode": 24
},
{
"value": "LPA to Notify",
"value_cy": "Awdurdod Cynllunio Lleol iw Hysbysu",
"statuscode": 25
},
{
"value": "Report Issued to Welsh Ministers",
"value_cy": "Adroddiad wedii Gyhoeddi i Weinidogion Cymru",
"statuscode": 26
},
{
"value": "Fee Due",
"value_cy": "Ffin Ddyledus",
"statuscode": 27
},
{
"value": "Validated",
"value_cy": "Dilyswyd",
"statuscode": 28
},
{
"value": "Appeal Start / Case in Progress",
"value_cy": "Cais Wedi'i Ddechrau/Achos Ar Y Gweill",
"statuscode": 29
},
{
"value": "Statements/Representations Period",
"value_cy": "Cyfnod Datganiadau/Sylwadau",
"statuscode": 30
},
{
"value": "Order Submitted",
"value_cy": "Gorchymyn wedii Gyflwyno",
"statuscode": 31
},
{
"value": "Order Submission Registered",
"value_cy": "Cyflwyniad Gorchymyn wedii Gofrestru",
"statuscode": 32
},
{
"value": "Order Submission Validated",
"value_cy": "Cyflwyniad Gorchymyn wedii Ddilysu",
"statuscode": 33
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi Dechrau/Achos ar Waith",
"statuscode": 34
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 35
},
{
"value": "Event/Site Visit",
"value_cy": "Digwyddiad/Ymweliad Safle",
"statuscode": 36
},
{
"value": "Application Submitted",
"value_cy": "Cais wedii Gyflwyno",
"statuscode": 37
},
{
"value": "Application Start/Case In Progress",
"value_cy": "Dechrau Cais/Achos ar Waith",
"statuscode": 38
},
{
"value": "Applicant Statement on Representations",
"value_cy": "Datganiad yr Ymgeisydd ar Sylwadau",
"statuscode": 39
},
{
"value": "Representatives Comment",
"value_cy": "Sylw Cynrychiolydd",
"statuscode": 40
},
{
"value": "Applicants Final Comment",
"value_cy": "Sylw Terfynol yr Ymgeisydd",
"statuscode": 41
},
{
"value": "Order Registered",
"value_cy": "Gorchymyn wedii Gofrestru",
"statuscode": 42
},
{
"value": "Order Validated",
"value_cy": "Gorchymyn wedii Ddilysu",
"statuscode": 43
},
{
"value": "Report to DESNZ",
"value_cy": "Adroddiad i DESNZ",
"statuscode": 44
},
{
"value": "Case in Progress / Assessment",
"value_cy": "Achos ar Waith / Asesiad",
"statuscode": 45
},
{
"value": "Decision / Outcome",
"value_cy": "Penderfyniad / Canlyniad",
"statuscode": 46
},
{
"value": "Complete",
"value_cy": "Wedii Gwblhau",
"statuscode": 47
},
{
"value": "In progress",
"value_cy": "Ar Waith",
"statuscode": 48
},
{
"value": "Not started",
"value_cy": "Heb Ddechrau",
"statuscode": 49
},
{
"value": "Blocked",
"value_cy": "Wedii Rwystro",
"statuscode": 50
},
{
"value": "Environmental Impact Assessment Scoping",
"value_cy": "Cwmpasu Asesiad Effaith Amgylcheddol",
"statuscode": "51"
},
{
"value": "Case Closed - Decision Issued",
"value_cy": "Achos Ar Gau - Penderfyniad Wedi'i Gyhoeddi",
"statuscode": "52"
}
]
{
"value": "Active",
"value_cy": "Gweithredol",
"statuscode": 1
},
{
"value": "In Progress",
"value_cy": "Ar Waith",
"statuscode": 2
},
{
"value": "On Hold",
"value_cy": "Wedii Ohirio",
"statuscode": 3
},
{
"value": "Waiting for a Decision",
"value_cy": "Aros am Benderfyniad",
"statuscode": 4
},
{
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 5
},
{
"value": "Problem Solved",
"value_cy": "Problem wedii Datrys",
"statuscode": 6
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 6
}
],
"pinswg_decision": [
{
+9 -21
View File
@@ -21,14 +21,13 @@ module.exports = {
"/myportal/advancedsearch": ["search", "myportal"],
"/myportal/advancedsearchresults": ["search", "myportal", "case"],
"/myportal/searchresults": ["search", "myportal", "case"],
"/myportal/case": ["case", "home", "case-stages"],
"/myportal/case/[ticketnumber]": ["case", "myportal", "case-stages"],
"/myportal/case": ["case"],
"/myportal/case/[ticketnumber]": ["case", "myportal"],
"/myportal/dnsapplications": [
"search",
"dnsCommon",
"dnsApplications",
"case",
"case-stages"
"case"
],
"/myportal/dnsdetails": [
"case",
@@ -37,22 +36,16 @@ module.exports = {
"dnsApplications"
],
"/myportal/dns/*": ["dnsCommon", "case", "common"],
"/myportal/dns/[developmentName]": [
"dnsCommon",
"case",
"common",
,
"case-stages"
],
"/myportal/dns/[developmentName]": ["dnsCommon", "case", "common"],
"/advancedsearch": ["search", "myportal"],
"/advancedsearchresults": ["search", "case"],
"/searchresults": ["search", "case"],
"/addresssearch": ["search", "case", "myportal"],
"/addresssearchresults": ["search", "case", "myportal"],
"/viewall": ["search"],
"/case": ["case", "home", "case-stages"],
"/case": ["case", "home"],
"/case/*": ["case", "home"],
"/case/[ticketnumber]": ["case", "home", "case-stages"],
"/case/[ticketnumber]": ["case", "home"],
"/case/id/[incident]": ["case", "home"],
"/myportal/representation": [
"case",
@@ -70,14 +63,9 @@ module.exports = {
"/newappeal/*": ["newappeal", "home"],
"/newappeal/[appealtypes]": ["newappeal", "home", "myportal"],
"/newappeal/selectappeal": ["newappeal", "home"],
"/dns/*": ["dnsCommon", "case", "common", "case-stages"],
"/dns/[developmentName]": [
"dnsCommon",
"case",
"common",
"case-stages"
],
"/dns": ["dnsCommon", "dnsHome", , "case-stages"],
"/dns/*": ["dnsCommon", "case", "common"],
"/dns/[developmentName]": ["dnsCommon", "case", "common"],
"/dns": ["dnsCommon", "dnsHome"],
"/dns/applications": ["dnsCommon", "dnsApplications"],
"/dns/application-view": ["dnsCommon", "dnsApplicationView"],
"/dnsapplications": ["search", "dnsCommon", "dnsApplications", "case"],
+27
View File
@@ -0,0 +1,27 @@
import { destroyCookie } from "nookies";
import { signOut } from "next-auth/react";
const AUTH_COOKIE_NAMES = [
"next-auth.csrf-token",
"next-auth.callback-url",
"__Secure-next-auth.callback-url",
"pedw_locale",
"pinsUser"
];
export const clearClientSessionArtifacts = () => {
if (typeof window !== "undefined") {
window.localStorage.clear();
}
AUTH_COOKIE_NAMES.forEach((cookieName) => {
destroyCookie(null, cookieName, { path: "/" });
});
};
export const logoutClient = async (locale) => {
clearClientSessionArtifacts();
await signOut({
callbackUrl: locale === "cy" ? "/cy/allgofnodi" : "/logout"
});
};
-58
View File
@@ -1,58 +0,0 @@
import { getSession } from "next-auth/react";
import { consoleLogger } from "../../actions/core/logger";
const signinRedirect = {
destination: "/auth/signin",
permanent: false
};
const buildSigninRedirectResult = () => ({ redirect: signinRedirect });
export async function resolveMyPortalAuthContext(ctx, options = {}) {
const {
loggerName = "MyPortalAuthGuard",
noSessionMessage = "myportal loader missing session; redirecting to signin",
noSessionUserMessage = "myportal loader missing session user identity; redirecting to signin",
noPinsUserMessage = "myportal loader missing pinsUser cookie; redirecting to signin"
} = options;
const session = await getSession(ctx);
if (!session) {
consoleLogger({
name: loggerName,
reasonCode: "NO_SESSION",
message: noSessionMessage
});
return { ok: false, redirect: buildSigninRedirectResult().redirect };
}
if (!session?.user?.id || !session?.user?.email) {
consoleLogger({
name: loggerName,
reasonCode: "NO_SESSION_USER",
message: noSessionUserMessage,
hasSessionUserId: !!session?.user?.id,
hasSessionUserEmail: !!session?.user?.email
});
return { ok: false, redirect: buildSigninRedirectResult().redirect };
}
const pinsUser = ctx?.req?.cookies?.pinsUser;
if (!pinsUser) {
consoleLogger({
name: loggerName,
reasonCode: "NO_PINSUSER_COOKIE",
message: noPinsUserMessage
});
return { ok: false, redirect: buildSigninRedirectResult().redirect };
}
return {
ok: true,
session,
sessionUserId: session.user.id,
sessionUserEmail: session.user.email,
pinsUser
};
}
-47
View File
@@ -1,47 +0,0 @@
import { destroyCookie } from "nookies";
import { signOut } from "next-auth/react";
const AUTH_COOKIE_CANDIDATES = [
"next-auth.csrf-token",
"next-auth.callback-url",
"__Secure-next-auth.callback-url",
"pedw_locale",
"pinsUser"
];
export const buildSignedOutCallbackUrl = (locale) =>
locale === "cy" ? "/cy/allgofnodi" : "/logout";
const resolveSignOutArgs = (args) => {
if (typeof args === "string") {
return {
locale: args,
callbackUrl: undefined,
signOutFn: signOut
};
}
return {
locale: args?.locale,
callbackUrl: args?.callbackUrl,
signOutFn: args?.signOutFn || signOut
};
};
export const clearSessionArtifacts = () => {
if (typeof window !== "undefined") {
window.localStorage.clear();
}
AUTH_COOKIE_CANDIDATES.forEach((cookieName) => {
destroyCookie(null, cookieName, { path: "/" });
});
};
export const performPortalSignOut = async (args) => {
const { locale, callbackUrl, signOutFn } = resolveSignOutArgs(args);
clearSessionArtifacts();
return signOutFn({
callbackUrl: callbackUrl || buildSignedOutCallbackUrl(locale)
});
};
+7 -8
View File
@@ -11,15 +11,13 @@ const xmlCache = new Map();
export function readFormXml(appealtypes) {
if (!appealtypes) throw new Error("readFormXml: appealtypes is required");
if (xmlCache.has(appealtypes)) {
return xmlCache.get(appealtypes);
}
const configDirectory = path.resolve(process.cwd(), "data/formsxml");
const filePath = path.join(configDirectory, `${appealtypes}.xml`);
const cacheKey = filePath;
const cached = xmlCache.get(cacheKey);
if (cached) {
return { xmlStr: cached, filePath, fromCache: true };
}
let xmlStr = fs.readFileSync(filePath, "utf8");
// Keep existing normalisation behaviour
@@ -28,7 +26,8 @@ export function readFormXml(appealtypes) {
xmlStr = xmlStr.replace(/> <"/g, "><");
xmlStr = xmlStr.toString();
xmlCache.set(cacheKey, xmlStr);
const result = { xmlStr, filePath };
xmlCache.set(appealtypes, result);
return { xmlStr, filePath };
return result;
}
+10 -116
View File
@@ -11,7 +11,7 @@ import {
getProgressFromBlob
} from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService";
import { consoleLogger, getIP } from "../../actions/core/logger";
import { getIP } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -32,42 +32,11 @@ export async function loadMyPortalAppealPage(ctx) {
"casereference"
]);
if (!required.ok) {
consoleLogger({
name: "MyPortalAppealLoaderMissingQuery",
message:
"loadMyPortalAppealPage missing required query params; redirecting",
hasAppealType: !!query?.appealtypes,
hasAppealTypeId: !!query?.apt,
hasCaseReference: !!query?.casereference
});
return { redirect: required.redirect };
}
const session = await getSession(ctx);
if (!session) {
consoleLogger({
name: "MyPortalAppealLoaderAuthGuard",
reasonCode: "NO_SESSION",
message:
"loadMyPortalAppealPage missing session; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
if (!session?.user?.id || !session?.user?.email) {
consoleLogger({
name: "MyPortalAppealLoaderAuthGuard",
reasonCode: "NO_SESSION_USER",
message:
"loadMyPortalAppealPage missing session user identity; redirecting to signin",
hasUserId: !!session?.user?.id,
hasUserEmail: !!session?.user?.email
});
return {
redirect: {
destination: "/auth/signin",
@@ -81,79 +50,21 @@ export async function loadMyPortalAppealPage(ctx) {
const loggedInUserIdent = session.user.id;
const loggedInUserEmail = session.user.email;
if (!loggedInUser) {
consoleLogger({
name: "MyPortalAppealLoaderAuthGuard",
reasonCode: "NO_PINSUSER_COOKIE",
message:
"loadMyPortalAppealPage missing pinsUser cookie; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
const accountDetails = await getPersonalAccount(loggedInUser);
// Fetch config + blob assets in parallel
let appealTypeData;
let mandatoryFieldsData;
let pickListData;
let blobList;
let blobProgress;
let accountDetails;
try {
[
appealTypeData,
mandatoryFieldsData,
pickListData,
blobList,
blobProgress,
accountDetails
] = await Promise.all([
const [appealTypeData, mandatoryFieldsData, pickListData, blobList] =
await Promise.all([
getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes),
getPickLists(query.appealtypes),
getFilesFromBlob(loggedInUserIdent, query.casereference),
getProgressFromBlob(loggedInUserIdent, query.casereference),
getPersonalAccount(loggedInUser)
getFilesFromBlob(loggedInUserIdent, query.casereference)
]);
} catch (_error) {
consoleLogger({
name: "MyPortalAppealLoaderDependencyFailure",
reasonCode: "UPSTREAM_FAILURE",
message:
"loadMyPortalAppealPage dependency fetch failed; redirecting to /myportal",
appealType: query?.appealtypes,
hasCaseReference: !!query?.casereference,
error: _error?.message
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
if (!accountDetails || accountDetails?.errorCode) {
consoleLogger({
name: "MyPortalAppealLoaderContactGuard",
reasonCode: "CONTACT_LOOKUP_FAILED",
message:
"loadMyPortalAppealPage account contact lookup failed; redirecting to signin",
hasAccountDetails: !!accountDetails,
hasErrorCode: !!accountDetails?.errorCode
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
const blobProgress = await getProgressFromBlob(
loggedInUserIdent,
query.casereference
);
// Optional: awaiting-submission view setup when query.key exists
let awaitingSubmissionFromBlob = null;
@@ -163,24 +74,7 @@ export async function loadMyPortalAppealPage(ctx) {
);
}
let xmlStr = "";
try {
xmlStr = readFormXml(query.appealtypes).xmlStr;
} catch (_error) {
consoleLogger({
name: "MyPortalAppealLoaderXmlReadFailure",
message:
"loadMyPortalAppealPage XML read failed; redirecting to /myportal",
appealType: query?.appealtypes,
error: _error?.message
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const { xmlStr } = readFormXml(query.appealtypes);
return {
session,
+1 -1
View File
@@ -1,5 +1,5 @@
export const mergeWithExistingFilesList = (buildAppealFilesArray, values) => {
return Object.prototype.hasOwnProperty.call(values, "filesList")
return values.hasOwnProperty("filesList")
? (buildAppealFilesArray.concat(values.filesList),
buildAppealFilesArray.filter(function (item, idx) {
return item.name;
+14 -80
View File
@@ -7,7 +7,7 @@ import {
} from "../../actions/services/referenceDataService";
import { getProgressFromBlob } from "../../actions/services/documentService";
import { getPersonalAccount } from "../../actions/services/accountService";
import { consoleLogger, getIP } from "../../actions/core/logger";
import { getIP, logInfo, consoleLogger } from "../../actions/core/logger";
import { readFormXml } from "../forms/readFormXml";
import { requireQueryParams } from "../routing/requireQueryParams";
@@ -29,27 +29,9 @@ export async function loadNewAppealPage(ctx) {
const session = await getSession(ctx);
if (!session) {
consoleLogger({
name: "NewAppealLoaderAuthGuard",
reasonCode: "NO_SESSION",
message: "loadNewAppealPage missing session; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
if (!session?.user?.id || !session?.user?.email) {
consoleLogger({
name: "NewAppealLoaderAuthGuard",
reasonCode: "NO_SESSION_USER",
message:
"loadNewAppealPage missing session user identity; redirecting to signin",
hasSessionUserId: !!session?.user?.id,
hasSessionUserEmail: !!session?.user?.email
logInfo("auth.guard.redirect", {
route: "/newappeal/[appealtypes]",
reason: "missing_session"
});
return {
redirect: {
@@ -64,72 +46,24 @@ export async function loadNewAppealPage(ctx) {
const loggedInUserIdent = session.user.id;
const loggedInUserEmail = session.user.email;
if (!loggedInUser) {
consoleLogger({
name: "NewAppealLoaderAuthGuard",
reasonCode: "NO_PINSUSER_COOKIE",
message:
"loadNewAppealPage missing pinsUser cookie identity; redirecting to signin"
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
}
let appealTypeData;
let mandatoryFieldsData;
let pickListData;
let blobProgress;
let accountDetails;
try {
[
appealTypeData,
mandatoryFieldsData,
pickListData,
blobProgress,
accountDetails
] = await Promise.all([
const [appealTypeData, mandatoryFieldsData, pickListData] =
await Promise.all([
getAppealsTypesForNewAppeal(),
getMandatoryFields(query.appealtypes),
getPickLists(query.appealtypes),
getProgressFromBlob(loggedInUserIdent, query.id),
getPersonalAccount(loggedInUser)
getPickLists(query.appealtypes)
]);
} catch (_error) {
consoleLogger({
name: "NewAppealLoaderDependencyFailure",
message:
"loadNewAppealPage dependency fetch failed; redirecting to /myportal",
appealType: query?.appealtypes,
hasCaseId: !!query?.id,
error: _error?.message
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const blobProgress = await getProgressFromBlob(loggedInUserIdent, query.id);
const accountDetails = await getPersonalAccount(loggedInUser);
let xmlStr = "";
try {
xmlStr = readFormXml(query.appealtypes).xmlStr;
} catch (_error) {
consoleLogger({
name: "NewAppealLoaderXmlReadFailure",
message:
"loadNewAppealPage XML read failed; redirecting to /myportal",
appealType: query?.appealtypes,
error: _error?.message
});
({ xmlStr } = readFormXml(query.appealtypes));
} catch (error) {
consoleLogger(error);
return {
redirect: {
destination: "/myportal",
destination: "/error?reason=formxml",
permanent: false
}
};
+45 -126
View File
@@ -9,7 +9,6 @@ import {
} from "../../actions/services/caseService";
import { getRepsFromBlob } from "../../actions/services/documentService";
import { getBasicSearch } from "../../actions/services/searchService";
import { consoleLogger } from "../../actions/core/logger";
import {
getFormCollectionByID,
getSearchDetails
@@ -42,7 +41,7 @@ const getDetails = (resultsObj, detailsType) => {
detailsType == "mySubmittedReps" ? resultsObj : resultsObj.value;
if (detailsType == "myRepresentations") {
resultsObj.map((searchDetail) => {
const repsObj = resultsObj.map((searchDetail, index) => {
detailsArr.push(
getCase(searchDetail["incidentID"]).then((data) => {
let caseID = "";
@@ -76,21 +75,19 @@ const getDetails = (resultsObj, detailsType) => {
}
let detArr = Promise.all(detailsArr);
console.log(detArr);
return detArr;
};
export const loadRepresentationBootstrap = async ({ ctx }) => {
const { query } = ctx;
console.log("The query", query);
let thisSession = await getSession(ctx);
let loggedInUser = null;
let loggedInUser = {};
if (!thisSession) {
consoleLogger({
name: "RepresentationLoaderMissingSession",
message:
"loadRepresentationBootstrap missing session; redirecting to signin"
});
console.log("not has sesssion.......");
return {
redirect: {
destination: "/auth/signin",
@@ -98,28 +95,22 @@ export const loadRepresentationBootstrap = async ({ ctx }) => {
}
};
} else {
loggedInUser = await getPortalLogin(thisSession.user.email);
loggedInUser = loggedInUser?.value?.[0]?.contactid || null;
}
[loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email)
]);
if (!loggedInUser) {
consoleLogger({
name: "RepresentationLoaderMissingContact",
message:
"loadRepresentationBootstrap missing CRM contact id; redirecting to signin",
hasSessionEmail: !!thisSession?.user?.email
});
return {
redirect: {
destination: "/auth/signin",
permanent: false
}
};
console.log(
"=====//////////=====",
thisSession,
thisSession.user.email,
loggedInUser
);
loggedInUser = loggedInUser.value[0].contactid;
}
const [accountDetails, myRepresentations] = await Promise.all([
getPersonalAccount(loggedInUser),
getRepsFromBlob(thisSession.user.id)
await getPersonalAccount(loggedInUser),
await getRepsFromBlob(thisSession.user.id)
]);
const myRepresentationsDetails = await getDetails(
@@ -127,8 +118,10 @@ export const loadRepresentationBootstrap = async ({ ctx }) => {
"myRepresentations"
);
console.log(accountDetails);
const isLPA =
accountDetails?.[
accountDetails[
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
] == "LPA"
? true
@@ -155,26 +148,8 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
isLPA
} = bootstrap;
const searchResultsObj = await getBasicSearch(query.case);
if (!searchResultsObj?.value?.[0]) {
consoleLogger({
name: "RepresentationExistingMissingSearchResult",
message:
"loadExistingRepresentation missing search result; redirecting to myportal",
hasCaseQuery: !!query?.case
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
console.log("is lpa?:", isLPA);
const searchDetailsObj = await getSearchDetails(searchResultsObj);
store.dispatch(setSearchResults(searchResultsObj));
store.dispatch(setSearchDetails(searchDetailsObj));
store.dispatch(setContainerID(thisSession.user.id));
store.dispatch(setMyRepresentations(myRepresentations));
store.dispatch(setMyRepresentationsDetails(myRepresentationsDetails));
@@ -184,26 +159,11 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
}
const result = findObjectByKeyValue(
myRepresentations?.value || [],
myRepresentations.value,
"repfile_name",
query.created
);
if (!result) {
consoleLogger({
name: "RepresentationExistingMissingBlobEntry",
message:
"loadExistingRepresentation missing representation blob entry; redirecting to myportal",
hasCreatedQuery: !!query?.created
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
store.dispatch(
setCurrentReference({
"ticketnumber":
@@ -220,7 +180,7 @@ export const loadExistingRepresentation = async ({ store, ctx, bootstrap }) => {
store.dispatch(setRepresentationCapacity(result.representationCapacity));
const repsFileListObj = await getRepsFilesBlobs(
result.containerID || thisSession.user.id,
result.containerID,
result.ticketnumber || result.caseRef,
result.repfile_name
);
@@ -241,21 +201,6 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
const { thisSession, accountDetails } = bootstrap;
const searchResultsObj = await getBasicSearch(query.case);
if (!searchResultsObj?.value?.[0]) {
consoleLogger({
name: "RepresentationNewMissingSearchResult",
message:
"loadNewRepresentation missing search result; redirecting to myportal",
hasCaseQuery: !!query?.case
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const searchDetailsObj = await getSearchDetails(searchResultsObj);
store.dispatch(setContainerID(thisSession.user.id));
@@ -269,26 +214,31 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
})
);
console.log(
accountDetails,
"===================== is nrw",
accountDetails.emailaddress1.includes(process.env.NRWDOMAIN),
"===================== "
);
store.dispatch(
setCurrentReference({
"isNRW":
accountDetails?.emailaddress1?.includes(
process.env.NRWDOMAIN
) || false,
"ticketnumber": searchResultsObj?.value?.[0]?.ticketnumber,
"currentReference": searchResultsObj?.value?.[0]?.title,
accountDetails.emailaddress1.includes(process.env.NRWDOMAIN) ||
false,
"ticketnumber": searchResultsObj.value[0].ticketnumber,
"currentReference": searchResultsObj.value[0].title,
"currentType": "myRepresentations",
"incidentid": searchResultsObj?.value?.[0]?.incidentid,
"appealType": searchResultsObj?.value?.[0]?.pinswg_appealcasetype,
"incidentid": searchResultsObj.value[0].incidentid,
"appealType": searchResultsObj.value[0].pinswg_appealcasetype,
"specialistProcess":
searchDetailsObj?.[0]?.value?.[0]
?.pinswg_speacialistcaseprocess != null ||
searchDetailsObj?.[0]?.value?.[0]
?.pinswg_specialistcaseprocess != null
? searchDetailsObj?.[0]?.value?.[0]
searchDetailsObj[0].value[0].pinswg_speacialistcaseprocess !=
null ||
searchDetailsObj[0].value[0].pinswg_specialistcaseprocess !=
null
? searchDetailsObj[0].value[0]
.pinswg_speacialistcaseprocess ||
searchDetailsObj?.[0]?.value?.[0]
.pinswg_specialistcaseprocess
searchDetailsObj[0].value[0].pinswg_specialistcaseprocess
: ""
})
);
@@ -304,46 +254,15 @@ export const loadNewRepresentation = async ({ store, ctx, bootstrap }) => {
};
export const loadRepresentationPage = async ({ store, ctx }) => {
const { query } = ctx;
if (!query?.case) {
consoleLogger({
name: "RepresentationLoaderMissingCaseQuery",
message:
"loadRepresentationPage missing case query; redirecting to myportal"
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
if (
Object.prototype.hasOwnProperty.call(query, "state") &&
!query?.created
) {
consoleLogger({
name: "RepresentationLoaderMissingCreatedQuery",
message:
"loadRepresentationPage missing created query for state flow; redirecting to myportal"
});
return {
redirect: {
destination: "/myportal",
permanent: false
}
};
}
const bootstrap = await loadRepresentationBootstrap({ ctx });
if (bootstrap?.redirect) {
return bootstrap;
}
if (Object.prototype.hasOwnProperty.call(query, "state")) {
const { query } = ctx;
if (query.hasOwnProperty("state")) {
return loadExistingRepresentation({ store, ctx, bootstrap });
}
-1
View File
@@ -18,7 +18,6 @@
"register-new-account-email-address-label": "Cyfeiriad e-bost",
"register-new-account-email-address-label-errormsg": "Rhowch gyfeiriad e-bost dilys",
"register-new-account-phone-label": "Rhif ffôn",
"register-new-account-company-label": "Cwmni/Grŵp",
"register-new-account-password-label": "Cyfrinair",
"register-new-account-password-label-errormsg": "Cyfrinair",
"register-new-account-confirm-password-label": "Cadarnhau cyfrinair",
-111
View File
@@ -1,111 +0,0 @@
{
"pre-application": "Cyn-ymgeisio",
"pre-application-desc": "Mae'r prosiect hwn yn y cyfnod cyn-ymgeisio ac nid yw wedi'i gyflwyno i PEDW i'w ystyried. Nid yw PEDW yn derbyn sylwadau ar hyn o bryd. Dylid cyfeirio unrhyw ymholiadau at yr ymgeisydd.",
"environmental-impact-assessment-scoping": "Cwmpasu Asesiad Effaith Amgylcheddol",
"environmental-impact-assessment-scoping-desc": "Penderfynu cwmpas y Datganiad Amgylcheddol yn y dyfodol. Dim ond cyflwyniadau am gwmpas arfaethedig y Datganiad Amgylcheddol y bydd PEDW yn eu hystyried ar hyn o bryd.",
"notification": "Hysbysiad",
"notification-desc": "Mae PEDW wedi cael gwybod gan yr ymgeisydd am eu bwriad i gyflwyno cais. Nid yw PEDW yn derbyn sylwadau ar hyn o bryd.",
"acceptance-checking": "Gwirio Derbyniad",
"acceptance-checking-desc": "Mae'r cais wedi'i gyflwyno i PEDW ac mae'n cael ei ddilysu ar hyn o bryd.",
"invalid-submission": "Cyflwyniad Annilys",
"invalid-submission-desc": "Mae'r cais a gyflwynwyd i PEDW wedi'i ganfod yn annilys ac mae angen rhagor o wybodaeth.",
"consultation": "Ymgynghori",
"consultation-desc": "Mae ymgynghoriad ar agor ar y cais hwn. Gellir cyflwyno sylwadau i PEDW yn ystod y cyfnod hwn.",
"re-consultation": "Ail-Ymgynghori",
"re-consultation-desc": "Mae PEDW yn ail-ymgynghori ar y cais hwn - derbynnir sylwadau ar faterion cyfyngedig yn ystod y cyfnod ymgynghori. Gweler yr hysbysiad archwilio ar ein porth am fanylion.",
"reporting": "Adrodd",
"reporting-desc": "Mae'r Arolygydd(ion) yn ystyried y dystiolaeth a gyflwynwyd ar gyfer y cais hwn. Nid yw PEDW yn derbyn sylwadau ar hyn o bryd. ",
"inspectors-decision": "Penderfyniad yr Arolygydd(ion)",
"inspectors-decision-desc": "Mae'r Arolygydd wedi cyhoeddi ei benderfyniad ar y cais hwn.",
"report-to-ministers": "Adrodd i Weinidogion",
"report-to-ministers-desc-cpo": "Mae'r Arolygydd wedi cyflwyno ei adroddiad i Weinidogion Cymru.",
"report-to-ministers-desc": "Mae Gweinidogion Cymru wedi derbyn adroddiad yr Arolygydd(ion) a byddant yn cyhoeddi eu penderfyniad.",
"minister-s-decision": "Penderfyniad y Gweinidog",
"minister-s-decision-desc": "Mae Gweinidogion Cymru wedi cyhoeddi eu penderfyniad ar y cais hwn.",
"minister-s-decision-desc-callin": "Bydd Gweinidogion Cymru yn cyhoeddi eu penderfyniad.",
"case-closed": "Achos wedi'i Gau",
"case-closed-nonval": "Achos Ar Gau - Penderfyniad Wedi'i Gyhoeddi",
"case-closed-desc": "Mae PEDW wedi penderfynu ar yr apêl ac mae'r achos bellach wedi'i gau.",
"case-closed-desc-order": "Mae PEDW wedi penderfynu ar y gorchymyn ac mae'r achos bellach wedi'i gau.",
"case-closed-desc-application": "Mae PEDW wedi penderfynu ar y cais ac mae'r achos bellach wedi'i gau.",
"case-closed-desc-callin": "Mae PEDW wedi penderfynu ar y cais a alwyd i mewn ac mae'r achos bellach wedi'i gau.",
"appeal-submitted": "Apêl wedi'i Chyflwyno",
"appeal-submitted-desc": "Mae PEDW wedi derbyn yr apêl.",
"appeal-registered": "Apêl wedi'i Chofrestru",
"appeal-registered-desc": "Mae PEDW wedi cofrestru'r apêl.",
"appeal-validated": "Apêl wedi'i Dilysu",
"appeal-validated-desc": "Mae PEDW wedi canfod bod yr apêl yn ddilys.",
"case-in-progress": "Achos ar y Gweill",
"case-in-progress-desc": "Mae'r apêl wedi cychwyn.",
"case-in-progress-desc-callin": "Mae'r rhaglen a alwyd i mewn wedi'i chychwyn.",
"questionnaire-lpa-to-notify": "Holiadur / ACLl i'w Hysbysu",
"questionnaire-lpa-to-notify-desc": "Rhaid i'r Awdurdod Cynllunio Lleol gyflwyno eu Holiadur i PEDW a hysbysu partïon â diddordeb o ddechrau'r apêl, a'u cyfle i gyflwyno sylwadau.",
"representations-period": "Cyfnod cynrychioliadau",
"representations-period-desc": "Gellir cyflwyno cynrychiolaethau ar gyfer yr apel yn awr.",
"representations-period-desc-callin": "Gellir cyflwyno sylwadau nawr ar gyfer y cais a alwyd i mewn.",
"final-comments": "Sylwadau Terfynol",
"final-comments-desc": "Gellir cyflwyno sylwadau terfynol nawr ar gyfer y gorchymyn.",
"final-comments-desc-callin": "Gellir cyflwyno sylwadau terfynol nawr ar gyfer y cais a alwyd i mewn.",
"final-comments-desc-cpo": "Gellir cyflwyno sylwadau terfynol ar gyfer y gorchymyn nawr.",
"event": "Digwyddiad",
"event-desc": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer yr apêl hon.",
"event-desc-order": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y gorchymyn hwn.",
"event-desc-callin": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y cais apêl-i-mewn hwn.",
"site-visit": "Ymweliad â Safle",
"site-visit-desc": "Mae'r Arolygydd yn cynnal ei ymweliad â'r safle.",
"decision-issued": "Penderfyniad Wedi'i Gyhoeddi",
"decision-issued-desc": "Mae'r Arolygydd wedi cyflwyno ei benderfyniad i'w gyhoeddi.",
"application-called-in": "Cais Wedi'i Alw I Mewn",
"application-called-in-desc": "Mae'r cais wedi'i alw i mewn gan Weinidogion Cymru.",
"application-registered": "Cais Wedi'i Gofrestru",
"application-registered-desc": "Mae'r cais wedi'i gofrestru gan PEDW.",
"application-validated": "Cais Wedi'i Ddilysu",
"application-validated-desc": "Mae PEDW wedi canfod bod y cais yn ddilys.",
"application-validated-desc-callin": "Mae PEDW wedi canfod bod y cais a alwyd i mewn yn ddilys.",
"lpa-to-notify": "ACLl i Hysbysu",
"lpa-to-notify-desc": "Mae'r Awdurdod Cynllunio Lleol yn hysbysu Partïon â Diddordeb o ddechrau'r cais a Alwyd i Mewn, a'u cyfle i gyflwyno sylwadau.",
"report-issued-to-welsh-ministers": "Adroddiad Wedi'i Gyhoeddi i Weinidogion Cymru",
"report-issued-to-welsh-ministers-desc": "Mae'r Arolygydd wedi cyflwyno ei adroddiad argymhelliad i Weinidogion Cymru.",
"fee-due": "Ffi Ddyledus",
"fee-due-desc": "Os oes angen, mae'r ffi bellach yn ddyledus.",
"validated": "Wedi'i ddilysu",
"appeal-start-case-in-progress": "Cais Wedi'i Ddechrau/Achos Ar Y Gweill",
"statements-representations-period": "Datganiadau/Cyfnod Sylwadau",
"statements-representations-period-desc": "Gellir cyflwyno datganiadau a sylwadau ar gyfer yr apêl nawr.",
"order-submitted": "Gorchymyn Wedi'i Gyflwyno",
"order-submitted-desc": "Mae PEDW wedi derbyn y gorchymyn.",
"order-submission-registered": "Cyflwyniad Gorchymyn Wedi'i Gofrestru",
"order-submission-registered-desc": "Mae PEDW wedi cofrestru'r gorchymyn.",
"order-submission-validated": "Cyflwyniad Gorchymyn Wedi'i Ddilysu",
"order-submission-validated-desc": "Mae PEDW wedi canfod bod y gorchymyn yn ddilys.",
"case-started-case-in-progress": "Achos Wedi'i gychwyn/Achos ar y Gweill",
"case-started-case-in-progress-desc": "Mae'r gorchymyn wedi'i gychwyn.",
"statements": "Datganiadau",
"statements-desc": "Gellir cyflwyno datganiadau ar gyfer yr apêl nawr.",
"statements-desc-application": "Gellir cyflwyno datganiadau ar gyfer y cais nawr.",
"statements-desc-order": "Gellir cyflwyno datganiadau ar gyfer y gorchymyn nawr.",
"event-site-visit": "Digwyddiad/Ymweliad Safle",
"event-site-visit-desc": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y cais hwn, neu mae'r Arolygydd yn cynnal ei ymweliad â'r safle.",
"event-site-visit-desc-order": "Mae PEDW yn trefnu'r digwyddiad Gwrandawiad / Ymchwiliad ar gyfer y gorchymyn hwn, neu mae'r Arolygydd yn cynnal ei ymweliad â'r safle.",
"application-submitted": "Cais Wedi'i Gyflwyno",
"application-submitted-desc": "Mae PEDW wedi derbyn y cais.",
"application-start-case-in-progress": "Cais Wedi'i Ddechrau/Achos Ar Y Gweill",
"application-start-case-in-progress-desc": "Mae'r cais wedi'i gychwyn.",
"applicant-statement-on-representations": "Datganiad yr Ymgeisydd ar Gynrychioliadau",
"applicant-statement-on-representations-desc": "Gall yr ymgeisydd nawr gyflwyno ei ddatganiad ar gyfer y cais.",
"representatives-comment": "Sylwadau'r Cynrychiolwyr",
"representatives-comment-desc": "Gall cynrychiolwyr nawr gyflwyno eu sylwadau ar ddatganiad yr ymgeisydd.",
"applicants-final-comment": "Sylwadau Terfynol yr Ymgeisydd",
"applicants-final-comment-desc": "Gall yr ymgeisydd nawr gyflwyno sylwadau terfynol ar gyfer y cais.",
"order-registered": "Gorchymyn Wedi'i Gofrestru",
"order-validated": "Gorchymyn Wedi'i Ddilysu",
"report-to-desnz": "Adrodd i DESNZ",
"report-to-desnz-desc": "Mae'r Arolygydd wedi cyflwyno ei adroddiad i DESNZ.",
"case-in-progress-assessment": "Achos ar y Gweill / Asesiad",
"decision-outcome": "Penderfyniad / Canlyniad",
"decision-outcome-desc": "Mae PEDW wedi gwneud ei benderfyniad ar ddilysrwydd y cais.",
"status-complete": "Wedi cwblhau",
"status-in-progress": "Ar y gweill",
"status-not-started": "Heb ddechrau",
"status-blocked": "Wedi'i rwystro"
}
+3 -9
View File
@@ -6,7 +6,7 @@
"summary-tab-map-label": " Map",
"summary-tab-events-label": " Digwyddiadau",
"summary-tab-documents-label": "Dogfennau",
"summary-tab-media-label": "Recordiadau",
"summary-tab-media-label": "Cyfryngau",
"summary-reference-label": "Cyfeirnod",
"summary-applicant-label": "Apelydd",
"summary-applicantonly-label": "Ymgeisydd",
@@ -144,12 +144,6 @@
"summary-report-issued-to-welsh-ministers": "Adroddiad a Gyhoeddwyd i Weinidogion Cymru",
"summary-decision-issued-to-applicant": "Penderfyniad a Gyhoeddwyd i'r Ymgeisydd",
"summary-decision-outcome": "Canlyniad y Penderfyniad",
"media-title": "Recordiadau digwyddiadau",
"video-heading": "Fideos",
"live-event-subheading": "Digwyddiad byw",
"live-event-copy": "Mae digwyddiad sy'n cael ei ffrydio'n fyw yn digwydd nawr.",
"live-event-link": "Gwylio'r ffrydio byw",
"status-title": "Statws",
"status-show-all-label": "Dangoswch bob cam",
"status-hide-all-label": "Cuddio pob cam"
"media-title": "Cyfryngau",
"video-heading": "Fideos"
}
+4 -5
View File
@@ -1,14 +1,13 @@
{
"page-title": "Prosiectau Isadeiledd",
"page-intro-paragraph-1": "Mae dau fath gwahanol o gais ar gyfer prosiectau seilwaith mawr a bennir gan Weinidogion Cymru: Datblygiadau o Arwyddocâd Cenedlaethol a Phrosiectau Seilwaith Sylweddol.",
"page-intro-list-item-1": " Datblygiadau o Arwyddocâd Cenedlaethol yw datblygiadau a diffinio yn ",
"page-intro-paragraph-1": "Mae dau fath gwahanol o gais ar gyfer prosiectau seilwaith, sef Datblygiadau o Arwyddocâd Cenedlaethol a Phrosiectau Seilwaith Arwyddocaol.",
"page-intro-list-item-1": " Datblygiadau o Arwyddocâd Cenedlaethol yw datblygiadau a ddiffinnir yn ",
"page-intro-list-item-1-link": "https://www.llyw.cymru/datblygiadau-o-arwyddocad-cenedlaethol-dns-ceisiadau",
"page-intro-list-item-2": "Mae Prosiectau Seilwaith Arwyddocaol yn ddatblygiadau sydd wedi'u diffinio yn ",
"page-intro-list-item-2": "Mae Prosiectau Seilwaith Arwyddocaol yn ddatblygiadau sydd wedi'u diffinio (YMA)",
"page-intro-list-item-2-link": "https://www.llyw.cymru/datblygiadau-o-arwyddocad-cenedlaethol-dns-ceisiadau",
"page-intro-list-item-3": "Lle penderfynwyd ar gynnig.",
"page-intro-paragraph-2": "Defnyddiwch y tabl isod i ddod o hyd i geisiadau fesul cam neu fath. Fel arall, defnyddiwch y map trwy glicio ar y marcwyr i fynd ir dudalen geisiadau. Mae rhestr o ddigwyddiadau a therfynau amser allweddol ar gyfer pob cais ar gael ar ein ",
"page-intro-paragraph-2-link": "tudalen galendr",
"page-intro-list-item-3": "Yn ogystal, mae rhai prosiectau seilwaith yng Nghymru ar raddfa nad ydynt wedi'u datganoli i Gymru ac yn hytrach yn cael eu penderfynu gan Lywodraeth y DU, er enghraifft, prosiectau cynhyrchu ynni dros 350MW. Gelwir y rhain yn Brosiectau Seilwaith Cenedlaethol eu Harwyddocâd (NSIPs) ac mae rhagor o wybodaeth ar gael yma: ",
"page-intro-list-item-3-link": "https://national-infrastructure-consenting.planninginspectorate.gov.uk/?lang=cy",
"result-list-heading-label-reference": "Cyfeirnod",
"result-list-heading-label-application": "Cais",
"result-list-heading-label-developer": "Datblygwr",
+1 -5
View File
@@ -53,9 +53,5 @@
"casescomment-card-paragraph-three": "Gallwch wneud sylwadau ar apeliadau a cheisiadau yn ystod y cyfnod cynrychioli neu gyflwyno datganiadau achos neu'r Holiadur LPA.",
"casescomment-card-paragraph-four": "Cyfeiriwch at y dyddiadau cau ar gyfer cynrychioli achosion unigol ar gyfer datganiadau a sylwadau.",
"signin-benefits-title": "Mewngofnodwch i'ch porth",
"signin-benefits-paragraph": "Drwy fewngofnodi gyda'r botwm Mewngofnodi, byddwch yn gallu:",
"ai-policy-notice-title": "Pwysig: canllawiau ar ddefnyddio cynnwys a gynhyrchir gan AI",
"ai-policy-notice-paragraph-one": "Deellir y gall partïon ddewis defnyddio Deallusrwydd Artiffisial Cynhyrchiol (AI) wrth gyflwyno apeliadau neu gynrychioliadau i PEDW. Er bod gan y rhai sy'n ymgysylltu â PEDW hawl i ddefnyddio AI i gynorthwyo eu cyflwyniadau, dylid nodi y gall cynnwys a gynhyrchir gan AI gynnwys honiadau ffug neu ddi-sail.",
"ai-policy-notice-paragraph-two": "Gan y bydd cyflwyniadau ysgrifenedig yn destun craffu yn y broses apelio, o bosibl o dan groesholiad mewn gwrandawiadau ac ymholiadau, ni ddylech wneud cyflwyniadau ysgrifenedig nad ydych yn eu deall neu'n gwybod eu bod yn gywir. Gall cyflwyno tystiolaeth anghywir arwain at gost ddiangen wrth wirio neu wrthbrofi tystiolaeth o'r fath a gallai arwain at ddyfarnu costau yn eich erbyn. Gweler ein Canllawiau ar gyfer defnyddio AI Cynhyrchiol am ragor o wybodaeth.",
"ai-policy-notice-dismiss-button": "Rwy'n deall"
"signin-benefits-paragraph": "Drwy fewngofnodi gyda'r botwm Mewngofnodi, byddwch yn gallu:"
}
-7
View File
@@ -21,11 +21,6 @@
"consultation-from-an-interested-person-heading": "Ymateb i'r ymgynghoriad gan Barti/Person â Diddordeb",
"kind-of-rep-label": "Pa fath o sylw ydych chi'n ei wneud?",
"kind-of-consultation-label": "Pa fath o ymateb i'r ymgynghoriad ydych chi'n ei wneud?",
"rep-type-statement-hint": "Gall Partïon â Diddordeb gyflwyno eu sylwadau ar yr apêl / cais erbyn y dyddiad cau o 4 wythnos. Dyma'ch cyfle i wneud sylwadau ar yr apêl / cais a'r dogfennau a gyflwynwyd gan yr apelydd / ymgeisydd.",
"rep-type-final-comments-hint": "Gall pob parti gyflwyno Sylwadau Terfynol ar yr apêl / cais erbyn y dyddiad cau o 6 wythnos. Rhaid i'ch Sylwadau Terfynol ymateb i'r Datganiad a'r Sylwadau a gyflwynwyd gan yr Awdurdod Cynllunio Lleol a Phartïon â Diddordeb ar gyfer y dyddiad cau o 4 wythnos yn unig. Ni all eich Sylwadau Terfynol gyflwyno deunydd newydd na chyflwyno dadleuon y dylid bod wedi'u cynnwys yn eich Datganiad cynharach. Os gwnewch hynny, ni fydd eich sylwadau'n cael eu derbyn a byddant yn cael eu hanwybyddu.",
"rep-type-questionnaire-hint": "Mae holiadur ar gyfer Awdurdodau Cynllunio Lleol i ddarparu'r wybodaeth achos ofynnol.",
"rep-type-consultation-hint": "Gall Partïon â Diddordeb gyflwyno eu sylwadau ar y cais erbyn y dyddiad cau o 5 wythnos. Dyma'ch cyfle i wneud sylwadau ar y cais a'r dogfennau a gyflwynwyd gan yr ymgeisydd.",
"rep-type-lir-hint": "Dylai'r LIR nodi asesiad yr ACLl o effeithiau tebygol y datblygiad arfaethedig ar yr ardal leol. NI ddylai'r LIR gynnwys tystiolaeth newydd oni bai ei fod yn cael ei nodi'n glir felly ac ni ddylai ailadrodd sylwadau a ddarparwyd eisoes oni bai bod angen hynny er mwyn eglurder. Rhaid cyflwyno'r LIR o fewn yr amserlen statudol.",
"enter-comment-label": "Gallwch roi eich cynrychioliad yn y gofod a ddarparwyd neu atodi dogfen ar wahân.",
"consultation-comment-label": "Gallwch atodi'ch dogfennau sy'n gysylltiedig â'ch ymateb i'r ymgynghoriad.",
"comments-set-out-label": "Mae fy sylwadau wedi'u nodi yn",
@@ -261,8 +256,6 @@
"rep-period-notice-label": "Aeth y dyddiad dyledus ar gyfer y sylw hwn heibio. Ni allwch gyflwyno'r wybodaeth a ddarparwyd gennych mwyach.",
"representation-onbehalfof-hint": " e.e. \"Perchnogion Rhifau 1-5 Stryd Fawr\", neu \"Mr a Mrs Smith\" neu \"ysgutorion ystâd Mr Evans\"",
"representation-onbehalfof-label": "Rhowch enw'r cwmni/grŵp/sefydliad",
"representation-type-unavailable-label": "Nid oes unrhyw fathau o sylwadau ar gael ar gyfer yr achos hwn ar hyn o bryd.",
"return-home-link-label": "Dychwelyd i'r hafan",
"docsoffline-reps-label": "Oherwydd gwaith cynnal a chadw system, ni allwn dderbyn sylwadau ar hyn o bryd. Rhowch gynnig arall arni yn nes ymlaen.",
"return-to-myportal-link": "Dychwelyd i Fy Mhorth"
}
-1
View File
@@ -18,7 +18,6 @@
"register-new-account-email-address-label": "Email address",
"register-new-account-email-address-label-errormsg": "Enter a valid email address",
"register-new-account-phone-label": "Telephone",
"register-new-account-company-label": "Company/Group",
"register-new-account-password-label": "Password",
"register-new-account-password-label-errormsg": "Password",
"register-new-account-confirm-password-label": "Confirm password",
-111
View File
@@ -1,111 +0,0 @@
{
"pre-application": "Pre-Application",
"pre-application-desc": "This project is at pre-application stage and it has not been submitted to PEDW for consideration. PEDW is not accepting representations at this stage. Any queries should be directed to the applicant.",
"environmental-impact-assessment-scoping": "Environmental Impact Assessment Scoping",
"environmental-impact-assessment-scoping-desc": "Determination of the scope of the future Environmental Statement. PEDW will only consider submissions about the proposed scope of the Environmental Statement at this time.",
"notification": "Notification",
"notification-desc": "PEDW has been notified by the applicant of their intention to submit an application. PEDW is not accepting representations at this stage.",
"acceptance-checking": "Acceptance Checking",
"acceptance-checking-desc": "The application has been submitted to PEDW and is currently being validated.",
"invalid-submission": "Invalid Submission",
"invalid-submission-desc": "The application submitted to PEDW has been found invalid and further information is required.",
"consultation": "Consultation",
"consultation-desc": "Consultation is open on this application. Representations may be submitted to PEDW during this period.",
"re-consultation": "Re-Consultation",
"re-consultation-desc": "PEDW is re-consulting on this application - representations on limited matters will be accepted during the consultation period. Please see the examination notice on our portal for details.",
"reporting": "Reporting",
"reporting-desc": "The Inspector(s) is considering the evidence submitted for this application. PEDW is not accepting representations at this stage. ",
"inspectors-decision": "Inspector(s) Decision",
"inspectors-decision-desc": "The Inspector has issued their decision on this application.",
"report-to-ministers": "Report to Ministers",
"report-to-ministers-desc-cpo": "The Inspector has submitted their report to the Welsh Ministers.",
"report-to-ministers-desc": "The Welsh Ministers have received the Inspector(s)'s report and will issue their decision.",
"minister-s-decision": "Minister's Decision",
"minister-s-decision-desc": "The Welsh Ministers have issued their decision on this application.",
"minister-s-decision-desc-callin": "The Welsh Ministers will issue their decision.",
"case-closed": "Case Closed",
"case-closed-nonval": "Case Closed - Decision Issued",
"case-closed-desc": "PEDW has determined the appeal and the case has now been closed.",
"case-closed-desc-order": "PEDW has determined the order and the case has now been closed.",
"case-closed-desc-application": "PEDW has determined the application and the case has now been closed.",
"case-closed-desc-callin": "PEDW has determined the called-in application and the case has now been closed.",
"appeal-submitted": "Appeal Submitted",
"appeal-submitted-desc": "Appeal has been received by PEDW.",
"appeal-registered": "Appeal Registered",
"appeal-registered-desc": "Appeal has been registered by PEDW.",
"appeal-validated": "Appeal Validated",
"appeal-validated-desc": "PEDW has found the appeal valid.",
"case-in-progress": "Case in Progress",
"case-in-progress-desc": "The appeal has been started.",
"case-in-progress-desc-callin": "The called-in application has been started.",
"questionnaire-lpa-to-notify": "Questionnaire / LPA to Notify",
"questionnaire-lpa-to-notify-desc": "The Local Planning Authority must submit their Questionnaire to PEDW and notify interested parties of the start of the appeal, and their opportunity to submit comments.",
"representations-period": "Representations Period",
"representations-period-desc": "Representations may now be submitted for the appeal.",
"representations-period-desc-callin": "Representations may now be submitted for the called-in application.",
"final-comments": "Final Comments",
"final-comments-desc": "Final comments may now be submitted for the appeal.",
"final-comments-desc-callin": "Final comments may now be submitted for the called-in application.",
"final-comments-desc-cpo": "Final comments may now be submitted for the order.",
"event": "Event",
"event-desc": "PEDW is arranging the Hearing / Inquiry event for this appeal.",
"event-desc-order": "PEDW is arranging the Hearing / Inquiry event for this order.",
"event-desc-callin": "PEDW is arranging the Hearing / Inquiry event for this appeal-in application.",
"site-visit": "Site Visit",
"site-visit-desc": "The Inspector is conducting their visit to the site.",
"decision-issued": "Decision Issued",
"decision-issued-desc": "The Inspector has submitted their decision for issuing.",
"application-called-in": "Application Called-In",
"application-called-in-desc": "Application has been called-in by the Welsh Ministers.",
"application-registered": "Application Registered",
"application-registered-desc": "Application has been registered by PEDW.",
"application-validated": "Application Validated",
"application-validated-desc": "PEDW has found the application valid.",
"application-validated-desc-callin": "PEDW has found the called-in application valid.",
"lpa-to-notify": "LPA to Notify",
"lpa-to-notify-desc": "The Local Planning Authority is notifying Interested Parties of the start of the Called-In application, and their opportunity to submit comments.",
"report-issued-to-welsh-ministers": "Report Issued to Welsh Ministers",
"report-issued-to-welsh-ministers-desc": "The Inspector has submitted their recommendation report to the Welsh Ministers.",
"fee-due": "Fee Due",
"fee-due-desc": "If required, the payment of the fee is now due.",
"validated": "Validated",
"appeal-start-case-in-progress": "Appeal Start / Case in Progress",
"statements-representations-period": "Statements/Representations Period",
"statements-representations-period-desc": "Statements and representations may now be submitted for the appeal.",
"order-submitted": "Order Submitted",
"order-submitted-desc": "Order has been received by PEDW.",
"order-submission-registered": "Order Submission Registered",
"order-submission-registered-desc": "Order has been registered by PEDW.",
"order-submission-validated": "Order Submission Validated",
"order-submission-validated-desc": "PEDW has found the order valid.",
"case-started-case-in-progress": "Case started/Case in Progress",
"case-started-case-in-progress-desc": "The order has been started.",
"statements": "Statements",
"statements-desc": "Statements may now be submitted for the appeal.",
"statements-desc-application": "Statements may now be submitted for the application.",
"statements-desc-order": "Statements may now be submitted for the order.",
"event-site-visit": "Event/Site Visit",
"event-site-visit-desc": "PEDW is arranging the Hearing / Inquiry event for this application, or the Inspector is conducting their visit to the site.",
"event-site-visit-desc-order": "PEDW is arranging the Hearing / Inquiry event for this order, or the Inspector is conducting their visit to the site.",
"application-submitted": "Application Submitted",
"application-submitted-desc": "Application has been received by PEDW.",
"application-start-case-in-progress": "Application Start/Case In Progress",
"application-start-case-in-progress-desc": "The application has been started.",
"applicant-statement-on-representations": "Applicant Statement on Representations",
"applicant-statement-on-representations-desc": "The applicant may now submit their statement for the application.",
"representatives-comment": "Representatives Comment",
"representatives-comment-desc": "Representatives may now submit their comments on the applicant's statement.",
"applicants-final-comment": "Applicants Final Comment",
"applicants-final-comment-desc": "The applicant may now submit final comments for the application.",
"order-registered": "Order Registered",
"order-validated": "Order Validated",
"report-to-desnz": "Report to DESNZ",
"report-to-desnz-desc": "The Inspector has submitted their report to DESNZ.",
"case-in-progress-assessment": "Case in Progress / Assessment",
"decision-outcome": "Decision / Outcome",
"decision-outcome-desc": "PEDW has made their decision on the validity of the application.",
"status-complete": "Complete",
"status-in-progress": "In progress",
"status-not-started": "Not started",
"status-blocked": "Blocked"
}
+3 -9
View File
@@ -6,7 +6,7 @@
"summary-tab-map-label": "Map",
"summary-tab-events-label": "Events",
"summary-tab-documents-label": "Documents",
"summary-tab-media-label": "Event recordings",
"summary-tab-media-label": "Media",
"summary-reference-label": "Reference",
"summary-applicant-label": "Appellant",
"summary-applicantonly-label": "Applicant",
@@ -145,12 +145,6 @@
"summary-report-issued-to-welsh-ministers": "Report Issued to Welsh Ministers",
"summary-decision-issued-to-applicant": "Decision Issued to Applicant",
"summary-decision-outcome": "Decision Outcome",
"media-title": "Event recordings",
"video-heading": "Videos",
"live-event-subheading": "Live event",
"live-event-copy": "A live streamed event is happening now.",
"live-event-link": "Watch live stream",
"status-title": "Status",
"status-show-all-label": "Show all stages",
"status-hide-all-label": "Hide all stages"
"media-title": "Media",
"video-heading": "Fideos"
}

Some files were not shown because too many files have changed in this diff Show More