From 8a2ee508c008cd3321563bb17c5d437c7bdfbfda Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 12 Aug 2025 07:18:36 +0100 Subject: [PATCH] use ticket not title/ref/pinswg_name --- components/myportal/topthree.js | 14 +++--- components/search/addresssearchresults.js | 4 +- components/search/dnssearchresults.js | 58 ++++++++++++++++++++++- components/search/searchresults.js | 4 +- pages/api/file/generatepdf.js | 2 +- 5 files changed, 68 insertions(+), 14 deletions(-) diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index 9d61d7fc..07438548 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -207,11 +207,11 @@ const TopThree = (props) => { showTopThreeArr[key].incidentid : router.locale == "cy" ? "/fymhorth/achos/" + - showTopThreeArr[key].pinswg_title + + showTopThreeArr[key].ticketnumber + "?key=" + topThreeType : "/myportal/case/" + - showTopThreeArr[key].pinswg_title + + showTopThreeArr[key].ticketnumber + "?key=" + topThreeType } @@ -239,9 +239,8 @@ const TopThree = (props) => { : showTopThreeArr[key][ "_pinswg_case_value@OData.Community.Display.V1.FormattedValue" ] - : showTopThreeArr[key][ - "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" - ], + : showTopThreeArr[key] + .ticketnumber, "currentType": topThreeType, "incidentid": getIncidentId( @@ -255,7 +254,8 @@ const TopThree = (props) => { }); }} > - {topThreeType != "watchedCases" + {showTopThreeArr[key].pinswg_title} + {/* {topThreeType != "watchedCases" ? topThreeType != "myRepresentations" ? showTopThreeArr[key].ticketnumber : showTopThreeArr[key][ @@ -263,7 +263,7 @@ const TopThree = (props) => { ] : showTopThreeArr[key][ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" - ]}{" "} + ]}{" "} */} )} {topThreeType == "watchedCases" && !props.myReps && ( diff --git a/components/search/addresssearchresults.js b/components/search/addresssearchresults.js index 51fb4479..86310831 100644 --- a/components/search/addresssearchresults.js +++ b/components/search/addresssearchresults.js @@ -247,8 +247,8 @@ const SearchResults = (props) => { resultsArrPaged.map((item, key) => { let detailsObj = jsonpath({ path: - '$..value[?(@ && @.pinswg_name=="' + - item.pinswg_name + + '$..value[?(@ && @.ticketnumber=="' + + item.ticketnumber + '")]', json: searchDetailsObj, diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 787f5c91..2a978b21 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -31,6 +31,8 @@ import { setWatchedCasesDetails, } from "../../store/watchedCases/action"; import { getDetailsProxy, getSearchDetailsPaged } from "../utils"; +import RepsOnResults from "./repsonresults"; +import { signIn, useSession } from "next-auth/react"; const DNSSearchResults = (props) => { const { @@ -48,11 +50,13 @@ const DNSSearchResults = (props) => { setWatchedCases, setWatchedCasesDetails, showMap, + showLoginCheck, } = props; let { t } = useTranslation(); const router = useRouter(); const { locale } = router; + const { data: session } = useSession(); var resultsArr = searchResultsObj.value || []; @@ -299,8 +303,8 @@ const DNSSearchResults = (props) => { resultsArr.map((item, key) => { let detailsObj = jsonpath({ path: - '$..value[?(@ && @.pinswg_name=="' + - item.title + + '$..value[?(@ && @.ticketnumber=="' + + item.ticketnumber + '")]', json: searchDetailsObj, eval: true, @@ -339,6 +343,8 @@ const DNSSearchResults = (props) => { "appealType": item.pinswg_appealcasetype, "showMap": showMap, + "showLoginCheck": + props.showLoginCheck, }); }} > @@ -350,6 +356,9 @@ const DNSSearchResults = (props) => { {item.title} +
@@ -553,6 +562,51 @@ const DNSSearchResults = (props) => { )}
)} + + {(showLoginCheck == "true" || + showLoginCheck == true) && + !session && ( +
+ + {t( + "case:watch-this-case-link" + )} + + +
+ )} ); }) diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 983cee61..2656f674 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -244,8 +244,8 @@ const SearchResults = (props) => { resultsArr.map((item, key) => { let detailsObj = jsonpath({ path: - '$..value[?(@ && @.pinswg_name=="' + - item.title + + '$..value[?(@ && @.ticketnumber=="' + + item.ticketnumber + '")]', json: searchDetailsObj, eval: true, diff --git a/pages/api/file/generatepdf.js b/pages/api/file/generatepdf.js index 10ae541c..910ee7d5 100644 --- a/pages/api/file/generatepdf.js +++ b/pages/api/file/generatepdf.js @@ -166,7 +166,7 @@ export default async function handler(req, res) { var containerID = reqBodyobj.containerID; var casefolderID = reqBodyobj.casefolderID; - var caseRef = reqBodyobj.caseRef; + var caseRef = reqBodyobj.ticketnumber; var representationType = reqBodyobj.representationType; var repRaiser = reqBodyobj.lastname; var localeSelect = reqBodyobj.locale;