From a549687c8f7fc6a1a70b85b7eccd154a3954f673 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 31 Jan 2022 11:47:41 +0000 Subject: [PATCH] added fetching data notice on pagination --- components/case/documents.js | 215 +++++----- components/case/pagination.js | 10 +- components/search/dnssearchresults.js | 324 +++++++-------- components/search/pagination.js | 12 +- components/search/searchresults.js | 498 +++++++++++++----------- locales/cy/common.json | 1 + locales/en/common.json | 1 + pages/api/documents/download/[id].js | 2 + pages/myportal/advancedsearchresults.js | 2 + public/assets/images/loading.gif | Bin 0 -> 4178 bytes styles/sass/welshgov/_application.scss | 6 + 11 files changed, 569 insertions(+), 502 deletions(-) create mode 100644 public/assets/images/loading.gif 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 0000000000000000000000000000000000000000..c97ec6ea9739a68e25637c0aa4adaaea05e3e4ca GIT binary patch literal 4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