diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 45c5b090..104ad1a1 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -7,6 +7,7 @@ import { useCallback, useEffect, useState } from "react"; import { connect } from "react-redux"; import transLookup from "../../data/lookuptranslations.json"; import PaginationControl from "./pagination"; +import RepsOnResults from "./repsonresults"; import { getBasicDNSSearchPaged, getDNSCoords } from "../../actions"; @@ -387,14 +388,16 @@ const DNSSearchResults = (props) => { var appType = router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + eval: true, + }) : item[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || "N/A"; @@ -451,6 +454,12 @@ const DNSSearchResults = (props) => { {item.title} +
diff --git a/components/utils/index.js b/components/utils/index.js index ba9b616c..c1e79203 100644 --- a/components/utils/index.js +++ b/components/utils/index.js @@ -115,19 +115,19 @@ export const getSearchDetails = async (searchResultsObj) => { } ); } else { - formMeta?.LogicalCollectionName && - formMeta?.LogicalCollectionName != "pinswg_sipses" && - detailsArr.push( - getBasicSearchDetails( - formMeta.LogicalCollectionName, - searchDetail.title, - formMeta.PrimaryIdAttribute, - searchDetail.incidentid - ) || { - "@odata.count": 1, - "value": [{ "title": searchDetail.title }], - } - ); + // formMeta?.LogicalCollectionName && + // formMeta?.LogicalCollectionName != "pinswg_sipses" && + detailsArr.push( + getBasicSearchDetails( + formMeta.LogicalCollectionName, + searchDetail.title, + formMeta.PrimaryIdAttribute, + searchDetail.incidentid + ) || { + "@odata.count": 1, + "value": [{ "title": searchDetail.title }], + } + ); } }); // Promise.all(detailsArr).then((data) => { @@ -180,16 +180,16 @@ export const getSearchDetailsPaged = (searchResultsObj) => { let formMeta = getFormCollectionByID( searchDetail.pinswg_appealcasetype ); - formMeta?.LogicalCollectionName && - formMeta?.LogicalCollectionName != "pinswg_sipses" && - detailsArr.push( - getBasicSearchDetailsPaged( - formMeta.LogicalCollectionName, - searchDetail.title, - formMeta.PrimaryIdAttribute, - searchDetail.incidentid - ) - ); + // formMeta?.LogicalCollectionName && + // formMeta?.LogicalCollectionName != "pinswg_sipses" && + detailsArr.push( + getBasicSearchDetailsPaged( + formMeta.LogicalCollectionName, + searchDetail.title, + formMeta.PrimaryIdAttribute, + searchDetail.incidentid + ) + ); } }); return Promise.all(detailsArr);