Merged PR 1811: use ticket number not title/reference/pinswg_name

Related work items: #18356
This commit is contained in:
Robert Bond
2025-08-12 08:42:11 +00:00
27 changed files with 226 additions and 89 deletions
+53 -2
View File
@@ -32,6 +32,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 {
@@ -49,11 +51,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 || [];
@@ -300,8 +304,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,
@@ -340,6 +344,8 @@ const DNSSearchResults = (props) => {
"appealType":
item.pinswg_appealcasetype,
"showMap": showMap,
"showLoginCheck":
props.showLoginCheck,
});
}}
>
@@ -557,6 +563,51 @@ const DNSSearchResults = (props) => {
)}
</dd>
)}
{(showLoginCheck == "true" ||
showLoginCheck == true) &&
!session && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
<span className="results-visually-hidden">
{t(
"case:watch-this-case-link"
)}
</span>
<button
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
confirm(
t(
"case:trying-to-watch-case-label"
) +
item.title +
"\n\n" +
t(
"case:trying-to-watch-case-redirect-label"
)
) &&
// signIn("email");
signIn(
undefined,
{
callbackUrl:
"/myportal/searchresults?q=" +
searchString +
"&toWatch=" +
item.incidentid +
"_" +
item.pinswg_appealcasetype,
}
);
}}
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</button>
</dd>
)}
</div>
);
})