diff --git a/.env.local b/.env.local index ed13161f..035eccf5 100644 --- a/.env.local +++ b/.env.local @@ -1,9 +1,9 @@ // dev -//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/ -//RELAYURI = "dev-pedw-ns.servicebus.windows.net" -//RELAYPATH = "dev-pedw-hc" -//SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y=" -//SASKEYNAME = "devpedwnspolicy" +RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/ +RELAYURI = "dev-pedw-ns.servicebus.windows.net" +RELAYPATH = "dev-pedw-hc" +SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y=" +SASKEYNAME = "devpedwnspolicy" PORT= "3000" @@ -23,11 +23,11 @@ I18N_DOMAIN = "cymru.local" //preprod -RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/ -RELAYURI = "pp-pedw-ns.servicebus.windows.net" -RELAYPATH = "pp-pedw-hc" -SASKEY = "JzrOYfMTsGBD1cZHH2nkzqsbfDCqg0brO6jyiIDNVPo=" -SASKEYNAME = "pppedwnspolicy" +//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/ +//RELAYURI = "pp-pedw-ns.servicebus.windows.net" +//RELAYPATH = "pp-pedw-hc" +//SASKEY = "JzrOYfMTsGBD1cZHH2nkzqsbfDCqg0brO6jyiIDNVPo=" +//SASKEYNAME = "pppedwnspolicy" GOOGLE_TAG_MANAGER = GTM-T78CBC3 diff --git a/actions/index.js b/actions/index.js index 8e9d0c3f..3dc36942 100644 --- a/actions/index.js +++ b/actions/index.js @@ -642,7 +642,7 @@ export const getLPA = (token) => { azureHeaders(token) ) .then((res) => { - // console.log(res.data); + console.log(res.data); return res.data; }) .catch((error) => { diff --git a/components/case/documents.js b/components/case/documents.js index 0b6c5226..bfcc9a59 100644 --- a/components/case/documents.js +++ b/components/case/documents.js @@ -52,9 +52,13 @@ const DocumentDetails = (props) => { return ( <>

- {t("case:documents-count-label-1")}{" "} + {documentDetailsObj["@odata.count"] > 1 + ? t("case:documents-count-label-1") + : t("case:documents-count-label-1a")}{" "} {documentDetailsObj["@odata.count"]}{" "} - {t("case:documents-count-label-2")} + {documentDetailsObj["@odata.count"] > 1 + ? t("case:documents-count-label-2") + : t("case:documents-count-label-2a")}

diff --git a/components/case/pagination.js b/components/case/pagination.js index 4d2a6600..50b88581 100644 --- a/components/case/pagination.js +++ b/components/case/pagination.js @@ -73,81 +73,84 @@ const PaginationControl = (props) => { return ( <> - {" "} -
-
-
- {currentPage != 1 ? ( - { - spinnerState(), - getDocumentResults(currentPage - 1); - }} - > - {t("common:previous-link-button")} - - ) : ( - - {t("common:previous-link-button")} - - )} -
-
- {paginationArray.map((e, i) => - currentPage == i + 1 ? ( + {pagesCount > 1 ? ( +
+
+
+ {currentPage != 1 ? ( - {e} - - ) : e == "..." ? ( - - {e} - - ) : ( - { - spinnerState(); - console.log(i + 1); - getDocumentResults(i + 1); + spinnerState(), + getDocumentResults(currentPage - 1); }} > - {e} + {t("common:previous-link-button")} - ) - )} + ) : ( + + {t("common:previous-link-button")} + + )} +
+
+ {paginationArray.map((e, i) => + currentPage == i + 1 ? ( + + {e} + + ) : e == "..." ? ( + + {e} + + ) : ( + { + spinnerState(); + console.log(i + 1); + getDocumentResults(i + 1); + }} + > + {e} + + ) + )} +
+
+ {currentPage != pagesCount ? ( + { + spinnerState(), + getDocumentResults(currentPage + 1); + }} + > + {t("common:next-link-button")} + + ) : ( + + {" "} + {t("common:next-link-button")} + + )} +
-
- {currentPage != pagesCount ? ( - { - spinnerState(), - getDocumentResults(currentPage + 1); - }} - > - {t("common:next-link-button")} - - ) : ( - - {" "} - {t("common:next-link-button")} - - )} +
+ {t("common:pages-label")} {currentPage}{" "} + {t("common:of-label")} {pagesCount}
-
- {t("common:pages-label")} {currentPage}{" "} - {t("common:of-label")} {pagesCount} -
-
+ ) : ( + "" + )} ); }; diff --git a/components/case/summary.js b/components/case/summary.js index 900adc9e..4fb59036 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -282,6 +282,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -292,6 +293,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -302,6 +304,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -312,6 +315,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -323,6 +327,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -333,6 +338,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -343,6 +349,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -353,6 +360,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -363,6 +371,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -373,6 +382,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -383,6 +393,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -393,6 +404,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -403,6 +415,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -413,6 +426,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -423,6 +437,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -433,6 +448,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -443,6 +459,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -453,6 +470,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -463,6 +481,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -473,6 +492,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -484,6 +504,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -495,6 +516,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -505,6 +527,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -515,6 +538,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; @@ -525,6 +549,7 @@ const CaseSummary = (props) => { detailsObj={detailsObj} formatDates={formatDates} linkedCasesList={linkedCasesList} + currentView={props.currentView} /> ); break; diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js index 56dac0a0..24daceeb 100644 --- a/components/case/summaryTypes/pinswg_dnsid.js +++ b/components/case/summaryTypes/pinswg_dnsid.js @@ -12,35 +12,44 @@ const Pinswg_dnsid = (props) => { const { locale } = router; return ( <> -
-
-
-

- {t("case:summary-project-details-label")} -

-

- {router.locale == "cy" - ? detailsObj.pinswg_projectdescription.split( - ";" - )[1] - : detailsObj.pinswg_projectdescription.split( - ";" - )[0]} -

+ {detailsObj.pinswg_projectdescription != null || + detailsObj.pinswg_projectlocation != null ? ( +
+
+
+

+ {t("case:summary-project-details-label")} +

+

+ {detailsObj.pinswg_projectdescription != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectdescription.split( + ";" + )[1] + : detailsObj.pinswg_projectdescription.split( + ";" + )[0] + : ""} +

-

- {" "} - {router.locale == "cy" - ? detailsObj.pinswg_projectlocation.split( - ";" - )[1] - : detailsObj.pinswg_projectlocation.split( - ";" - )[0]} -

+

+ {detailsObj.pinswg_projectlocation != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectlocation.split( + ";" + )[1] + : detailsObj.pinswg_projectlocation.split( + ";" + )[0] + : ""} +

+
-
+ ) : ( + "" + )} +
diff --git a/components/case/summaryTypes/pinswg_electricityactid.js b/components/case/summaryTypes/pinswg_electricityactid.js index ab3d6082..f932a71c 100644 --- a/components/case/summaryTypes/pinswg_electricityactid.js +++ b/components/case/summaryTypes/pinswg_electricityactid.js @@ -12,35 +12,43 @@ const Pinswg_electricityactid = (props) => { const { locale } = router; return ( <> -
-
-
-

- {t("case:summary-project-details-label")} -

-

- {router.locale == "cy" - ? detailsObj.pinswg_projectdescription.split( - ";" - )[1] - : detailsObj.pinswg_projectdescription.split( - ";" - )[0]} -

+ {detailsObj.pinswg_projectdescription != null || + detailsObj.pinswg_projectlocation != null ? ( +
+
+
+

+ {t("case:summary-project-details-label")} +

+

+ {detailsObj.pinswg_projectdescription != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectdescription.split( + ";" + )[1] + : detailsObj.pinswg_projectdescription.split( + ";" + )[0] + : ""} +

-

- {" "} - {router.locale == "cy" - ? detailsObj.pinswg_projectlocation.split( - ";" - )[1] - : detailsObj.pinswg_projectlocation.split( - ";" - )[0]} -

+

+ {detailsObj.pinswg_projectlocation != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectlocation.split( + ";" + )[1] + : detailsObj.pinswg_projectlocation.split( + ";" + )[0] + : ""} +

+
-
+ ) : ( + "" + )}
diff --git a/components/case/summaryTypes/pinswg_harbourrevisionorderid.js b/components/case/summaryTypes/pinswg_harbourrevisionorderid.js index 9f8eef3c..66dace02 100644 --- a/components/case/summaryTypes/pinswg_harbourrevisionorderid.js +++ b/components/case/summaryTypes/pinswg_harbourrevisionorderid.js @@ -12,35 +12,43 @@ const Pinswg_harbourrevisionorderid = (props) => { const { locale } = router; return ( <> -
-
-
-

- {t("case:summary-project-details-label")} -

-

- {router.locale == "cy" - ? detailsObj.pinswg_projectdescription.split( - ";" - )[1] - : detailsObj.pinswg_projectdescription.split( - ";" - )[0]} -

+ {detailsObj.pinswg_projectdescription != null || + detailsObj.pinswg_projectlocation != null ? ( +
+
+
+

+ {t("case:summary-project-details-label")} +

+

+ {detailsObj.pinswg_projectdescription != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectdescription.split( + ";" + )[1] + : detailsObj.pinswg_projectdescription.split( + ";" + )[0] + : ""} +

-

- {" "} - {router.locale == "cy" - ? detailsObj.pinswg_projectlocation.split( - ";" - )[1] - : detailsObj.pinswg_projectlocation.split( - ";" - )[0]} -

+

+ {detailsObj.pinswg_projectlocation != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectlocation.split( + ";" + )[1] + : detailsObj.pinswg_projectlocation.split( + ";" + )[0] + : ""} +

+
-
+ ) : ( + "" + )}
diff --git a/components/case/summaryTypes/pinswg_transportandworkactid.js b/components/case/summaryTypes/pinswg_transportandworkactid.js index cc264083..aa0937d6 100644 --- a/components/case/summaryTypes/pinswg_transportandworkactid.js +++ b/components/case/summaryTypes/pinswg_transportandworkactid.js @@ -12,35 +12,43 @@ const Pinswg_transportandworkactid = (props) => { const { locale } = router; return ( <> -
-
-
-

- {t("case:summary-project-details-label")} -

-

- {router.locale == "cy" - ? detailsObj.pinswg_projectdescription.split( - ";" - )[1] - : detailsObj.pinswg_projectdescription.split( - ";" - )[0]} -

+ {detailsObj.pinswg_projectdescription != null || + detailsObj.pinswg_projectlocation != null ? ( +
+
+
+

+ {t("case:summary-project-details-label")} +

+

+ {detailsObj.pinswg_projectdescription != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectdescription.split( + ";" + )[1] + : detailsObj.pinswg_projectdescription.split( + ";" + )[0] + : ""} +

-

- {" "} - {router.locale == "cy" - ? detailsObj.pinswg_projectlocation.split( - ";" - )[1] - : detailsObj.pinswg_projectlocation.split( - ";" - )[0]} -

+

+ {detailsObj.pinswg_projectlocation != null + ? router.locale == "cy" + ? detailsObj.pinswg_projectlocation.split( + ";" + )[1] + : detailsObj.pinswg_projectlocation.split( + ";" + )[0] + : ""} +

+
-
+ ) : ( + "" + )}
diff --git a/data/lookuptranslations.json b/data/lookuptranslations.json index ae4c01a0..88e8265c 100644 --- a/data/lookuptranslations.json +++ b/data/lookuptranslations.json @@ -311,6 +311,11 @@ "value_cy": "Cyngor a Dinas Abertawe", "pinswg_lpa": 0 }, + { + "value": "City and County of Swansea Council", + "value_cy": "Dinas a Sir Abertawe", + "pinswg_lpa": 0 + }, { "value": "Torfaen County Borough Council", "value_cy": "Cyngor Bwrdeistref Sirol Torfaen", diff --git a/locales/cy/case.json b/locales/cy/case.json index 09f99842..857780ba 100644 --- a/locales/cy/case.json +++ b/locales/cy/case.json @@ -41,6 +41,8 @@ "documents-checking-label": "Gwirio am ddogfennau", "documents-count-label-1": "Mae yna", "documents-count-label-2": "dogfennau", + "documents-count-label-1a": "Mae yna", + "documents-count-label-2a": "dogfen", "summary-application-accepted-as-valid": "Derbynnir cais fel un dilys", "summary-application-rejected-as-invalid": "Gwrthodwyd y cais fel Ymfudwr", "summary-confirm-request-to-vary-application": "Cadarnhewch y cais i amrywio cais", diff --git a/locales/en/case.json b/locales/en/case.json index 40cffcc5..bf936078 100644 --- a/locales/en/case.json +++ b/locales/en/case.json @@ -41,6 +41,8 @@ "documents-checking-label": "Checking for documents", "documents-count-label-1": "There are", "documents-count-label-2": "documents", + "documents-count-label-1a": "There is", + "documents-count-label-2a": "document", "summary-application-accepted-as-valid": "Application Accepted as Valid", "summary-application-rejected-as-invalid": "Application rejected as Invalid", "summary-confirm-request-to-vary-application": "Confirm Request to Vary Application",