diff --git a/components/case/documents.js b/components/case/documents.js index e9c698ec..9e096b5a 100644 --- a/components/case/documents.js +++ b/components/case/documents.js @@ -75,113 +75,130 @@ const DocumentDetails = (props) => { {t("case:documents-size-label")} */} + {showSpinnerState == true ? ( +
+
+ {t("common:spinner-fetching-data")} + { +
+
+ ) : ( + documentDetailsArr.map((item) => { + let detailsObj = jsonpath.query( + item, + "$..[?(@._pinswg_documentids_value=='" + + incidentid + + "')]" + ); + detailsObj = item; - {documentDetailsArr.map((item) => { - let detailsObj = jsonpath.query( - item, - "$..[?(@._pinswg_documentids_value=='" + - incidentid + - "')]" - ); - detailsObj = item; + if (typeof detailsObj != "undefined") { + var documentHistoryArr = + documentHistoryObj || []; + return documentHistoryArr.map( + (historyItem, key) => { + let historyObj = jsonpath.query( + documentHistoryObj[key], + "$..value[?(@._pinswg_documentid_value=='" + + detailsObj.pinswg_documentid + + "')]" + ); - if (typeof detailsObj != "undefined") { - var documentHistoryArr = documentHistoryObj || []; - return documentHistoryArr.map( - (historyItem, key) => { - let historyObj = jsonpath.query( - documentHistoryObj[key], - "$..value[?(@._pinswg_documentid_value=='" + - detailsObj.pinswg_documentid + - "')]" - ); - - historyObj = historyObj[0]; - return !_.isEmpty(historyObj) ? ( -
-
- + historyObj = historyObj[0]; + return !_.isEmpty(historyObj) ? ( +
+
+ + + {t( + "case:documents-name-label" + )} + : + + {_.has(historyObj, [ + "_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue", + ]) + ? historyObj[ + "_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue" + ] + : ""} + +
+
{t( - "case:documents-name-label" + "case:documents-doc-type-label" )} : + + {router.locale == "cy" + ? jsonpath.query( + transLookup, + '$..[?(@.value=="' + + detailsObj[ + "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy' + ) + : detailsObj[ + "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" + ] || + t( + "case:summary-no-date-entered-label" + )} +
+
+ + {t( + "case:documents-date-published-label" + )} + : + + {_.has(historyObj, [ - "_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue", + "pinswg_publisheddate@OData.Community.Display.V1.FormattedValue", ]) - ? historyObj[ - "_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue" - ] + ? formatDates( + historyObj.pinswg_publisheddate + ) : ""} - -
-
- - {t( - "case:documents-doc-type-label" - )} - : - - - {router.locale == "cy" - ? jsonpath.query( - transLookup, - '$..[?(@.value=="' + - detailsObj[ - "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" - ] + - '")].value_cy' - ) - : detailsObj[ - "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" - ] || - t( - "case:summary-no-date-entered-label" - )} -
-
- - {t( - "case:documents-date-published-label" - )} - : - - - {_.has(historyObj, [ - "pinswg_publisheddate@OData.Community.Display.V1.FormattedValue", - ]) - ? historyObj[ - "pinswg_publisheddate@OData.Community.Display.V1.FormattedValue" - ] - : ""} -
- {/*
+
+ {/*
{t("case:documents-size-label")}: 92
*/} -
- ) : ( - "" - ); - } - ); - } - })} + + ) : ( + "" + ); + } + ); + } + }) + )} @@ -201,7 +218,6 @@ const DocumentDetails = (props) => { (result) => { setDocumentHistory(result); setDocumentSearchState(true); - return result; } ); @@ -236,16 +252,13 @@ const DocumentDetails = (props) => { const getDocumentResults = (pageNumber) => { getSearchDocumentDetailsPaged(incidentid, pageNumber) - .then((data) => { - //console.log(data); - setDocumentDetails(data); - return data; - }) + .then((data) => data) .then((data) => { //console.log("getting details", data); + setDocumentDetails(data); return getDocumentHistory(data.value).then((data) => { setDocumentHistory(data); - //setShowSpinnerState(false); + setShowSpinnerState(false); }); }); }; @@ -323,13 +336,13 @@ const DocumentDetails = (props) => { ) : pagesCount; - //const [showSpinnerState, setShowSpinnerState] = useState(false); + const [showSpinnerState, setShowSpinnerState] = useState(false); - // let spinnerState = () => { - // showSpinnerState == true - // ? setShowSpinnerState(false) - // : setShowSpinnerState(true); - // }; + let spinnerState = () => { + showSpinnerState == true + ? setShowSpinnerState(false) + : setShowSpinnerState(true); + }; const [showDocumentSearchState, setDocumentSearchState] = useState(false); diff --git a/components/case/pagination.js b/components/case/pagination.js index 41768f9b..50b88581 100644 --- a/components/case/pagination.js +++ b/components/case/pagination.js @@ -81,8 +81,8 @@ const PaginationControl = (props) => { { - // spinnerState(), - getDocumentResults(currentPage - 1); + spinnerState(), + getDocumentResults(currentPage - 1); }} > {t("common:previous-link-button")} @@ -114,7 +114,7 @@ const PaginationControl = (props) => { className="govuk-body govuk-link govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem" key={i} onClick={() => { - // spinnerState(); + spinnerState(); console.log(i + 1); getDocumentResults(i + 1); }} @@ -129,8 +129,8 @@ const PaginationControl = (props) => { { - // spinnerState(), - getDocumentResults(currentPage + 1); + spinnerState(), + getDocumentResults(currentPage + 1); }} > {t("common:next-link-button")} diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 777a59f7..11167c23 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -38,13 +38,13 @@ const DNSSearchResults = (props) => { var resultsArr = searchResultsObj.value || []; - //const [showSpinnerState, setShowSpinnerState] = useState(false); + const [showSpinnerState, setShowSpinnerState] = useState(false); - // let spinnerState = () => { - // showSpinnerState == true - // ? setShowSpinnerState(false) - // : setShowSpinnerState(true); - // }; + let spinnerState = () => { + showSpinnerState == true + ? setShowSpinnerState(false) + : setShowSpinnerState(true); + }; const ResultsView = (resultsArr) => { return ( @@ -70,163 +70,180 @@ const DNSSearchResults = (props) => { - {resultsArr.map((item, key) => { - let detailsObj = jsonpath.query( - searchDetailsObj, - "$..value[?(@.pinswg_name=='" + - item.title + - "')]" - ); - detailsObj = detailsObj[0]; + {showSpinnerState == true ? ( +
+
+ {t("common:spinner-fetching-data")} + { +
+
+ ) : ( + resultsArr.map((item, key) => { + let detailsObj = jsonpath.query( + searchDetailsObj, + "$..value[?(@.pinswg_name=='" + + item.title + + "')]" + ); + detailsObj = detailsObj[0]; - return ( -
-
- - { - setCurrentReference({ - "currentReference": - item.title, - "currentType": - "searchResultsObj", - "incidentid": - item.incidentid, - "appealType": - item.pinswg_appealcasetype, - }); - }} + return ( +
+
+ - - {t( - "search:searchresults-case-reference-label" - )} - : - - {item.title} - - -
-
- - {t( - "search:searchresults-site-address-label" - )} - : - - {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddressline1 - : ""} -
- {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddressline2 - : ""} -
- {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddresstown - : ""} -
- {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddresscounty - : ""} -
- {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddresspostcode - : ""} -
-
- - {t( - "search:searchresults-applicant-label" - )} - : - - {_.has(detailsObj, [ - "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue", - ]) - ? detailsObj[ - "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" - ] - : ""} -
-
- - {t( - "search:searchresults-authority-label" - )} - : - - {_.has(detailsObj, [ - "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", - ]) - ? router.locale == "cy" + { + setCurrentReference({ + "currentReference": + item.title, + "currentType": + "searchResultsObj", + "incidentid": + item.incidentid, + "appealType": + item.pinswg_appealcasetype, + }); + }} + > + + {t( + "search:searchresults-case-reference-label" + )} + : + + {item.title} + + +
+
+ + {t( + "search:searchresults-site-address-label" + )} + : + + {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddressline1 + : ""} +
+ {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddressline2 + : ""} +
+ {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddresstown + : ""} +
+ {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddresscounty + : ""} +
+ {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddresspostcode + : ""} +
+
+ + {t( + "search:searchresults-applicant-label" + )} + : + + {_.has(detailsObj, [ + "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue", + ]) + ? detailsObj[ + "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" + ] + : ""} +
+
+ + {t( + "search:searchresults-authority-label" + )} + : + + {_.has(detailsObj, [ + "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", + ]) + ? router.locale == "cy" + ? jsonpath.query( + transLookup, + '$..[?(@.value=="' + + detailsObj[ + "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy' + ) + : detailsObj[ + "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" + ] || "N/A" + : ""} +
+
+ + {t( + "search:searchresults-status-label" + )} + : + + + {router.locale == "cy" ? jsonpath.query( transLookup, '$..[?(@.value=="' + - detailsObj[ - "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" + item[ + "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy' ) - : detailsObj[ - "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" - ] || "N/A" - : ""} -
-
- - {t( - "search:searchresults-status-label" - )} - : - - - {router.locale == "cy" - ? jsonpath.query( - transLookup, - '$..[?(@.value=="' + - item[ - "statuscode@OData.Community.Display.V1.FormattedValue" - ] + - '")].value_cy' - ) - : item[ - "statuscode@OData.Community.Display.V1.FormattedValue" - ] || "N/A"} -
-
- ); - })} + : item[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] || "N/A"} + + + ); + }) + )} @@ -260,14 +277,13 @@ const DNSSearchResults = (props) => { getBasicDNSSearchPaged(pageNumber) .then((data) => { - setSearchResults(data); return data; }) .then((data) => { - //console.log("getting details", data); + setSearchResults(data); return getSearchDetailsPaged(data).then((data) => { setSearchDetails(data); - //setShowSpinnerState(false); + setShowSpinnerState(false); }); }); }; diff --git a/components/search/pagination.js b/components/search/pagination.js index 9a29050d..2ac43e98 100644 --- a/components/search/pagination.js +++ b/components/search/pagination.js @@ -7,7 +7,7 @@ const PaginationControl = (props) => { searchString, searchResultsObj, currentPage, - // spinnerState, + spinnerState, getSearchPageResults, } = props; let { t } = useTranslation(); @@ -81,8 +81,8 @@ const PaginationControl = (props) => { { - // spinnerState(), - getSearchPageResults(currentPage - 1); + spinnerState(), + getSearchPageResults(currentPage - 1); }} > {t("common:previous-link-button")} @@ -114,7 +114,7 @@ const PaginationControl = (props) => { className="govuk-body govuk-link govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem" key={i} onClick={() => { - // spinnerState(); + spinnerState(); console.log(i + 1); getSearchPageResults(i + 1); }} @@ -129,8 +129,8 @@ const PaginationControl = (props) => { { - // spinnerState(), - getSearchPageResults(currentPage + 1); + spinnerState(), + getSearchPageResults(currentPage + 1); }} > {t("common:next-link-button")} diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 0436111d..5b8a635a 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -66,13 +66,13 @@ const SearchResults = (props) => { var resultsArr = searchResultsObj.value || []; - // const [showSpinnerState, setShowSpinnerState] = useState(false); + const [showSpinnerState, setShowSpinnerState] = useState(false); - // let spinnerState = () => { - // showSpinnerState == true - // ? setShowSpinnerState(false) - // : setShowSpinnerState(true); - // }; + let spinnerState = () => { + showSpinnerState == true + ? setShowSpinnerState(false) + : setShowSpinnerState(true); + }; const cookies = parseCookies(); @@ -178,249 +178,278 @@ const SearchResults = (props) => {
)} - - {resultsArr.map((item, key) => { - let detailsObj = jsonpath.query( - searchDetailsObj, - "$..value[?(@.pinswg_name=='" + item.title + "')]" - ); - detailsObj = detailsObj[0]; - return ( -
-
- - { - setCurrentReference({ - "currentReference": - item.title, - "currentType": - "searchResultsObj", - "incidentid": - item.incidentid, - "appealType": - item.pinswg_appealcasetype, - }); - }} + {showSpinnerState == true ? ( +
+
+ {t("common:spinner-fetching-data")} + { +
+
+ ) : ( + resultsArr.map((item, key) => { + let detailsObj = jsonpath.query( + searchDetailsObj, + "$..value[?(@.pinswg_name=='" + + item.title + + "')]" + ); + detailsObj = detailsObj[0]; + return ( +
+
+ - - {t( - "search:searchresults-case-reference-label" - )} - : - - {item.title} - - -
-
- - {t( - "search:searchresults-site-address-label" - )} - : - - {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddressline1 - : ""} + { + setCurrentReference({ + "currentReference": + item.title, + "currentType": + "searchResultsObj", + "incidentid": + item.incidentid, + "appealType": + item.pinswg_appealcasetype, + }); + }} + > + + {t( + "search:searchresults-case-reference-label" + )} + : + + {item.title} + + +
+
+ + {t( + "search:searchresults-site-address-label" + )} + : + + {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddressline1 + : ""} - {/* {detailsObj.pinswg_siteaddressline1 != + {/* {detailsObj.pinswg_siteaddressline1 != null &&
} */} - {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) && - detailsObj.pinswg_siteaddressline1 != - null &&
} + {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) && + detailsObj.pinswg_siteaddressline1 != + null &&
} - {_.has( - detailsObj, - "pinswg_siteaddressline1" - ) - ? detailsObj.pinswg_siteaddressline2 - : ""} + {_.has( + detailsObj, + "pinswg_siteaddressline1" + ) + ? detailsObj.pinswg_siteaddressline2 + : ""} - {_.has( - detailsObj, - "pinswg_siteaddressline2" - ) && - detailsObj.pinswg_siteaddressline2 != - null &&
} - {_.has(detailsObj, "pinswg_siteaddresstown") - ? detailsObj.pinswg_siteaddresstown - : ""} - {_.has( - detailsObj, - "pinswg_siteaddresstown" - ) && - detailsObj.pinswg_siteaddresstown != - null &&
} + {_.has( + detailsObj, + "pinswg_siteaddressline2" + ) && + detailsObj.pinswg_siteaddressline2 != + null &&
} + {_.has( + detailsObj, + "pinswg_siteaddresstown" + ) + ? detailsObj.pinswg_siteaddresstown + : ""} + {_.has( + detailsObj, + "pinswg_siteaddresstown" + ) && + detailsObj.pinswg_siteaddresstown != + null &&
} - {_.has( - detailsObj, - "pinswg_siteaddresscounty" - ) - ? detailsObj.pinswg_siteaddresscounty - : ""} - {_.has( - detailsObj, - "pinswg_siteaddresscounty" - ) && - detailsObj.pinswg_siteaddresscounty != - null &&
} - {_.has( - detailsObj, - "pinswg_siteaddresspostcode" - ) - ? detailsObj.pinswg_siteaddresspostcode - : ""} -
-
- - {t( - "search:searchresults-applicant-label" - )} - : - - {_.has(detailsObj, [ - "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue", - ]) - ? detailsObj[ - "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" - ] - : ""} -
-
- - {t( - "search:searchresults-authority-label" - )} - : - - {_.has(item, [ - "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", - ]) - ? router.locale == "cy" + {_.has( + detailsObj, + "pinswg_siteaddresscounty" + ) + ? detailsObj.pinswg_siteaddresscounty + : ""} + {_.has( + detailsObj, + "pinswg_siteaddresscounty" + ) && + detailsObj.pinswg_siteaddresscounty != + null &&
} + {_.has( + detailsObj, + "pinswg_siteaddresspostcode" + ) + ? detailsObj.pinswg_siteaddresspostcode + : ""} +
+
+ + {t( + "search:searchresults-applicant-label" + )} + : + + {_.has(detailsObj, [ + "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue", + ]) + ? detailsObj[ + "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" + ] + : ""} +
+
+ + {t( + "search:searchresults-authority-label" + )} + : + + {_.has(item, [ + "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", + ]) + ? router.locale == "cy" + ? jsonpath.query( + transLookup, + '$..[?(@.value=="' + + item[ + "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy' + ) + : item[ + "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" + ] || "N/A" + : ""} +
+
+ + {t( + "search:searchresults-case-type-label" + )} + : + + {router.locale == "cy" ? jsonpath.query( transLookup, '$..[?(@.value=="' + item[ - "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy' ) : item[ - "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" - ] || "N/A" - : ""} -
-
- - {t( - "search:searchresults-case-type-label" - )} - : - - {router.locale == "cy" - ? jsonpath.query( - transLookup, - '$..[?(@.value=="' + - item[ - "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" - ] + - '")].value_cy' - ) - : item[ - "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" - ] || "N/A"} -
-
- - {t("search:searchresults-status-label")} - : - - - {router.locale == "cy" - ? jsonpath.query( - transLookup, - '$..[?(@.value=="' + - item[ - "statuscode@OData.Community.Display.V1.FormattedValue" - ] + - '")].value_cy' - ) - : item[ - "statuscode@OData.Community.Display.V1.FormattedValue" - ] || "N/A"} -
- {myportal == true && ( -
- {isWatchedCase(item.incidentid).length > - 0 == - true ? ( - { - deleteItem( - isWatchedCase( - item.incidentid - )[0].pinswg_watchlistid, - - "watchedCases" - ); - alert( - "You have stopped watching case " + - item.title - ); - }} - title="Stop watching this case" - > - − - - ) : ( - { - selectWatchedCase( - cookies.pinsUser, - item.incidentid, - item.pinswg_appealcasetype - ); - alert( - "You are watching case " + - item.title - ); - }} - title="Watch this case" - > - + - - )} + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" + ] || "N/A"}
- )} -
- ); - })} +
+ + {t( + "search:searchresults-status-label" + )} + : + + + {router.locale == "cy" + ? jsonpath.query( + transLookup, + '$..[?(@.value=="' + + item[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy' + ) + : item[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] || "N/A"} +
+ {myportal == true && ( +
+ {isWatchedCase(item.incidentid) + .length > + 0 == + true ? ( + { + deleteItem( + isWatchedCase( + item.incidentid + )[0] + .pinswg_watchlistid, + + "watchedCases" + ); + alert( + "You have stopped watching case " + + item.title + ); + }} + title="Stop watching this case" + > + − + + ) : ( + { + selectWatchedCase( + cookies.pinsUser, + item.incidentid, + item.pinswg_appealcasetype + ); + alert( + "You are watching case " + + item.title + ); + }} + title="Watch this case" + > + + + + )} +
+ )} + + ); + }) + )} + @@ -457,16 +486,13 @@ const SearchResults = (props) => { ); getAdvancedSearchPaged(searchoObj, pageNumber) - .then((data) => { - //console.log(data); - setSearchResults(data); - return data; - }) + .then((data) => data) .then((data) => { //console.log("getting details", data); + setSearchResults(data); return getSearchDetailsPaged(data).then((data) => { setSearchDetails(data); - //setShowSpinnerState(false); + setShowSpinnerState(false); }); }); } else { @@ -480,7 +506,7 @@ const SearchResults = (props) => { //console.log("getting details", data); return getSearchDetailsPaged(data).then((data) => { setSearchDetails(data); - //setShowSpinnerState(false); + setShowSpinnerState(false); }); }); } diff --git a/locales/cy/common.json b/locales/cy/common.json index eb7bc9f5..4ed82261 100644 --- a/locales/cy/common.json +++ b/locales/cy/common.json @@ -46,6 +46,7 @@ "breadcrumb-case-reference": "Cyfeirnod Achos", "spinner-loading": "Llwytho...", "spinner-searching": "Chwilio...", + "spinner-fetching-data": "Nôl data", "logged-out-title": "Rydych chi wedi allgofnodi", "logged-out-link": "Dychwelwch i'r porth Gwaith Achos Cynllunio", "404-not-found-title": "404 - heb ei ddarganfod", diff --git a/locales/en/common.json b/locales/en/common.json index 7e8e5323..c1713622 100644 --- a/locales/en/common.json +++ b/locales/en/common.json @@ -46,6 +46,7 @@ "breadcrumb-case-reference": "Case Reference", "spinner-loading": "Loading...", "spinner-searching": "Searching...", + "spinner-fetching-data": "Fetching data", "logged-out-title": "You have been logged out", "logged-out-link": "Return to Planning Casework portal", "404-not-found-title": "404 - not found", diff --git a/pages/api/documents/download/[id].js b/pages/api/documents/download/[id].js index 4acc9afa..80c9c8e9 100644 --- a/pages/api/documents/download/[id].js +++ b/pages/api/documents/download/[id].js @@ -58,6 +58,8 @@ export default async function ApiProxy(req, res) { }; }; + console.log(WEBAPI_URL + queryUrl); + return axios .get( WEBAPI_URL + queryUrl, // + hashAPIPath(queryUrl), diff --git a/pages/myportal/advancedsearchresults.js b/pages/myportal/advancedsearchresults.js index 98b39d92..67e2c675 100644 --- a/pages/myportal/advancedsearchresults.js +++ b/pages/myportal/advancedsearchresults.js @@ -20,6 +20,7 @@ import { setSearchDetails, setSearchResults, } from "../../store/searchOutput/action"; +import { setSearch } from "../../store/search/action"; import { wrapper } from "../../store/store"; import { setWatchedCases, @@ -88,6 +89,7 @@ export const getServerSideProps = wrapper.getServerSideProps( store.dispatch(setSearchDetails(searchDetailsObj)); store.dispatch(setWatchedCases(watchedCases)); store.dispatch(setWatchedCasesDetails(watchedCasesDetails)); + store.dispatch(setSearch(Object.entries(query))); } ); diff --git a/public/assets/images/loading.gif b/public/assets/images/loading.gif new file mode 100644 index 00000000..c97ec6ea Binary files /dev/null and b/public/assets/images/loading.gif differ diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss index 2b0b6969..7de77af6 100644 --- a/styles/sass/welshgov/_application.scss +++ b/styles/sass/welshgov/_application.scss @@ -1824,3 +1824,9 @@ fade { border-top-left-radius: calc(0.3rem - 1px); border-top-right-radius: calc(0.3rem - 1px); } + +.data-loading-icon { + position: relative; + top: 10px; + left: 10px; +}