added in pagination for search result requests
This commit is contained in:
+15
-6
@@ -1,8 +1,9 @@
|
|||||||
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
// dev
|
||||||
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
||||||
RELAYPATH = "dev-pedw-hc"
|
//RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
||||||
SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y="
|
//RELAYPATH = "dev-pedw-hc"
|
||||||
SASKEYNAME = "devpedwnspolicy"
|
//SASKEY = "Ml0Y/S/nfRcmIrHFRkO4jNm2J3iH52TSxPiak7+E1+Y="
|
||||||
|
//SASKEYNAME = "devpedwnspolicy"
|
||||||
|
|
||||||
|
|
||||||
PORT= "3000"
|
PORT= "3000"
|
||||||
@@ -13,7 +14,7 @@ I18N_DOMAIN = "cymru.local"
|
|||||||
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
|
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
|
|
||||||
|
//test
|
||||||
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
||||||
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
||||||
//RELAYPATH = "test-pedw-hc"
|
//RELAYPATH = "test-pedw-hc"
|
||||||
@@ -21,4 +22,12 @@ I18N_DOMAIN = "cymru.local"
|
|||||||
//SASKEYNAME = "testpedwhcpolicy"
|
//SASKEYNAME = "testpedwhcpolicy"
|
||||||
|
|
||||||
|
|
||||||
|
//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"
|
||||||
|
|
||||||
|
|
||||||
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
+172
-30
@@ -105,16 +105,6 @@ const crmHeadersReturn = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const azureHeaders = (SASToken) => {
|
const azureHeaders = (SASToken) => {
|
||||||
// console.log({
|
|
||||||
// headers: {
|
|
||||||
// "OData-MaxVersion": "4.0",
|
|
||||||
// "OData-Version": "4.0",
|
|
||||||
// "Accept": "application/json",
|
|
||||||
// "Prefer": 'odata.include-annotations="*",return=representation',
|
|
||||||
// "Content-Type": "application/json",
|
|
||||||
// "ServiceBusAuthorization": SASToken,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
return {
|
return {
|
||||||
headers: {
|
headers: {
|
||||||
"OData-MaxVersion": "4.0",
|
"OData-MaxVersion": "4.0",
|
||||||
@@ -127,26 +117,60 @@ const azureHeaders = (SASToken) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// const azureHeaders = {
|
const azureHeadersPaged = (SASToken) => {
|
||||||
// headers: {
|
return {
|
||||||
// "OData-MaxVersion": "4.0",
|
headers: {
|
||||||
// "OData-Version": "4.0",
|
"OData-MaxVersion": "4.0",
|
||||||
// "Accept": "application/json",
|
"OData-Version": "4.0",
|
||||||
// "Prefer": 'odata.include-annotations="*",return=representation',
|
"Accept": "application/json",
|
||||||
// "Content-Type": "application/json",
|
"Prefer":
|
||||||
// "Authorization": "Bearer " + accessToken,
|
'odata.include-annotations="*",return=representation, odata.maxpagesize=10',
|
||||||
// },
|
"Content-Type": "application/json",
|
||||||
// };
|
"ServiceBusAuthorization": SASToken,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export const getBasicSearch = (token, searchString) => {
|
export const getBasicSearch = (token, searchString) => {
|
||||||
//console.log("\n\n", token, searchString);
|
//console.log("\n\n", token, searchString);
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
||||||
searchString +
|
searchString +
|
||||||
"') and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
"') and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
||||||
azureHeaders(token)
|
azureHeadersPaged(token)
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
// console.log(" ");
|
||||||
|
// console.log("/////////////////////");
|
||||||
|
// console.log("data:" + res.data.value);
|
||||||
|
// console.log("/////////////////////");
|
||||||
|
// console.log(" ");
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log("thiserror", error);
|
||||||
|
return error.response;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getBasicSearchPaged = (searchString, pageNumber) => {
|
||||||
|
//console.log("\n\n", token, searchString);
|
||||||
|
var token = getSASToken();
|
||||||
|
|
||||||
|
console.log(typeof pageNumber != "undefined");
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
||||||
|
searchString +
|
||||||
|
"') and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" +
|
||||||
|
encodeURI('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
|
: ""),
|
||||||
|
azureHeadersPaged(token)
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log(" ");
|
// console.log(" ");
|
||||||
@@ -167,7 +191,25 @@ export const getBasicDNSSearch = (token, searchString) => {
|
|||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
||||||
azureHeaders(token)
|
azureHeadersPaged(token)
|
||||||
|
)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
return error.response;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getBasicDNSSearchPaged = (pageNumber) => {
|
||||||
|
var token = getSASToken();
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" +
|
||||||
|
encodeURI('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
|
: ""),
|
||||||
|
azureHeadersPaged(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -208,7 +250,7 @@ export const getAdvancedSearch = (token, searchString) => {
|
|||||||
queryString +
|
queryString +
|
||||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
||||||
|
|
||||||
azureHeaders(token)
|
azureHeadersPaged(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -222,15 +264,99 @@ export const getAdvancedSearch = (token, searchString) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getBasicSearchDetails = (token, appealType, caseReference) => {
|
export const getAdvancedSearchPaged = (searchString, pageNumber) => {
|
||||||
|
console.log(searchString);
|
||||||
|
var token = getSASToken();
|
||||||
|
|
||||||
|
var queryString = "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
searchString.q != null
|
||||||
|
? "contains(title, '" + searchString.q + "') "
|
||||||
|
: "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
searchString.lpa != null
|
||||||
|
? (typeof searchString.q == "undefined" ? "" : " and ") +
|
||||||
|
"_pinswg_associatedlpa_value eq " +
|
||||||
|
searchString.lpa
|
||||||
|
: "";
|
||||||
|
queryString +=
|
||||||
|
searchString.apt != null
|
||||||
|
? (typeof searchString.q == "undefined" &&
|
||||||
|
typeof searchString.lpa == "undefined"
|
||||||
|
? ""
|
||||||
|
: " and ") +
|
||||||
|
"pinswg_appealcasetype eq " +
|
||||||
|
searchString.apt
|
||||||
|
: "";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||||
|
queryString +
|
||||||
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
|
||||||
|
(typeof pageNumber != "undefined"
|
||||||
|
? "&$skiptoken=" +
|
||||||
|
encodeURI('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
|
: ""),
|
||||||
|
|
||||||
|
azureHeadersPaged(token)
|
||||||
|
)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
let ErrResponse = {
|
||||||
|
value: [],
|
||||||
|
errorCode: error.response.status,
|
||||||
|
errorMsg: error.response.statusText,
|
||||||
|
};
|
||||||
|
|
||||||
|
return ErrResponse;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export const getBasicSearchDetails = (
|
||||||
|
token,
|
||||||
|
appealTypeName,
|
||||||
|
caseReference,
|
||||||
|
primaryIdAttribute,
|
||||||
|
incidentID
|
||||||
|
) => {
|
||||||
//console.log("check appealtype:", appealType, caseReference);
|
//console.log("check appealtype:", appealType, caseReference);
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
appealType +
|
appealTypeName +
|
||||||
"?$filter=pinswg_name eq '" +
|
"?$filter=_" +
|
||||||
caseReference +
|
primaryIdAttribute +
|
||||||
"'&$count=true",
|
"s_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$count=true",
|
||||||
|
azureHeadersPaged(token)
|
||||||
|
)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("this error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getBasicSearchDetailsPaged = (
|
||||||
|
appealTypeName,
|
||||||
|
caseReference,
|
||||||
|
primaryIdAttribute,
|
||||||
|
incidentID
|
||||||
|
) => {
|
||||||
|
//console.log("check appealtype:", appealType, caseReference);
|
||||||
|
var token = getSASToken();
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/" +
|
||||||
|
appealTypeName +
|
||||||
|
"?$filter=_" +
|
||||||
|
primaryIdAttribute +
|
||||||
|
"s_value eq " +
|
||||||
|
incidentID +
|
||||||
|
"&$count=true",
|
||||||
azureHeaders(token)
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -307,7 +433,23 @@ export const getBasicDNSSearchDetails = (token, appealType, caseReference) => {
|
|||||||
"pinswg_dnses?$filter=pinswg_name eq '" +
|
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
caseReference +
|
caseReference +
|
||||||
"'&$count=true",
|
"'&$count=true",
|
||||||
azureHeaders(token)
|
azureHeadersPaged(token)
|
||||||
|
)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thiserror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getBasicDNSSearchDetailsPaged = (caseReference) => {
|
||||||
|
var token = getSASToken();
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
|
caseReference +
|
||||||
|
"'&$count=true",
|
||||||
|
azureHeadersPaged(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -120,25 +120,45 @@ const CaseSummary = (props) => {
|
|||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
<br />
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddressline1"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
|
null && <br />}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddressline2"
|
"pinswg_siteaddressline2"
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
<br />
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddressline2"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
|
null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
<br />
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresstown"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
|
null && <br />}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresscounty"
|
"pinswg_siteaddresscounty"
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
<br />
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresscounty"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
|
null && <br />}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_siteaddresspostcode"
|
"pinswg_siteaddresspostcode"
|
||||||
@@ -397,6 +417,19 @@ const CaseSummary = (props) => {
|
|||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"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(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -475,6 +508,19 @@ const CaseSummary = (props) => {
|
|||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"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(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -6,6 +6,19 @@ import { connect } from "react-redux";
|
|||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
import PaginationControl from "./pagination";
|
||||||
|
import { useState } from "react";
|
||||||
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
import {
|
||||||
|
getBasicDNSSearchPaged,
|
||||||
|
getBasicSearchDetailsPaged,
|
||||||
|
} from "../../actions";
|
||||||
|
import data from "../../data/collections.json";
|
||||||
|
|
||||||
|
import {
|
||||||
|
setSearchResults,
|
||||||
|
setSearchDetails,
|
||||||
|
} from "../../store/searchOutput/action";
|
||||||
|
|
||||||
const DNSSearchResults = (props) => {
|
const DNSSearchResults = (props) => {
|
||||||
const {
|
const {
|
||||||
@@ -13,6 +26,9 @@ const DNSSearchResults = (props) => {
|
|||||||
searchResultsObj,
|
searchResultsObj,
|
||||||
searchDetailsObj,
|
searchDetailsObj,
|
||||||
setCurrentReference,
|
setCurrentReference,
|
||||||
|
setSearchResults,
|
||||||
|
setSearchDetails,
|
||||||
|
advancedSearch,
|
||||||
} = props;
|
} = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -21,6 +37,14 @@ const DNSSearchResults = (props) => {
|
|||||||
|
|
||||||
var resultsArr = searchResultsObj.value || [];
|
var resultsArr = searchResultsObj.value || [];
|
||||||
|
|
||||||
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
|
let spinnerState = () => {
|
||||||
|
showSpinnerState == true
|
||||||
|
? setShowSpinnerState(false)
|
||||||
|
: setShowSpinnerState(true);
|
||||||
|
};
|
||||||
|
|
||||||
const ResultsView = (resultsArr) => {
|
const ResultsView = (resultsArr) => {
|
||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row govuk-!-margin-top-9">
|
<div className="govuk-grid-row govuk-!-margin-top-9">
|
||||||
@@ -193,11 +217,97 @@ const DNSSearchResults = (props) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</dl>
|
</dl>
|
||||||
|
<PaginationControl
|
||||||
|
currentPage={currentPage}
|
||||||
|
searchResultsObj={searchResultsObj}
|
||||||
|
spinnerState={spinnerState}
|
||||||
|
getSearchPageResults={getSearchPageResults}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let currentPage = 0;
|
||||||
|
|
||||||
|
currentPage = decodeURI(searchResultsObj["@odata.nextLink"]).split(
|
||||||
|
"skiptoken="
|
||||||
|
)[1];
|
||||||
|
currentPage =
|
||||||
|
typeof currentPage != "undefined"
|
||||||
|
? parseInt(
|
||||||
|
decodeURI(currentPage)
|
||||||
|
.split('pagenumber="')[1]
|
||||||
|
.slice(
|
||||||
|
0,
|
||||||
|
decodeURI(currentPage)
|
||||||
|
.split('pagenumber="')[1]
|
||||||
|
.indexOf('"')
|
||||||
|
) - 1
|
||||||
|
)
|
||||||
|
: pagesCount;
|
||||||
|
|
||||||
|
const getSearchPageResults = (pageNumber) => {
|
||||||
|
console.log(advancedSearch, searchString, pageNumber);
|
||||||
|
|
||||||
|
getBasicDNSSearchPaged(pageNumber)
|
||||||
|
.then((data) => {
|
||||||
|
console.log(data);
|
||||||
|
setSearchResults(data);
|
||||||
|
return data;
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
console.log("getting details", data);
|
||||||
|
return getSearchDetails(data).then((data) => {
|
||||||
|
setSearchDetails(data);
|
||||||
|
setShowSpinnerState(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSearchDetails = (searchResultsObj) => {
|
||||||
|
//console.log(searchResultsObj);
|
||||||
|
|
||||||
|
let detailsArr = [];
|
||||||
|
//console.log("search results", searchResultsObj);
|
||||||
|
searchResultsObj = searchResultsObj.value;
|
||||||
|
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||||
|
//console.log(searchDetail);
|
||||||
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
|
console.log(searchDetail.title);
|
||||||
|
} else {
|
||||||
|
let formMeta = getFormCollection(
|
||||||
|
"pinswg_" +
|
||||||
|
searchDetail[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.slice(0, 39)
|
||||||
|
);
|
||||||
|
|
||||||
|
detailsArr.push(
|
||||||
|
getBasicSearchDetailsPaged(
|
||||||
|
formMeta.LogicalCollectionName,
|
||||||
|
searchDetail.title,
|
||||||
|
formMeta.PrimaryIdAttribute,
|
||||||
|
searchDetail.incidentid
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// console.log(detailsArr);
|
||||||
|
return Promise.all(detailsArr);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFormCollection = (formtype) => {
|
||||||
|
const collectionName = jsonpath.query(
|
||||||
|
data,
|
||||||
|
"$..[?(@.LogicalName=='" + formtype + "')]"
|
||||||
|
);
|
||||||
|
//console.log(collectionName[0]);
|
||||||
|
return collectionName[0];
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
@@ -227,6 +337,11 @@ const DNSSearchResults = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<LoadingOverlay
|
||||||
|
active={showSpinnerState}
|
||||||
|
spinner
|
||||||
|
text={t("common:spinner-searching")}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -236,6 +351,12 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
setCurrentReference: (currentReference) => {
|
setCurrentReference: (currentReference) => {
|
||||||
dispatch(setCurrentReference(currentReference));
|
dispatch(setCurrentReference(currentReference));
|
||||||
},
|
},
|
||||||
|
setSearchResults: (searchResultsObj) => {
|
||||||
|
dispatch(setSearchResults(searchResultsObj));
|
||||||
|
},
|
||||||
|
setSearchDetails: (searchDetailsObj) => {
|
||||||
|
dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,157 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
const PaginationControl = (props) => {
|
||||||
|
const {
|
||||||
|
searchString,
|
||||||
|
searchResultsObj,
|
||||||
|
currentPage,
|
||||||
|
spinnerState,
|
||||||
|
getSearchPageResults,
|
||||||
|
} = props;
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
|
||||||
|
|
||||||
|
const getRange = (start, end) => {
|
||||||
|
console.log(start, end);
|
||||||
|
return Array(end - start + 1)
|
||||||
|
.fill()
|
||||||
|
.map((v, i) => i + start);
|
||||||
|
};
|
||||||
|
|
||||||
|
const paginationNumbers = (currentPage, pageCount) => {
|
||||||
|
console.log(currentPage);
|
||||||
|
let delta;
|
||||||
|
if (pageCount <= 10) {
|
||||||
|
// delta === 7: [1 2 3 4 5 6 7]
|
||||||
|
delta = 10;
|
||||||
|
} else {
|
||||||
|
// delta === 2: [1 ... 4 5 6 ... 10]
|
||||||
|
// delta === 4: [1 2 3 4 5 ... 10]
|
||||||
|
delta = currentPage > 4 && currentPage < pageCount - 3 ? 4 : 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
const range = {
|
||||||
|
start: Math.round(currentPage - delta / 2),
|
||||||
|
end: Math.round(currentPage + delta / 2),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (range.start - 1 === 1 || range.end + 1 === pageCount) {
|
||||||
|
range.start += 1;
|
||||||
|
range.end += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
let pages =
|
||||||
|
currentPage > delta
|
||||||
|
? getRange(
|
||||||
|
Math.min(range.start, pageCount - delta),
|
||||||
|
Math.min(range.end, pageCount)
|
||||||
|
)
|
||||||
|
: getRange(1, Math.min(pageCount, delta + 1));
|
||||||
|
|
||||||
|
const withDots = (value, pair) =>
|
||||||
|
pages.length + 1 !== pageCount ? pair : [value];
|
||||||
|
|
||||||
|
if (pages[0] !== 1) {
|
||||||
|
pages = withDots(1, [1, "..."]).concat(pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pages[pages.length - 1] < pageCount) {
|
||||||
|
pages = pages.concat(withDots(pageCount, ["...", pageCount]));
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(pages);
|
||||||
|
return pages;
|
||||||
|
};
|
||||||
|
|
||||||
|
const paginationArray = paginationNumbers(currentPage, pagesCount);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{" "}
|
||||||
|
<div className="govuk-!-margin-bottom-7 ">
|
||||||
|
<div className="govuk-grid-row paginationWrapper">
|
||||||
|
<div className="govuk-grid-column-one-quarter paginationPrevious">
|
||||||
|
{currentPage != 1 ? (
|
||||||
|
<span
|
||||||
|
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem leftTextButton"
|
||||||
|
onClick={() => {
|
||||||
|
spinnerState(),
|
||||||
|
getSearchPageResults(currentPage - 1),
|
||||||
|
console.log(currentPage - 1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:previous-link-button")}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="govuk-body leftTextButton govuk-!-font-weight-bold">
|
||||||
|
{t("common:previous-link-button")}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-column-one-half paginationContainer">
|
||||||
|
{paginationArray.map((e, i) =>
|
||||||
|
currentPage == i + 1 ? (
|
||||||
|
<span
|
||||||
|
key={i}
|
||||||
|
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold "
|
||||||
|
>
|
||||||
|
{e}
|
||||||
|
</span>
|
||||||
|
) : e == "..." ? (
|
||||||
|
<span
|
||||||
|
key={i}
|
||||||
|
className=" govuk-body govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
|
||||||
|
>
|
||||||
|
{e}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span
|
||||||
|
className="govuk-body govuk-link govuk-!-padding-2 govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem"
|
||||||
|
key={i}
|
||||||
|
onClick={() => {
|
||||||
|
spinnerState();
|
||||||
|
console.log(i + 1);
|
||||||
|
getSearchPageResults(i + 1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{e}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-column-one-quarter paginationNext">
|
||||||
|
{currentPage != pagesCount ? (
|
||||||
|
<span
|
||||||
|
className="govuk-body govuk-link govuk-!-font-weight-bold govuk-link--no-underline activePaginationItem rightTextButton"
|
||||||
|
onClick={() => {
|
||||||
|
spinnerState(),
|
||||||
|
getSearchPageResults(currentPage + 1),
|
||||||
|
console.log(currentPage + 1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:next-link-button")}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="govuk-body rightTextButton govuk-!-font-weight-bold">
|
||||||
|
{" "}
|
||||||
|
{t("common:next-link-button")}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-body-s mobilePageCount">
|
||||||
|
{t("common:pages-label")} {currentPage}{" "}
|
||||||
|
{t("common:of-label")} {pagesCount}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PaginationControl;
|
||||||
+388
-183
@@ -1,11 +1,31 @@
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { setCurrentReference } from "../../store/currentView/action";
|
import {
|
||||||
|
currentViewActionTypes,
|
||||||
|
setCurrentReference,
|
||||||
|
} from "../../store/currentView/action";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
import {
|
||||||
|
getBasicSearchPaged,
|
||||||
|
getSearchDocumentDetails,
|
||||||
|
getBasicSearchDetailsPaged,
|
||||||
|
getAdvancedSearchPaged,
|
||||||
|
} from "../../actions";
|
||||||
|
import data from "../../data/collections.json";
|
||||||
|
import { useState } from "react";
|
||||||
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
|
||||||
|
import {
|
||||||
|
setSearchResults,
|
||||||
|
setSearchDetails,
|
||||||
|
} from "../../store/searchOutput/action";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
import PaginationControl from "./pagination";
|
||||||
|
|
||||||
const SearchResults = (props) => {
|
const SearchResults = (props) => {
|
||||||
const {
|
const {
|
||||||
@@ -13,6 +33,9 @@ const SearchResults = (props) => {
|
|||||||
searchResultsObj,
|
searchResultsObj,
|
||||||
searchDetailsObj,
|
searchDetailsObj,
|
||||||
setCurrentReference,
|
setCurrentReference,
|
||||||
|
setSearchResults,
|
||||||
|
setSearchDetails,
|
||||||
|
advancedSearch,
|
||||||
} = props;
|
} = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -21,208 +44,384 @@ const SearchResults = (props) => {
|
|||||||
|
|
||||||
var resultsArr = searchResultsObj.value || [];
|
var resultsArr = searchResultsObj.value || [];
|
||||||
|
|
||||||
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
|
let spinnerState = () => {
|
||||||
|
showSpinnerState == true
|
||||||
|
? setShowSpinnerState(false)
|
||||||
|
: setShowSpinnerState(true);
|
||||||
|
};
|
||||||
|
|
||||||
const ResultsView = (resultsArr) => {
|
const ResultsView = (resultsArr) => {
|
||||||
return (
|
return (
|
||||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
<>
|
||||||
<div className="govuk-summary-list__row results-headings">
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 results_wider ">
|
<div className="govuk-summary-list__row results-headings">
|
||||||
{t("search:searchresults-case-reference-label")}
|
<dd className="govuk-summary-list__key govuk-!-font-size-16 results_wider ">
|
||||||
</dd>
|
{t("search:searchresults-case-reference-label")}
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</dd>
|
||||||
{t("search:searchresults-site-address-label")}
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
</dd>
|
{t("search:searchresults-site-address-label")}
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</dd>
|
||||||
{t("search:searchresults-applicant-label")}
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
</dd>
|
{t("search:searchresults-applicant-label")}
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</dd>
|
||||||
{t("search:searchresults-authority-label")}
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
</dd>
|
{t("search:searchresults-authority-label")}
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</dd>
|
||||||
{t("search:searchresults-case-type-label")}
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
</dd>
|
{t("search:searchresults-case-type-label")}
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</dd>
|
||||||
{t("search:searchresults-status-label")}
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
</dd>
|
{t("search:searchresults-status-label")}
|
||||||
</div>
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
{resultsArr.map((item, key) => {
|
{resultsArr.map((item, key) => {
|
||||||
let detailsObj = jsonpath.query(
|
let detailsObj = jsonpath.query(
|
||||||
searchDetailsObj,
|
searchDetailsObj,
|
||||||
"$..value[?(@.pinswg_name=='" + item.title + "')]"
|
"$..value[?(@.pinswg_name=='" + item.title + "')]"
|
||||||
);
|
);
|
||||||
detailsObj = detailsObj[0];
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? "/achos"
|
? "/achos"
|
||||||
: "/case"
|
: "/case"
|
||||||
}
|
}
|
||||||
>
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setCurrentReference({
|
|
||||||
"currentReference": item.title,
|
|
||||||
"currentType":
|
|
||||||
"searchResultsObj",
|
|
||||||
"incidentid": item.incidentid,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<span className="results-visually-hidden">
|
<a
|
||||||
{t(
|
onClick={() => {
|
||||||
"search:searchresults-case-reference-label"
|
setCurrentReference({
|
||||||
)}
|
"currentReference":
|
||||||
:
|
item.title,
|
||||||
</span>
|
"currentType":
|
||||||
{item.title}
|
"searchResultsObj",
|
||||||
</a>
|
"incidentid":
|
||||||
</Link>
|
item.incidentid,
|
||||||
</dd>
|
});
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
}}
|
||||||
<span className="results-visually-hidden">
|
>
|
||||||
{t(
|
<span className="results-visually-hidden">
|
||||||
"search:searchresults-site-address-label"
|
{t(
|
||||||
)}
|
"search:searchresults-case-reference-label"
|
||||||
:
|
)}
|
||||||
</span>
|
:
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
</span>
|
||||||
? detailsObj.pinswg_siteaddressline1
|
{item.title}
|
||||||
: ""}
|
</a>
|
||||||
<br />
|
</Link>
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
</dd>
|
||||||
? detailsObj.pinswg_siteaddressline2
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
: ""}
|
<span className="results-visually-hidden">
|
||||||
<br />
|
{t(
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
"search:searchresults-site-address-label"
|
||||||
? detailsObj.pinswg_siteaddresstown
|
)}
|
||||||
: ""}
|
:
|
||||||
<br />
|
</span>
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
detailsObj,
|
||||||
: ""}
|
"pinswg_siteaddressline1"
|
||||||
<br />
|
)
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
? detailsObj.pinswg_siteaddressline1
|
||||||
? detailsObj.pinswg_siteaddresspostcode
|
: ""}
|
||||||
: ""}
|
|
||||||
</dd>
|
{/* {detailsObj.pinswg_siteaddressline1 !=
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
null && <br />} */}
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t("search:searchresults-applicant-label")}:
|
{_.has(
|
||||||
</span>
|
detailsObj,
|
||||||
{_.has(detailsObj, [
|
"pinswg_siteaddressline1"
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
) &&
|
||||||
])
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
? detailsObj[
|
null && <br />}
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
{_.has(
|
||||||
: ""}
|
detailsObj,
|
||||||
</dd>
|
"pinswg_siteaddressline1"
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
)
|
||||||
<span className="results-visually-hidden">
|
? detailsObj.pinswg_siteaddressline2
|
||||||
{t("search:searchresults-authority-label")}:
|
: ""}
|
||||||
</span>
|
|
||||||
{_.has(item, [
|
{_.has(
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
detailsObj,
|
||||||
])
|
"pinswg_siteaddressline2"
|
||||||
? router.locale == "cy"
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
|
? detailsObj.pinswg_siteaddresstown
|
||||||
|
: ""}
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresstown"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
|
null && <br />}
|
||||||
|
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresscounty"
|
||||||
|
)
|
||||||
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
|
: ""}
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresscounty"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresspostcode"
|
||||||
|
)
|
||||||
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
|
: ""}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"search:searchresults-applicant-label"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
{_.has(detailsObj, [
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||||
|
])
|
||||||
|
? detailsObj[
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
: ""}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"search:searchresults-authority-label"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
{_.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"
|
||||||
|
: ""}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"search:searchresults-case-type-label"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
{router.locale == "cy"
|
||||||
? jsonpath.query(
|
? jsonpath.query(
|
||||||
transLookup,
|
transLookup,
|
||||||
'$..[?(@.value=="' +
|
'$..[?(@.value=="' +
|
||||||
item[
|
item[
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
] +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: item[
|
: item[
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
] || "N/A"}
|
||||||
: ""}
|
</dd>
|
||||||
</dd>
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<span className="results-visually-hidden">
|
||||||
<span className="results-visually-hidden">
|
{t("search:searchresults-status-label")}
|
||||||
{t("search:searchresults-case-type-label")}:
|
:
|
||||||
</span>
|
</span>
|
||||||
{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"}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t("search:searchresults-status-label")}:
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{router.locale == "cy"
|
{router.locale == "cy"
|
||||||
? jsonpath.query(
|
? jsonpath.query(
|
||||||
transLookup,
|
transLookup,
|
||||||
'$..[?(@.value=="' +
|
'$..[?(@.value=="' +
|
||||||
item[
|
item[
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
] +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: item[
|
: item[
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"}
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</dl>
|
</dl>
|
||||||
|
<PaginationControl
|
||||||
|
currentPage={currentPage}
|
||||||
|
searchResultsObj={searchResultsObj}
|
||||||
|
spinnerState={spinnerState}
|
||||||
|
getSearchPageResults={getSearchPageResults}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
const pagesCount = Math.ceil(searchResultsObj["@odata.count"] / 10);
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-grid-column-full">
|
|
||||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
|
||||||
{t("search:searchresults-title-label")}
|
|
||||||
</h1>
|
|
||||||
<p className="govuk-body">
|
|
||||||
{resultsArr.length > 200
|
|
||||||
? t("search:searchresults-max-count-label")
|
|
||||||
: t("search:searchresults-count-label", {
|
|
||||||
count: resultsArr.length,
|
|
||||||
})}
|
|
||||||
.
|
|
||||||
{typeof searchString != "undefined" ? (
|
|
||||||
<>
|
|
||||||
<span>
|
|
||||||
{t("search:searchresults-case-count-label")}{" "}
|
|
||||||
{" "}
|
|
||||||
<em>"{searchString}"</em>
|
|
||||||
</span>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{resultsArr.length > 0 ? (
|
let currentPage = 0;
|
||||||
ResultsView(resultsArr)
|
|
||||||
) : (
|
currentPage = decodeURI(searchResultsObj["@odata.nextLink"]).split(
|
||||||
<div className="govuk-grid-row">
|
"skiptoken="
|
||||||
<div className="govuk-grid-column-two-thirds">
|
)[1];
|
||||||
<h3>
|
currentPage =
|
||||||
{t("search:searchresults-no-records-label")}
|
typeof currentPage != "undefined"
|
||||||
</h3>
|
? parseInt(
|
||||||
|
decodeURI(currentPage)
|
||||||
|
.split('pagenumber="')[1]
|
||||||
|
.slice(
|
||||||
|
0,
|
||||||
|
decodeURI(currentPage)
|
||||||
|
.split('pagenumber="')[1]
|
||||||
|
.indexOf('"')
|
||||||
|
) - 1
|
||||||
|
)
|
||||||
|
: pagesCount;
|
||||||
|
|
||||||
|
const getSearchPageResults = (pageNumber) => {
|
||||||
|
console.log(advancedSearch, searchString, pageNumber);
|
||||||
|
|
||||||
|
if (advancedSearch) {
|
||||||
|
var searchoObj = Object.assign(
|
||||||
|
...searchString.map(([key, val]) => ({ [key]: val }))
|
||||||
|
);
|
||||||
|
|
||||||
|
getAdvancedSearchPaged(searchoObj, pageNumber)
|
||||||
|
.then((data) => {
|
||||||
|
//console.log(data);
|
||||||
|
setSearchResults(data);
|
||||||
|
return data;
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
//console.log("getting details", data);
|
||||||
|
return getSearchDetails(data).then((data) => {
|
||||||
|
setSearchDetails(data);
|
||||||
|
setShowSpinnerState(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getBasicSearchPaged(searchString, pageNumber)
|
||||||
|
.then((data) => {
|
||||||
|
//console.log(data);
|
||||||
|
setSearchResults(data);
|
||||||
|
return data;
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
//console.log("getting details", data);
|
||||||
|
return getSearchDetails(data).then((data) => {
|
||||||
|
setSearchDetails(data);
|
||||||
|
setShowSpinnerState(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSearchDetails = (searchResultsObj) => {
|
||||||
|
//console.log(searchResultsObj);
|
||||||
|
|
||||||
|
let detailsArr = [];
|
||||||
|
//console.log("search results", searchResultsObj);
|
||||||
|
searchResultsObj = searchResultsObj.value;
|
||||||
|
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||||
|
//console.log(searchDetail);
|
||||||
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
|
console.log(searchDetail.title);
|
||||||
|
} else {
|
||||||
|
let formMeta = getFormCollection(
|
||||||
|
"pinswg_" +
|
||||||
|
searchDetail[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.slice(0, 39)
|
||||||
|
);
|
||||||
|
|
||||||
|
detailsArr.push(
|
||||||
|
getBasicSearchDetailsPaged(
|
||||||
|
formMeta.LogicalCollectionName,
|
||||||
|
searchDetail.title,
|
||||||
|
formMeta.PrimaryIdAttribute,
|
||||||
|
searchDetail.incidentid
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// console.log(detailsArr);
|
||||||
|
return Promise.all(detailsArr);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFormCollection = (formtype) => {
|
||||||
|
const collectionName = jsonpath.query(
|
||||||
|
data,
|
||||||
|
"$..[?(@.LogicalName=='" + formtype + "')]"
|
||||||
|
);
|
||||||
|
//console.log(collectionName[0]);
|
||||||
|
return collectionName[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||||
|
{t("search:searchresults-title-label")}
|
||||||
|
</h1>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{resultsArr.length > 200
|
||||||
|
? t("search:searchresults-max-count-label")
|
||||||
|
: t("search:searchresults-count-label", {
|
||||||
|
count: searchResultsObj["@odata.count"],
|
||||||
|
})}
|
||||||
|
.
|
||||||
|
{advancedSearch != true ? (
|
||||||
|
<>
|
||||||
|
<span>
|
||||||
|
{t("search:searchresults-case-count-label")}{" "}
|
||||||
|
{" "}
|
||||||
|
<em>"{searchString}"</em>
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
{resultsArr.length > 0 ? (
|
||||||
|
ResultsView(resultsArr)
|
||||||
|
) : (
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-two-thirds">
|
||||||
|
<h3>
|
||||||
|
{t("search:searchresults-no-records-label")}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
)}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<LoadingOverlay
|
||||||
|
active={showSpinnerState}
|
||||||
|
spinner
|
||||||
|
text={t("common:spinner-searching")}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -231,6 +430,12 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
setCurrentReference: (currentReference) => {
|
setCurrentReference: (currentReference) => {
|
||||||
dispatch(setCurrentReference(currentReference));
|
dispatch(setCurrentReference(currentReference));
|
||||||
},
|
},
|
||||||
|
setSearchResults: (searchResultsObj) => {
|
||||||
|
dispatch(setSearchResults(searchResultsObj));
|
||||||
|
},
|
||||||
|
setSearchDetails: (searchDetailsObj) => {
|
||||||
|
dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import SearchResults from "./search/searchresults";
|
|||||||
import CRMError from "./crmError";
|
import CRMError from "./crmError";
|
||||||
|
|
||||||
export default function Search(props) {
|
export default function Search(props) {
|
||||||
const { searchString, searchResultsObj } = props;
|
const { searchString, searchResultsObj, advancedSearch } = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -32,6 +32,7 @@ export default function Search(props) {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<SearchResults
|
<SearchResults
|
||||||
|
advancedSearch={advancedSearch}
|
||||||
searchString={searchString}
|
searchString={searchString}
|
||||||
searchResultsObj={
|
searchResultsObj={
|
||||||
searchResultsObj.searchResultsObj
|
searchResultsObj.searchResultsObj
|
||||||
|
|||||||
+14
-14
@@ -115,14 +115,14 @@
|
|||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_miscellaneouscaseworks",
|
"LogicalCollectionName": "pinswg_miscellaneouscaseworks",
|
||||||
"LogicalName": "pinswg_miscellaneouscasework",
|
"LogicalName": "pinswg_miscellaneouscasework",
|
||||||
"PrimaryIdAttribute": "pinswg_miscellaneouscaseworkid",
|
"PrimaryIdAttribute": "pinswg_miscellaneouscasewordid",
|
||||||
"UrlName": "miscellaneouscasework",
|
"UrlName": "miscellaneouscasework",
|
||||||
"MetadataId": "f519aa8e-5782-eb11-aac0-00224800be9c"
|
"MetadataId": "f519aa8e-5782-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_miscellaneouscaseworks",
|
"LogicalCollectionName": "pinswg_miscellaneouscaseworks",
|
||||||
"LogicalName": "pinswg_misccasework",
|
"LogicalName": "pinswg_misccasework",
|
||||||
"PrimaryIdAttribute": "pinswg_miscellaneouscaseworkid",
|
"PrimaryIdAttribute": "pinswg_miscellaneouscasewordid",
|
||||||
"UrlName": "miscellaneouscasework",
|
"UrlName": "miscellaneouscasework",
|
||||||
"MetadataId": "f519aa8e-5782-eb11-aac0-00224800be9c"
|
"MetadataId": "f519aa8e-5782-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
@@ -150,21 +150,21 @@
|
|||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_lawfuldevelopmentcertificates",
|
"LogicalCollectionName": "pinswg_lawfuldevelopmentcertificates",
|
||||||
"LogicalName": "pinswg_lawfuldevelopmentcertificate",
|
"LogicalName": "pinswg_lawfuldevelopmentcertificate",
|
||||||
"PrimaryIdAttribute": "pinswg_lawfuldevelopmentcertificateid",
|
"PrimaryIdAttribute": "pinswg_lawfuldevelopmentcertificatappid",
|
||||||
"UrlName": "lawfuldevelopmentcertificate",
|
"UrlName": "lawfuldevelopmentcertificate",
|
||||||
"MetadataId": "184e4861-9681-eb11-aac0-00224800be9c"
|
"MetadataId": "184e4861-9681-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_lawfuldevelopmentcertificates",
|
"LogicalCollectionName": "pinswg_lawfuldevelopmentcertificates",
|
||||||
"LogicalName": "pinswg_lawfuldevelopmentcertificateappeals194195",
|
"LogicalName": "pinswg_lawfuldevelopmentcertificateappeals194195",
|
||||||
"PrimaryIdAttribute": "pinswg_lawfuldevelopmentcertificateid",
|
"PrimaryIdAttribute": "pinswg_lawfuldevelopmentcertificatappid",
|
||||||
"UrlName": "lawfuldevelopmentcertificateappeals1941",
|
"UrlName": "lawfuldevelopmentcertificateappeals1941",
|
||||||
"MetadataId": "184e4861-9681-eb11-aac0-00224800be9c"
|
"MetadataId": "184e4861-9681-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_lawfuldevelopmentcertificates",
|
"LogicalCollectionName": "pinswg_lawfuldevelopmentcertificates",
|
||||||
"LogicalName": "pinswg_lawfuldevelopmentcertificateappeals1941",
|
"LogicalName": "pinswg_lawfuldevelopmentcertificateappeals1941",
|
||||||
"PrimaryIdAttribute": "pinswg_lawfuldevelopmentcertificateid",
|
"PrimaryIdAttribute": "pinswg_lawfuldevelopmentcertificatappid",
|
||||||
"UrlName": "lawfuldevelopmentcertificate",
|
"UrlName": "lawfuldevelopmentcertificate",
|
||||||
"MetadataId": "184e4861-9681-eb11-aac0-00224800be9c"
|
"MetadataId": "184e4861-9681-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
@@ -185,21 +185,21 @@
|
|||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
|
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
|
||||||
"LogicalName": "pinswg_enforcementlistedbuildingconservationap",
|
"LogicalName": "pinswg_enforcementlistedbuildingconservationap",
|
||||||
"PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconservationapid",
|
"PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconseid",
|
||||||
"UrlName": "enforcementlistedbuildingconservationap",
|
"UrlName": "enforcementlistedbuildingconservationap",
|
||||||
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c"
|
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
|
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
|
||||||
"LogicalName": "pinswg_enforcementlistedbuildingandconservationappeals39",
|
"LogicalName": "pinswg_enforcementlistedbuildingandconservationappeals39",
|
||||||
"PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconservationapid",
|
"PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconseid",
|
||||||
"UrlName": "enforcementlistedbuildingconservationap",
|
"UrlName": "enforcementlistedbuildingconservationap",
|
||||||
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c"
|
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
|
"LogicalCollectionName": "pinswg_enforcementlistedbuildingconservationaps",
|
||||||
"LogicalName": "pinswg_enforcementlistedbuildingandconservationap",
|
"LogicalName": "pinswg_enforcementlistedbuildingandconservationap",
|
||||||
"PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconservationapid",
|
"PrimaryIdAttribute": "pinswg_enforcementlistedbuildingconseid",
|
||||||
"UrlName": "enforcementlistedbuildingconservationap",
|
"UrlName": "enforcementlistedbuildingconservationap",
|
||||||
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c"
|
"MetadataId": "c697be96-9481-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
@@ -227,21 +227,21 @@
|
|||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
|
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
|
||||||
"LogicalName": "pinswg_hedgeshedgerowstreepreservationreplacem",
|
"LogicalName": "pinswg_hedgeshedgerowstreepreservationreplacem",
|
||||||
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservationreplacemid",
|
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservatioids",
|
||||||
"UrlName": "hedgeshedgerowstreepreservationreplacem",
|
"UrlName": "hedgeshedgerowstreepreservationreplacem",
|
||||||
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c"
|
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
|
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
|
||||||
"LogicalName": "pinswg_highhedgestreepreservationordershedgerowstreereplacementnotice",
|
"LogicalName": "pinswg_highhedgestreepreservationordershedgerowstreereplacementnotice",
|
||||||
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservationreplacemid",
|
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservatioid",
|
||||||
"UrlName": "hedgeshedgerowstreepreservationreplacem",
|
"UrlName": "hedgeshedgerowstreepreservationreplacem",
|
||||||
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c"
|
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
|
"LogicalCollectionName": "pinswg_hedgeshedgerowstreepreservationreplacems",
|
||||||
"LogicalName": "pinswg_highhedgestreepreservationordershedgero",
|
"LogicalName": "pinswg_highhedgestreepreservationordershedgero",
|
||||||
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservationreplacemid",
|
"PrimaryIdAttribute": "pinswg_hedgeshedgerowstreepreservatioid",
|
||||||
"UrlName": "hedgeshedgerowstreepreservationreplacem",
|
"UrlName": "hedgeshedgerowstreepreservationreplacem",
|
||||||
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c"
|
"MetadataId": "60f38fed-5382-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_communityinfrastructurelevys117118119s",
|
"LogicalCollectionName": "pinswg_communityinfrastructurelevys117118119s",
|
||||||
"LogicalName": "pinswg_communityinfrastructurelevys117118119",
|
"LogicalName": "pinswg_communityinfrastructurelevys117118119",
|
||||||
"PrimaryIdAttribute": "pinswg_communityinfrastructurelevys117118119id",
|
"PrimaryIdAttribute": "pinswg_communityinfrastructurelevyid",
|
||||||
"UrlName": "communityinfrastructurelevys117118119",
|
"UrlName": "communityinfrastructurelevys117118119",
|
||||||
"MetadataId": "0c309f3c-4882-eb11-aac0-00224800be9c"
|
"MetadataId": "0c309f3c-4882-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
@@ -346,14 +346,14 @@
|
|||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_listedbuildingandconservationareaconsens",
|
"LogicalCollectionName": "pinswg_listedbuildingandconservationareaconsens",
|
||||||
"LogicalName": "pinswg_listedbuildingandconservationareaconsen",
|
"LogicalName": "pinswg_listedbuildingandconservationareaconsen",
|
||||||
"PrimaryIdAttribute": "pinswg_listedbuildingandconservationareaconsenid",
|
"PrimaryIdAttribute": "pinswg_listedbuildingandconservationrid",
|
||||||
"UrlName": "listedbuildingandconservationareaconsen",
|
"UrlName": "listedbuildingandconservationareaconsen",
|
||||||
"MetadataId": "4cd95405-8f81-eb11-aac0-00224800be9c"
|
"MetadataId": "4cd95405-8f81-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"LogicalCollectionName": "pinswg_listedbuildingandconservationareaconsens",
|
"LogicalCollectionName": "pinswg_listedbuildingandconservationareaconsens",
|
||||||
"LogicalName": "pinswg_listedbuildingconservationareaconsent",
|
"LogicalName": "pinswg_listedbuildingconservationareaconsent",
|
||||||
"PrimaryIdAttribute": "pinswg_listedbuildingandconservationareaconsenid",
|
"PrimaryIdAttribute": "pinswg_listedbuildingandconservationrid",
|
||||||
"UrlName": "listedbuildingandconservationareaconsen",
|
"UrlName": "listedbuildingandconservationareaconsen",
|
||||||
"MetadataId": "4cd95405-8f81-eb11-aac0-00224800be9c"
|
"MetadataId": "4cd95405-8f81-eb11-aac0-00224800be9c"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -193,6 +193,11 @@
|
|||||||
"value": "Split Decision",
|
"value": "Split Decision",
|
||||||
"value_cy": "Penderfyniad Hollt",
|
"value_cy": "Penderfyniad Hollt",
|
||||||
"pinswg_decision": 846040002
|
"pinswg_decision": 846040002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Planning permission granted",
|
||||||
|
"value_cy": "Rhoddwyd caniatâd cynllunio",
|
||||||
|
"pinswg_decision": 846040002
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"pinswg_lpa": [
|
"pinswg_lpa": [
|
||||||
|
|||||||
@@ -51,5 +51,9 @@
|
|||||||
"cookie-banner-decline": "Rwy'n dirywio",
|
"cookie-banner-decline": "Rwy'n dirywio",
|
||||||
"cookie-banner-accept": "Derbyn cwcis",
|
"cookie-banner-accept": "Derbyn cwcis",
|
||||||
"cookie-banner-change-settings": "Newid gosodiadau cwcis",
|
"cookie-banner-change-settings": "Newid gosodiadau cwcis",
|
||||||
"drop-down-select": "Dewiswch..."
|
"drop-down-select": "Dewiswch...",
|
||||||
|
"previous-link-button": "Blaenorol",
|
||||||
|
"next-link-button": "Nesaf",
|
||||||
|
"pages-label": "Tudalen",
|
||||||
|
"of-label": "o"
|
||||||
}
|
}
|
||||||
@@ -51,5 +51,9 @@
|
|||||||
"cookie-banner-decline": "I decline",
|
"cookie-banner-decline": "I decline",
|
||||||
"cookie-banner-accept": "Accept cookies",
|
"cookie-banner-accept": "Accept cookies",
|
||||||
"cookie-banner-change-settings": "Change cookie settings",
|
"cookie-banner-change-settings": "Change cookie settings",
|
||||||
"drop-down-select": "Select..."
|
"drop-down-select": "Select...",
|
||||||
|
"previous-link-button": "Previous",
|
||||||
|
"next-link-button": "Next",
|
||||||
|
"pages-label": "Page",
|
||||||
|
"of-label": "of"
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ const Home = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const { appealtypes } = router.query;
|
const { appealtypes } = router.query;
|
||||||
|
|
||||||
console.log(props, props.LPAData);
|
//console.log(props, props.LPAData);
|
||||||
var hasError =
|
var hasError =
|
||||||
_.has(props.LPAData.LPAData, "errorCode") ||
|
_.has(props.LPAData.LPAData, "errorCode") ||
|
||||||
_.has(props.appealType.appealType, "errorCode")
|
_.has(props.appealType.appealType, "errorCode")
|
||||||
|
|||||||
@@ -20,15 +20,11 @@ import { setSearch, getSearchObj } from "../store/search/action";
|
|||||||
import {
|
import {
|
||||||
setSearchResults,
|
setSearchResults,
|
||||||
setSearchDetails,
|
setSearchDetails,
|
||||||
setDocumentDetails,
|
|
||||||
setDocumentHistory,
|
|
||||||
getSearchResultsObj,
|
getSearchResultsObj,
|
||||||
} from "../store/searchOutput/action";
|
} from "../store/searchOutput/action";
|
||||||
import {
|
import {
|
||||||
getAdvancedSearch,
|
getAdvancedSearch,
|
||||||
getBasicSearchDetails,
|
getBasicSearchDetails,
|
||||||
getSearchDocumentDetails,
|
|
||||||
getSearchDocumentHistory,
|
|
||||||
getSASToken,
|
getSASToken,
|
||||||
} from "../actions";
|
} from "../actions";
|
||||||
|
|
||||||
@@ -80,13 +76,14 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
|
store.dispatch(setSearch(Object.entries(query)));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const getFormCollection = (formtype) => {
|
const getFormCollection = (formtype) => {
|
||||||
const collectionName = jsonpath.query(
|
const collectionName = jsonpath.query(
|
||||||
data,
|
data,
|
||||||
"$..[?(@.LogicalName=='" + formtype + "')].LogicalCollectionName"
|
"$..[?(@.LogicalName=='" + formtype + "')]"
|
||||||
);
|
);
|
||||||
//console.log(collectionName[0]);
|
//console.log(collectionName[0]);
|
||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
@@ -102,19 +99,23 @@ const getSearchDetails = (token, searchResultsObj) => {
|
|||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
console.log(searchDetail.ticketnumber);
|
console.log(searchDetail.ticketnumber);
|
||||||
} else {
|
} else {
|
||||||
|
let formMeta = getFormCollection(
|
||||||
|
"pinswg_" +
|
||||||
|
searchDetail[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.slice(0, 39)
|
||||||
|
);
|
||||||
|
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getBasicSearchDetails(
|
getBasicSearchDetails(
|
||||||
token,
|
token,
|
||||||
getFormCollection(
|
formMeta.LogicalCollectionName,
|
||||||
"pinswg_" +
|
searchDetail.title,
|
||||||
searchDetail[
|
formMeta.PrimaryIdAttribute,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
searchDetail.incidentid
|
||||||
]
|
|
||||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
|
||||||
.toLowerCase()
|
|
||||||
.slice(0, 39)
|
|
||||||
),
|
|
||||||
searchDetail.ticketnumber
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
"OData-MaxVersion": "4.0",
|
"OData-MaxVersion": "4.0",
|
||||||
"OData-Version": "4.0",
|
"OData-Version": "4.0",
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
"Prefer":
|
||||||
|
'odata.include-annotations="*",return=representation,odata.maxpagesize=10',
|
||||||
"Authorization": SASToken,
|
"Authorization": SASToken,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
@@ -99,13 +100,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let apiPath = req.url.split("/api/proxy/")[1];
|
let apiPath = req.url.split("/api/proxy/")[1];
|
||||||
let hasDocument = apiPath.indexOf("/download") > 0 ? true : false;
|
let hasDocument = apiPath.indexOf("/download") > 0 ? true : false;
|
||||||
console.log(
|
// console.log(
|
||||||
"//////////////",
|
// "//////////////",
|
||||||
req.url.split("/api/proxy/")[1],
|
// req.url.split("/api/proxy/")[1],
|
||||||
PROXY_RELAY_URL + req.query.route[0],
|
// PROXY_RELAY_URL + req.query.route[0],
|
||||||
req.method,
|
// req.method,
|
||||||
hasDocument
|
// hasDocument
|
||||||
);
|
// );
|
||||||
axios(
|
axios(
|
||||||
req.method == "GET"
|
req.method == "GET"
|
||||||
? hasDocument
|
? hasDocument
|
||||||
|
|||||||
+16
-12
@@ -90,7 +90,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
const getFormCollection = (formtype) => {
|
const getFormCollection = (formtype) => {
|
||||||
const collectionName = jsonpath.query(
|
const collectionName = jsonpath.query(
|
||||||
data,
|
data,
|
||||||
"$..[?(@.LogicalName=='" + formtype + "')].LogicalCollectionName"
|
"$..[?(@.LogicalName=='" + formtype + "')]"
|
||||||
);
|
);
|
||||||
//console.log(collectionName[0]);
|
//console.log(collectionName[0]);
|
||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
@@ -103,21 +103,25 @@ const getSearchDetails = (token, searchResultsObj) => {
|
|||||||
searchResultsObj = searchResultsObj.value;
|
searchResultsObj = searchResultsObj.value;
|
||||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
console.log(searchDetail.ticketnumber);
|
console.log(searchDetail.title);
|
||||||
} else {
|
} else {
|
||||||
|
let formMeta = getFormCollection(
|
||||||
|
"pinswg_" +
|
||||||
|
searchDetail[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.slice(0, 39)
|
||||||
|
);
|
||||||
|
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getBasicSearchDetails(
|
getBasicSearchDetails(
|
||||||
token,
|
token,
|
||||||
getFormCollection(
|
formMeta.LogicalCollectionName,
|
||||||
"pinswg_" +
|
searchDetail.title,
|
||||||
searchDetail[
|
formMeta.PrimaryIdAttribute,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
searchDetail.incidentid
|
||||||
]
|
|
||||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
|
||||||
.toLowerCase()
|
|
||||||
.slice(0, 39)
|
|
||||||
),
|
|
||||||
searchDetail.ticketnumber
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+35
-80
@@ -19,17 +19,9 @@ import { setSearch, getSearchObj } from "../store/search/action";
|
|||||||
import {
|
import {
|
||||||
setSearchResults,
|
setSearchResults,
|
||||||
setSearchDetails,
|
setSearchDetails,
|
||||||
setDocumentDetails,
|
|
||||||
setDocumentHistory,
|
|
||||||
getSearchResultsObj,
|
getSearchResultsObj,
|
||||||
} from "../store/searchOutput/action";
|
} from "../store/searchOutput/action";
|
||||||
import {
|
import { getBasicSearch, getBasicSearchDetails, getSASToken } from "../actions";
|
||||||
getBasicSearch,
|
|
||||||
getBasicSearchDetails,
|
|
||||||
getSearchDocumentDetails,
|
|
||||||
getSearchDocumentHistory,
|
|
||||||
getSASToken,
|
|
||||||
} from "../actions";
|
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
@@ -87,21 +79,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
searchResultsObj
|
searchResultsObj
|
||||||
);
|
);
|
||||||
|
|
||||||
// const searchDocumentResultsObj = await getDocumentDetails(
|
|
||||||
// token,
|
|
||||||
// searchResultsObj
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const searchDocumentHistoryObj = await getDocumentHistory(
|
|
||||||
// token,
|
|
||||||
// searchDocumentResultsObj
|
|
||||||
// );
|
|
||||||
// console.log(searchDocumentHistoryObj);
|
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
//store.dispatch(setDocumentDetails(searchDocumentResultsObj));
|
|
||||||
//store.dispatch(setDocumentHistory(searchDocumentHistoryObj));
|
|
||||||
store.dispatch(setSearch(query.q));
|
store.dispatch(setSearch(query.q));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -109,7 +88,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
const getFormCollection = (formtype) => {
|
const getFormCollection = (formtype) => {
|
||||||
const collectionName = jsonpath.query(
|
const collectionName = jsonpath.query(
|
||||||
data,
|
data,
|
||||||
"$..[?(@.LogicalName=='" + formtype + "')].LogicalCollectionName"
|
"$..[?(@.LogicalName=='" + formtype + "')]"
|
||||||
);
|
);
|
||||||
//console.log(collectionName[0]);
|
//console.log(collectionName[0]);
|
||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
@@ -123,8 +102,22 @@ const getSearchDetails = (token, searchResultsObj) => {
|
|||||||
searchResultsObj = searchResultsObj.value;
|
searchResultsObj = searchResultsObj.value;
|
||||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||||
//console.log(searchDetail);
|
//console.log(searchDetail);
|
||||||
|
|
||||||
|
// console.log(
|
||||||
|
// "the collect",
|
||||||
|
// getFormCollection(
|
||||||
|
// "pinswg_" +
|
||||||
|
// searchDetail[
|
||||||
|
// "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
// ]
|
||||||
|
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
|
// .toLowerCase()
|
||||||
|
// .slice(0, 39)
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
|
||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
console.log(searchDetail.ticketnumber);
|
console.log(searchDetail.title);
|
||||||
} else {
|
} else {
|
||||||
// console.log(
|
// console.log(
|
||||||
// "appealtype collection name",
|
// "appealtype collection name",
|
||||||
@@ -138,21 +131,28 @@ const getSearchDetails = (token, searchResultsObj) => {
|
|||||||
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
// .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
// .toLowerCase()
|
// .toLowerCase()
|
||||||
// .slice(0, 39),
|
// .slice(0, 39),
|
||||||
// searchDetail.ticketnumber
|
// searchDetail.title,
|
||||||
|
// searchDetail.ticketnumber,
|
||||||
|
// searchDetail.incidentid
|
||||||
// );
|
// );
|
||||||
|
|
||||||
|
let formMeta = getFormCollection(
|
||||||
|
"pinswg_" +
|
||||||
|
searchDetail[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.slice(0, 39)
|
||||||
|
);
|
||||||
|
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getBasicSearchDetails(
|
getBasicSearchDetails(
|
||||||
token,
|
token,
|
||||||
getFormCollection(
|
formMeta.LogicalCollectionName,
|
||||||
"pinswg_" +
|
searchDetail.title,
|
||||||
searchDetail[
|
formMeta.PrimaryIdAttribute,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
searchDetail.incidentid
|
||||||
]
|
|
||||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
|
||||||
.toLowerCase()
|
|
||||||
.slice(0, 39)
|
|
||||||
),
|
|
||||||
searchDetail.ticketnumber
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -161,51 +161,6 @@ const getSearchDetails = (token, searchResultsObj) => {
|
|||||||
return Promise.all(detailsArr);
|
return Promise.all(detailsArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDocumentDetails = (token, searchResultsObj) => {
|
|
||||||
//console.log(searchResultsObj);
|
|
||||||
|
|
||||||
let detailsArr = [];
|
|
||||||
//console.log("search results", searchResultsObj);
|
|
||||||
searchResultsObj = searchResultsObj.value;
|
|
||||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
|
||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
|
||||||
console.log(searchDetail.incidentid);
|
|
||||||
} else {
|
|
||||||
detailsArr.push(
|
|
||||||
getSearchDocumentDetails(token, searchDetail.incidentid)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//console.log(detailsArr);
|
|
||||||
return Promise.all(detailsArr);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDocumentHistory = (token, searchDocumentDetailsObj) => {
|
|
||||||
//console.log(searchResultsObj);
|
|
||||||
|
|
||||||
let historyArr = [];
|
|
||||||
//console.log("search results", searchDocumentDetailsObj);
|
|
||||||
searchDocumentDetailsObj = searchDocumentDetailsObj[0].value;
|
|
||||||
|
|
||||||
//console.log(searchDocumentDetailsObj);
|
|
||||||
const detailsObj = searchDocumentDetailsObj.map((historyDetail, index) => {
|
|
||||||
//console.log(historyDetail);
|
|
||||||
if (historyDetail.pinswg_publishtoweb != true) {
|
|
||||||
console.log(historyDetail.pinswg_documentid);
|
|
||||||
} else {
|
|
||||||
// console.log(
|
|
||||||
// "history detail documentid:",
|
|
||||||
// historyDetail.pinswg_documentid
|
|
||||||
// );
|
|
||||||
historyArr.push(
|
|
||||||
getSearchDocumentHistory(token, historyDetail.pinswg_documentid)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log(historyArr);
|
|
||||||
return Promise.all(historyArr);
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
return {
|
return {
|
||||||
currentView: state.currentView,
|
currentView: state.currentView,
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="13px" height="20px" viewBox="0 0 13 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Path</title>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="arrow-right--black" transform="translate(0.100000, 0.000000)" fill="#B80D0D" fill-rule="nonzero">
|
||||||
|
<polygon id="Path" transform="translate(6.450000, 10.000000) scale(-1, 1) translate(-6.450000, -10.000000) " points="12.9 10 9.6 6.5 3.3 0 3.60822483e-16 3.6 6.1 10 3.60822483e-16 16.4 3.3 20 9.6 13.5"></polygon>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 657 B |
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="13px" height="20px" viewBox="0 0 13 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>arrow-right--black</title>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="arrow-right--black" transform="translate(6.550000, 10.000000) scale(-1, 1) translate(-6.550000, -10.000000) translate(0.100000, 0.000000)" fill="#111111" fill-rule="nonzero">
|
||||||
|
<polygon id="Path" points="12.9 10 9.6 6.5 3.3 0 3.60822483e-16 3.6 6.1 10 3.60822483e-16 16.4 3.3 20 9.6 13.5"></polygon>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 658 B |
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="13px" height="20px" viewBox="0 0 13 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>arrow-right--white</title>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="arrow-right--white" transform="translate(6.550000, 10.000000) scale(-1, 1) translate(-6.550000, -10.000000) translate(0.100000, 0.000000)" fill="#FFFFFF" fill-rule="nonzero">
|
||||||
|
<polygon id="Path" points="12.9 10 9.6 6.5 3.3 0 3.60822483e-16 3.6 6.1 10 3.60822483e-16 16.4 3.3 20 9.6 13.5"></polygon>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 658 B |
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="13px" height="20px" viewBox="0 0 13 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Path</title>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="arrow-right--black" transform="translate(0.100000, 0.000000)" fill="#B80D0D" fill-rule="nonzero">
|
||||||
|
<polygon id="Path" points="12.9 10 9.6 6.5 3.3 0 3.60822483e-16 3.6 6.1 10 3.60822483e-16 16.4 3.3 20 9.6 13.5"></polygon>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 567 B |
@@ -1379,3 +1379,118 @@ ul#sharePageLinks.active {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.paginationWrapper {
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginationPrevious {
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
.leftTextButton {
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: "";
|
||||||
|
background-image: url(/assets/images/arrow-left--black.svg);
|
||||||
|
padding: 0 0 0 20px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: left center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.activePaginationItem {
|
||||||
|
color: #b80d0d;
|
||||||
|
&:before {
|
||||||
|
content: "";
|
||||||
|
background-image: url(/assets/images/arrow-left--active.svg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
&.activePaginationItem {
|
||||||
|
color: $white;
|
||||||
|
&:before {
|
||||||
|
content: "";
|
||||||
|
background-image: url(/assets/images/arrow-left--white.svg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
background-color: $black;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 15px 20px 15px 20px !important;
|
||||||
|
-webkit-transition: all 0.2s ease-in;
|
||||||
|
-moz-transition: all 0.2s ease-in;
|
||||||
|
transition: all 0.2s ease-in;
|
||||||
|
width: max-content;
|
||||||
|
&:link {
|
||||||
|
color: $white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginationContainer {
|
||||||
|
text-align: center;
|
||||||
|
.activePaginationItem {
|
||||||
|
color: #b80d0d;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginationNext {
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
.rightTextButton {
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: "";
|
||||||
|
background-image: url(/assets/images/arrow-right--black.svg);
|
||||||
|
padding: 0 0 0 20px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.activePaginationItem {
|
||||||
|
color: #b80d0d;
|
||||||
|
&:after {
|
||||||
|
content: "";
|
||||||
|
background-image: url(/assets/images/arrow-right--active.svg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
&.activePaginationItem {
|
||||||
|
color: #ffffff;
|
||||||
|
&:after {
|
||||||
|
content: "";
|
||||||
|
background-image: url(/assets/images/arrow-right--white.svg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
background-color: $black;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 15px 15px 15px 20px !important;
|
||||||
|
-webkit-transition: all 0.2s ease-in;
|
||||||
|
-moz-transition: all 0.2s ease-in;
|
||||||
|
transition: all 0.2s ease-in;
|
||||||
|
margin-left: 20px;
|
||||||
|
width: max-content;
|
||||||
|
&:link {
|
||||||
|
color: $white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mobilePageCount {
|
||||||
|
margin-top: 40px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user