use ticket not title/ref/pinswg_name

This commit is contained in:
2025-08-12 07:18:36 +01:00
parent 5fb944e90f
commit 8a2ee508c0
5 changed files with 68 additions and 14 deletions
+7 -7
View File
@@ -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"
]}{" "}
]}{" "} */}
</Link>
)}
{topThreeType == "watchedCases" && !props.myReps && (
+2 -2
View File
@@ -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,
+56 -2
View File
@@ -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) => {
</span>
{item.title}
</Link>
<RepsOnResults
detailsObj={detailsObj}
/>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
@@ -553,6 +562,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>
);
})
+2 -2
View File
@@ -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,