Merged PR 477: updated the documents query and display
updated the documents query and display Related work items: #6248
This commit is contained in:
+31
-1
@@ -143,7 +143,7 @@ export const getBasicSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
"incidents?$select=_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&$top=201",
|
||||||
azureHeaders(token)
|
azureHeaders(token)
|
||||||
@@ -265,6 +265,36 @@ export const getSearchDocumentHistory = (token, documentID) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getSearchDocumentDetails1 = (incidentID) => {
|
||||||
|
var token = getSASToken();
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/pinswg_documents?$count=true&$filter=_pinswg_documentids_value eq " +
|
||||||
|
incidentID +
|
||||||
|
" and pinswg_publishtoweb eq true&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference",
|
||||||
|
azureHeaders(token)
|
||||||
|
)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thiserror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getSearchDocumentHistory1 = (documentID) => {
|
||||||
|
var token = getSASToken();
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||||
|
documentID,
|
||||||
|
azureHeaders(token)
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thiserror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
export const getBasicDNSSearchDetails = (token, appealType, caseReference) => {
|
export const getBasicDNSSearchDetails = (token, appealType, caseReference) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
|
|||||||
+536
-503
File diff suppressed because it is too large
Load Diff
+101
-19
@@ -2,10 +2,28 @@ 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 jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
import { useState, useEffect, useRef } from "react";
|
||||||
|
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getBasicSearch,
|
||||||
|
getBasicSearchDetails,
|
||||||
|
getSearchDocumentDetails1,
|
||||||
|
getSearchDocumentHistory1,
|
||||||
|
getSASToken,
|
||||||
|
} from "../../actions";
|
||||||
|
|
||||||
|
import {
|
||||||
|
setSearchResults,
|
||||||
|
setSearchDetails,
|
||||||
|
setDocumentDetails,
|
||||||
|
setDocumentHistory,
|
||||||
|
getSearchResultsObj,
|
||||||
|
} from "../../store/searchOutput/action";
|
||||||
|
|
||||||
const DocumentDetails = (props) => {
|
const DocumentDetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
const firstRender = useRef(false);
|
||||||
const {
|
const {
|
||||||
incidentid,
|
incidentid,
|
||||||
caseReference,
|
caseReference,
|
||||||
@@ -20,10 +38,11 @@ const DocumentDetails = (props) => {
|
|||||||
|
|
||||||
var documentDetailsArr = documentDetailsObj || [];
|
var documentDetailsArr = documentDetailsObj || [];
|
||||||
|
|
||||||
console.log(documentDetailsObj);
|
|
||||||
console.log(documentDetailsArr);
|
|
||||||
|
|
||||||
const DocumentView = (documentDetailsArr) => {
|
const DocumentView = (documentDetailsArr) => {
|
||||||
|
console.log(documentDetailsArr);
|
||||||
|
|
||||||
|
documentDetailsArr = documentDetailsArr.value;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
||||||
<div className="govuk-summary-list__row results-headings">
|
<div className="govuk-summary-list__row results-headings">
|
||||||
@@ -41,15 +60,14 @@ const DocumentDetails = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{documentDetailsArr.map((item, key) => {
|
{documentDetailsArr.map((item) => {
|
||||||
console.log(key);
|
|
||||||
let detailsObj = jsonpath.query(
|
let detailsObj = jsonpath.query(
|
||||||
documentDetailsObj[key],
|
item,
|
||||||
"$..value[?(@._pinswg_documentids_value=='" +
|
"$..[?(@._pinswg_documentids_value=='" +
|
||||||
incidentid +
|
incidentid +
|
||||||
"')]"
|
"')]"
|
||||||
);
|
);
|
||||||
detailsObj = detailsObj[0];
|
detailsObj = item;
|
||||||
|
|
||||||
if (typeof detailsObj != "undefined") {
|
if (typeof detailsObj != "undefined") {
|
||||||
var documentHistoryArr = documentHistoryObj || [];
|
var documentHistoryArr = documentHistoryObj || [];
|
||||||
@@ -60,7 +78,9 @@ const DocumentDetails = (props) => {
|
|||||||
detailsObj.pinswg_documentid +
|
detailsObj.pinswg_documentid +
|
||||||
"')]"
|
"')]"
|
||||||
);
|
);
|
||||||
return (
|
|
||||||
|
historyObj = historyObj[0];
|
||||||
|
return !_.isEmpty(historyObj) ? (
|
||||||
<div
|
<div
|
||||||
className="govuk-summary-list__row"
|
className="govuk-summary-list__row"
|
||||||
key={key}
|
key={key}
|
||||||
@@ -74,10 +94,10 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{_.has(historyObj[key], [
|
{_.has(historyObj, [
|
||||||
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue",
|
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue",
|
||||||
])
|
])
|
||||||
? historyObj[key][
|
? historyObj[
|
||||||
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: ""}
|
: ""}
|
||||||
@@ -103,10 +123,10 @@ const DocumentDetails = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{_.has(historyObj[key], [
|
{_.has(historyObj, [
|
||||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
|
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
|
||||||
])
|
])
|
||||||
? historyObj[key][
|
? historyObj[
|
||||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: ""}
|
: ""}
|
||||||
@@ -118,6 +138,8 @@ const DocumentDetails = (props) => {
|
|||||||
92
|
92
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -126,20 +148,63 @@ const DocumentDetails = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const docDetailsObj = async () => {
|
||||||
|
let docObj = await getSearchDocumentDetails1(incidentid)
|
||||||
|
.then((data) => {
|
||||||
|
props.setDocumentDetails(data);
|
||||||
|
return data;
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
let historyObj = getDocumentHistory(data.value).then(
|
||||||
|
(result) => {
|
||||||
|
props.setDocumentHistory(result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
|
||||||
|
return docObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getDocumentHistory = async (searchDocumentDetailsObj) => {
|
||||||
|
let historyArr = [];
|
||||||
|
searchDocumentDetailsObj = searchDocumentDetailsObj;
|
||||||
|
|
||||||
|
const detailsObj = searchDocumentDetailsObj.map(
|
||||||
|
(historyDetail, index) => {
|
||||||
|
if (historyDetail.pinswg_publishtoweb != true) {
|
||||||
|
console.log(historyDetail.pinswg_documentid);
|
||||||
|
} else {
|
||||||
|
historyArr.push(
|
||||||
|
getSearchDocumentHistory1(
|
||||||
|
historyDetail.pinswg_documentid
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.all(historyArr);
|
||||||
|
};
|
||||||
|
|
||||||
|
const searchDocumentResultsObj = docDetailsObj();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<h2>Documents</h2>
|
<h2>Documents</h2>
|
||||||
{console.log(documentDetailsObj)}
|
{_.isEmpty(documentHistoryObj) ? (
|
||||||
{documentDetailsArr.length > 0 ? (
|
|
||||||
DocumentView(documentDetailsArr)
|
|
||||||
) : (
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-two-thirds">
|
<div className="govuk-grid-column-two-thirds">
|
||||||
<h3>There are no documents for this appeal</h3>
|
<h3>There are no documents for this appeal</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
DocumentView(documentDetailsArr)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -147,4 +212,21 @@ const DocumentDetails = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DocumentDetails;
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setDocumentDetails: (detailsObj) => {
|
||||||
|
dispatch(setDocumentDetails(detailsObj));
|
||||||
|
},
|
||||||
|
setDocumentHistory: (historyObj) => {
|
||||||
|
dispatch(setDocumentHistory(historyObj));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(DocumentDetails);
|
||||||
|
|||||||
+44
-69
@@ -210,31 +210,16 @@ const CaseSummary = (props) => {
|
|||||||
? jsonpath.query(
|
? jsonpath.query(
|
||||||
transLookup,
|
transLookup,
|
||||||
'$..[?(@.value=="' +
|
'$..[?(@.value=="' +
|
||||||
detailsObj[
|
casesObj[
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
] +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: detailsObj[
|
: casesObj[
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || ""}
|
] || ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-case-summary-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_casedescription"
|
|
||||||
)
|
|
||||||
? detailsObj.pinswg_casedescription
|
|
||||||
: ""}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
@@ -246,10 +231,12 @@ const CaseSummary = (props) => {
|
|||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
{/* {casesObj.caseDetails.caseOfficer ||
|
||||||
""} */}
|
""} */}
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
casesObj,
|
||||||
"pinswg_casedescription"
|
"_ownerid_value"
|
||||||
)
|
)
|
||||||
? detailsObj.pinswg_casedescription
|
? casesObj[
|
||||||
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
@@ -377,11 +364,11 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_startdate@OData.Community.Display.V1.FormattedValue"
|
"pinswg_startdate"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_startdate@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_startdate
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -397,11 +384,11 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_questionnaireduedate@OData.Community.Display.V1.FormattedValue"
|
"pinswg_questionnaireduedate"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_questionnaireduedate@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_questionnaireduedate
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -417,11 +404,11 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_statementduedate@OData.Community.Display.V1.FormattedValue"
|
"pinswg_statementduedate"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_statementduedate@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_statementduedate
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -437,11 +424,11 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_otherpartiesstatement@OData.Community.Display.V1.FormattedValue"
|
"pinswg_otherpartiesstatement"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_otherpartiesstatement@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_otherpartiesstatement
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -457,37 +444,16 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_finalcommentsduedate@OData.Community.Display.V1.FormattedValue"
|
"pinswg_finalcommentsduedate"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_finalcommentsduedate@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_finalcommentsduedate@OData.Community.Display.V1.FormattedValue"
|
|
||||||
)
|
|
||||||
? detailsObj[
|
|
||||||
"pinswg_finalcommentsduedate@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t(
|
{t(
|
||||||
@@ -497,11 +463,11 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateeventrequested@OData.Community.Display.V1.FormattedValue"
|
"pinswg_dateeventrequested"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_dateeventrequested@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_dateeventrequested
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -517,11 +483,11 @@ const CaseSummary = (props) => {
|
|||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_dateoflpadecision@OData.Community.Display.V1.FormattedValue"
|
"pinswg_dateoflpadecision"
|
||||||
)
|
)
|
||||||
? detailsObj[
|
? formatDates(
|
||||||
"pinswg_dateoflpadecision@OData.Community.Display.V1.FormattedValue"
|
detailsObj.pinswg_dateoflpadecision
|
||||||
]
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
@@ -582,6 +548,15 @@ const CaseSummary = (props) => {
|
|||||||
: setShowSpinnerState(true);
|
: setShowSpinnerState(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{showDetailsBlock}
|
{showDetailsBlock}
|
||||||
|
|||||||
@@ -120,19 +120,19 @@ const SearchResults = (props) => {
|
|||||||
{t("search:searchresults-authority-label")}:
|
{t("search:searchresults-authority-label")}:
|
||||||
</span>
|
</span>
|
||||||
{_.has(item, [
|
{_.has(item, [
|
||||||
"_customerid_value@OData.Community.Display.V1.FormattedValue",
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||||
])
|
])
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? jsonpath.query(
|
? jsonpath.query(
|
||||||
transLookup,
|
transLookup,
|
||||||
'$..[?(@.value=="' +
|
'$..[?(@.value=="' +
|
||||||
item[
|
item[
|
||||||
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] +
|
] +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: item[
|
: item[
|
||||||
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
] || "N/A"
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
@@ -291,6 +291,11 @@
|
|||||||
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
|
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
|
||||||
"pinswg_lpa": 0
|
"pinswg_lpa": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"value": "Rhondda Cynon Taf CBC",
|
||||||
|
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
|
||||||
|
"pinswg_lpa": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"value": "Swansea Council",
|
"value": "Swansea Council",
|
||||||
"value_cy": "Cyngor a Dinas Abertawe",
|
"value_cy": "Cyngor a Dinas Abertawe",
|
||||||
|
|||||||
+11
-11
@@ -80,21 +80,21 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
searchResultsObj
|
searchResultsObj
|
||||||
);
|
);
|
||||||
|
|
||||||
const searchDocumentResultsObj = await getDocumentDetails(
|
// const searchDocumentResultsObj = await getDocumentDetails(
|
||||||
token,
|
// token,
|
||||||
searchResultsObj
|
// searchResultsObj
|
||||||
);
|
// );
|
||||||
|
|
||||||
const searchDocumentHistoryObj = await getDocumentHistory(
|
// const searchDocumentHistoryObj = await getDocumentHistory(
|
||||||
token,
|
// token,
|
||||||
searchDocumentResultsObj
|
// searchDocumentResultsObj
|
||||||
);
|
// );
|
||||||
console.log(searchDocumentHistoryObj);
|
// 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(setDocumentDetails(searchDocumentResultsObj));
|
||||||
store.dispatch(setDocumentHistory(searchDocumentHistoryObj));
|
//store.dispatch(setDocumentHistory(searchDocumentHistoryObj));
|
||||||
store.dispatch(setSearch(query.q));
|
store.dispatch(setSearch(query.q));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user